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] Fix and be more forgiving in the alias oracle


As PR47283 shows we still have issues with debug insns and the alias
oracle.  This patch makes us give conservative answers for
refs_may_alias_p_1 like we do in the other oracle entires (where
I noticed a bug, fixed with this patch).  I'll keep the assert
for checking-enabled builds as we probably want to fix the issues
nevertheless.

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

Richard.

2011-03-03  Richard Guenther  <rguenther@suse.de>

	PR middle-end/47283
	* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Make code
	match comment.
	(refs_may_alias_p_1): For release branches return true if
	we are confused by our input.

Index: gcc/tree-ssa-alias.c
===================================================================
*** gcc/tree-ssa-alias.c	(revision 170594)
--- gcc/tree-ssa-alias.c	(working copy)
*************** ptr_deref_may_alias_decl_p (tree ptr, tr
*** 178,184 ****
        || (TREE_CODE (decl) != VAR_DECL
  	  && TREE_CODE (decl) != PARM_DECL
  	  && TREE_CODE (decl) != RESULT_DECL))
!     return false;
  
    /* Disregard pointer offsetting.  */
    if (TREE_CODE (ptr) == POINTER_PLUS_EXPR)
--- 178,184 ----
        || (TREE_CODE (decl) != VAR_DECL
  	  && TREE_CODE (decl) != PARM_DECL
  	  && TREE_CODE (decl) != RESULT_DECL))
!     return true;
  
    /* Disregard pointer offsetting.  */
    if (TREE_CODE (ptr) == POINTER_PLUS_EXPR)
*************** refs_may_alias_p_1 (ao_ref *ref1, ao_ref
*** 1080,1086 ****
--- 1080,1091 ----
  				      ao_ref_alias_set (ref2), -1,
  				      tbaa_p);
  
+   /* We really do not want to end up here, but returning true is safe.  */
+ #ifdef ENABLE_CHECKING
    gcc_unreachable ();
+ #else
+   return true;
+ #endif
  }
  
  bool


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