public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: error while x-compiling libgcc2.c
@ 2009-03-31  6:19 ganesh gopalasubramanian
  2009-03-31  6:51 ` Florent DEFAY
  0 siblings, 1 reply; 8+ messages in thread
From: ganesh gopalasubramanian @ 2009-03-31  6:19 UTC (permalink / raw)
  To: spira.inhabitant; +Cc: gcc-help

Hi Florent,

I am facing the problem too. How did u sort that out?

Ganesh

> Hi,
>
> I am workingon a new port.
> Target: 16 bits, no hard mul.
>
> My problem is when I try to compile libgcc2, it finishes with error:
> __________________________________________________________________
> /home/guest1/gcc/build_target/./gcc/xgcc
> -B/home/guest1/gcc/build_target/./gcc/
> -B/home/guest1/target/target/bin/ -B/home/guest1/target/target/lib/
> -isystem /home/guest1/target/target/include -isystem
> /home/guest1/target/target/sys-include -O2 -g -g -O2 -O2  -O2 -g -g
> -O2   -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
> -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
> -Dinhibit_libc  -I. -I. -I../.././gcc -I../../../gcc-4.3.3/libgcc
> -I../../../gcc-4.3.3/libgcc/. -I../../../gcc-4.3.3/libgcc/../gcc
> -I../../../gcc-4.3.3/libgcc/../include   -o _muldi3.o -MT _muldi3.o
> -MD -MP -MF _muldi3.dep -DL_muldi3 -c
> ../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c \
>
> xgcc: Internal error: Segmentation fault (program cc1)
> Please submit a full bug report.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> make: *** [_muldi3.o] Error 1
> _________________________________________________________________
>
>
> Here is the piece of code in libgcc2.c which provokes the crash:
> _________________________________________________________________
> #ifdef L_muldi3
> DWtype
> __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;
> }
> #endif
> _________________________________________________________________
>
>
> More precisely the crash is on this line:
> DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)};
>
> I don't know what's wrong in my machine description. I tried to
> include a pattern "umulsidi3" but it does not change anything.
> I do not find the definition of this __umulsidi3.
>
> Has someone any idea ? any clue ?
>
> Thank you.
> Regards.
>
> Florent

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error while x-compiling libgcc2.c
  2009-03-31  6:19 error while x-compiling libgcc2.c ganesh gopalasubramanian
@ 2009-03-31  6:51 ` Florent DEFAY
  2009-03-31  7:01   ` ganesh gopalasubramanian
  0 siblings, 1 reply; 8+ messages in thread
From: Florent DEFAY @ 2009-03-31  6:51 UTC (permalink / raw)
  To: gcc-help

Hi Ganesh,

2009/3/31 ganesh gopalasubramanian <gganeshgcc@gmail.com>:
> Hi Florent,
>
> I am facing the problem too. How did u sort that out?

In my case, there were several problems.

First, I did not implement unsigned comparisons. Indeed, GTU, LTU,
GEU, LEU seem necessary to compile muldi3.
If you have already implement them, then something else could be
missing in the machine description.
Then came other errors but with error messages about RTL mismatching,
so easier to deal with. On top of all, I had a
bug in the GO_IF_LEGITIMATE_ADDRESS.

I hope it could help. Please keep me informed.

Regards.

Florent

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error while x-compiling libgcc2.c
  2009-03-31  6:51 ` Florent DEFAY
@ 2009-03-31  7:01   ` ganesh gopalasubramanian
  2009-03-31  7:29     ` Florent DEFAY
  2009-03-31 14:23     ` Ian Lance Taylor
  0 siblings, 2 replies; 8+ messages in thread
From: ganesh gopalasubramanian @ 2009-03-31  7:01 UTC (permalink / raw)
  To: Florent DEFAY; +Cc: gcc-help

Hi Florent,

The GTU, LTU, GEU, LEU comparisons are implemented. The
"GO_IF_LEGITIMATE_ADDRESS" is also there.

We tried building the libraries using the make script and it ended up
with the error. For debugging we compiled the file (libgcc2.c) in the
path and it went on fine. Any idea about this situation?

On Tue, Mar 31, 2009 at 12:21 PM, Florent DEFAY
<spira.inhabitant@gmail.com> wrote:
> Hi Ganesh,
>
> 2009/3/31 ganesh gopalasubramanian <gganeshgcc@gmail.com>:
>> Hi Florent,
>>
>> I am facing the problem too. How did u sort that out?
>
> In my case, there were several problems.
>
> First, I did not implement unsigned comparisons. Indeed, GTU, LTU,
> GEU, LEU seem necessary to compile muldi3.
> If you have already implement them, then something else could be
> missing in the machine description.
> Then came other errors but with error messages about RTL mismatching,
> so easier to deal with. On top of all, I had a
> bug in the GO_IF_LEGITIMATE_ADDRESS.
>
> I hope it could help. Please keep me informed.
>
> Regards.
>
> Florent
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error while x-compiling libgcc2.c
  2009-03-31  7:01   ` ganesh gopalasubramanian
@ 2009-03-31  7:29     ` Florent DEFAY
  2009-03-31  7:47       ` Florent DEFAY
  2009-03-31 14:23     ` Ian Lance Taylor
  1 sibling, 1 reply; 8+ messages in thread
From: Florent DEFAY @ 2009-03-31  7:29 UTC (permalink / raw)
  To: ganesh gopalasubramanian; +Cc: gcc-help

> We tried building the libraries using the make script and it ended up
> with the error. For debugging we compiled the file (libgcc2.c) in the
> path and it went on fine. Any idea about this situation?

Do you mean 'make' ended up with error and compiling libgcc2.c alone
comes to no problem ?
How do you perform debugging ?
The easiest way I know is
1- make
2- select the last compilation (the one which provokes error)
3-run gdb --arg [last compilation]

Here is a cancrete example:

/home/guest1/gcc/build_target/./gcc/xgcc
-B/home/guest1/gcc/build_target/./gcc/
-B/home/guest1/target/target/bin/ -B/home/guest1/target/target/lib/
-isystem /home/guest1/target/target/include -isystem
/home/guest1/target/target/sys-include -O2 -g -g -O2 -O2  -O2 -g -g
-O2   -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-Dinhibit_libc  -I. -I. -I../.././gcc -I../../../gcc-4.3.3/libgcc
-I../../../gcc-4.3.3/libgcc/. -I../../../gcc-4.3.3/libgcc/../gcc
-I../../../gcc-4.3.3/libgcc/../include   -o _muldi3.o -MT _muldi3.o
-MD -MP -MF _muldi3.dep -DL_muldi3 -c
../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c \

xgcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [_muldi3.o] Error 1
...

prompt$ gdb --args /home/guest1/gcc/build_target/./gcc/xgcc
-B/home/guest1/gcc/build_target/./gcc/
-B/home/guest1/target/target/bin/ -B/home/guest1/target/target/lib/
-isystem /home/guest1/target/target/include -isystem
/home/guest1/target/target/sys-include -O2 -g -g -O2 -O2  -O2 -g -g
-O2   -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-Dinhibit_libc  -I. -I. -I../.././gcc -I../../../gcc-4.3.3/libgcc
-I../../../gcc-4.3.3/libgcc/. -I../../../gcc-4.3.3/libgcc/../gcc
-I../../../gcc-4.3.3/libgcc/../include   -o _muldi3.o -MT _muldi3.o
-MD -MP -MF _muldi3.dep -DL_muldi3 -c
../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c

Here is the complete list of patterns I implemented and are sufficient
(in my case) to compile libgcc:
movqi,hi,si,di
exetendqihi2,hisi2,sidi2
zero_extendqihi2,hisi2,sidi2
add,sub,neg in qi,hi,si,di modes
mulhi,si
umulqihi3,hisi3,sidi3
divmodqi4,hi4
jump
indirect_jump
cmphi
all branch
all reverse branch
prologue,epilogue,call,call_value,nop.

Regards.

Florent

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error while x-compiling libgcc2.c
  2009-03-31  7:29     ` Florent DEFAY
@ 2009-03-31  7:47       ` Florent DEFAY
  0 siblings, 0 replies; 8+ messages in thread
From: Florent DEFAY @ 2009-03-31  7:47 UTC (permalink / raw)
  To: ganesh gopalasubramanian; +Cc: gcc-help

Sorry I forgot a few patterns. Note that this is sufficient in my case.
I do not say it is sufficient in all cases. I definitly do not say
they all are necessary.

See the list bellow:

> Here is the complete list of patterns I implemented and are sufficient
> (in my case) to compile libgcc:
> movqi,hi,si,di
> exetendqihi2,hisi2,sidi2
> zero_extendqihi2,hisi2,sidi2
> add,sub,neg in qi,hi,si,di modes
> mulhi,si
> umulqihi3,hisi3,sidi3
> divmodqi4,hi4
> jump
> indirect_jump
> cmphi
> all branch
> all reverse branch
> prologue,epilogue,call,call_value,nop.
aslqi3,hi3,si3,di3
asrqi3,hi3,si3,di3
and,ior,xor,one_cmpl in qi,hi,si modes

>
> Regards.
>
> Florent
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error while x-compiling libgcc2.c
  2009-03-31  7:01   ` ganesh gopalasubramanian
  2009-03-31  7:29     ` Florent DEFAY
@ 2009-03-31 14:23     ` Ian Lance Taylor
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Lance Taylor @ 2009-03-31 14:23 UTC (permalink / raw)
  To: ganesh gopalasubramanian; +Cc: Florent DEFAY, gcc-help

ganesh gopalasubramanian <gganeshgcc@gmail.com> writes:

> We tried building the libraries using the make script and it ended up
> with the error. For debugging we compiled the file (libgcc2.c) in the
> path and it went on fine. Any idea about this situation?

In a normal gcc build, building libgcc is the first time that the newly
built compiler is used.  Bugs in the new compiler normally show up then.
The problem could really be anything.  What it means is that there is
something wrong with your compiler.  You have to debug the problem to
find out what it is.

Ian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error while x-compiling libgcc2.c
  2009-03-25 15:33 Florent DEFAY
@ 2009-03-25 18:50 ` Georg-Johann Lay
  0 siblings, 0 replies; 8+ messages in thread
From: Georg-Johann Lay @ 2009-03-25 18:50 UTC (permalink / raw)
  To: Florent DEFAY; +Cc: gcc-help

Florent DEFAY schrieb:
> Hi,
> 
> I am workingon a new port.
> Target: 16 bits, no hard mul.
> 
> My problem is when I try to compile libgcc2, it finishes with error:
> __________________________________________________________________
> /home/guest1/gcc/build_target/./gcc/xgcc
> -B/home/guest1/gcc/build_target/./gcc/
> -B/home/guest1/target/target/bin/ -B/home/guest1/target/target/lib/
> -isystem /home/guest1/target/target/include -isystem
> /home/guest1/target/target/sys-include -O2 -g -g -O2 -O2  -O2 -g -g
> -O2   -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
> -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
> -Dinhibit_libc  -I. -I. -I../.././gcc -I../../../gcc-4.3.3/libgcc
> -I../../../gcc-4.3.3/libgcc/. -I../../../gcc-4.3.3/libgcc/../gcc
> -I../../../gcc-4.3.3/libgcc/../include   -o _muldi3.o -MT _muldi3.o
> -MD -MP -MF _muldi3.dep -DL_muldi3 -c
> ../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c \
> 
> xgcc: Internal error: Segmentation fault (program cc1)
> Please submit a full bug report.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> make: *** [_muldi3.o] Error 1

You will have to debug cc1.

Call xgcc with -v -save-temps to get .i and command line arguments for cc1.

Georg-Johann

^ permalink raw reply	[flat|nested] 8+ messages in thread

* error while x-compiling libgcc2.c
@ 2009-03-25 15:33 Florent DEFAY
  2009-03-25 18:50 ` Georg-Johann Lay
  0 siblings, 1 reply; 8+ messages in thread
From: Florent DEFAY @ 2009-03-25 15:33 UTC (permalink / raw)
  To: gcc-help

Hi,

I am workingon a new port.
Target: 16 bits, no hard mul.

My problem is when I try to compile libgcc2, it finishes with error:
__________________________________________________________________
/home/guest1/gcc/build_target/./gcc/xgcc
-B/home/guest1/gcc/build_target/./gcc/
-B/home/guest1/target/target/bin/ -B/home/guest1/target/target/lib/
-isystem /home/guest1/target/target/include -isystem
/home/guest1/target/target/sys-include -O2 -g -g -O2 -O2  -O2 -g -g
-O2   -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-Dinhibit_libc  -I. -I. -I../.././gcc -I../../../gcc-4.3.3/libgcc
-I../../../gcc-4.3.3/libgcc/. -I../../../gcc-4.3.3/libgcc/../gcc
-I../../../gcc-4.3.3/libgcc/../include   -o _muldi3.o -MT _muldi3.o
-MD -MP -MF _muldi3.dep -DL_muldi3 -c
../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c \

xgcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [_muldi3.o] Error 1
_________________________________________________________________


Here is the piece of code in libgcc2.c which provokes the crash:
_________________________________________________________________
#ifdef L_muldi3
DWtype
__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;
}
#endif
_________________________________________________________________


More precisely the crash is on this line:
 DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)};

I don't know what's wrong in my machine description. I tried to
include a pattern "umulsidi3" but it does not change anything.
I do not find the definition of this __umulsidi3.

Has someone any idea ? any clue ?

Thank you.
Regards.

Florent

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-03-31 14:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-31  6:19 error while x-compiling libgcc2.c ganesh gopalasubramanian
2009-03-31  6:51 ` Florent DEFAY
2009-03-31  7:01   ` ganesh gopalasubramanian
2009-03-31  7:29     ` Florent DEFAY
2009-03-31  7:47       ` Florent DEFAY
2009-03-31 14:23     ` Ian Lance Taylor
  -- strict thread matches above, loose matches on Subject: below --
2009-03-25 15:33 Florent DEFAY
2009-03-25 18:50 ` Georg-Johann Lay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).