[Bug optimization/12965] New: SEGV+ICE in cc1plus on alpha-linux with -O2

gcc-bugzilla at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Nov 8 16:49:00 GMT 2003


g++ (actually cc1plus process) reports segmentation fault and internal
compiler error when building "dar" package with -O2 optimization on
alpha-linux. tst.ii is the preprocessed source of simplified source
file which triggers problem (.cpp is ~80 lines long, most of .ii
file lines are STL headers; original classes structure was much more
complicated).

This file compiles correctly using gcc 3.3.2 with -O2 on i*86 (with
-march=i386/i586/i686/athlon), sparc and ppc machines.
On alpha gcc 2.95.3 works too with -O2 optimization.

When running g++ on alpha I get:

$ g++ -O2 -c tst.ii
tst.cpp: In constructor `inode::inode()':
tst.cpp:87: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

I tried to run cc1plus under gdb and got:

[...]
[with _Tp = char] inode::inode()
Program received signal SIGSEGV, Segmentation fault.
insert_insn_on_edge (pattern=0x20001c0d340, e=0x0) at ../../gcc/cfgrtl.c:1345
1345      if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e))
(gdb) bt
#0  insert_insn_on_edge (pattern=0x20001c0d340, e=0x0) at ../../gcc/cfgrtl.c:1345
#1  0x000000012025251c in fixup_abnormal_edges () at ../../gcc/reload1.c:9524
#2  0x000000012023f840 in reload (first=0x200015b87e8, global=1) at ../../gcc/reload1.c:1287
#3  0x00000001202eeabc in global_alloc (file=0x0) at ../../gcc/global.c:583
#4  0x000000012027b77c in rest_of_compilation (decl=0x200013a5008) at ../../gcc/toplev.c:3305
#5  0x00000001200a6720 in genrtl_finish_function (fn=0x200013a5008)
    at ../../gcc/cp/semantics.c:2589
#6  0x00000001200a627c in expand_body (fn=0x200013a5008) at ../../gcc/cp/semantics.c:2412
#7  0x00000001200adc40 in maybe_clone_body (fn=0x200013955f0) at ../../gcc/cp/optimize.c:274
#8  0x00000001200a6038 in expand_body (fn=0x200013955f0) at ../../gcc/cp/semantics.c:2328
#9  0x000000012006d310 in yyparse () at parse.y:815
#10 0x00000001200cc094 in c_common_parse_file (set_yydebug=29414208) at ../../gcc/c-lex.c:159
#11 0x0000000120279638 in compile_file () at ../../gcc/toplev.c:2130
#12 0x0000000120280ee4 in do_compile () at ../../gcc/toplev.c:5402
#13 0x0000000120280fc4 in toplev_main (argc=5, argv=0x11ffffc38) at ../../gcc/toplev.c:5432
#14 0x00000001200d5188 in main (argc=29414208, argv=0x0) at ../../gcc/main.c:35

insert_insn_on_edge() is called with e=NULL, but the function doesn't
expect this.
In fixup_abnormal_edges() before the call bb->succ is not NULL,
bb->succ->flags == 14, bb->succ->succ_next == NULL.

Environment:
System: Linux alpha 2.4.22 #5 Fri Oct 3 11:20:04 CEST 2003 alpha EV6 unknown PLD Linux
Architecture: alpha
host: alpha-pld-linux-gnu
build: alpha-pld-linux-gnu
target: alpha-pld-linux-gnu
configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,f77,objc,ada,java,ksi --enable-c99 --enable-long-long --enable-multilib --enable-nls --with-gnu-as --with-gnu-ld --with-system-zlib --with-slibdir=/lib --without-x alpha-pld-linux

How-To-Repeat:
Compile attached preprocessed file (tst.ii) with one of:
-O2  (adding just -fno-inline-functions doesn't help)
-O3
------- Additional Comments From qboosh at pld-linux dot org  2003-11-08 16:49 -------
Fix:
Workaround is to compile with one of:
-O1
-O2 -fno-inline
-O2 -fno-default-inline

-- 
           Summary: SEGV+ICE in cc1plus on alpha-linux with -O2
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: qboosh at pld-linux dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: alpha-pld-linux-gnu
  GCC host triplet: alpha-pld-linux-gnu
GCC target triplet: alpha-pld-linux-gnu


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



More information about the Gcc-bugs mailing list