public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Call validize_mem in assign_386_stack_local (PR target/50092)
@ 2011-08-18 14:21 Jakub Jelinek
  2011-08-18 15:17 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2011-08-18 14:21 UTC (permalink / raw)
  To: Uros Bizjak, Richard Henderson; +Cc: gcc-patches

Hi!

If stack frame size is larger than 2GB, the MEMs returned by
assign_386_stack_local aren't necessarily valid MEMs.  While we could do
validize_mem in all the assign_386_stack_local callers, it seems far easier
to do it just in one (well, two actually) spots.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.6?

2011-08-18  Jakub Jelinek  <jakub@redhat.com>

	PR target/50092
	* config/i386/i386.c (assign_386_stack_local): Call validize_mem
	on the result before returning it.

	* gcc.dg/torture/pr50092.c: New test.

--- gcc/config/i386/i386.c.jj	2011-08-18 08:35:53.000000000 +0200
+++ gcc/config/i386/i386.c	2011-08-18 11:16:41.000000000 +0200
@@ -21787,7 +21787,7 @@ assign_386_stack_local (enum machine_mod
 
   for (s = ix86_stack_locals; s; s = s->next)
     if (s->mode == mode && s->n == n)
-      return copy_rtx (s->rtl);
+      return validize_mem (copy_rtx (s->rtl));
 
   s = ggc_alloc_stack_local_entry ();
   s->n = n;
@@ -21796,7 +21796,7 @@ assign_386_stack_local (enum machine_mod
 
   s->next = ix86_stack_locals;
   ix86_stack_locals = s;
-  return s->rtl;
+  return validize_mem (s->rtl);
 }
 \f
 /* Calculate the length of the memory address in the instruction encoding.
--- gcc/testsuite/gcc.dg/torture/pr50092.c.jj	2011-08-18 11:27:07.000000000 +0200
+++ gcc/testsuite/gcc.dg/torture/pr50092.c	2011-08-18 11:27:39.000000000 +0200
@@ -0,0 +1,15 @@
+/* PR target/50092 */
+/* { dg-do compile { target lp64 } } */
+
+volatile int v;
+
+void bar (long double);
+void baz (_Complex long double *);
+
+void
+foo (void)
+{
+  _Complex long double w[100000000];
+  bar ((long double) v / 2147483648.0);
+  baz (w);
+}

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Call validize_mem in assign_386_stack_local (PR target/50092)
  2011-08-18 14:21 [PATCH] Call validize_mem in assign_386_stack_local (PR target/50092) Jakub Jelinek
@ 2011-08-18 15:17 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2011-08-18 15:17 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Uros Bizjak, gcc-patches

On 08/18/2011 07:03 AM, Jakub Jelinek wrote:
> 	PR target/50092
> 	* config/i386/i386.c (assign_386_stack_local): Call validize_mem
> 	on the result before returning it.
> 
> 	* gcc.dg/torture/pr50092.c: New test.

Ok.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-18 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18 14:21 [PATCH] Call validize_mem in assign_386_stack_local (PR target/50092) Jakub Jelinek
2011-08-18 15:17 ` Richard Henderson

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