The following fixes PR70948, a failure of PTA considering all
fields of va_list being clobbered (assigned from NONLOCAL) for
__builtin_va_start.  With the new pointer-vs.-decl comparison
optimization this bug manifests as a miscompile of
gcc.c-torture/execute/va-arg-pack-1.c on AARCH64.

Bootstrapped and tested on x86_64-unknown-linux-gnu, Jiong Wang
verified it fixes the aarch64 issue (I verified by dump inspection only).

Applied to trunk.

Richard.

2016-05-06  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/70948
        * tree-ssa-structalias.c (find_func_aliases_for_builtin_call):
        Properly clobber all fields of va_list for __builtin_va_start.

Index: gcc/tree-ssa-structalias.c
===================================================================
--- gcc/tree-ssa-structalias.c  (revision 235945)
+++ gcc/tree-ssa-structalias.c  (working copy)
@@ -4492,7 +4492,7 @@ find_func_aliases_for_builtin_call (stru
          tree valist = gimple_call_arg (t, 0);
          struct constraint_expr rhs, *lhsp;
          unsigned i;
-         get_constraint_for (valist, &lhsc);
+         get_constraint_for_ptr_offset (valist, NULL_TREE, &lhsc);
          do_deref (&lhsc);
          /* The va_list gets access to pointers in variadic
             arguments.  Which we know in the case of IPA analysis

Reply via email to