> Structural analysis let's you prove that stores to fields m1 and m2
may
> never overlap. They're always at different offsets, even if p1 and p2
> point to the same area.
Yes, but one can write something like this:
p2 = (S1 *)&p1->s1_m2;
Of course, this is a blatant violation of ANSI C standa
Actually, I'm interested in how to force conservative analysis *without*
source code modifications (only with compiler's options).
Yours,
Andrey
Diego Novillo wrote:
> 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
> x_2 = p1_1(D)->m1;
>
> # SMT.4_8 = VDEF
> p1_1(D)->m1 = 32;
>
>
Hi,
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-aliasin