public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH]: Fix PR45296, register long double ICE at -O2, -Os, -O3
@ 2010-08-17  7:46 Uros Bizjak
  2010-08-17  9:46 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2010-08-17  7:46 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

Hello!

We should reject stack registers as global registers, otherwise stack
compensation code ICEs.

2010-08-17  Uros Bizjak  <ubizjak@gmail.com>

	PR target/45296
	* reginfo.c (globalize_reg): Reject stack registers.

testsuite/ChangeLog:

2010-08-17  Uros Bizjak  <ubizjak@gmail.com>

	PR target/45296
	* gcc.target/i386/pr45296.c: New test.

Tested on x86_64-pc-linux-gnu {,-m32}. OK for mainline and release branches?

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 849 bytes --]

Index: testsuite/gcc.target/i386/pr45296.c
===================================================================
--- testsuite/gcc.target/i386/pr45296.c	(revision 0)
+++ testsuite/gcc.target/i386/pr45296.c	(revision 0)
@@ -0,0 +1 @@
+register long double F80 __asm__("st"); /* { dg-error "stack register" } */
Index: reginfo.c
===================================================================
--- reginfo.c	(revision 163291)
+++ reginfo.c	(working copy)
@@ -798,6 +798,14 @@ fix_register (const char *name, int fixe
 void
 globalize_reg (int i)
 {
+#ifdef STACK_REGS
+  if (IN_RANGE (i, FIRST_STACK_REG, LAST_STACK_REG))
+    {
+      error ("stack register used for global register variable");
+      return;
+    }
+#endif
+
   if (fixed_regs[i] == 0 && no_global_reg_vars)
     error ("global register variable follows a function definition");
 

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

* Re: [PATCH]: Fix PR45296, register long double ICE at -O2, -Os, -O3
  2010-08-17  7:46 [PATCH]: Fix PR45296, register long double ICE at -O2, -Os, -O3 Uros Bizjak
@ 2010-08-17  9:46 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2010-08-17  9:46 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Tue, Aug 17, 2010 at 9:27 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> We should reject stack registers as global registers, otherwise stack
> compensation code ICEs.
>
> 2010-08-17  Uros Bizjak  <ubizjak@gmail.com>
>
>        PR target/45296
>        * reginfo.c (globalize_reg): Reject stack registers.
>
> testsuite/ChangeLog:
>
> 2010-08-17  Uros Bizjak  <ubizjak@gmail.com>
>
>        PR target/45296
>        * gcc.target/i386/pr45296.c: New test.
>
> Tested on x86_64-pc-linux-gnu {,-m32}. OK for mainline and release branches?

Ok.

Thanks,
Richard.

> Uros.
>

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

end of thread, other threads:[~2010-08-17  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17  7:46 [PATCH]: Fix PR45296, register long double ICE at -O2, -Os, -O3 Uros Bizjak
2010-08-17  9:46 ` Richard Guenther

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