public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/26213]  New: new (within last few days) infinite loop with -O1
@ 2006-02-10 14:10 list+gcc-bugzilla at meyering dot net
  2006-02-10 14:24 ` [Bug tree-optimization/26213] [4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: list+gcc-bugzilla at meyering dot net @ 2006-02-10 14:10 UTC (permalink / raw)
  To: gcc-bugs

gcc infloops with -O1 (but not -O, -Os, -O2, or -O3) given the following input.
Note that this happens using gcc built from svn a few hours ago, that it is
also reproducible with a two-day-old binary, but not with one from 2006-02-04.

$ cat xnanosleep.c
void
xnanosleep (_Bool overflow)
{
  struct { int tv_nsec; } ts_sleep;
  if (0 <= ts_sleep.tv_nsec)
    overflow |= 1;

  for (;;)
    {
      if (overflow)
        ts_sleep.tv_nsec = 0;
      if (foo (ts_sleep))
        break;
    }
}
$ time gcc -v -O1 xnanosleep.c 2> /t/err

gcc -v -O1 xnanosleep.c 2> /t/err  0.00s user 0.00s system 0% cpu 5.106 total
[Exit 130 (INT)]
$ cat /t/err
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /mirror/d/gcc/configure --disable-nls
--prefix=/p/p/gcc-2006-02-10.10h41 --disable-multilib --enable-languages=c
Thread model: posix
gcc version 4.2.0 20060210 (experimental)

/nobak/p/p/gcc-2006-02-10.10h41/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/cc1
-quiet -v -iprefix
/nobak/p/p/gcc-2006-02-10.10h41/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.0/
xnanosleep.c -quiet -dumpbase xnanosleep.c -mtune=generic -auxbase xnanosleep
-O1 -version -o /t/cc9XDV6L.s
ignoring nonexistent directory
"/nobak/p/p/gcc-2006-02-10.10h41/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory
"/p/p/gcc-2006-02-10.10h41/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/include"
ignoring nonexistent directory
"/p/p/gcc-2006-02-10.10h41/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/nobak/p/p/gcc-2006-02-10.10h41/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.0/include
 /usr/local/include
 /p/p/gcc-2006-02-10.10h41/include
 /usr/include
End of search list.
GNU C version 4.2.0 20060210 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.2.0 20060210 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: ddb06f39f2f5fb93ee768a85a3be125e


-- 
           Summary: new (within last few days) infinite loop with -O1
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: list+gcc-bugzilla at meyering dot net
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug tree-optimization/26213] [4.2 Regression] new (within last few days) infinite loop with -O1
  2006-02-10 14:10 [Bug c/26213] New: new (within last few days) infinite loop with -O1 list+gcc-bugzilla at meyering dot net
@ 2006-02-10 14:24 ` pinskia at gcc dot gnu dot org
  2006-02-10 16:19 ` law at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-10 14:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-10 14:24 -------
Confirmed, the backtrace:
#0  0x004c0784 in thread_across_edge (dummy_cond=0x41ee29f0, e=0x41ee24e0,
handle_dominating_asserts=0 '\0', stack=0x6c9530, simplify=0x422674
<simplify_stmt_for_jump_threading>) at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-threadedge.c:445
#1  0x0042359c in dom_opt_finalize_block (walk_data=0x41ee24e0, bb=0x41ee21b0)
at /Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-dom.c:722
#2  0x0042359c in dom_opt_finalize_block (walk_data=0xbffff80c, bb=0x41ee1930)
at /Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-dom.c:722
#3  0x0049b044 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1930) at
/Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:234
#4  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1850) at
/Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212
#5  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1770) at
/Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212
#6  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee15b0) at
/Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
          Component|c                           |tree-optimization
     Ever Confirmed|0                           |1
  GCC build triplet|x86_64-unknown-linux-gnu    |
   GCC host triplet|x86_64-unknown-linux-gnu    |
 GCC target triplet|x86_64-unknown-linux-gnu    |
           Keywords|                            |compile-time-hog
   Last reconfirmed|0000-00-00 00:00:00         |2006-02-10 14:24:16
               date|                            |
            Summary|new (within last few days)  |[4.2 Regression] new (within
                   |infinite loop with -O1      |last few days) infinite loop
                   |                            |with -O1
   Target Milestone|---                         |4.2.0


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


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

* [Bug tree-optimization/26213] [4.2 Regression] new (within last few days) infinite loop with -O1
  2006-02-10 14:10 [Bug c/26213] New: new (within last few days) infinite loop with -O1 list+gcc-bugzilla at meyering dot net
  2006-02-10 14:24 ` [Bug tree-optimization/26213] [4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-02-10 16:19 ` law at redhat dot com
  2006-02-10 19:23 ` law at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: law at redhat dot com @ 2006-02-10 16:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from law at redhat dot com  2006-02-10 16:19 -------
Subject: Re:  [4.2 Regression] new (within
        last few days) infinite loop with -O1

On Fri, 2006-02-10 at 14:24 +0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-10 14:24 -------
> Confirmed, the backtrace:
> #0  0x004c0784 in thread_across_edge (dummy_cond=0x41ee29f0, e=0x41ee24e0,
> handle_dominating_asserts=0 '\0', stack=0x6c9530, simplify=0x422674
> <simplify_stmt_for_jump_threading>) at
> /Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-threadedge.c:445
> #1  0x0042359c in dom_opt_finalize_block (walk_data=0x41ee24e0, bb=0x41ee21b0)
> at /Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-dom.c:722
> #2  0x0042359c in dom_opt_finalize_block (walk_data=0xbffff80c, bb=0x41ee1930)
> at /Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-dom.c:722
> #3  0x0049b044 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1930) at
> /Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:234
> #4  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1850) at
> /Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212
> #5  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1770) at
> /Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212
> #6  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee15b0) at
> /Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212
Fix in testing.
jeff


-- 


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


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

* [Bug tree-optimization/26213] [4.2 Regression] new (within last few days) infinite loop with -O1
  2006-02-10 14:10 [Bug c/26213] New: new (within last few days) infinite loop with -O1 list+gcc-bugzilla at meyering dot net
  2006-02-10 14:24 ` [Bug tree-optimization/26213] [4.2 Regression] " pinskia at gcc dot gnu dot org
  2006-02-10 16:19 ` law at redhat dot com
@ 2006-02-10 19:23 ` law at redhat dot com
  2006-02-10 19:23 ` law at gcc dot gnu dot org
  2006-02-10 23:08 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: law at redhat dot com @ 2006-02-10 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from law at redhat dot com  2006-02-10 19:23 -------
Subject: Re:  [4.2 Regression] new (within
        last few days) infinite loop with -O1

On Fri, 2006-02-10 at 14:24 +0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-10 14:24 -------
> Confirmed, the backtrace:
> #0  0x004c0784 in thread_across_edge (dummy_cond=0x41ee29f0, e=0x41ee24e0,
> handle_dominating_asserts=0 '\0', stack=0x6c9530, simplify=0x422674
> <simplify_stmt_for_jump_threading>) at
> /Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-threadedge.c:445
> #1  0x0042359c in dom_opt_finalize_block (walk_data=0x41ee24e0, bb=0x41ee21b0)
> at /Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-dom.c:722
> #2  0x0042359c in dom_opt_finalize_block (walk_data=0xbffff80c, bb=0x41ee1930)
> at /Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-dom.c:722
> #3  0x0049b044 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1930) at
> /Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:234
> #4  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1850) at
> /Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212
> #5  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee1770) at
> /Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212
> #6  0x0049aff0 in walk_dominator_tree (walk_data=0xbffff80c, bb=0x41ee15b0) at
> /Users/pinskia/src/gcc/local/gcc/gcc/domwalk.c:212

I should have known better.  It's possible to have loops in the
SSA_NAME_VALUE chain.  Dumb dumb dumb.  

Bootstrapped and regression tested on i686-pc-linux-gnu.


------- Comment #5 from law at redhat dot com  2006-02-10 19:23 -------
Created an attachment (id=10818)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10818&action=view)


-- 


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


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

* [Bug tree-optimization/26213] [4.2 Regression] new (within last few days) infinite loop with -O1
  2006-02-10 14:10 [Bug c/26213] New: new (within last few days) infinite loop with -O1 list+gcc-bugzilla at meyering dot net
                   ` (2 preceding siblings ...)
  2006-02-10 19:23 ` law at redhat dot com
@ 2006-02-10 19:23 ` law at gcc dot gnu dot org
  2006-02-10 23:08 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: law at gcc dot gnu dot org @ 2006-02-10 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from law at gcc dot gnu dot org  2006-02-10 19:23 -------
Subject: Bug 26213

Author: law
Date: Fri Feb 10 19:22:58 2006
New Revision: 110846

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110846
Log:

        PR tree-optimization/26213
        * tree-ssa-threadedge.c (simplify_control_stmt_condition): Do not
        loop trying to follow SSA_NAME_VALUE chains.

        * gcc.c-torture/compile/pr26213.c: New test.


Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr26213.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-threadedge.c


-- 


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


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

* [Bug tree-optimization/26213] [4.2 Regression] new (within last few days) infinite loop with -O1
  2006-02-10 14:10 [Bug c/26213] New: new (within last few days) infinite loop with -O1 list+gcc-bugzilla at meyering dot net
                   ` (3 preceding siblings ...)
  2006-02-10 19:23 ` law at gcc dot gnu dot org
@ 2006-02-10 23:08 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-10 23:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-02-10 23:08 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2006-02-10 23:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-10 14:10 [Bug c/26213] New: new (within last few days) infinite loop with -O1 list+gcc-bugzilla at meyering dot net
2006-02-10 14:24 ` [Bug tree-optimization/26213] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-02-10 16:19 ` law at redhat dot com
2006-02-10 19:23 ` law at redhat dot com
2006-02-10 19:23 ` law at gcc dot gnu dot org
2006-02-10 23:08 ` pinskia at gcc dot gnu dot 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).