This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/58513] *var and MEM[(const int &)var] (var has int* type) are not treated as the same data ref.
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Sep 2013 11:04:06 +0000
- Subject: [Bug tree-optimization/58513] *var and MEM[(const int &)var] (var has int* type) are not treated as the same data ref.
- Auto-submitted: auto-generated
- References: <bug-58513-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58513
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Sep 24 11:04:04 2013
New Revision: 202865
URL: http://gcc.gnu.org/viewcvs?rev=202865&root=gcc&view=rev
Log:
2013-09-24 Richard Biener <rguenther@suse.de>
PR middle-end/58513
* tree.c (reference_alias_ptr_type): Move ...
* alias.c (reference_alias_ptr_type): ... here and implement
in terms of the new reference_alias_ptr_type_1.
(ref_all_alias_ptr_type_p): New helper.
(get_deref_alias_set_1): Drop flag_strict_aliasing here,
use ref_all_alias_ptr_type_p.
(get_deref_alias_set): Add flag_strict_aliasing check here.
(reference_alias_ptr_type_1): New function, split out from ...
(get_alias_set): ... here.
(alias_ptr_types_compatible_p): New function.
* alias.h (reference_alias_ptr_type): Declare.
(alias_ptr_types_compatible_p): Likewise.
* tree.h (reference_alias_ptr_type): Remove.
* fold-const.c (operand_equal_p): Use alias_ptr_types_compatible_p
to compare MEM_REF alias types.
* g++.dg/vect/pr58513.cc: New testcase.
Added:
trunk/gcc/testsuite/g++.dg/vect/pr58513.cc
Modified:
trunk/gcc/ChangeLog
trunk/gcc/alias.c
trunk/gcc/alias.h
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.c
trunk/gcc/tree.h