[Bug rtl-optimization/49390] [4.6/4.7 Regression] GCSE miscompilation
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 13 13:53:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49390
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-13 13:53:23 UTC ---
Perhaps we should have some exceptions where we allow different MEM_ATTRS, but
they need to be carefully chosen. E.g. if both refs are indirect refs and are
similar, with the same points-to info, it would be ok.
if (MEM_VOLATILE_P (x) || MEM_VOLATILE_P (y))
return 0;
if (MEM_ATTRS (x) != MEM_ATTRS (y) && mem_attrs_equiv_p (x, y))
return 0;
where mem_attrs_equiv_p would call ao_ref_from_mem on both x and y,
if at least one of them returns false, fail, compare all integer fields for
equality (alias sets using ao_ref_base_alias_set/ao_ref_alias_set) and compare
base kinds, for indirect we could check for same type and same points-to info
(couldn't find a points-to set comparison function, e.g. for pt->vars can just
pointer equality be tested or does it need bitmap_equal_p?).
More information about the Gcc-bugs
mailing list