public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation
@ 2004-09-15 20:51 rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:53 ` [Bug tree-optimization/17510] " rguenth at tat dot physik dot uni-tuebingen dot de
` (14 more replies)
0 siblings, 15 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-15 20:51 UTC (permalink / raw)
To: gcc-bugs
The attached testcase is miscompiled using
-O2 -static --param max-inline-insns-single=800 --param
large-function-insns=5000 --param inline-unit-growth=100000
and works ok adding -fno-strict-aliasing.
The testcase is instrumented with leafify attributes and with a supporting
compiler (patch attached) the problem can be reproduced with just -O2 vs. -O2
-fno-strict-aliasing and -O1 -fstrict-aliasing vs. -O1.
The failure manifests as a segmentation fault during the first iteration, run
the program with "-n 10" commandline.
The segmentation fault occours at different places depending on optimization
level (-O1 vs. -O2) and inlining heuristics (leafify or the large inlining
parameters). This may hint at stack allocating/aliasing problems and not
of the actual code.
See also thread starting at
http://gcc.gnu.org/ml/gcc/2004-09/msg00904.html
for some initial tree-dump differences.
--
Summary: -fstrict-aliasing triggers miscompilation
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at tat dot physik dot uni-tuebingen dot de
CC: dnovillo at redhat dot com,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=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-15 20:53 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:56 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-15 20:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-15 20:53 -------
Created an attachment (id=7144)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7144&action=view)
testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:53 ` [Bug tree-optimization/17510] " rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-15 20:56 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:58 ` bangerth at dealii dot org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-15 20:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-15 20:56 -------
Created an attachment (id=7145)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7145&action=view)
leafify patch
Or see http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00187.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:53 ` [Bug tree-optimization/17510] " rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:56 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-15 20:58 ` bangerth at dealii dot org
2004-09-15 21:04 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-09-15 20:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-09-15 20:58 -------
Can you try to come up with something smaller? You are probably well
aware by now that POOMA testcases aren't very popular with us bug
reducers... :-(
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (2 preceding siblings ...)
2004-09-15 20:58 ` bangerth at dealii dot org
@ 2004-09-15 21:04 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 22:06 ` [Bug tree-optimization/17510] [4.0 Regression] " pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-15 21:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-15 21:04 -------
Subject: Re: -fstrict-aliasing triggers miscompilation
> Can you try to come up with something smaller? You are probably well
> aware by now that POOMA testcases aren't very popular with us bug
> reducers... :-(
I know :( I'll at least try to reduce compilation time somewhat and
throw one or two runs of delta at it - it's only even manually reducing
the testcase is tedious (compilation time is >10min for me with the
weird inlining limits, and failure with leafify doesn't imply failure
with these limits (which I already reduced, maybe too much)).
Oh well - I love C++.
Thanks anyway,
Richard.
(don't expect anything before Friday)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (3 preceding siblings ...)
2004-09-15 21:04 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-15 22:06 ` pinskia at gcc dot gnu dot org
2004-09-15 22:22 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-15 22:06 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC|dnovillo at redhat dot com |pinskia at gcc dot gnu dot
| |org, dnovillo at gcc dot gnu
| |dot org
Keywords| |wrong-code
Summary|-fstrict-aliasing triggers |[4.0 Regression] -fstrict-
|miscompilation |aliasing triggers
| |miscompilation
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (4 preceding siblings ...)
2004-09-15 22:06 ` [Bug tree-optimization/17510] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-09-15 22:22 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-16 4:08 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-15 22:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-15 22:22 -------
Created an attachment (id=7146)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7146&action=view)
ed script for testcase reduction
Here's cut in compile-time (10min to 1:30) - ed script to delete unnecessary
stuff. Failure now
(gdb) run -n 2
Starting program: /net/alwazn/home/rguenth/PR17510/tramp3d-v3 -n 2
i = 1 t = 0.001 dt = 0.001 (9.9999e-07s/it)
Program received signal SIGSEGV, Segmentation fault.
0x08067f4c in
MultiArgKernel<MultiArg3<Field<UniformRectilinearMesh<MeshTraits<3, double,
UniformRectilinearTag, CartesianTag, 3> >, double, BrickView>,
Field<UniformRectilinearMesh<MeshTraits<3, double, UniformRectilinearTag,
CartesianTag, 3> >, double, BrickView>,
Field<UniformRectilinearMesh<MeshTraits<3, double, UniformRectilinearTag,
CartesianTag, 3> >, double, BrickView> >,
EvaluateLocLoop<Adv5::X::MomentumfluxX<3>, 3> >::run (this=0x3)
at tramp3d-v3.x.cpp:54523
54523 s = (vx(I) + vx(I+dX)) * 0.5*dt;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (5 preceding siblings ...)
2004-09-15 22:22 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-16 4:08 ` pinskia at gcc dot gnu dot org
2004-09-16 7:59 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-16 4:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-16 04:08 -------
Does -fno-ivopts makes this works?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (6 preceding siblings ...)
2004-09-16 4:08 ` pinskia at gcc dot gnu dot org
@ 2004-09-16 7:59 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-16 8:07 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-16 7:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-16 07:59 -------
Subject: Re: [4.0 Regression] -fstrict-aliasing
triggers miscompilation
On 16 Sep 2004, pinskia at gcc dot gnu dot org wrote:
> Does -fno-ivopts makes this works?
No. But -fno-tree-loop-optimize does. Is there an option to turn
off rths stack coalescing?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (7 preceding siblings ...)
2004-09-16 7:59 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-16 8:07 ` pinskia at gcc dot gnu dot org
2004-09-16 8:35 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-16 8:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-16 08:07 -------
-fno-tree-loop-optimizate is meta-flag, so does -fno-tree-loop-im works then as this is more likely
the problem.
And no there is no flag to turn off stack coalescing (I really doubt that stack colaescing is causing the
problem).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (8 preceding siblings ...)
2004-09-16 8:07 ` pinskia at gcc dot gnu dot org
@ 2004-09-16 8:35 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-16 8:43 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-16 8:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-16 08:35 -------
Subject: Re: [4.0 Regression] -fstrict-aliasing
triggers miscompilation
> -fno-tree-loop-optimizate is meta-flag, so does -fno-tree-loop-im works then as this is more likely
> the problem.
Yes, -fno-tree-loop-im fixes the problem, too.
I guessed the failure may be stack allocation related because if I
remove the call before the call to the faulting function the failure
goes away (but only with leafify, not with the weird inlining parameters).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (9 preceding siblings ...)
2004-09-16 8:35 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-16 8:43 ` pinskia at gcc dot gnu dot org
2004-09-16 8:56 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-16 8:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-16 08:42 -------
Then this is most likely the same problem as PR 17133 (there is a patch which you can test also).
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |17133
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (10 preceding siblings ...)
2004-09-16 8:43 ` pinskia at gcc dot gnu dot org
@ 2004-09-16 8:56 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-16 11:05 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-16 8:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-16 08:56 -------
Subject: Re: [4.0 Regression] -fstrict-aliasing
triggers miscompilation
On 16 Sep 2004, pinskia at gcc dot gnu dot org wrote:
> Then this is most likely the same problem as PR 17133 (there is a patch which you can test also).
The patch doesn't apply cleanly anymore, I'll tried to apply it manually,
let's see if it passes bootstrapping first.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (11 preceding siblings ...)
2004-09-16 8:56 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-16 11:05 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-17 9:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-10-29 5:43 ` pinskia at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-16 11:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-16 11:04 -------
Subject: Re: [4.0 Regression] -fstrict-aliasing
triggers miscompilation
> Then this is most likely the same problem as PR 17133 (there is a patch which you can test also).
Manually applied patch survives bootstrap but doesn't fix the problem,
sorry.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (12 preceding siblings ...)
2004-09-16 11:05 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-17 9:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-10-29 5:43 ` pinskia at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-17 9:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-17 09:27 -------
It seems I can no longer reproduce the failure with todays mainline. May be
papered over or fixed, at least I don't have to reduce the testcase further.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/17510] [4.0 Regression] -fstrict-aliasing triggers miscompilation
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
` (13 preceding siblings ...)
2004-09-17 9:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-10-29 5:43 ` pinskia at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-29 5:43 UTC (permalink / raw)
To: gcc-bugs
--
Bug 17510 depends on bug 17133, which changed state.
Bug 17133 Summary: [4.0 Regression] wrong code with -ftree-lim
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17133
What |Old Value |New Value
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2004-10-29 5:43 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15 20:51 [Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:53 ` [Bug tree-optimization/17510] " rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:56 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 20:58 ` bangerth at dealii dot org
2004-09-15 21:04 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-15 22:06 ` [Bug tree-optimization/17510] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-09-15 22:22 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-16 4:08 ` pinskia at gcc dot gnu dot org
2004-09-16 7:59 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-16 8:07 ` pinskia at gcc dot gnu dot org
2004-09-16 8:35 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-16 8:43 ` pinskia at gcc dot gnu dot org
2004-09-16 8:56 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-16 11:05 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-17 9:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-10-29 5:43 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).