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]

[PATCH] Fix bootstrap on i686-pc-linux-gnu


On Tue, Dec 13, 2005 at 08:49:56PM +0000, Joern RENNECKE wrote:
> >I can't reproduce it (otherwise I wouldn't have committed it), it
> >bootstrapped/regtested just fine for me.
> 
> >Can one of those who can reproduce it give me preprocessed mf-runtime.i
> >and exact gcc options that triggered it?
> 
> I have attached the stripped down testcase.
> The bug is triggered with:
> ./cc1  mf-runtime-i.c -march=i686

Turns out I missed -mtune=pentium4 I was using when building libmudflap
and other target libraries, sorry.

Here is a fix I have verified on the testcase and am going to bootstrap
it right now.  As pushhi2 pattern is now actually pushing 32 bits,
it is the same insn as pushsi2.  While we could use pushhi2 insn
(would need to use pre_modify rather than pre_dec etc.), it wouldn't
buy us anything.  For -m64 we always do a DImode push as well.
Ok to commit if it succeeds?

2005-12-13  Jakub Jelinek  <jakub@redhat.com>

	PR debug/25023
	* config/i386/i386.c (ix86_force_to_memory): Always use
	SImode push for HImode in -m32.

	* gcc.dg/pr25023.c: New test.

--- gcc/config/i386/i386.c.jj	2005-12-13 12:31:15.000000000 +0100
+++ gcc/config/i386/i386.c	2005-12-13 22:07:18.000000000 +0100
@@ -15790,9 +15790,8 @@ ix86_force_to_memory (enum machine_mode 
 	  }
 	  break;
 	case HImode:
-	  /* It is better to store HImodes as SImodes.  */
-	  if (!TARGET_PARTIAL_REG_STALL)
-	    operand = gen_lowpart (SImode, operand);
+	  /* Store HImodes as SImodes.  */
+	  operand = gen_lowpart (SImode, operand);
 	  /* FALLTHRU */
 	case SImode:
 	  emit_insn (
--- gcc/testsuite/gcc.dg/pr25023.c.jj	2005-12-13 22:11:38.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr25023.c	2005-12-13 22:12:50.000000000 +0100
@@ -0,0 +1,12 @@
+/* PR debug/25023 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i686" { target { { i?86-*-* || x86_64-*-* } && ilp32 } } } */
+
+extern unsigned char v;
+
+float
+foo (void)
+{
+  return v;
+}


	Jakub


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