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]

Patch for m68k.c



There is an accidentally reversed condition in m68k/m68k.c. As a
result, some optimisations in function prologue and epilogue are not
performed. Actually, the code that performed these optimisations was
buggy, though it didn't matter when it was disabled.


Here's a patch:


Thu Sep 10 14:51:25 1998  Kamil Iskra  <iskra@student.uci.agh.edu.pl>,
			  Gunther Nikl <gnikl@informatik.uni-rostock.de>

	* m68k/m68k.c (output_function_prologue,
	output_function_epilogue): Reverse NO_ADDSUB_Q condition, fix
	format strings.


--- m68k.c.orig	Thu Sep 10 14:36:46 1998
+++ m68k.c	Thu Sep 10 14:38:55 1998
@@ -234,25 +234,25 @@ output_function_prologue (stream, size)
     {
       if (fsize + 4 < 0x8000)
 	{
-#ifdef NO_ADDSUB_Q
+#ifndef NO_ADDSUB_Q
 	  if (fsize + 4 <= 8)
 	    {
 	      if (!TARGET_5200)
 		{
 		  /* asm_fprintf() cannot handle %. */
 #ifdef MOTOROLA
-		  asm_fprintf (stream, "\tsubq.w %OI%d,%Rsp\n", fsize + 4);
+		  asm_fprintf (stream, "\tsubq.w %0I%d,%Rsp\n", fsize + 4);
 #else
-		  asm_fprintf (stream, "\tsubqw %OI%d,%Rsp\n", fsize + 4);
+		  asm_fprintf (stream, "\tsubqw %0I%d,%Rsp\n", fsize + 4);
 #endif
 		}
 	      else
 		{
 		  /* asm_fprintf() cannot handle %. */
 #ifdef MOTOROLA
-		  asm_fprintf (stream, "\tsubq.l %OI%d,%Rsp\n", fsize + 4);
+		  asm_fprintf (stream, "\tsubq.l %0I%d,%Rsp\n", fsize + 4);
 #else
-		  asm_fprintf (stream, "\tsubql %OI%d,%Rsp\n", fsize + 4);
+		  asm_fprintf (stream, "\tsubql %0I%d,%Rsp\n", fsize + 4);
 #endif
 		}
 	    }
@@ -262,15 +262,15 @@ output_function_prologue (stream, size)
 		 subtract a small integer (8 < N <= 16) to a register. */
 	      /* asm_fprintf() cannot handle %. */
 #ifdef MOTOROLA
-	      asm_fprintf (stream, "\tsubq.w %OI8,%Rsp\n\tsubq.w %OI%d,%Rsp\n",
+	      asm_fprintf (stream, "\tsubq.w %0I8,%Rsp\n\tsubq.w %0I%d,%Rsp\n",
 			   fsize + 4);
 #else
-	      asm_fprintf (stream, "\tsubqw %OI8,%Rsp\n\tsubqw %OI%d,%Rsp\n",
+	      asm_fprintf (stream, "\tsubqw %0I8,%Rsp\n\tsubqw %0I%d,%Rsp\n",
 			   fsize + 4);
 #endif
 	    }
 	  else 
-#endif /* NO_ADDSUB_Q */
+#endif /* not NO_ADDSUB_Q */
 	  if (TARGET_68040)
 	    {
 	      /* Adding negative number is faster on the 68040.  */
@@ -774,23 +774,23 @@ output_function_epilogue (stream, size)
 	     reg_names[FRAME_POINTER_REGNUM]);
   else if (fsize)
     {
-#ifdef NO_ADDSUB_Q
+#ifndef NO_ADDSUB_Q
       if (fsize + 4 <= 8) 
 	{
 	  if (!TARGET_5200)
 	    {
 #ifdef MOTOROLA
-	      asm_fprintf (stream, "\taddq.w %OI%d,%Rsp\n", fsize + 4);
+	      asm_fprintf (stream, "\taddq.w %0I%d,%Rsp\n", fsize + 4);
 #else
-	      asm_fprintf (stream, "\taddqw %OI%d,%Rsp\n", fsize + 4);
+	      asm_fprintf (stream, "\taddqw %0I%d,%Rsp\n", fsize + 4);
 #endif
 	    }
 	  else
 	    {
 #ifdef MOTOROLA
-	      asm_fprintf (stream, "\taddq.l %OI%d,%Rsp\n", fsize + 4);
+	      asm_fprintf (stream, "\taddq.l %0I%d,%Rsp\n", fsize + 4);
 #else
-	      asm_fprintf (stream, "\taddql %OI%d,%Rsp\n", fsize + 4);
+	      asm_fprintf (stream, "\taddql %0I%d,%Rsp\n", fsize + 4);
 #endif
 	    }
 	}
@@ -800,15 +800,15 @@ output_function_epilogue (stream, size)
 	     add a small integer (8 < N <= 16) to a register. */
 	  /* asm_fprintf() cannot handle %. */
 #ifdef MOTOROLA
-	  asm_fprintf (stream, "\taddq.w %OI8,%Rsp\n\taddq.w %OI%d,%Rsp\n",
+	  asm_fprintf (stream, "\taddq.w %0I8,%Rsp\n\taddq.w %0I%d,%Rsp\n",
 		       fsize + 4);
 #else
-	  asm_fprintf (stream, "\taddqw %OI8,%Rsp\n\taddqw %OI%d,%Rsp\n",
+	  asm_fprintf (stream, "\taddqw %0I8,%Rsp\n\taddqw %0I%d,%Rsp\n",
 		       fsize + 4);
 #endif
 	}
       else
-#endif /* NO_ADDSUB_Q */
+#endif /* not NO_ADDSUB_Q */
       if (fsize + 4 < 0x8000)
 	{
 	  if (TARGET_68040)

/ Kamil Iskra    AmigaOS  Linux/i386  Linux/m68k               \
| GeekGadgets GCC maintainer   UNIX system administrator       |
| iskra@student.uci.agh.edu.pl  kiskra@ernie.icslab.agh.edu.pl |
\ kamil@dwd.interkom.pl   http://student.uci.agh.edu.pl/~iskra /



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