This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR70948
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 May 2016 14:24:20 +0200 (CEST)
- Subject: [PATCH] Fix PR70948
- Authentication-results: sourceware.org; auth=none
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 <rguenther@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