The following fixes PR79552 on trunk (for the branch it would also need
backporting of r235147 to not regress PR48885 - its fix caused this
regression).

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

Richard.

2017-02-17  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/79552
        * tree-ssa-structalias.c (visit_loadstore): Properly verify
        default defs.

Index: gcc/tree-ssa-structalias.c
===================================================================
--- gcc/tree-ssa-structalias.c  (revision 245501)
+++ gcc/tree-ssa-structalias.c  (working copy)
@@ -7296,9 +7312,15 @@ visit_loadstore (gimple *, tree base, tr
       || TREE_CODE (base) == TARGET_MEM_REF)
     {
       tree ptr = TREE_OPERAND (base, 0);
-      if (TREE_CODE (ptr) == SSA_NAME
-         && ! SSA_NAME_IS_DEFAULT_DEF (ptr))
+      if (TREE_CODE (ptr) == SSA_NAME)
        {
+         /* For parameters, get at the points-to set for the actual parm
+            decl.  */
+         if (SSA_NAME_IS_DEFAULT_DEF (ptr)
+             && (TREE_CODE (SSA_NAME_VAR (ptr)) == PARM_DECL
+                 || TREE_CODE (SSA_NAME_VAR (ptr)) == RESULT_DECL))
+           ptr = SSA_NAME_VAR (ptr);
+
          /* We need to make sure 'ptr' doesn't include any of
             the restrict tags we added bases for in its points-to set.  */
          varinfo_t vi = lookup_vi_for_tree (ptr);

Reply via email to