This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix small regression in asm handling


The following was noticed in a build of parisc linux with the 3.4 branch.
It shouldn't be an error to use the PIC register when it is not a fixed
register.

Tested on hppa-unknown-linux-gnu with no regressions.  Ok for 3.4 and
trunk?

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

2004-01-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* stmt.c (expand_asm_operands): Allow the PIC register to be clobbered
	when it is not fixed.

Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.344
diff -u -3 -p -r1.344 stmt.c
--- stmt.c	19 Jan 2004 03:08:14 -0000	1.344
+++ stmt.c	29 Jan 2004 03:37:28 -0000
@@ -1512,8 +1512,9 @@ expand_asm_operands (tree string, tree o
       /* Mark clobbered registers.  */
       if (i >= 0)
         {
-	  /* Clobbering the PIC register is an error */
-	  if (i == (int) PIC_OFFSET_TABLE_REGNUM)
+	  /* Clobbering the PIC register is an error.  */
+	  if (i == (int) PIC_OFFSET_TABLE_REGNUM
+	      && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
 	    {
 	      error ("PIC register `%s' clobbered in `asm'", regname);
 	      return;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]