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

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

--- Comment #1 from Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> 2011-04-29 00:57:50 UTC ---
Created attachment 24136
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24136
Output of "ajo-gcc -Os -funroll-loops -c test227972954.c -v" with gcc 4.7.0
from SVN


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

* [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

* [Bug tree-optimization/48813] [4.4/4.5/4.6/4.7 Regression] Segfault with backward branch inside dead loop body
  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 ` rguenth at gcc dot gnu.org
  2011-04-29 14:28 ` [Bug rtl-optimization/48813] " jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-29  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*
             Status|UNCONFIRMED                 |NEW
      Known to work|4.5.1                       |4.3.5
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2011.04.29 09:45:48
     Ever Confirmed|0                           |1
            Summary|Segfault with backward      |[4.4/4.5/4.6/4.7
                   |branch inside dead loop     |Regression] Segfault with
                   |body                        |backward branch inside dead
                   |                            |loop body
   Target Milestone|---                         |4.4.7
      Known to fail|                            |4.5.1, 4.6.0

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-29 09:45:48 UTC ---
Confirmed.  Fails for me since 4.4.0.


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

* [Bug rtl-optimization/48813] [4.4/4.5/4.6/4.7 Regression] Segfault with backward branch inside dead loop body
  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 ` jakub at gcc dot gnu.org
  2011-06-12 13:36 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-29 14:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-29 14:18:10 UTC ---
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139234
so might very well be latent before that.

Slightly cleaned up testcase:

/* PR rtl-optimization/48813 */
/* { dg-do compile } */
/* { dg-options "-Os -funroll-loops" } */

extern int a, b, c;
extern void foo (void);

int
bar (void)
{
  for (b = 0; b < 1; b++)
    {
      foo ();
      for (a = 2; a <= 1; a++)
        if (c)
          return bar ();
    }
  return 0;
}


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

* [Bug rtl-optimization/48813] [4.4/4.5/4.6/4.7 Regression] Segfault with backward branch inside dead loop body
  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
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-12 13:36 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug rtl-optimization/48813] [4.4/4.5/4.6 Regression] Segfault with backward branch inside dead loop body
  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
                   ` (3 preceding siblings ...)
  2011-06-12 13:36 ` rguenth at gcc dot gnu.org
@ 2012-01-20  4:46 ` 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
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-20  4:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.7.0
         Depends on|                            |49710
            Summary|[4.4/4.5/4.6/4.7            |[4.4/4.5/4.6 Regression]
                   |Regression] Segfault with   |Segfault with backward
                   |backward branch inside dead |branch inside dead loop
                   |loop body                   |body

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-20 03:48:56 UTC ---
Fixed on the trunk by PR 49710.


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

* [Bug rtl-optimization/48813] [4.5/4.6 Regression] Segfault with backward branch inside dead loop body
  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
                   ` (4 preceding siblings ...)
  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 ` 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
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-13 14:10 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.7                       |4.5.4

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-13 12:46:35 UTC ---
4.4 branch is being closed, moving to 4.5.4 target.


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

* [Bug rtl-optimization/48813] [4.5/4.6 Regression] Segfault with backward branch inside dead loop body
  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
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 12:13 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.4                       |4.6.4

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 12:12:07 UTC ---
The 4.5 branch is being closed, adjusting target milestone.


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

* [Bug rtl-optimization/48813] [4.6 Regression] Segfault with backward branch inside dead loop body
  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
                   ` (6 preceding siblings ...)
  2012-07-02 12:13 ` rguenth at gcc dot gnu.org
@ 2013-04-12 16:18 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 16:18 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.6.4                       |4.7.0

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 16:18:03 UTC ---
The 4.6 branch has been closed, fixed in GCC 4.7.0.


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