This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ipa/65270] [5 regression] ICF needs to match TYPE attributes on memory accesses


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65270

--- Comment #16 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Richard,
thanks, I also think alias trick makes gloal vars safe for merging across
RESTRICT flags. 

One however needs to consider merging of items referring restricted vars.

const restrict int *a=&var;
const int *b = &var; 

const int **ptrs1={&a};
const int **ptrs2=[&b};

with -fmerge-all-constants we may merge ptrs1 and ptrs2 and, in the late
compilation, in turn fold expression "ptrs2[0]" into a restricted pointer to
var?

If this case is legit, the correct place to match RESTRICT flags is
compare_cgraph_references. We can also go with your patch that will make A and
B considered to be different and thus prevent merging PTRS1&PTRS2.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]