https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61278

--- Comment #3 from Zhendong Su <su at cs dot ucdavis.edu> ---
Here is another (somewhat simpler) test case that points to the same issue: 

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 4.10.0 20140524 (experimental) [trunk revision 210885] (GCC) 
$ 
$ gcc-trunk -O1 -c small.c
small.c: In function ‘fn2’:
small.c:20:1: internal compiler error: Segmentation fault
 }
 ^
0x989def crash_signal
    ../../gcc-trunk/gcc/toplev.c:337
0x5d4fa0 bitmap_clear
    ../../gcc-trunk/gcc/bitmap.c:311
0x5d4fa0 bitmap_copy(bitmap_head*, bitmap_head const*)
    ../../gcc-trunk/gcc/bitmap.c:534
0x961bf7 move_insn_for_shrink_wrap
    ../../gcc-trunk/gcc/shrink-wrap.c:209
0x961bf7 prepare_shrink_wrap(basic_block_def*)
    ../../gcc-trunk/gcc/shrink-wrap.c:337
0x961feb try_shrink_wrapping(edge_def**, edge_def*, bitmap_head*, rtx_def*)
    ../../gcc-trunk/gcc/shrink-wrap.c:463
0x78bbf1 thread_prologue_and_epilogue_insns
    ../../gcc-trunk/gcc/function.c:5661
0x78bbf1 rest_of_handle_thread_prologue_and_epilogue
    ../../gcc-trunk/gcc/function.c:6213
0x78bbf1 execute
    ../../gcc-trunk/gcc/function.c:6252
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


-------------------------------


int a, b, c, *d, e, f, g, h;

int
fn1 ()
{
  return a - b;
}

int *
fn2 (int *p)
{
  h = c;
  for (e = 0; e == 0; e = fn1 () + 1)
    for (; f; f++)
      if (c)
    g = 0;
      else
    return d = p;
  return 0;
}

Reply via email to