public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR70948
@ 2016-05-06 12:24 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2016-05-06 12:24 UTC (permalink / raw)
  To: gcc-patches


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-06 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-06 12:24 [PATCH] Fix PR70948 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).