This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix bootstrap on i686-pc-linux-gnu
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Joern RENNECKE <joern dot rennecke at st dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org, Martin Reinecke <martin at MPA-Garching dot MPG dot DE>, Laurent GUERBY <laurent at guerby dot net>
- Date: Tue, 13 Dec 2005 16:39:56 -0500
- Subject: Re: [PATCH] Fix bootstrap on i686-pc-linux-gnu
- References: <439F24E3.6050307@st.com> <439F33F4.2010402@st.com> <20051213212050.GR31785@devserv.devel.redhat.com> <439F3C59.7030403@st.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Dec 13, 2005 at 09:25:45PM +0000, Joern RENNECKE wrote:
> >While we could use pushhi2 insn
> >(would need to use pre_modify rather than pre_dec etc.), it wouldn't
> >buy us anything.
> >
> Presumably, it would prevent a partial register stall.
Alternatively we could
subl $4, %esp
movw %ax, (%esp)
instead of
pushl %eax
Not sure how would that perform cycle wise though (on the testcase
there is actually not a partial register stall at all, since the QI->HI
zero extension is movzbl, so pushl %eax in this case is best).
BTW, I just noticed I posted an older incomplete version of the patch,
ix86_free_from_memory obviously needs corresponding adjustement.
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.
(ix86_free_from_memory): Likewise.
* 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 (
@@ -15820,8 +15819,6 @@ ix86_free_from_memory (enum machine_mode
if (mode == DImode || TARGET_64BIT)
size = 8;
- else if (mode == HImode && TARGET_PARTIAL_REG_STALL)
- size = 2;
else
size = 4;
/* Use LEA to deallocate stack space. In peephole2 it will be converted
--- 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