public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/48813] New: Segfault with backward branch inside dead loop body
@ 2011-04-29  1:01 arthur.j.odwyer at gmail dot com
  2011-04-29  0:59 ` [Bug tree-optimization/48813] " arthur.j.odwyer at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: arthur.j.odwyer at gmail dot com @ 2011-04-29  1:01 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Segfault with backward branch inside dead loop body
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: arthur.j.odwyer@gmail.com


Created attachment 24135
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24135
Output of "gcc -Os -funroll-loops -c test227972954.c -v" with gcc 4.4.5

This reproduces for me with svn revision 172950 (2011-04-25), and also with gcc
4.4.5, but strangely not with gcc 4.5.1.  I'm on Ubuntu 10.10, x86-64.

cat >test227972954.c <<EOF
extern unsigned int g_202;
extern int g_16, x;
extern void foo();
int func_103() {
  lbl_240:
    for (g_16 = 0; g_16 < 1; ++g_16) {
        foo();
        for (g_202 = 4; g_202 <= 3; ++g_202) {  /* loop body is dead */
            if (x)
              goto lbl_240;
        }
    }
    return 0;
}
EOF
gcc -Os -funroll-loops -c test227972954.c

test227972954.c: In function ‘func_103’:
test227972954.c:14:1: internal compiler error: Segmentation fault


gdb's stack trace looks like this:

Program received signal SIGSEGV, Segmentation fault.
0x00000000005aa45c in fix_bb_placements (from=0x7ffff6df0820, 
    irred_invalidated=0x7fffffffddfe "") at ../../gcc/cfgloopmanip.c:199
199      SET_BIT (in_queue, base_loop->header->index);
(gdb) backtrace
#0  0x00000000005aa45c in fix_bb_placements (from=0x7ffff6df0820, 
    irred_invalidated=0x7fffffffddfe "") at ../../gcc/cfgloopmanip.c:199
#1  0x00000000005aab22 in fix_loop_placements (e=<value optimized out>)
    at ../../gcc/cfgloopmanip.c:858
#2  remove_path (e=<value optimized out>) at ../../gcc/cfgloopmanip.c:388
#3  0x0000000000745fc6 in peel_loop_completely (flags=6)
    at ../../gcc/loop-unroll.c:514
#4  peel_loops_completely (flags=6) at ../../gcc/loop-unroll.c:256
#5  unroll_and_peel_loops (flags=6) at ../../gcc/loop-unroll.c:165
[...]


This test case is reduced from the output of Csmith
(http://embed.cs.utah.edu/csmith/), using the following command line:
csmith --bitfields --packed-struct -s 227972954 > test227972954.c


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

end of thread, other threads:[~2013-04-12 16:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-29  1:01 [Bug tree-optimization/48813] New: Segfault with backward branch inside dead loop body arthur.j.odwyer at gmail dot com
2011-04-29  0:59 ` [Bug tree-optimization/48813] " arthur.j.odwyer at gmail dot com
2011-04-29  9:47 ` [Bug tree-optimization/48813] [4.4/4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
2011-04-29 14:28 ` [Bug rtl-optimization/48813] " jakub at gcc dot gnu.org
2011-06-12 13:36 ` rguenth at gcc dot gnu.org
2012-01-20  4:46 ` [Bug rtl-optimization/48813] [4.4/4.5/4.6 " pinskia at gcc dot gnu.org
2012-03-13 14:10 ` [Bug rtl-optimization/48813] [4.5/4.6 " jakub at gcc dot gnu.org
2012-07-02 12:13 ` rguenth at gcc dot gnu.org
2013-04-12 16:18 ` [Bug rtl-optimization/48813] [4.6 " jakub at gcc dot gnu.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).