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 <[EMAIL PROTECTED]> 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