Port-sh3 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Can't compile with netbsd-7 or -current



> This is a different issue than what Oshima-san found.
> 
> After some fiddling I came up with the following test case code:
> #include <stdio.h>
> #include <errno.h>
> #include <sys/select.h>
> 
> int main(void)
> {
>         int fd, rs;
>         //fd_set t;
> 
>         for(;;) {
>                 fd_set t;
>                 rs = select(fd, &t, NULL, NULL, NULL);
>                 if (rs == -1) {
>                         if (errno == EAGAIN || errno == EINTR)
>                                 continue;
>                 }
> 
>         }
>         return 0;
> }
> 
> Compiling this with -O1 crashes the compiler.
> ratatosk# gcc -O1 nt2.c
> nt2.c: In function 'main':
> nt2.c:5:5: internal compiler error: Segmentation fault
>  int main(void)
>      ^
> no stack trace because unwind library not available
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://www.NetBSD.org/support/send-pr.html> for instructions.
> ratatosk#
> 
> If you move "fd_set t;" out of the for-loop no crash happens.
> This is, I would assume, the important part.
> 
> Compiling with -O0 works. I did not find which optimization flag it is that causes this crash.

Because some optimizing routine of native-gcc-binary on NetBSd/sh3
will be wrong, maybe.

Native gcc binary on NetBSD/sh3 has made from build-toolchain.
The gcc of build-toolchain is cross-compiler for target=sh3el
on host-machine.
A problem already exists in this cross-compiler. So, there is 
a possibilityall that the native binaries including gcc 
for NetBSD/sh3 will be wrong.

I'm now testing the following patch:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64479#c2

After apply this patch to src/external/gpl3/gcc/dist/gcc/rtlanal.c
and clean build, it seems that it works well on both cross tools
and native binary.
But I don't know whether it influences somewhere.

Thanks.


Home | Main Index | Thread Index | Old Index