public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix -mregnames
@ 2009-11-25 15:42 Jakub Jelinek
  2009-11-25 16:50 ` David Edelsohn
  2009-11-25 19:26 ` Michael Meissner
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2009-11-25 15:42 UTC (permalink / raw)
  To: David Edelsohn, Michael Meissner; +Cc: gcc-patches

Hi!

The power7 changes http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01833.html
broke -mregnames support.  The problem is that TARGET_REGNAMES changed from
a macro (defined for targets including sysv4.opt, not defined otherwise)
to a variable, so #ifdef TARGET_REGNAMES in rs6000.c is always false.
As the variable used for -mregnames in sysv4.opt is only defined on targets
that include sysv4.opt, we need a different variable name and a macro.

Ok for trunk?

2009-11-25  Jakub Jelinek  <jakub@redhat.com>

	* config/rs6000/sysv4.opt (mregnames): Change Var to rs6000_regnames.
	* config/rs6000/sysv4.h (TARGET_REGNAMES): Define.

	* gcc.target/powerpc/regnames-1.c: New test.

--- gcc/config/rs6000/sysv4.opt.jj	2009-06-30 13:10:26.000000000 +0200
+++ gcc/config/rs6000/sysv4.opt	2009-11-25 16:12:30.000000000 +0100
@@ -91,7 +91,7 @@ Target Report Var(TARGET_NO_BITFIELD_WOR
 Allow bit-fields to cross word boundaries
 
 mregnames
-Target Var(TARGET_REGNAMES)
+Target Var(rs6000_regnames)
 Use alternate register names
 
 ;; This option does nothing and only exists because the compiler
--- gcc/config/rs6000/sysv4.h.jj	2009-09-16 09:06:28.000000000 +0200
+++ gcc/config/rs6000/sysv4.h	2009-11-25 16:13:13.000000000 +0100
@@ -63,6 +63,7 @@ extern enum rs6000_sdata_type rs6000_sda
 #define	TARGET_NO_PROTOTYPE	(! TARGET_PROTOTYPE)
 #define	TARGET_NO_TOC		(! TARGET_TOC)
 #define	TARGET_NO_EABI		(! TARGET_EABI)
+#define	TARGET_REGNAMES		rs6000_regnames
 
 #ifdef HAVE_AS_REL16
 #undef TARGET_SECURE_PLT
--- gcc/testsuite/gcc.target/powerpc/regnames-1.c.jj	2009-11-25 16:14:58.000000000 +0100
+++ gcc/testsuite/gcc.target/powerpc/regnames-1.c	2009-11-25 16:14:51.000000000 +0100
@@ -0,0 +1,8 @@
+/* { dg-do compile { target powerpc*-*-linux* } */
+/* { dg-options "-mregnames" } */
+
+register double f17 asm ("f17");
+double foo (void)
+{
+  return f17;
+}

	Jakub

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

* Re: [PATCH] Fix -mregnames
  2009-11-25 15:42 [PATCH] Fix -mregnames Jakub Jelinek
@ 2009-11-25 16:50 ` David Edelsohn
  2009-11-25 19:26 ` Michael Meissner
  1 sibling, 0 replies; 3+ messages in thread
From: David Edelsohn @ 2009-11-25 16:50 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Michael Meissner, gcc-patches

On Wed, Nov 25, 2009 at 10:38 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> The power7 changes http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01833.html
> broke -mregnames support.  The problem is that TARGET_REGNAMES changed from
> a macro (defined for targets including sysv4.opt, not defined otherwise)
> to a variable, so #ifdef TARGET_REGNAMES in rs6000.c is always false.
> As the variable used for -mregnames in sysv4.opt is only defined on targets
> that include sysv4.opt, we need a different variable name and a macro.
>
> Ok for trunk?
>
> 2009-11-25  Jakub Jelinek  <jakub@redhat.com>
>
>        * config/rs6000/sysv4.opt (mregnames): Change Var to rs6000_regnames.
>        * config/rs6000/sysv4.h (TARGET_REGNAMES): Define.
>
>        * gcc.target/powerpc/regnames-1.c: New test.

Okay.

Thanks, David

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

* Re: [PATCH] Fix -mregnames
  2009-11-25 15:42 [PATCH] Fix -mregnames Jakub Jelinek
  2009-11-25 16:50 ` David Edelsohn
@ 2009-11-25 19:26 ` Michael Meissner
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Meissner @ 2009-11-25 19:26 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: David Edelsohn, Michael Meissner, gcc-patches

On Wed, Nov 25, 2009 at 10:38:05AM -0500, Jakub Jelinek wrote:
> Hi!
> 
> The power7 changes http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01833.html
> broke -mregnames support.  The problem is that TARGET_REGNAMES changed from
> a macro (defined for targets including sysv4.opt, not defined otherwise)
> to a variable, so #ifdef TARGET_REGNAMES in rs6000.c is always false.
> As the variable used for -mregnames in sysv4.opt is only defined on targets
> that include sysv4.opt, we need a different variable name and a macro.
> 
> Ok for trunk?

Whoops, I'm sorry about breaking that.

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com

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

end of thread, other threads:[~2009-11-25 19:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-25 15:42 [PATCH] Fix -mregnames Jakub Jelinek
2009-11-25 16:50 ` David Edelsohn
2009-11-25 19:26 ` Michael Meissner

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