This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/49390] [4.6/4.7 Regression] GCSE miscompilation
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Jun 2011 13:53:25 +0000
- Subject: [Bug rtl-optimization/49390] [4.6/4.7 Regression] GCSE miscompilation
- Auto-submitted: auto-generated
- References: <bug-49390-4@http.gcc.gnu.org/bugzilla/>
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?).