* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-01-25 16:57 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 17:16 ` pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-01-25 16:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-01-25 16:57 -------
Created an attachment (id=8062)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8062&action=view)
testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 16:57 ` [Bug tree-optimization/19626] " rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-01-25 17:16 ` pinskia at gcc dot gnu dot org
2005-01-25 17:24 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-25 17:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-25 17:15 -------
If you had used the correct types in the first place instead of this crazy uninitialized pointer this works
(almost):
dX.D.2220.D.2170.domain_m.buffer[0].D.2098.D.2055.domain_m = 1;
dX.D.2220.D.2170.domain_m.buffer[1].D.2098.D.2055.domain_m = 0;
....
k.D.2220.D.2170.domain_m.buffer[0].D.2098.D.2055.domain_m = 0;
k.D.2220.D.2170.domain_m.buffer[1].D.2098.D.2055.domain_m = 1;
return k.D.2220.D.2170.domain_m.buffer[0].D.2098.D.2055.domain_m +
dX.D.2220.D.2170.domain_m.buffer[0].D.2098.D.2055.domain_m;
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Keywords| |alias, missed-optimization,
| |TREE
Priority|P2 |P3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 16:57 ` [Bug tree-optimization/19626] " rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 17:16 ` pinskia at gcc dot gnu dot org
@ 2005-01-25 17:24 ` pinskia at gcc dot gnu dot org
2005-01-26 8:47 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-25 17:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-25 17:20 -------
D.2540 = (struct Loc<1> *) &dX.D.2210.D.2166.domain_m.buffer;
That confuses the aliasing mechanism
buffer is of type int* but you are casting it to Loc<1> *.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (2 preceding siblings ...)
2005-01-25 17:24 ` pinskia at gcc dot gnu dot org
@ 2005-01-26 8:47 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-02-10 18:59 ` rguenth 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 @ 2005-01-26 8:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-01-26 08:47 -------
Subject: Re: Aliasing says stores to local
memory do alias
> D.2540 = (struct Loc<1> *) &dX.D.2210.D.2166.domain_m.buffer;
> That confuses the aliasing mechanism
> buffer is of type int* but you are casting it to Loc<1> *.
Telling it the truth by having an array of Loc<1> instead doesn't help.
I suppose you're talking about not decomposing Loc<2> into two
Loc<1> as intermediate step? Well, yes, that's a design decision I
cannot change. It looks superfluous for Loc<>, but makes sense for
the more complex domain objects like Interval and Range (but that's
a different story).
But in principle a compiler could determine that the two objects
cannot alias, even which this interwinded type structure?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (3 preceding siblings ...)
2005-01-26 8:47 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-02-10 18:59 ` rguenth at gcc dot gnu dot org
2005-04-07 10:36 ` rguenth at gcc dot gnu dot org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-02-10 18:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-02-10 13:18 -------
Actually, exchanging loc_test for
int loc_test(void)
{
const Loc<2> k(0, 1);
return k[0].first();
}
shows the same problem:
<bb 0>:
D.2541 = (struct Loc<1> *) &k.D.2190.D.2155.domain_m.buffer;
# k_160 = V_MAY_DEF <k_150>;
*&(&D.2541->D.2101)->D.2064.domain_m = 0;
# k_63 = V_MAY_DEF <k_160>;
*&(&(D.2541 + 4B)->D.2101)->D.2064.domain_m = 1;
D.2628 = (struct Loc<1> *) &k.D.2190.D.2155.domain_m.buffer;
return (&D.2628->D.2101)->D.2064.domain_m;
One problem might be, that PRE does not recognize the redundant
(struct Loc<1>D.1872 *) &kD.1965.D.2190.D.2155.domain_mD.2002.bufferD.2015
in
<L0>:;
currIndex_114 = 1;
D.2554_122 = (struct Loc<1> *) &k.D.2190.D.2155.domain_m.buffer;
n.6_123 = 0;
D.2556_124 = 0;
D.2557_125 = 0B;
D.2548_126 = D.2554_122;
this_130 = &D.2548_126->D.2101;
dom_133 = &this_130->D.2064.domain_m;
# k_160 = V_MAY_DEF <k_150>;
*dom_133 = 0;
D.2540_141 = 1;
<L29>:;
currIndex_79 = 2;
n.6_88 = 1;
D.2604_89 = 4;
D.2605_90 = 4B;
D.2596_91 = D.2554_122 + 4B;
this_95 = &D.2596_91->D.2101;
dom_98 = &this_95->D.2064.domain_m;
# k_63 = V_MAY_DEF <k_160>;
*dom_98 = 1;
D.2588_106 = 1;
D.2641_47 = (struct Loc<1> *) &k.D.2190.D.2155.domain_m.buffer;
this_55 = &D.2641_47->D.2101;
# VUSE <TMT.12_38>;
# VUSE <k_63>;
d_57 = this_55->D.2064.domain_m;
return d_57;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (4 preceding siblings ...)
2005-02-10 18:59 ` rguenth at gcc dot gnu dot org
@ 2005-04-07 10:36 ` rguenth at gcc dot gnu dot org
2005-04-07 12:48 ` dberlin at dberlin dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-04-07 10:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-04-07 10:30 -------
Created an attachment (id=8554)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8554&action=view)
Revised testcase without confusing casts
This changes the testcase to not cast int* to Loc<1>*, but use Loc<1>[2] as
storage for Loc<2> while retaining the initialization properties. It requires
the testcase be compiled with tree-level loop-unrolling enabled, as the empty
constructors/destructors for array members are created as loops by the C++
frontend.
Other than that, struct aliasing (or just removing the casts) doesn't fix the
aliasing problems - though struct aliasing doesn't handle array elements at
the moment(?).
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #8062 is|0 |1
obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (5 preceding siblings ...)
2005-04-07 10:36 ` rguenth at gcc dot gnu dot org
@ 2005-04-07 12:48 ` dberlin at dberlin dot org
2005-04-07 12:50 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: dberlin at dberlin dot org @ 2005-04-07 12:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-04-07 12:48 -------
Subject: Re: Aliasing says stores to local
memory do alias
> Other than that, struct aliasing (or just removing the casts) doesn't fix the
> aliasing problems - though struct aliasing doesn't handle array elements at
> the moment(?).
Correct, it does not.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (6 preceding siblings ...)
2005-04-07 12:48 ` dberlin at dberlin dot org
@ 2005-04-07 12:50 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-04-07 16:43 ` dberlin at dberlin dot org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-04-07 12:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-04-07 12:50 -------
Subject: Re: Aliasing says stores to local
memory do alias
On 7 Apr 2005, dberlin at dberlin dot org wrote:
>
> ------- Additional Comments From dberlin at gcc dot gnu dot org 2005-04-07 12:48 -------
> Subject: Re: Aliasing says stores to local
> memory do alias
>
>
> > Other than that, struct aliasing (or just removing the casts) doesn't fix the
> > aliasing problems - though struct aliasing doesn't handle array elements at
> > the moment(?).
>
> Correct, it does not.
Ok, at least the RTL optimizers figure out that these stack locals
cannot alias. Hope we get this for the tree optimizers, too.
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=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (7 preceding siblings ...)
2005-04-07 12:50 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-04-07 16:43 ` dberlin at dberlin dot org
2005-04-07 22:55 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: dberlin at dberlin dot org @ 2005-04-07 16:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-04-07 16:43 -------
Subject: Re: Aliasing says stores to local
memory do alias
> >
> >
> > > Other than that, struct aliasing (or just removing the casts) doesn't fix the
> > > aliasing problems - though struct aliasing doesn't handle array elements at
> > > the moment(?).
> >
> > Correct, it does not.
>
> Ok, at least the RTL optimizers figure out that these stack locals
> cannot alias. Hope we get this for the tree optimizers, too.
It's already in my plans. It's just the implementation is a bit trickier
than one would like :)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (8 preceding siblings ...)
2005-04-07 16:43 ` dberlin at dberlin dot org
@ 2005-04-07 22:55 ` pinskia at gcc dot gnu dot org
2005-05-13 13:18 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-07 22:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-07 22:55 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-04-07 22:55:38
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (9 preceding siblings ...)
2005-04-07 22:55 ` pinskia at gcc dot gnu dot org
@ 2005-05-13 13:18 ` pinskia at gcc dot gnu dot org
2005-05-17 16:39 ` law at redhat dot com
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-13 13:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-13 13:18 -------
Most of the problem is PR 17141, the other problem comes into play with struct aliasing issues.
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |17141
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (10 preceding siblings ...)
2005-05-13 13:18 ` pinskia at gcc dot gnu dot org
@ 2005-05-17 16:39 ` law at redhat dot com
2005-05-17 17:36 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: law at redhat dot com @ 2005-05-17 16:39 UTC (permalink / raw)
To: gcc-bugs
--
Bug 19626 depends on bug 17141, which changed state.
Bug 17141 Summary: *&a->b is not folded
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17141
What |Old Value |New Value
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (11 preceding siblings ...)
2005-05-17 16:39 ` law at redhat dot com
@ 2005-05-17 17:36 ` pinskia at gcc dot gnu dot org
2005-05-18 21:52 ` rguenth at gcc dot gnu dot org
2005-06-09 16:32 ` pinskia at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-17 17:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-17 17:35 -------
We now get:
dX.D.2296.D.2252.domain_m[0].D.2209.D.2200.D.2154.domain_m = 1;
dX.D.2296.D.2252.domain_m[1].D.2209.D.2200.D.2154.domain_m = 0;
k.D.2296.D.2252.domain_m[0].D.2209.D.2200.D.2154.domain_m = 0;
k.D.2296.D.2252.domain_m[1].D.2209.D.2200.D.2154.domain_m = 1;
return k.D.2296.D.2252.domain_m[0].D.2209.D.2200.D.2154.domain_m +
dX.D.2296.D.2252.domain_m[0].D.2209.D.2200.D.2154.domain_m;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (12 preceding siblings ...)
2005-05-17 17:36 ` pinskia at gcc dot gnu dot org
@ 2005-05-18 21:52 ` rguenth at gcc dot gnu dot org
2005-06-09 16:32 ` pinskia at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-05-18 21:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-05-18 21:51 -------
Nice. Now it's really an aliasing problem only - and maybe bad timing for when
we end up with such nice state.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/19626] Aliasing says stores to local memory do alias
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
` (13 preceding siblings ...)
2005-05-18 21:52 ` rguenth at gcc dot gnu dot org
@ 2005-06-09 16:32 ` pinskia at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-09 16:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-09 16:32 -------
This has now been fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19626
^ permalink raw reply [flat|nested] 16+ messages in thread