public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4)
@ 2003-12-29 23:01 capiman at clibb dot de
  2003-12-29 23:32 ` [Bug optimization/13506] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: capiman at clibb dot de @ 2003-12-29 23:01 UTC (permalink / raw)
  To: gcc-bugs

I am just porting Ethernut (http://www.ethernut.de) to ARM platform.
I am using WinXP with newest Cygwin and a downloaded precompiled GCC 
Environment from http://www.ariusdsp.com/gnuarm/gnuarm.html.

Compiling worked for a few hours with a lot of files without preblems, but 
when reaching tcpsm.c, i get the segmentation fault. Position is function 
NutTcpProcessSyn. Error is 100 % reproducable. When i completely comment out 
the function it happens at another functions... Just unzip the attached zip-
file and call "make". The last line when compiling are:

.
.
.
make -C net
make[1]: Entering directory `/cygdrive/d/internet/ethernut/ethernut-
3.3.2/nut/net'
arm-elf-gcc -c -mcpu=arm7tdmi -DCOMPILE_FOR_ARM -save-temps -Os -Wall -Werror -
Wstrict-prototypes -Wa,-ahlms=tcpsm.lst  -I../mod/include_arm -I../include_arm 
tcpsm.c -o tcpsm.o
tcpsm.c: In function `NutTcpProcessSyn':

tcpsm.c:263: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

I am not a compiler guru, so please tell me which information you additional 
need from me. 

Greetings,

    Martin Maurer (capiman@clibb.de)

-- 
           Summary: tcpsm.c:263: internal compiler error: Segmentation fault
                    (WinXP / Cygwin / arm-elf-gcc 3.4)
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: capiman at clibb dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: arm-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4)
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
@ 2003-12-29 23:32 ` pinskia at gcc dot gnu dot org
  2003-12-29 23:58 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-29 23:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-29 22:49 -------
Read http://gcc.gnu.org/bugs.html.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
          Component|c                           |optimization
           Keywords|                            |ice-on-valid-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4)
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
  2003-12-29 23:32 ` [Bug optimization/13506] " pinskia at gcc dot gnu dot org
@ 2003-12-29 23:58 ` pinskia at gcc dot gnu dot org
  2003-12-30  0:06 ` capiman at clibb dot de
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-29 23:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4)
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
  2003-12-29 23:32 ` [Bug optimization/13506] " pinskia at gcc dot gnu dot org
  2003-12-29 23:58 ` pinskia at gcc dot gnu dot org
@ 2003-12-30  0:06 ` capiman at clibb dot de
  2003-12-30  0:19 ` [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4), error also on x86 with GCC 3.3.1 capiman at clibb dot de
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: capiman at clibb dot de @ 2003-12-30  0:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From capiman at clibb dot de  2003-12-29 23:32 -------
I narrowed the error to following statement:

ntohl(th->th_ack);

When ntohl is called, compiler is crashing).

ntohl is defined as __byte_swap4(x), which is again defined as

#define __byte_swap4(val)           \
    (((val & 0xff) << 24) |         \
     ((val & 0xff00) << 8) |        \
     ((val & 0xff0000) >> 8) |      \
     ((val & 0xff000000) >> 24))    

I tried extracting the parts from the big environment out to a single C file, 
but then i can compile with a segmentation fault. But wasn't able to use the 
same parameter when calling gcc.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4), error also on x86 with GCC 3.3.1
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (2 preceding siblings ...)
  2003-12-30  0:06 ` capiman at clibb dot de
@ 2003-12-30  0:19 ` capiman at clibb dot de
  2003-12-30  0:20 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: capiman at clibb dot de @ 2003-12-30  0:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From capiman at clibb dot de  2003-12-30 00:08 -------
I have minimalized the code to one small C file (no includes !) 
and still can reproduce the error:
(perhaps the problem is, that the assembler code is not yet ported,
 but this is still no reason to throw an segmentation fault...)

C File contains:

static inline long __byte_swap4(long val)
{
    asm volatile(
        "mov __tmp_reg__, %A0\n\t"
        "mov %A0, %D0\n\t"
        "mov %D0, __tmp_reg__\n\t"
        "mov __tmp_reg__, %B0\n\t"
        "mov %B0, %C0\n\t"
        "mov %C0, __tmp_reg__\n\t"
        : "=r" (val)
        : "0" (val)
    );
    return(val);
}


 void NutTcpInputOptions(void) 
{
    unsigned long c = 0;

    c = __byte_swap4(c);
}


You can compile and reproduce the error with:

arm-elf-gcc -c -mcpu=arm7tdmi tcpsm.c

Hope it helps !

BTW: I have tried out to feed the same thing into normal GCC 3.3.1 for x86, 
also a version compiled for cygwin and get also an error (segmentation fault 
but a bit another text):

tcpsm.c: In function `__byte_swap4':
tcpsm.c:2: internal compiler error: in print_operand, at 
config/i386/i386.c:6904




-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|tcpsm.c:263: internal       |tcpsm.c:263: internal
                   |compiler error: Segmentation|compiler error: Segmentation
                   |fault (WinXP / Cygwin / arm-|fault (WinXP / Cygwin / arm-
                   |elf-gcc 3.4)                |elf-gcc 3.4), error also on
                   |                            |x86 with GCC 3.3.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4), error also on x86 with GCC 3.3.1
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (3 preceding siblings ...)
  2003-12-30  0:19 ` [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4), error also on x86 with GCC 3.3.1 capiman at clibb dot de
@ 2003-12-30  0:20 ` pinskia at gcc dot gnu dot org
  2003-12-30  0:43 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-30  0:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-30 00:18 -------
Marking as invalid to mark as ...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4), error also on x86 with GCC 3.3.1
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (4 preceding siblings ...)
  2003-12-30  0:20 ` pinskia at gcc dot gnu dot org
@ 2003-12-30  0:43 ` pinskia at gcc dot gnu dot org
  2003-12-30  3:35 ` [Bug target/13506] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-30  0:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-30 00:19 -------
Unconfirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4), error also on x86 with GCC 3.3.1
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (5 preceding siblings ...)
  2003-12-30  0:43 ` pinskia at gcc dot gnu dot org
@ 2003-12-30  3:35 ` pinskia at gcc dot gnu dot org
  2004-01-14  4:41 ` [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault giovannibajo at libero dot it
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-30  3:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-30 02:30 -------
The code is invalid.

if CODE is 'D', then the X is a condition operand and the instruction
   should only be executed if the condition is false: however, if the mode
   of the comparison is CCFPEmode, then always execute the instruction -- we
   do this because in these circumstances !GE does not necessarily imply LT;
   in these cases the instruction pattern will take care to make sure that
   an instruction containing %d will follow, thereby undoing the effects of
   doing this instruction unconditionally.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|optimization                |target
     Ever Confirmed|                            |1
           Keywords|ice-on-valid-code           |ice-on-invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-30 02:30:30
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (6 preceding siblings ...)
  2003-12-30  3:35 ` [Bug target/13506] " pinskia at gcc dot gnu dot org
@ 2004-01-14  4:41 ` giovannibajo at libero dot it
  2004-08-25 17:18 ` rearnsha at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-14  4:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-01-14 04:41 -------
Martin, is this a regression? Did this work on older GCC releases?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it
            Summary|tcpsm.c:263: internal       |tcpsm.c:263: internal
                   |compiler error: Segmentation|compiler error: Segmentation
                   |fault (WinXP / Cygwin / arm-|fault
                   |elf-gcc 3.4), error also on |
                   |x86 with GCC 3.3.1          |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (7 preceding siblings ...)
  2004-01-14  4:41 ` [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault giovannibajo at libero dot it
@ 2004-08-25 17:18 ` rearnsha at gcc dot gnu dot org
  2004-08-26 16:42 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2004-08-25 17:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rearnsha at gcc dot gnu dot org  2004-08-25 17:18 -------
While it might be possible to fix this specific instance, I see no realistic way
to make the compiler robust against this sort of junk input.

Asm statements are generally fairly fragile, you need to know what you are doing
with them -- consider the crash as your diagnostic :-)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (8 preceding siblings ...)
  2004-08-25 17:18 ` rearnsha at gcc dot gnu dot org
@ 2004-08-26 16:42 ` cvs-commit at gcc dot gnu dot org
  2004-08-26 16:43 ` rearnsha at gcc dot gnu dot org
  2004-08-26 16:45 ` rearnsha at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-26 16:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-26 16:42 -------
Subject: Bug 13506

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rearnsha@gcc.gnu.org	2004-08-26 16:42:45

Modified files:
	gcc            : ChangeLog toplev.c 

Log message:
	PR target/13506
	* toplev.c (crash_signal): If we crashed while emitting
	a user asm, then die more gracefully.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5104&r2=2.5105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.c.diff?cvsroot=gcc&r1=1.912&r2=1.913



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (9 preceding siblings ...)
  2004-08-26 16:42 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-26 16:43 ` rearnsha at gcc dot gnu dot org
  2004-08-26 16:45 ` rearnsha at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2004-08-26 16:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rearnsha at gcc dot gnu dot org  2004-08-26 16:43 -------
Reopening to ....

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

* [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault
  2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
                   ` (10 preceding siblings ...)
  2004-08-26 16:43 ` rearnsha at gcc dot gnu dot org
@ 2004-08-26 16:45 ` rearnsha at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2004-08-26 16:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rearnsha at gcc dot gnu dot org  2004-08-26 16:45 -------
... close as fixed -- it turns out there's a fairly easy way to make the compiler
more friendly when things fail horribly.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13506


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

end of thread, other threads:[~2004-08-26 16:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-29 23:01 [Bug c/13506] New: tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4) capiman at clibb dot de
2003-12-29 23:32 ` [Bug optimization/13506] " pinskia at gcc dot gnu dot org
2003-12-29 23:58 ` pinskia at gcc dot gnu dot org
2003-12-30  0:06 ` capiman at clibb dot de
2003-12-30  0:19 ` [Bug optimization/13506] tcpsm.c:263: internal compiler error: Segmentation fault (WinXP / Cygwin / arm-elf-gcc 3.4), error also on x86 with GCC 3.3.1 capiman at clibb dot de
2003-12-30  0:20 ` pinskia at gcc dot gnu dot org
2003-12-30  0:43 ` pinskia at gcc dot gnu dot org
2003-12-30  3:35 ` [Bug target/13506] " pinskia at gcc dot gnu dot org
2004-01-14  4:41 ` [Bug target/13506] tcpsm.c:263: internal compiler error: Segmentation fault giovannibajo at libero dot it
2004-08-25 17:18 ` rearnsha at gcc dot gnu dot org
2004-08-26 16:42 ` cvs-commit at gcc dot gnu dot org
2004-08-26 16:43 ` rearnsha at gcc dot gnu dot org
2004-08-26 16:45 ` rearnsha at gcc dot gnu dot org

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).