Bug 68459 - ICE when compiling for alpha with -O3
Summary: ICE when compiling for alpha with -O3
Status: RESOLVED DUPLICATE of bug 67055
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 5.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-20 13:47 UTC by dhowells@redhat.com
Modified: 2015-11-20 13:56 UTC (History)
0 users

See Also:
Host: x86_64-redhat-linux-gnu
Target: alpha-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Reduced test case (268 bytes, text/plain)
2015-11-20 13:47 UTC, dhowells@redhat.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dhowells@redhat.com 2015-11-20 13:47:23 UTC
Created attachment 36782 [details]
Reduced test case

When compiling the attached test case for alpha-linux-gnu with -O3, the compiler segfaults and produces the following:

    alpha-linux-gnu-gcc -c -O3 /tmp/bz1265791-testcase.c 
    /tmp/bz1265791-testcase.c: In function ‘synchronize_rcu_tasks’:
    /tmp/bz1265791-testcase.c:8:6: internal compiler error: Segmentation fault
     void synchronize_rcu_tasks(void)
          ^

/usr/libexec/gcc/alpha-linux-gnu/5.2.1/cc1 -quiet -v /tmp/bz1265791-testcase.c -quiet -dumpbase bz1265791-testcase.c -auxbase bz1265791-testcase -O3 -version -o /tmp/ccf0UqVc.s

I caught it in gdb:

Program received signal SIGSEGV, Segmentation fault.
fold_builtin_alloca_with_align (stmt=0x7ffff19436c0)
    at ../../gcc-5.2.1-20150716/gcc/tree-ssa-ccp.c:2067
2067            && TREE_CODE (BLOCK_SUPERCONTEXT (block)) == FUNCTION_DECL))


and I got the following backtrace:

#0  fold_builtin_alloca_with_align (stmt=0x7ffff19436c0)
    at ../../gcc-5.2.1-20150716/gcc/tree-ssa-ccp.c:2067
#1  ccp_fold_stmt (gsi=0x7fffffffd8a0)
    at ../../gcc-5.2.1-20150716/gcc/tree-ssa-ccp.c:2172
#2  0x0000000000a07c17 in substitute_and_fold_dom_walker::before_dom_children (
    this=0x7fffffffd960, bb=0x7ffff191faf8)
    at ../../gcc-5.2.1-20150716/gcc/tree-ssa-propagate.c:1177
#3  0x0000000000b8dfe8 in dom_walker::walk (this=0x7fffffffd960, 
    bb=0x7ffff191faf8) at ../../gcc-5.2.1-20150716/gcc/domwalk.c:188
#4  0x0000000000a0762a in substitute_and_fold (
    get_value_fn=get_value_fn@entry=0x9942f0 <get_constant_value(tree)>, 
    fold_fn=fold_fn@entry=0x99bfa0 <ccp_fold_stmt(gimple_stmt_iterator*)>, 
    do_dce=do_dce@entry=true)
    at ../../gcc-5.2.1-20150716/gcc/tree-ssa-propagate.c:1272
#5  0x0000000000993b41 in ccp_finalize ()
    at ../../gcc-5.2.1-20150716/gcc/tree-ssa-ccp.c:941
#6  do_ssa_ccp () at ../../gcc-5.2.1-20150716/gcc/tree-ssa-ccp.c:2382
#7  (anonymous namespace)::pass_ccp::execute (this=<optimized out>)
    at ../../gcc-5.2.1-20150716/gcc/tree-ssa-ccp.c:2414
#8  0x000000000083aa9e in execute_one_pass (pass=pass@entry=0x12221d0)
    at ../../gcc-5.2.1-20150716/gcc/passes.c:2330
#9  0x000000000083aeb6 in execute_pass_list_1 (pass=0x12221d0)
    at ../../gcc-5.2.1-20150716/gcc/passes.c:2382
---Type <return> to continue, or q <return> to quit---
#10 0x000000000083aec8 in execute_pass_list_1 (pass=0x1222050, 
    pass@entry=0x1221f90) at ../../gcc-5.2.1-20150716/gcc/passes.c:2383
#11 0x000000000083af09 in execute_pass_list (fn=0x7ffff193cf18, pass=0x1221f90)
    at ../../gcc-5.2.1-20150716/gcc/passes.c:2393
#12 0x00000000005fa268 in cgraph_node::expand (this=this@entry=0x7ffff183a300)
    at ../../gcc-5.2.1-20150716/gcc/cgraphunit.c:1895
#13 0x00000000005fb4ac in expand_all_functions ()
    at ../../gcc-5.2.1-20150716/gcc/cgraphunit.c:2031
#14 symbol_table::compile (this=0x7ffff183c000)
    at ../../gcc-5.2.1-20150716/gcc/cgraphunit.c:2384
#15 0x00000000005fc8b8 in symbol_table::finalize_compilation_unit (
    this=0x7ffff183c000) at ../../gcc-5.2.1-20150716/gcc/cgraphunit.c:2461
#16 0x00000000005114cb in c_write_global_declarations ()
    at ../../gcc-5.2.1-20150716/gcc/c/c-decl.c:10798
#17 0x00000000008d8d55 in compile_file ()
    at ../../gcc-5.2.1-20150716/gcc/toplev.c:613
#18 0x00000000004fde1f in do_compile ()
    at ../../gcc-5.2.1-20150716/gcc/toplev.c:2067
#19 toplev::main (this=this@entry=0x7fffffffdce0, argc=argc@entry=13, 
    argv=argv@entry=0x7fffffffdde8)
    at ../../gcc-5.2.1-20150716/gcc/toplev.c:2165
#20 0x00000000004fe7aa in main (argc=13, argv=0x7fffffffdde8)
    at ../../gcc-5.2.1-20150716/gcc/main.c:39
Comment 1 dhowells@redhat.com 2015-11-20 13:53:29 UTC
The backtrace was obtained from a compiler built from unpatched gcc sources produced from a gcc SVN branch with the following parameters:

SVNREV 225895
DATE 20150716
gcc_version 5.2.1

The compiler was configured as follows:

CC=gcc \
CXX=g++ \
CFLAGS='-O2 -g -Wall -Wformat-security -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -mtune=generic' \
CXXFLAGS=' -O2 -g -Wformat-security -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -mtune=generic ' \
CFLAGS_FOR_TARGET='-g -O2 -Wall -fexceptions' \
AR_FOR_TARGET=/usr/bin/alpha-linux-gnu-ar \
AS_FOR_TARGET=/usr/bin/alpha-linux-gnu-as \
DLLTOOL_FOR_TARGET=/usr/bin/alpha-linux-gnu-dlltool \
LD_FOR_TARGET=/usr/bin/alpha-linux-gnu-ld \
NM_FOR_TARGET=/usr/bin/alpha-linux-gnu-nm \
OBJDUMP_FOR_TARGET=/usr/bin/alpha-linux-gnu-objdump \
RANLIB_FOR_TARGET=/usr/bin/alpha-linux-gnu-ranlib \
READELF_FOR_TARGET=/usr/bin/alpha-linux-gnu-readelf \
STRIP_FOR_TARGET=/usr/bin/alpha-linux-gnu-strip \
WINDRES_FOR_TARGET=/usr/bin/alpha-linux-gnu-windres \
WINDMC_FOR_TARGET=/usr/bin/alpha-linux-gnu-windmc \
LDFLAGS='-Wl,-z,relro ' \
../gcc-5.2.1-20150716/configure --bindir=/usr/bin --build=x86_64-redhat-linux-gnu --datadir=/usr/share --disable-decimal-float --disable-dependency-tracking --disable-gold --disable-libgcj --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libunwind-exceptions --disable-nls --disable-plugin --disable-shared --disable-silent-rules --disable-sjlj-exceptions --disable-threads --with-ld=/usr/bin/alpha-linux-gnu-ld --enable-__cxa_atexit --enable-checking=release --enable-gnu-indirect-function --enable-gnu-unique-object --enable-initfini-array --enable-languages=c,c++ --enable-linker-build-id --enable-nls --enable-obsolete --enable-plugin --enable-targets=all --exec-prefix=/usr --host=x86_64-redhat-linux-gnu --includedir=/usr/include --infodir=/usr/share/info --libexecdir=/usr/libexec --localstatedir=/var --mandir=/usr/share/man --prefix=/usr --program-prefix=alpha-linux-gnu- --sbindir=/usr/sbin --sharedstatedir=/var/lib --sysconfdir=/etc --target=alpha-linux-gnu --with-bugurl=http://bugzilla.redhat.com/bugzilla/ --with-isl --with-linker-hash-style=gnu --with-newlib --with-sysroot=/usr/alpha-linux-gnu/sys-root --with-system-libunwind --with-system-zlib --without-headers

The binutils was a 2.25.1 cross hosted on x86_64 and targetted at alpha-linux-gnu.
Comment 2 Richard Biener 2015-11-20 13:56:39 UTC
duplicate (already fixed)

*** This bug has been marked as a duplicate of bug 67055 ***