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



Hi.

Since I can't seem to keep my hands out of anything these days...
This is from my netbsd-7 jornada 690 (sh3)

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.
I think I turned off everything listed under -O1 on https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
but the crash still happens.

Please advise.

/B


Home | Main Index | Thread Index | Old Index