public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Fix PR target/43958
@ 2010-07-02 20:58 John David Anglin
  0 siblings, 0 replies; only message in thread
From: John David Anglin @ 2010-07-02 20:58 UTC (permalink / raw)
  To: gcc-patches

The attached patch changes hppa_gimplify_va_arg_expr to use pointer
arithmetic instead of integer arithmetic.  This fixes the pointer
escape and failure of gcc.dg/ipa/ipa-pta-10.c.

Tested on hppa2.0w-hp-hpux11.11.  Committed to trunk.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2010-07-02  Richard Guenther  <rguenther@suse.de>

	PR target/43958
	* config/pa/pa.c (hppa_gimplify_va_arg_expr): Use pointer arithmetic
	for argument alignment.

Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c	(revision 161653)
+++ config/pa/pa.c	(working copy)
@@ -6040,11 +6040,10 @@
       u = fold_build1 (NEGATE_EXPR, sizetype, u);
       t = build2 (POINTER_PLUS_EXPR, valist_type, valist, u);
 
-      /* Copied from va-pa.h, but we probably don't need to align to
-	 word size, since we generate and preserve that invariant.  */
-      u = size_int (size > 4 ? -8 : -4);
-      t = fold_convert (sizetype, t);
-      t = build2 (BIT_AND_EXPR, sizetype, t, u);
+      /* Align to 4 or 8 byte boundary depending on argument size.  */
+
+      u = build_int_cst (TREE_TYPE (t), (HOST_WIDE_INT)(size > 4 ? -8 : -4));
+      t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t, u);
       t = fold_convert (valist_type, t);
 
       t = build2 (MODIFY_EXPR, valist_type, valist, t);

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

only message in thread, other threads:[~2010-07-02 20:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-02 20:58 [committed] Fix PR target/43958 John David Anglin

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).