This is the mail archive of the gcc-patches@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]

[PATCH] Revert part of PR80492


This change unnecessarily pessimizes some cases.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2017-05-03  Richard Biener  <rguenther@suse.de>

	Revert
	PR tree-optimization/80492
	* tree-ssa-alias.c (decl_refs_may_alias_p): Handle
	compare_base_decls returning dont-know properly.

Index: gcc/tree-ssa-alias.c
===================================================================
--- gcc/tree-ssa-alias.c	(revision 247492)
+++ gcc/tree-ssa-alias.c	(working copy)
@@ -1096,16 +1096,13 @@ decl_refs_may_alias_p (tree ref1, tree b
 {
   gcc_checking_assert (DECL_P (base1) && DECL_P (base2));
 
-  int cmp = compare_base_decls (base1, base2);
-
   /* If both references are based on different variables, they cannot alias.  */
-  if (cmp == 0)
+  if (compare_base_decls (base1, base2) == 0)
     return false;
 
   /* If both references are based on the same variable, they cannot alias if
      the accesses do not overlap.  */
-  if (cmp == 1
-      && !ranges_overlap_p (offset1, max_size1, offset2, max_size2))
+  if (!ranges_overlap_p (offset1, max_size1, offset2, max_size2))
     return false;
 
   /* For components with variable position, the above test isn't sufficient,


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