public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
@ 2004-01-12 10:13 rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-12 15:56 ` [Bug optimization/13653] " pinskia at gcc dot gnu dot org
                   ` (46 more replies)
  0 siblings, 47 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-01-12 10:13 UTC (permalink / raw)
  To: gcc-bugs

Current g++-3.3 (g++-3.3 (GCC) 3.3.3 20040107 (prerelease)) miscompiles quite a
few POOMA testcases which results in SIGSEGVs.  These failures occour with -O2
-funroll-loops, but not with -O2.

One example preprocessed testcase can be fetched from
http://www.tat.physik.uni-tuebingen.de/~rguenth/gcc/array_test1.ii.gz

compile with -fno-exceptions -O2 -funroll-loops to see it segfaulting and with
-fno-exceptions -O2 to see it printing a success message.

g++ (GCC) 3.3.3 20031114 (prerelease) also did have this problem (this is the
oldest binary I have lying around).

-- 
           Summary: [3.3 regression] -O2 -funroll-loop miscompiles POOMA
                    testcase
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at tat dot physik dot uni-tuebingen dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-01-12 15:56 ` pinskia at gcc dot gnu dot org
  2004-01-14 21:22 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (45 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-12 15:56 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
   Target Milestone|---                         |3.3.3


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-12 15:56 ` [Bug optimization/13653] " pinskia at gcc dot gnu dot org
@ 2004-01-14 21:22 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-15 18:55 ` bangerth at dealii dot org
                   ` (44 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-01-14 21:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-01-14 21:22 -------
Debian g++ (GCC) 3.3.3 20040110 (prerelease) (Debian) on powerpc-linux(!)
doesn't show the problem.  Also maybe this is a libstdc++ bug, so there is an
"unincluded" version of the testcase at

http://www.tat.physik.uni-tuebingen.de/~rguenth/gcc/array_test1.cpp.gz

I checked the gdb backtrace of the SIGSEGV and it segfaults during output
to a stream in malloc'ing a ridiculous amount of memory (1076086304 bytes)
coming from std::__default_alloc_template<true, 0>::allocate(unsigned)
coming from std::string::_Rep::_S_create() and so on.  So it looks like   
either a builtin failure (folding some strlen of a constant string comes  
to my mind) or a (long standing) loop optimizer bug triggered by a change
to libstdc++ strings or related area.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-12 15:56 ` [Bug optimization/13653] " pinskia at gcc dot gnu dot org
  2004-01-14 21:22 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-01-15 18:55 ` bangerth at dealii dot org
  2004-01-15 18:56 ` bangerth at dealii dot org
                   ` (43 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: bangerth at dealii dot org @ 2004-01-15 18:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-01-15 18:55 -------
Created an attachment (id=5499)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5499&action=view)
Preprocessed sources


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (2 preceding siblings ...)
  2004-01-15 18:55 ` bangerth at dealii dot org
@ 2004-01-15 18:56 ` bangerth at dealii dot org
  2004-01-15 19:10 ` bangerth at dealii dot org
                   ` (42 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: bangerth at dealii dot org @ 2004-01-15 18:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-01-15 18:56 -------
Confirmed with a 3.3.3 snapshot from 20040113. I attach the preprocessed  
source to this PR (without line numbers, though). The sources are enormous, 
though, so it would be nice to have a reduced testcase... 
  
W.  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-15 18:56:05
               date|                            |


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (3 preceding siblings ...)
  2004-01-15 18:56 ` bangerth at dealii dot org
@ 2004-01-15 19:10 ` bangerth at dealii dot org
  2004-01-15 19:12 ` dberlin at dberlin dot org
                   ` (41 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: bangerth at dealii dot org @ 2004-01-15 19:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-01-15 19:10 -------
For whatever reason, the sources I just attached need to be compiled 
with -pthread. Trying to reduce the testcase presently exceeds my time 
limits, though, in particular since compiling with these flags and 
-ggdb does not yield any meaningful backtrace etc :-( Local variables 
are also useless, so I am not sure whether Richard's initial analysis 
is valid. 
 
Richard: can you try and see what happens when you use a recent snapshot 
from gcc mainline? 
 
Thanks 
  W. 

-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (4 preceding siblings ...)
  2004-01-15 19:10 ` bangerth at dealii dot org
@ 2004-01-15 19:12 ` dberlin at dberlin dot org
  2004-01-15 19:13 ` bangerth at dealii dot org
                   ` (40 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: dberlin at dberlin dot org @ 2004-01-15 19:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at dberlin dot org  2004-01-15 19:12 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase


On Jan 15, 2004, at 1:56 PM, bangerth at dealii dot org wrote:

>
> ------- Additional Comments From bangerth at dealii dot org  
> 2004-01-15 18:56 -------
> Confirmed with a 3.3.3 snapshot from 20040113. I attach the 
> preprocessed
> source to this PR (without line numbers, though). The sources are 
> enormous,
> though, so it would be nice to have a reduced testcase...

I'm working on minimizing it.



-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (5 preceding siblings ...)
  2004-01-15 19:12 ` dberlin at dberlin dot org
@ 2004-01-15 19:13 ` bangerth at dealii dot org
  2004-01-15 19:26   ` Daniel Berlin
  2004-01-15 19:26 ` dberlin at dberlin dot org
                   ` (39 subsequent siblings)
  46 siblings, 1 reply; 49+ messages in thread
From: bangerth at dealii dot org @ 2004-01-15 19:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-01-15 19:13 -------
Oh, good luck. I'm certainly not one of the faint of heart regarding 
reducing testcases, but in this case I'll not be unhappy if someone 
else does it ;-) 
 
W. 

-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (6 preceding siblings ...)
  2004-01-15 19:13 ` bangerth at dealii dot org
@ 2004-01-15 19:26 ` dberlin at dberlin dot org
  2004-01-16  8:52 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (38 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: dberlin at dberlin dot org @ 2004-01-15 19:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at dberlin dot org  2004-01-15 19:26 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase

> Oh, good luck. I'm certainly not one of the faint of heart regarding
> reducing testcases, but in this case I'll not be unhappy if someone
> else does it ;-)
>
> W.
>
i'm just gonna let the automated reducer work on it, since it seems 
hard for humans.
--Dan



-- 


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


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

* Re: [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-15 19:13 ` bangerth at dealii dot org
@ 2004-01-15 19:26   ` Daniel Berlin
  0 siblings, 0 replies; 49+ messages in thread
From: Daniel Berlin @ 2004-01-15 19:26 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

> Oh, good luck. I'm certainly not one of the faint of heart regarding
> reducing testcases, but in this case I'll not be unhappy if someone
> else does it ;-)
>
> W.
>
i'm just gonna let the automated reducer work on it, since it seems 
hard for humans.
--Dan


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (7 preceding siblings ...)
  2004-01-15 19:26 ` dberlin at dberlin dot org
@ 2004-01-16  8:52 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-18  3:54 ` dberlin at gcc dot gnu dot org
                   ` (37 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-01-16  8:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-01-16 08:51 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

On Thu, 15 Jan 2004, bangerth at dealii dot org wrote:

>
> ------- Additional Comments From bangerth at dealii dot org  2004-01-15 19:10 -------
> For whatever reason, the sources I just attached need to be compiled
> with -pthread. Trying to reduce the testcase presently exceeds my time
> limits, though, in particular since compiling with these flags and
> -ggdb does not yield any meaningful backtrace etc :-( Local variables
> are also useless, so I am not sure whether Richard's initial analysis
> is valid.
>
> Richard: can you try and see what happens when you use a recent snapshot
> from gcc mainline?

It works for g++-3.4 (GCC) 3.4.0 20040114 (experimental), and I don't need
to build with -pthread (but maybe this is because my compilers are
configured with --enable-threads=posix?).  Of course I used the
"unincluded" testcase with HEAD because of libstdc++ incompatibilities.

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (8 preceding siblings ...)
  2004-01-16  8:52 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-01-18  3:54 ` dberlin at gcc dot gnu dot org
  2004-01-18 13:23 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (36 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2004-01-18  3:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2004-01-18 03:54 -------
Just a progress update
This is taking a while to minimize because it takes 40 seconds per compile at the current length 
and i do two compiles per minimize, to make sure it works at -O2 but breaks with -O2 -funroll-
loops.  
It'll probably be another few days before it's minimal.
But it's already gotten 25% smaller 

[dberlin@dberlin tmp0]$ wc 8472.c
  19949   88459  944229 8472.c
^^^^^^
Smallest so far that works at -O2 and doesn't work at -O2 -funroll-loops
[dberlin@dberlin tmp0]$ wc 000.c 
  26943  127952 1369563 000.c
^^^^^ 
Original array_test1.cpp
[dberlin@dberlin tmp0]$ 

-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (9 preceding siblings ...)
  2004-01-18  3:54 ` dberlin at gcc dot gnu dot org
@ 2004-01-18 13:23 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-28 18:45 ` bangerth at dealii dot org
                   ` (35 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-01-18 13:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-01-18 13:23 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

On Sun, 18 Jan 2004, dberlin at gcc dot gnu dot org wrote:

> Just a progress update
> This is taking a while to minimize because it takes 40 seconds per compile at the current length
> and i do two compiles per minimize, to make sure it works at -O2 but breaks with -O2 -funroll-
> loops.
> It'll probably be another few days before it's minimal.
> But it's already gotten 25% smaller

Many thanks for doing this work!  Couldn't tree-ssa be used to re-produce
sourcecode after DCE?  Or even just using cgraph for detecting completely
unused classes/methods?  (I thought of using the symbol table of a -O0
compile to extract used stuff, but that requires a C++ parser again...)

Richard.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (10 preceding siblings ...)
  2004-01-18 13:23 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-01-28 18:45 ` bangerth at dealii dot org
  2004-01-28 18:51 ` dberlin at dberlin dot org
                   ` (34 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: bangerth at dealii dot org @ 2004-01-28 18:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-01-28 18:45 -------
Daniel, did your automated reductions get you anywhere? Maybe you 
can attach the present (or latest) state to this PR in case someone 
else wants to reduce it. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at dberlin dot org


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (11 preceding siblings ...)
  2004-01-28 18:45 ` bangerth at dealii dot org
@ 2004-01-28 18:51 ` dberlin at dberlin dot org
  2004-01-29 22:10 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (33 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: dberlin at dberlin dot org @ 2004-01-28 18:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at dberlin dot org  2004-01-28 18:51 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase

I only got about 1000 lines off of it, most of them obvious.
I had to keep restarting due to reboots.
I'm still working on it, but it's taking *forever* because of what the 
script has to do (compile it with -O2, see if it runs, then compile it 
with -O2 -funroll-loops, see if it fails).



-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (12 preceding siblings ...)
  2004-01-28 18:51 ` dberlin at dberlin dot org
@ 2004-01-29 22:10 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-29 22:25 ` dberlin at dberlin dot org
                   ` (32 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-01-29 22:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-01-29 22:10 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

On Thu, 29 Jan 2004, dberlin at gcc dot gnu dot org wrote:

> I'll attach my even *more* reduced testcase, but that only passes at -O2 and
> fails at -O2 -funroll-loops (IE it doesn't pass at -O0 or -O1)

That does hint to maybe a stack corruption or somehow.  That would be
consistent with my observation that the original testcase fails only, if I
enable assertions in the code, if I disable them and they get #ifdef'ed
away, the failure does not occour.

So it may be interesting to look at the generated assembly of the main
function and looking for corrupt stack after calls?

Richard.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (13 preceding siblings ...)
  2004-01-29 22:10 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-01-29 22:25 ` dberlin at dberlin dot org
  2004-01-29 22:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (31 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: dberlin at dberlin dot org @ 2004-01-29 22:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at dberlin dot org  2004-01-29 22:25 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase

>
> Taking 15490.c and removing line 2322 (doesn't compile otherwise), I 
> now
> get an ICE at -fno-exceptions -O (-O0 is fine):

I had hand edited it to remove returning references to a local variable 
(which had no affect on the test result at any optimization level).

So that's actually my fault, because i typoed it on the version i 
posted.



-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (14 preceding siblings ...)
  2004-01-29 22:25 ` dberlin at dberlin dot org
@ 2004-01-29 22:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-29 22:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (30 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-01-29 22:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-01-29 22:27 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

> Minimal testcase that passes -O2, fails -O2 -funroll-loops

Ok, I'm now just changing little things to verify the bogous call
assumption.

If I stick a noreturn attribute onto the toss_cookies() declaration on
line 14 in the 15490.c testcase, the failure goes away (-O2
-funroll-loops).  There is a path to a check with a toss_cookies() call in
the else clause in the inner loop (in main) that is possibly be unrolled.

Richard.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (15 preceding siblings ...)
  2004-01-29 22:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-01-29 22:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-01-29 22:54 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (29 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-01-29 22:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-01-29 22:45 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

On Thu, 29 Jan 2004, Richard Guenther wrote:

> On Thu, 29 Jan 2004, dberlin at gcc dot gnu dot org wrote:
>
> > I'll attach my even *more* reduced testcase, but that only passes at -O2 and
> > fails at -O2 -funroll-loops (IE it doesn't pass at -O0 or -O1)
>
> That does hint to maybe a stack corruption or somehow.  That would be
> consistent with my observation that the original testcase fails only, if I
> enable assertions in the code, if I disable them and they get #ifdef'ed
> away, the failure does not occour.
>
> So it may be interesting to look at the generated assembly of the main
> function and looking for corrupt stack after calls?

Additionally to the noreturn attribute, I can reduce the main function to

int main(int argc, char *argv[]) {
        Interval<1> D(6);
        Interval<3> I3(D,D,D);
        Loc<3> blocks(2,2,2);
        UniformGridPartition<3> partition(blocks);
        UniformGridLayout<3> layout(I3, partition,ReplicatedTag());
        Array<3, double, MultiPatch<UniformTag,Brick> > u(layout);
        for (int i2 = 0; i2 < 4 /* 3 doesnt segfault */; i2++)
                for (int i1 = 0; i1 < 1; i1++)
                        for (int i0 = 0; i0 < 1; i0++)
                                u(i0,i1,i2) = 0;
        return 0;
}

and still get the segfault, but it is fixed with either running the first
loop only to i2 < 3, or removing any of the loops.

In fact, looking at the assembler, there are two calls to
_ZNK21UniformGridLayoutDataILi3EE8globalIDEiii inside the loop, and the
loop itself doesnt change with the noreturn attribute on toss_cookies, but
the called function does, as it calls toss_cookies several times.

Richard.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (16 preceding siblings ...)
  2004-01-29 22:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-01-29 22:54 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-02-01 23:06 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (28 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-01-29 22:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-01-29 22:54 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

On Thu, 29 Jan 2004, Richard Guenther wrote:

> On Thu, 29 Jan 2004, Richard Guenther wrote:
>
> > On Thu, 29 Jan 2004, dberlin at gcc dot gnu dot org wrote:
> >
> > > I'll attach my even *more* reduced testcase, but that only passes at -O2 and
> > > fails at -O2 -funroll-loops (IE it doesn't pass at -O0 or -O1)
> >
> > That does hint to maybe a stack corruption or somehow.  That would be
> > consistent with my observation that the original testcase fails only, if I
> > enable assertions in the code, if I disable them and they get #ifdef'ed
> > away, the failure does not occour.
> >
> > So it may be interesting to look at the generated assembly of the main
> > function and looking for corrupt stack after calls?
>
> Additionally to the noreturn attribute, I can reduce the main function to
>
> int main(int argc, char *argv[]) {
>         Interval<1> D(6);
>         Interval<3> I3(D,D,D);
>         Loc<3> blocks(2,2,2);
>         UniformGridPartition<3> partition(blocks);
>         UniformGridLayout<3> layout(I3, partition,ReplicatedTag());
>         Array<3, double, MultiPatch<UniformTag,Brick> > u(layout);
>         for (int i2 = 0; i2 < 4 /* 3 doesnt segfault */; i2++)
>                 for (int i1 = 0; i1 < 1; i1++)
>                         for (int i0 = 0; i0 < 1; i0++)
>                                 u(i0,i1,i2) = 0;
>         return 0;
> }
>
> and still get the segfault, but it is fixed with either running the first
> loop only to i2 < 3, or removing any of the loops.
>
> In fact, looking at the assembler, there are two calls to
> _ZNK21UniformGridLayoutDataILi3EE8globalIDEiii inside the loop, and the
> loop itself doesnt change with the noreturn attribute on toss_cookies, but
> the called function does, as it calls toss_cookies several times.

But if I remove the toss_cookies calls from the offending function the
segfault persists. Ugh. Feels like chasing a Heisenbug.

Going to bed now,
Richard.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (17 preceding siblings ...)
  2004-01-29 22:54 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-02-01 23:06 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-02-01 23:31 ` gdr at integrable-solutions dot net
                   ` (27 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-02-01 23:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-02-01 23:06 -------
Ok, I identified gcc (GCC) 3.2.3 as point to which this is a regression by
running uninclude over the (original array_test1.ii and array_test1_reduced.ii)
testcases and fixing the contained __builtin_va_* uses (which gcc 3.2 doesn't have).

I also checked the 3.3 and 3.3.2 releases which both contain the bug.

Maybe the regression hunting script can search for a patch between 3.2.3 and 3.3
on the reduced testcase? I asked Janis to do this.

Richard.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.3
      Known to work|                            |3.2.3


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (18 preceding siblings ...)
  2004-02-01 23:06 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-02-01 23:31 ` gdr at integrable-solutions dot net
  2004-02-02 15:11 ` reichelt at gcc dot gnu dot org
                   ` (26 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-02-01 23:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-02-01 23:31 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase

"rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla@gcc.gnu.org> writes:

| Ok, I identified gcc (GCC) 3.2.3 as point to which this is a regression by
| running uninclude over the (original array_test1.ii and array_test1_reduced.ii)
| testcases and fixing the contained __builtin_va_* uses (which gcc 3.2 doesn't have).
| 
| I also checked the 3.3 and 3.3.2 releases which both contain the bug.
| 
| Maybe the regression hunting script can search for a patch between 3.2.3 and 3.3
| on the reduced testcase? I asked Janis to do this.

Woaw, this detective work is quite impressive!  Many thanks.
Alas, I cannot hold the release on this bug since it already appeared
in a previous release -- that does not mean it is unimportant (quite
the contrary).  We should investigate ways to fix it for 3.3.4 though.

Thanks,

-- Gaby


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (19 preceding siblings ...)
  2004-02-01 23:31 ` gdr at integrable-solutions dot net
@ 2004-02-02 15:11 ` reichelt at gcc dot gnu dot org
  2004-02-02 16:16 ` dberlin at dberlin dot org
                   ` (25 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-02-02 15:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-02-02 15:11 -------
The testcase "minimal.c" is broken:
Line 2549 in "main" calls "UniformGridPartition<Dim>::partition" (line 2007+)
which calls "UniformGridPartition<Dim>::blocks" (line 1583) which is an
empty function returning a reference which will later be used.
Since the reference is not initialized at all this *has* to crash somewhere.

IMHO we cannot rely on automatic reducers here. :-(
One must know, whether it is safe to delete a line or not.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (20 preceding siblings ...)
  2004-02-02 15:11 ` reichelt at gcc dot gnu dot org
@ 2004-02-02 16:16 ` dberlin at dberlin dot org
  2004-02-02 16:33 ` janis187 at us dot ibm dot com
                   ` (24 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: dberlin at dberlin dot org @ 2004-02-02 16:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at dberlin dot org  2004-02-02 16:15 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase


On Feb 2, 2004, at 10:11 AM, reichelt at gcc dot gnu dot org wrote:
>
> The testcase "minimal.c" is broken:
> Line 2549 in "main" calls "UniformGridPartition<Dim>::partition" (line 
> 2007+)
> which calls "UniformGridPartition<Dim>::blocks" (line 1583) which is an
> empty function returning a reference which will later be used.
> Since the reference is not initialized at all this *has* to crash 
> somewhere.
>
> IMHO we cannot rely on automatic reducers here. :-(
> One must know, whether it is safe to delete a line or not.
>
As I said, I can only reduce it based on some objective criteria.
In this case, it was "pass at -O2, fail with -O2 -funroll-loops", with 
gcc 3.3.3.
This happens to be the case for minimal.c.



-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (21 preceding siblings ...)
  2004-02-02 16:16 ` dberlin at dberlin dot org
@ 2004-02-02 16:33 ` janis187 at us dot ibm dot com
  2004-02-02 16:59 ` reichelt at gcc dot gnu dot org
                   ` (23 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: janis187 at us dot ibm dot com @ 2004-02-02 16:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From janis187 at us dot ibm dot com  2004-02-02 16:33 -------
The regression in PR 13653 was introduced or exposed with this patch:

2002-09-08  Jan Hubicka  <jh@suse.cz>

        * emit-rtl.c (set_mem_attributes_minus_bitpos): Fix array_ref
        handling.

        * loop.c (loop_gics_reduce):  Emit addition after.

The regression hunt took place on i686-pc-linux-gnu using the reduced          
test case array_test1_reduced.cpp compiled with "-O2 -funroll-loops",
and sources from mainline.  This hunt was complicated by the fact that         
sources from too early got an ICE, and sources slightly after the 3.3          
branchpoint got syntax errors.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jh at suse dot cz


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (22 preceding siblings ...)
  2004-02-02 16:33 ` janis187 at us dot ibm dot com
@ 2004-02-02 16:59 ` reichelt at gcc dot gnu dot org
  2004-02-02 17:20 ` reichelt at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-02-02 16:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-02-02 16:59 -------
I'm afraid the result of the regression hunt doesn't help either. :-(
I used today's 3.3 branch, reverted both patches, and I still get a crash
with "-O2 -funroll-loops" and no crash with "-O2".

Well, I only made a new compiler and used today's libraries.
I'll try a full bootstrap soon.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (23 preceding siblings ...)
  2004-02-02 16:59 ` reichelt at gcc dot gnu dot org
@ 2004-02-02 17:20 ` reichelt at gcc dot gnu dot org
  2004-02-02 18:58 ` jh at suse dot cz
                   ` (21 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-02-02 17:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-02-02 17:20 -------
Just did a full bootstrap. Same result.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (24 preceding siblings ...)
  2004-02-02 17:20 ` reichelt at gcc dot gnu dot org
@ 2004-02-02 18:58 ` jh at suse dot cz
  2004-02-02 21:29 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (20 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: jh at suse dot cz @ 2004-02-02 18:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jh at suse dot cz  2004-02-02 18:58 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase

> 
> ------- Additional Comments From reichelt at gcc dot gnu dot org  2004-02-02 17:20 -------
> Just did a full bootstrap. Same result.

It is very dificult to analyze POOMA for me.  Do you know what
particularly gets wrong?

Honza
> 
> 
> -- 
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13653
> 
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (25 preceding siblings ...)
  2004-02-02 18:58 ` jh at suse dot cz
@ 2004-02-02 21:29 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-02-15 12:39 ` gdr at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-02-02 21:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-02-02 21:29 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

On Mon, 2 Feb 2004, reichelt at gcc dot gnu dot org wrote:

> I'm afraid the result of the regression hunt doesn't help either. :-(
> I used today's 3.3 branch, reverted both patches, and I still get a crash
> with "-O2 -funroll-loops" and no crash with "-O2".

Uh. That's sad.  I suppose doing another hunt with the patch reverted
wouldn't help much, either...  But maybe some middle-end wizard can figure
out what's going wrong with the parts of the puzzle we have now.

Richard.


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (26 preceding siblings ...)
  2004-02-02 21:29 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-02-15 12:39 ` gdr at gcc dot gnu dot org
  2004-04-27 15:32 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (18 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: gdr at gcc dot gnu dot org @ 2004-02-15 12:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at gcc dot gnu dot org  2004-02-15 12:39 -------
Adjust milestone

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.3.3                       |3.3.4


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (27 preceding siblings ...)
  2004-02-15 12:39 ` gdr at gcc dot gnu dot org
@ 2004-04-27 15:32 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-04-29 17:54 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (17 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-04-27 15:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-04-27 14:54 -------
Specifying -fno-force-mem works around the bug here too (as it does for PR11841).  

-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (28 preceding siblings ...)
  2004-04-27 15:32 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-04-29 17:54 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-05-03  7:54 ` ebotcazou at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-04-29 17:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-04-29 16:04 -------
The bug is not affected by the proposed fixes to PR11841 and/or PR15054.

-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (29 preceding siblings ...)
  2004-04-29 17:54 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-05-03  7:54 ` ebotcazou at gcc dot gnu dot org
  2004-05-03  8:24 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (15 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-05-03  7:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-03 07:54 -------
I'm a bit confused reading this audit trail.  Is there:
 - a self-contained testcase for the problem?
 - a valid reduced testcase for the problem?
 - a volunteer to tell B. Stroustrup that his f*** language makes it impossible
for compiler hackers to sleep? ;-)

Thanks in advance.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (30 preceding siblings ...)
  2004-05-03  7:54 ` ebotcazou at gcc dot gnu dot org
@ 2004-05-03  8:24 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-05-03 14:13 ` gdr at integrable-solutions dot net
                   ` (14 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-05-03  8:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-05-03 08:23 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

On Mon, 3 May 2004, ebotcazou at gcc dot gnu dot org wrote:

>
> ------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-03 07:54 -------
> I'm a bit confused reading this audit trail.  Is there:
>  - a self-contained testcase for the problem?

All testcases are self-contained,

>  - a valid reduced testcase for the problem?

the original and the array_test1_reduced.ii.gz are certainly valid,
15490.c may not be.

>  - a volunteer to tell B. Stroustrup that his f*** language makes it impossible
> for compiler hackers to sleep? ;-)

;)  What really would help would be a tool (hint: the compiler) removing
all unnecessary decls from the source.

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/


-- 


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


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

* [Bug optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (31 preceding siblings ...)
  2004-05-03  8:24 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-05-03 14:13 ` gdr at integrable-solutions dot net
  2004-05-18 14:15 ` [Bug rtl-optimization/13653] " ebotcazou at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-05-03 14:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-05-03 14:13 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase

"ebotcazou at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

|  - a volunteer to tell B. Stroustrup that his f*** language makes it impossible
| for compiler hackers to sleep? ;-)

I can give you his email address, then you should just be copy-pasting
and basta ;-)

-- Gaby


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (32 preceding siblings ...)
  2004-05-03 14:13 ` gdr at integrable-solutions dot net
@ 2004-05-18 14:15 ` ebotcazou at gcc dot gnu dot org
  2004-05-24  1:56 ` ebotcazou at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-05-18 14:15 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 13653 depends on bug 11841, which changed state.

Bug 11841 Summary: [3.3 Regression] The code compiled with -funroll-loops crashes
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11841

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (33 preceding siblings ...)
  2004-05-18 14:15 ` [Bug rtl-optimization/13653] " ebotcazou at gcc dot gnu dot org
@ 2004-05-24  1:56 ` ebotcazou at gcc dot gnu dot org
  2004-05-24  1:57 ` gdr at integrable-solutions dot net
                   ` (11 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-05-24  1:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-23 20:28 -------
I think I'm half way to fixing it (I know how to manually tweak the assembly
file to let 15490.cpp pass).


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (34 preceding siblings ...)
  2004-05-24  1:56 ` ebotcazou at gcc dot gnu dot org
@ 2004-05-24  1:57 ` gdr at integrable-solutions dot net
  2004-05-24  2:02 ` ebotcazou at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-05-24  1:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-05-23 21:05 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase

"ebotcazou at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| I think I'm half way to fixing it (I know how to manually tweak the assembly
| file to let 15490.cpp pass).

Great!

-- Gaby


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (35 preceding siblings ...)
  2004-05-24  1:57 ` gdr at integrable-solutions dot net
@ 2004-05-24  2:02 ` ebotcazou at gcc dot gnu dot org
  2004-05-24 13:44 ` ebotcazou at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-05-24  2:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-23 22:20 -------
Just for fun, another workaround (for 15490.cpp): -fno-schedule-insns2.


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (36 preceding siblings ...)
  2004-05-24  2:02 ` ebotcazou at gcc dot gnu dot org
@ 2004-05-24 13:44 ` ebotcazou at gcc dot gnu dot org
  2004-05-25  7:01 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (8 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-05-24 13:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-23 23:38 -------
This was probably hinted at in my previous comment: it's RTX_UNCHANGING_P again.


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (37 preceding siblings ...)
  2004-05-24 13:44 ` ebotcazou at gcc dot gnu dot org
@ 2004-05-25  7:01 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-05-25  7:36 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (7 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-05-25  7:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-05-24 11:49 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

One should make sure, 3.4 is not affected (consider -fold-unroll-loops).


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (38 preceding siblings ...)
  2004-05-25  7:01 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-05-25  7:36 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-05-25  8:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (6 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-05-25  7:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-05-24 13:06 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

While the patch fixes a lot of regressions, I get now (now that I
again run a full regression test on POOMA with gcc-3.3, the last
was from Feb02) segfaults in the loop optimizer.  The oldest binary I
can reproduce this is from Apr29, the last ok version I have is Mar01.
The segfaults look like:

Program received signal SIGSEGV, Segmentation fault.
0x0827c3e5 in ggc_set_mark (p=0x94d8988) at
/home/rguenth/src/gcc/gcc3.3/gcc/ggc-page.c:525
525       L2 = LOOKUP_L2 (p);
(gdb) bt
#0  0x0827c3e5 in ggc_set_mark (p=0x94d8988) at
/home/rguenth/src/gcc/gcc3.3/gcc/ggc-page.c:525
#1  0x083382b0 in gt_ggc_r_gt_alias_h ()
#2  0x080dcc14 in gt_ggc_ma_alias_invariant (x_p=0x9) at gt-alias.h:47
#3  0x081612c7 in ggc_mark_roots () at
/home/rguenth/src/gcc/gcc3.3/gcc/ggc-common.c:124
#4  0x0827ca75 in ggc_collect () at
/home/rguenth/src/gcc/gcc3.3/gcc/ggc-page.c:1727
#5  0x081eaa4b in loop_optimize (f=0x4fcf470c, dumpfile=0x0, flags=1)
    at /home/rguenth/src/gcc/gcc3.3/gcc/loop.c:558
#6  0x08263cba in rest_of_compilation (decl=0x469e77e0)
    at /home/rguenth/src/gcc/gcc3.3/gcc/toplev.c:2947
#7  0x080b908e in genrtl_finish_function (fn=0x469e77e0)
    at /home/rguenth/src/gcc/gcc3.3/gcc/cp/semantics.c:2589
#8  0x080b8dbd in expand_body (fn=0x469e77e0)
    at /home/rguenth/src/gcc/gcc3.3/gcc/cp/semantics.c:2412
#9  0x08077688 in instantiate_decl (d=0x0, defer_ok=0)
    at /home/rguenth/src/gcc/gcc3.3/gcc/cp/pt.c:10578
#10 0x080779d0 in instantiate_pending_templates ()
    at /home/rguenth/src/gcc/gcc3.3/gcc/cp/pt.c:10655
#11 0x08087abf in finish_file () at
/home/rguenth/src/gcc/gcc3.3/gcc/cp/decl2.c:2807
#12 0x08091dac in yyparse () at parse.y:489
#13 0x080d36e9 in c_common_parse_file (set_yydebug=0)
    at /home/rguenth/src/gcc/gcc3.3/gcc/c-lex.c:159
#14 0x08261f9a in compile_file () at
/home/rguenth/src/gcc/gcc3.3/gcc/toplev.c:2130
#15 0x08267127 in do_compile () at
/home/rguenth/src/gcc/gcc3.3/gcc/toplev.c:5414
#16 0x082671bb in toplev_main (argc=0, argv=0x0)
    at /home/rguenth/src/gcc/gcc3.3/gcc/toplev.c:5444
#17 0x080d93cb in main (argc=0, argv=0x0) at
/home/rguenth/src/gcc/gcc3.3/gcc/main.c:35
#18 0x4003b8ae in __libc_start_main () from /lib/libc.so.6
(gdb) up 5
#5  0x081eaa4b in loop_optimize (f=0x4fcf470c, dumpfile=0x0, flags=1)
    at /home/rguenth/src/gcc/gcc3.3/gcc/loop.c:558
558               ggc_collect ();
(gdb) list
553           struct loop *loop = &loops->array[i];
554
555           if (! loop->invalid && loop->end)
556             {
557               scan_loop (loop, flags);
558               ggc_collect ();
559             }
560         }
561
562       end_alias_analysis ();
(gdb) up 3
#8  0x080b8dbd in expand_body (fn=0x469e77e0)
    at /home/rguenth/src/gcc/gcc3.3/gcc/cp/semantics.c:2412
2412      genrtl_finish_function (fn);
(gdb) debug_tree(fn)
Undefined command: "debug".  Try "help".
(gdb) call debug_tree(fn)
 <function_decl 0x469e77e0 calcGCFillList
    type <method_type 0x469dc1c0
        type <void_type 0x4016ac40 void asm_written type_6 VOID
            align 8 symtab 0 alias set -1
            pointer_to_this <pointer_type 0x4016acb0>>
        DI
        size <integer_cst 0x4015d920 constant 64>
        unit size <integer_cst 0x4015db40 constant 8>
        align 64 symtab 0 alias set -1 method basetype <record_type
0x46853e00 GridLayoutData<2>>
        arg-types <tree_list 0x469dbed8 side-effects value <pointer_type
0x46853ee0>
            chain <tree_list 0x4015ef64 tree_2 value <void_type 0x4016ac40
void>>>
        pointer_to_this <pointer_type 0x47adbd20>>
    addressable asm_written used public private static weak decl_1 decl_5
QI file
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp line
350 context <record_type 0x46853e00 GridLayoutData<2>>
    arguments <parm_decl 0x4fb531c0 this
        type <pointer_type 0x46a45a10 type <record_type 0x46853e00
GridLayoutData<2>>
            readonly unsigned SI
            size <integer_cst 0x4015dba0 constant 32>
            unit size <integer_cst 0x4015dc00 constant 4>
            align 32 symtab 152330360 alias set -1>
        readonly unsigned used SI file
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp line
350 size <integer_cst 0x4015dba0 32> unit size <integer_cst 0x4015dc00 4>
        align 32 context <function_decl 0x469e77e0 calcGCFillList> initial
<pointer_type 0x46a45a10>
        (reg/v/u/f:SI 58) arg-type <pointer_type 0x46a45a10>
        incoming-rtl (mem/u/f:SI (reg/f:SI 16 argp) [116 this+0 S4 A32])>
    result <result_decl 0x4fb53230 type <void_type 0x4016ac40 void>
        VOID file
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp line
350
        align 8 context <function_decl 0x469e77e0 calcGCFillList>> initial
<block 0x4f7a4ef4>
    template-info 0x469e8438
    (mem:QI (symbol_ref/i:SI
("_ZN14GridLayoutDataILi2EE14calcGCFillListEv")) [0 S1 A8]) chain
<function_decl 0x469e7930 calcDomains>>
(gdb) c
Continuing.
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp: In
   member function `void GridLayoutData<Dim>::calcGCFillList() [with int
Dim =
   2]':
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp:201:
instantiated from `void GridLayoutData<Dim>::initialize(const
Interval<Dim>&, const Partitioner&, const ContextMapper<Dim>&) [with
Partitioner = GridPartition<2>, int Dim = 2]'
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp:96:
instantiated from `GridLayoutData<Dim>::GridLayoutData(const
Interval<Dim>&, const Partitioner&, const ContextMapper<Dim>&) [with
Partitioner = GridPartition<2>, int Dim = 2]'
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp:1428:
instantiated from `GridLayout<Dim>::GridLayout(typename
GridLayoutData<Dim>::Domain_t&, const Partitioner&, const ReplicatedTag&)
[with Partitioner = GridPartition<2>, int Dim = 2]'
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Engine/tests/gmp_test4.cpp:103:
instantiated from here
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp:484:
internal compiler error: Segmentation
   fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


the suggested changes to REGNO_LAST_LUID/REGNO_LAST_NOTE_LUID are
applied, and the following hunk, whose origin I don't remember (but I
don't think they are in the Apr29 build):

diff -u -u -r1.433.2.13 loop.c
--- loop.c      29 Jan 2004 04:42:15 -0000      1.433.2.13
+++ loop.c      24 May 2004 12:52:56 -0000
@@ -4709,7 +4709,8 @@
                 does not have a valid INSN_LUID.  */
              && ! bl->reversed
              && v->always_executed && ! v->maybe_multiple
-             && INSN_UID (v->insn) < max_uid_for_loop)
+             && INSN_UID (v->insn) < max_uid_for_loop
+             && !loop->top)
            {
              /* If other giv's have been combined with this one, then
                 this will work only if all uses of the other giv's occur

(also of course my leafify patch in the gcc 3.3 incarnation, but
disabling leafify does not cure the problem).

Preprocessed testcase is at
http://www.tat.physik.uni-tuebingen.de/~rguenth/gcc/gmp_test4.ii.gz

Richard.


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (39 preceding siblings ...)
  2004-05-25  7:36 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-05-25  8:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-05-25 14:31 ` ebotcazou at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-05-25  8:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-05-24 13:44 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

After a complete test with the patch, regression test results for POOMA
are (compared to Feb01):

+PASSED ... array_test1
+PASSED ... array_test7
+PASSED ... array_test21
+FAILED ... array_test27
+PASSED ... array_test28
+PASSED ... ump_test5: guard cell fill test.
+PASSED ... ump_test7
-PASSED ... gmp_test4 (Guard cell fill test)
-PASSED ... brickviewbase_test2
-FAILED ... brickviewbase_test3
+PASSED ... brickviewbase_test3
-PASSED ... FieldReductions
+PASSED ... Gradient
-PASSED ... OffsetReduction
+PASSED ... FileSetWriter
+PASSED ... FileSetWriterTest2
-PASSED ... TestTranspose

where FAILED ... array_test27 is a known FP precision problem with
gcc-3.3.  New PASSED/FAILED without corresponding vanishing FAILED/PASSED
are previous/new compile errors or runtime segfaults.

Should I file a new PR with the loop optimizer ICE?

Thanks,
Richard.


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (40 preceding siblings ...)
  2004-05-25  8:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-05-25 14:31 ` ebotcazou at gcc dot gnu dot org
  2004-05-26 10:43 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (4 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-05-25 14:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-24 16:01 -------
Try first to revert this one:

2004-04-24  Richard Henderson  <rth@redhat.com>

	PR bootstrap/14671
        * alias.c (alias_invariant, alias_invariant_size): Mark GTY.
        (reg_known_value, reg_known_value_size): Likewise; make static.
        (reg_known_equiv_p): Make static.
        (clear_reg_alias_info): Update for new indexing.
        (get_reg_known_value, set_reg_known_value): New.
        (get_reg_known_equiv_p, set_reg_known_equiv_p): New.
        (canon_rtx): Use them. 
        (init_alias_analysis): Likewise.  Allocate reg_known_value with gc.
        Don't play queer offsetting games with reg_known_value and
        reg_known_equiv_p.
        (end_alias_analysis): Don't free reg_known_value.
        * rtl.h (get_reg_known_value, get_reg_known_equiv_p): Declare.
        * sched-deps.c (reg_known_equiv_p, reg_known_value): Remove.
        (deps_may_trap_p, sched_analyze_1, sched_analyze_2): Use the new
        functions instead.


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (41 preceding siblings ...)
  2004-05-25 14:31 ` ebotcazou at gcc dot gnu dot org
@ 2004-05-26 10:43 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-05-26 18:57 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (3 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-05-26 10:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-05-25 10:01 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

On Mon, 24 May 2004, ebotcazou at gcc dot gnu dot org wrote:

>
> ------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-24 16:01 -------
> Try first to revert this one:
>
> 2004-04-24  Richard Henderson  <rth@redhat.com>
>
> 	PR bootstrap/14671
>         * alias.c (alias_invariant, alias_invariant_size): Mark GTY.
>         (reg_known_value, reg_known_value_size): Likewise; make static.
>         (reg_known_equiv_p): Make static.
>         (clear_reg_alias_info): Update for new indexing.
>         (get_reg_known_value, set_reg_known_value): New.
>         (get_reg_known_equiv_p, set_reg_known_equiv_p): New.
>         (canon_rtx): Use them.
>         (init_alias_analysis): Likewise.  Allocate reg_known_value with gc.
>         Don't play queer offsetting games with reg_known_value and
>         reg_known_equiv_p.
>         (end_alias_analysis): Don't free reg_known_value.
>         * rtl.h (get_reg_known_value, get_reg_known_equiv_p): Declare.
>         * sched-deps.c (reg_known_equiv_p, reg_known_value): Remove.
>         (deps_may_trap_p, sched_analyze_1, sched_analyze_2): Use the new
>         functions instead.

Reverting the patch fixes the problems and testresults are then on-par
with gcc 3.4!  Very nice.

Please revert the above change.

Richard.


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (42 preceding siblings ...)
  2004-05-26 10:43 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-05-26 18:57 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-05-30 21:14 ` gdr at integrable-solutions dot net
                   ` (2 subsequent siblings)
  46 siblings, 0 replies; 49+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-05-26 18:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-05-26 12:28 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop
 miscompiles POOMA testcase

I split the new ICE to PR middle-end/15660 so that it doesn't get lost, if
this PR gets closed as fixed.


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (43 preceding siblings ...)
  2004-05-26 18:57 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-05-30 21:14 ` gdr at integrable-solutions dot net
  2004-05-30 22:42 ` cvs-commit at gcc dot gnu dot org
  2004-05-30 22:57 ` ebotcazou at gcc dot gnu dot org
  46 siblings, 0 replies; 49+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-05-30 21:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-05-29 22:06 -------
Subject: Re:  [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase

"rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla@gcc.gnu.org> writes:

[...]

| Reverting the patch fixes the problems and testresults are then on-par
| with gcc 3.4!  Very nice.
| 
| Please revert the above change.

No, the problem is elsewhere and Dave had fixed it.

-- Gaby


-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (44 preceding siblings ...)
  2004-05-30 21:14 ` gdr at integrable-solutions dot net
@ 2004-05-30 22:42 ` cvs-commit at gcc dot gnu dot org
  2004-05-30 22:57 ` ebotcazou at gcc dot gnu dot org
  46 siblings, 0 replies; 49+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-05-30 22:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-05-29 23:27 -------
Subject: Bug 13653

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	ebotcazou@gcc.gnu.org	2004-05-29 23:27:31

Modified files:
	gcc            : ChangeLog loop.c 

Log message:
	PR optimization/13653
	* loop.c (loop_givs_rescan): When reducing a non-replaceable giv,
	clear the RTX_UNCHANGING_P flag.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.987&r2=1.16114.2.988
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.433.2.13&r2=1.433.2.14



-- 


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


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

* [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
  2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (45 preceding siblings ...)
  2004-05-30 22:42 ` cvs-commit at gcc dot gnu dot org
@ 2004-05-30 22:57 ` ebotcazou at gcc dot gnu dot org
  46 siblings, 0 replies; 49+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-05-30 22:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-29 23:30 -------
See http://gcc.gnu.org/ml/gcc-patches/2004-05/msg01553.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|ebotcazou at gcc dot gnu dot|
                   |org                         |
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2004-05-29 23:30 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-12 10:13 [Bug optimization/13653] New: [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase rguenth at tat dot physik dot uni-tuebingen dot de
2004-01-12 15:56 ` [Bug optimization/13653] " pinskia at gcc dot gnu dot org
2004-01-14 21:22 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-01-15 18:55 ` bangerth at dealii dot org
2004-01-15 18:56 ` bangerth at dealii dot org
2004-01-15 19:10 ` bangerth at dealii dot org
2004-01-15 19:12 ` dberlin at dberlin dot org
2004-01-15 19:13 ` bangerth at dealii dot org
2004-01-15 19:26   ` Daniel Berlin
2004-01-15 19:26 ` dberlin at dberlin dot org
2004-01-16  8:52 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-01-18  3:54 ` dberlin at gcc dot gnu dot org
2004-01-18 13:23 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-01-28 18:45 ` bangerth at dealii dot org
2004-01-28 18:51 ` dberlin at dberlin dot org
2004-01-29 22:10 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-01-29 22:25 ` dberlin at dberlin dot org
2004-01-29 22:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-01-29 22:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-01-29 22:54 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-02-01 23:06 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-02-01 23:31 ` gdr at integrable-solutions dot net
2004-02-02 15:11 ` reichelt at gcc dot gnu dot org
2004-02-02 16:16 ` dberlin at dberlin dot org
2004-02-02 16:33 ` janis187 at us dot ibm dot com
2004-02-02 16:59 ` reichelt at gcc dot gnu dot org
2004-02-02 17:20 ` reichelt at gcc dot gnu dot org
2004-02-02 18:58 ` jh at suse dot cz
2004-02-02 21:29 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-02-15 12:39 ` gdr at gcc dot gnu dot org
2004-04-27 15:32 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-29 17:54 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-05-03  7:54 ` ebotcazou at gcc dot gnu dot org
2004-05-03  8:24 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-05-03 14:13 ` gdr at integrable-solutions dot net
2004-05-18 14:15 ` [Bug rtl-optimization/13653] " ebotcazou at gcc dot gnu dot org
2004-05-24  1:56 ` ebotcazou at gcc dot gnu dot org
2004-05-24  1:57 ` gdr at integrable-solutions dot net
2004-05-24  2:02 ` ebotcazou at gcc dot gnu dot org
2004-05-24 13:44 ` ebotcazou at gcc dot gnu dot org
2004-05-25  7:01 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-05-25  7:36 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-05-25  8:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-05-25 14:31 ` ebotcazou at gcc dot gnu dot org
2004-05-26 10:43 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-05-26 18:57 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-05-30 21:14 ` gdr at integrable-solutions dot net
2004-05-30 22:42 ` cvs-commit at gcc dot gnu dot org
2004-05-30 22:57 ` ebotcazou 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).