This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to supress a specific kind of ansi-aliasing rules?
- From: Diego Novillo <dnovillo at google dot com>
- To: "Bokhanko, Andrey S" <andrey dot s dot bokhanko at intel dot com>
- Cc: gcc at gnu dot org
- Date: Wed, 20 Jun 2007 07:32:35 -0400
- Subject: Re: How to supress a specific kind of ansi-aliasing rules?
- References: <300B70C65DCD59468957941A60716EBC7EB6BD@mssmsx411>
On 6/20/07 6:35 AM, Bokhanko, Andrey S wrote:
> As I learned from experience, gcc always assume independence between memory references in the following program:
>
> typedef struct {
> int m1;
> int m2;
> } S1;
>
> void foo(S1 *p1, S1 *p2) {
> ... = p1->m1;
> ... = p2->m2;
> }
>
> ...even if -fno-strict-aliasing (an option disabling ansi-aliasing rules) supplied.
No, it doesn't. Both p1->m1 and p2->m2 will use the same memory tag in
GIMPLE and the same alias set during RTL. Notice how a store between
the two loads affects the second load:
# VUSE <SMT.4_7(D)>
x_2 = p1_1(D)->m1;
# SMT.4_8 = VDEF <SMT.4_7(D)>
p1_1(D)->m1 = 32;
# VUSE <SMT.4_8>
y_4 = p2_3(D)->m2;
Or did you mean that p1 and p2 should *not* interfere with each other?