* [Bug rtl-optimization/30931] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
@ 2007-02-22 22:40 ` bergner at gcc dot gnu dot org
2007-02-22 23:27 ` steven at gcc dot gnu dot org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu dot org @ 2007-02-22 22:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from bergner at gcc dot gnu dot org 2007-02-22 22:40 -------
Created an attachment (id=13092)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13092&action=view)
Reduced testcase showing the infinite looping
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
2007-02-22 22:40 ` [Bug rtl-optimization/30931] " bergner at gcc dot gnu dot org
@ 2007-02-22 23:27 ` steven at gcc dot gnu dot org
2007-02-22 23:29 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-02-22 23:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from steven at gcc dot gnu dot org 2007-02-22 23:26 -------
I cannot reproduce this.
Please paste the output of gcc -v.
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
2007-02-22 22:40 ` [Bug rtl-optimization/30931] " bergner at gcc dot gnu dot org
2007-02-22 23:27 ` steven at gcc dot gnu dot org
@ 2007-02-22 23:29 ` pinskia at gcc dot gnu dot org
2007-02-22 23:32 ` bergner at gcc dot gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-22 23:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-02-22 23:29 -------
> it only fails using the 4.1 compiler.
Well that is because loop.c has been removed in 4.2 and above.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (2 preceding siblings ...)
2007-02-22 23:29 ` pinskia at gcc dot gnu dot org
@ 2007-02-22 23:32 ` bergner at gcc dot gnu dot org
2007-02-23 10:03 ` rguenth at gcc dot gnu dot org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu dot org @ 2007-02-22 23:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from bergner at gcc dot gnu dot org 2007-02-22 23:32 -------
This is using source checked out this afternoon (revision 122219):
bg47:bergner% ./install/gcc-4.1/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../gcc-4_1-20070222/configure --enable-shared
--enable-threads=posix --enable-checking --enable-languages=c
--prefix=/tmp/bergner/install/gcc-4.1
Thread model: posix
gcc version 4.1.3 20070222 (prerelease)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (3 preceding siblings ...)
2007-02-22 23:32 ` bergner at gcc dot gnu dot org
@ 2007-02-23 10:03 ` rguenth at gcc dot gnu dot org
2007-02-23 14:06 ` bergner at gcc dot gnu dot org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-23 10:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2007-02-23 10:03 -------
Works for me. Can you tell us all options in effect? I.e. gcc -O
-fstrength-reduce t.c -v output?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (4 preceding siblings ...)
2007-02-23 10:03 ` rguenth at gcc dot gnu dot org
@ 2007-02-23 14:06 ` bergner at gcc dot gnu dot org
2007-02-23 14:13 ` [Bug rtl-optimization/30931] [4.1 Regression] " rguenth at gcc dot gnu dot org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu dot org @ 2007-02-23 14:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from bergner at gcc dot gnu dot org 2007-02-23 14:06 -------
Here's the output you asked for using the latest 4.1 sources I built yesterday.
This also fails for me using the system compilers on Ubuntu Edgy and SLES10.
I'll try and track down a x86 RHEL5 system to test there too.
Please note it's not the compiler that is looping forever, but the built binary
when executed.
bg47:bergner% ./install/gcc-4.1/bin/gcc -O1 -fstrength-reduce pr30311.c -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../gcc-4_1-20070222/configure --enable-shared
--enable-threads=posix --enable-checking --enable-languages=c
--prefix=/tmp/bergner/install/gcc-4.1
Thread model: posix
gcc version 4.1.3 20070222 (prerelease)
/tmp/bergner/install/gcc-4.1/libexec/gcc/i686-pc-linux-gnu/4.1.3/cc1 -quiet -v
pr30311.c -quiet -dumpbase pr30311.c -mtune=pentiumpro -auxbase pr30311 -O1
-version -fstrength-reduce -o /tmp/cc6Cx7Y6.s
ignoring nonexistent directory
"/tmp/bergner/install/gcc-4.1/lib/gcc/i686-pc-linux-gnu/4.1.3/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/tmp/bergner/install/gcc-4.1/include
/tmp/bergner/install/gcc-4.1/lib/gcc/i686-pc-linux-gnu/4.1.3/include
/usr/include
End of search list.
GNU C version 4.1.3 20070222 (prerelease) (i686-pc-linux-gnu)
compiled by GNU C version 3.4.4 20050721 (Red Hat 3.4.4-2).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 3c763771770d7626aeca3ba678fea9f5
as -V -Qy -o /tmp/ccmkRFA6.o /tmp/cc6Cx7Y6.s
GNU assembler version 2.15.92.0.2 (i386-redhat-linux) using BFD version
2.15.92.0.2 20040927
/tmp/bergner/install/gcc-4.1/libexec/gcc/i686-pc-linux-gnu/4.1.3/collect2
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o
/usr/lib/crti.o
/tmp/bergner/install/gcc-4.1/lib/gcc/i686-pc-linux-gnu/4.1.3/crtbegin.o
-L/tmp/bergner/install/gcc-4.1/lib/gcc/i686-pc-linux-gnu/4.1.3
-L/tmp/bergner/install/gcc-4.1/lib/gcc/i686-pc-linux-gnu/4.1.3/../../..
/tmp/ccmkRFA6.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed
-lgcc_s --no-as-needed
/tmp/bergner/install/gcc-4.1/lib/gcc/i686-pc-linux-gnu/4.1.3/crtend.o
/usr/lib/crtn.o
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] [4.1 Regression] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (5 preceding siblings ...)
2007-02-23 14:06 ` bergner at gcc dot gnu dot org
@ 2007-02-23 14:13 ` rguenth at gcc dot gnu dot org
2007-02-23 14:17 ` bergner at gcc dot gnu dot org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-23 14:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from rguenth at gcc dot gnu dot org 2007-02-23 14:13 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed|0 |1
GCC build triplet|i686-linux |
GCC host triplet|i686-linux |
GCC target triplet|i686-linux |i?86-*-*
Keywords| |wrong-code
Known to fail| |4.0.0 4.0.4 4.1.0 4.1.2
Known to work| |3.4.6 4.2.0
Last reconfirmed|0000-00-00 00:00:00 |2007-02-23 14:13:03
date| |
Summary|Simple test case loops |[4.1 Regression] Simple test
|infinitely with -O1 - |case loops infinitely with -
|fstrength-reduce. |O1 -fstrength-reduce.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] [4.1 Regression] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (6 preceding siblings ...)
2007-02-23 14:13 ` [Bug rtl-optimization/30931] [4.1 Regression] " rguenth at gcc dot gnu dot org
@ 2007-02-23 14:17 ` bergner at gcc dot gnu dot org
2007-02-23 14:17 ` bergner at gcc dot gnu dot org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu dot org @ 2007-02-23 14:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from bergner at gcc dot gnu dot org 2007-02-23 14:17 -------
Created an attachment (id=13097)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13097&action=view)
Good assembly output from the 4.1 compiler (-O1 -fno-strength-reduce)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] [4.1 Regression] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (7 preceding siblings ...)
2007-02-23 14:17 ` bergner at gcc dot gnu dot org
@ 2007-02-23 14:17 ` bergner at gcc dot gnu dot org
2007-02-23 14:30 ` bonzini at gnu dot org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu dot org @ 2007-02-23 14:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from bergner at gcc dot gnu dot org 2007-02-23 14:17 -------
Created an attachment (id=13098)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13098&action=view)
Bad assembly output from the 4.1 compiler (-O1 -fstrength-reduce)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] [4.1 Regression] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (8 preceding siblings ...)
2007-02-23 14:17 ` bergner at gcc dot gnu dot org
@ 2007-02-23 14:30 ` bonzini at gnu dot org
2007-02-23 14:32 ` bonzini at gnu dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bonzini at gnu dot org @ 2007-02-23 14:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from bonzini at gnu dot org 2007-02-23 14:30 -------
No, i (which is in %edx) *is* being incremented. It's the strength-reduced
derived induction variable that is constructed in a wrong way. The optimized
code looks like:
void bug (struct s *p)
{
int i;
struct s *pp = p;
for (i=0; i < 2; i++)
{
goto loop_cond;
loop:
/* ??? I think gcc assumes that pp (%eax) is an induction variable of
the inner loop... */
pp[-1].first = 0;
loop_cond:
if (!pp[0].first)
goto break_out_of_inner_loop;
if (pp[0].done)
goto loop;
break_out_of_inner_loop;
pp++; /* actually adds sizeof (struct s) in the asm code */
i++;
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] [4.1 Regression] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (9 preceding siblings ...)
2007-02-23 14:30 ` bonzini at gnu dot org
@ 2007-02-23 14:32 ` bonzini at gnu dot org
2007-02-26 19:18 ` ebotcazou at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bonzini at gnu dot org @ 2007-02-23 14:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from bonzini at gnu dot org 2007-02-23 14:32 -------
> for (i=0; i < 2; i++)
Well, that's obviously
for (i=0; i < 2; )
in my code of comment #10.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] [4.1 Regression] Simple test case loops infinitely with -O1 -fstrength-reduce.
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (10 preceding siblings ...)
2007-02-23 14:32 ` bonzini at gnu dot org
@ 2007-02-26 19:18 ` ebotcazou at gcc dot gnu dot org
2007-02-27 20:21 ` [Bug rtl-optimization/30931] [4.1 regression] infinite loop " ebotcazou at gcc dot gnu dot org
2007-02-27 20:23 ` ebotcazou at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-02-26 19:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from ebotcazou at gcc dot gnu dot org 2007-02-26 19:18 -------
Investigating.
--
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |ebotcazou at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-02-23 14:13:03 |2007-02-26 19:18:18
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] [4.1 regression] infinite loop with -O1 -fstrength-reduce
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (11 preceding siblings ...)
2007-02-26 19:18 ` ebotcazou at gcc dot gnu dot org
@ 2007-02-27 20:21 ` ebotcazou at gcc dot gnu dot org
2007-02-27 20:23 ` ebotcazou at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-02-27 20:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from ebotcazou at gcc dot gnu dot org 2007-02-27 20:21 -------
Subject: Bug 30931
Author: ebotcazou
Date: Tue Feb 27 20:21:17 2007
New Revision: 122383
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122383
Log:
PR rtl-optimization/30931
* loop.c (combine_givs_p): Return false if either GIV is not
always executed.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/execute/20070227-1.c
Modified:
branches/gcc-4_1-branch/gcc/ChangeLog
branches/gcc-4_1-branch/gcc/loop.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/30931] [4.1 regression] infinite loop with -O1 -fstrength-reduce
2007-02-22 22:39 [Bug rtl-optimization/30931] New: Simple test case loops infinitely with -O1 -fstrength-reduce bergner at gcc dot gnu dot org
` (12 preceding siblings ...)
2007-02-27 20:21 ` [Bug rtl-optimization/30931] [4.1 regression] infinite loop " ebotcazou at gcc dot gnu dot org
@ 2007-02-27 20:23 ` ebotcazou at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-02-27 20:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from ebotcazou at gcc dot gnu dot org 2007-02-27 20:23 -------
Fixed on 4.1 branch.
--
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2007-
| |02/msg02159.html
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30931
^ permalink raw reply [flat|nested] 15+ messages in thread