WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

internal compiler error in libgcc with gcc4.7.0

View: New views
2 Messages — Rating Filter:   Alert me  

internal compiler error in libgcc with gcc4.7.0

by Gaganpreet Kaur :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

I have been trying to cross-compile gcc-4.7.0 for new target (my_cpu) and getting following error at build time.

My build environment is:
-----------------------
Binutils for Target: binutils-2.21
Target CPU: 8-bit processor

Make Result:
------------
<snip>
/cygdrive/d/gcc-dir/source/gcc-4.7.0/libgcc/libgcc2.c: In function ‘__mulhi3’:
/cygdrive/d/gcc-dir/source/gcc-4.7.0/libgcc/libgcc2.c:549:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Makefile:467: recipe for target `_muldi3.o' failed
make[4]: *** [_muldi3.o] Error 1
make[4]: Leaving directory `/cygdrive/d/gcc-dir/gcc_build/my_cpu/softlib/libgcc'
Makefile:1088: recipe for target `multi-do' failed
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory `/cygdrive/d/gcc-dir/gcc_build/my_cpu/libgcc'
Makefile:113: recipe for target `all-multi' failed
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory `/cygdrive/d/gcc-dir/gcc_build/my_cpu/libgcc'
Makefile:9344: recipe for target `all-target-libgcc' failed
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/cygdrive/d/gcc-dir/gcc_build'
Makefile:853: recipe for target `all' failed
make: *** [all] Error 2
<snip>

Here is the snip of libgcc2.c file at line no. 549
---------------------------------------------
<snip>
__muldi3 (DWtype u, DWtype v)
{
  const DWunion uu = {.ll = u};
  const DWunion vv = {.ll = v};
  DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)};

  w.s.high += ((UWtype) uu.s.low * (UWtype) vv.s.high
      + (UWtype) uu.s.high * (UWtype) vv.s.low);

  return w.ll;
}
<snip>
This is the content of my t-my_cpu file:
--------------------------------------
<snip>
LIB1ASMSRC = my_cpu/lib1funcs.asm

LIB1ASMFUNCS  = addsf3 addtqf3 cmpsf3 cmptqf3
LIB1ASMFUNCS += divmodhi4 divmodqi4 divmodsi4 divsf3 divtqf3
LIB1ASMFUNCS += fix_truncsfhi2 fix_truncsfqi2 fix_truncsfsi2 fixuns_truncsfhi2
LIB1ASMFUNCS += fixuns_truncsfqi2 fixuns_truncsfsi2
LIB1ASMFUNCS += floathisf2 floatqisf2 floatsisf2 modqi3 mulhi3 mulhisi3
LIB1ASMFUNCS += mulsf3 mulsi3 multqf3 udivmodhi4 udivmodqi4 udivmodsi4
LIB1ASMFUNCS += umodqi3 umulhisi3
LIB1ASMFUNCS += _bswapsi2 _bswapdi2

# We do not have DF or DI types, so fake out the libgcc2 compilation.
TARGET_LIBGCC2_CFLAGS = -DDF=SF -DDI=SI -D__DF__=__SF__ -D__DI__=__SI__ -I$(srcdir)/config/my_cpu

# Startup files
CRT0_S = $(srcdir)/config/my_cpu/crt0.s
MCRT0_S = $(srcdir)/config/my_cpu/crt0.s
<snip>

Any pointers to fix this issue are very much appreciated.

Re: internal compiler error in libgcc with gcc4.7.0

by Georg-Johann Lay-4 :: Rate this Message:

| View Threaded | Show Only this Message

Gaganpreet Kaur schrieb:

> Hi,
>
> I have been trying to cross-compile gcc-4.7.0 for new target (my_cpu) and
> getting following error at build time.
>
> My build environment is:
> -----------------------
> Binutils for Target: binutils-2.21
> Target CPU: 8-bit processor
>
> Make Result:
> ------------
> <snip>
> /cygdrive/d/gcc-dir/source/gcc-4.7.0/libgcc/libgcc2.c: In function
> ‘__mulhi3’:
> /cygdrive/d/gcc-dir/source/gcc-4.7.0/libgcc/libgcc2.c:549:1: internal
> compiler error: Segmentation fault
>
> <snip>
>
> Here is the snip of libgcc2.c file at line no. 549
> ---------------------------------------------
> <snip>
> __muldi3 (DWtype u, DWtype v)
> {
>   const DWunion uu = {.ll = u};
>   const DWunion vv = {.ll = v};
>   DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)};
>
>   w.s.high += ((UWtype) uu.s.low * (UWtype) vv.s.high
>       + (UWtype) uu.s.high * (UWtype) vv.s.low);
>
>   return w.ll;
> }
> <snip>
>
> Any pointers to fix this issue are very much appreciated.

The problem is not in the libgcc code.

The problem is in the source of your my-cpu-gcc.
Thus, you have to debug your compiler proper to find out where and
why cc1 crashes.

Johann