How to supress a specific kind of ansi-aliasing rules?

Bokhanko, Andrey S andrey.s.bokhanko@intel.com
Wed Jun 20 11:33:00 GMT 2007


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-aliasing rules) supplied.

I wonder, is there a way to force gcc not to assume independence in the example shown above?

Yours,
Andrey



More information about the Gcc mailing list