Message ID | AM4PR0701MB2162054D27450ACE04AC4B8FE4510@AM4PR0701MB2162.eurprd07.prod.outlook.com |
---|---|
State | New |
Headers | show |
Ping... for this patch: https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00871.html I'd say it's a no-brainer... > Hi, > > this fixes an ICE that happens when an asm statement tries to print > the flags output operand. > > Boot-strapped and reg-tested on x86_64-linux-gnu. > OK for trunk? > > > Thanks > Bernd.
On 06/21/2016 02:09 AM, Bernd Edlinger wrote: > Ping... > > for this patch: https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00871.html > > I'd say it's a no-brainer... You might want to contact Uros directly. He does the most with the x86 backend these days. jeff
Oh, yes. Uros... ? Thanks Bernd. Am 21.06.2016 um 17:04 schrieb Jeff Law: > On 06/21/2016 02:09 AM, Bernd Edlinger wrote: >> Ping... >> >> for this patch: https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00871.html >> >> I'd say it's a no-brainer... > You might want to contact Uros directly. He does the most with the x86 > backend these days. > > jeff >
Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 237323) +++ gcc/config/i386/i386.c (working copy) @@ -17180,10 +17180,15 @@ print_reg (rtx x, int code, FILE *file) gcc_assert (regno != ARG_POINTER_REGNUM && regno != FRAME_POINTER_REGNUM - && regno != FLAGS_REG && regno != FPSR_REG && regno != FPCR_REG); + if (regno == FLAGS_REG) + { + output_operand_lossage ("invalid use of asm flag output"); + return; + } + duplicated = code == 'd' && TARGET_AVX; switch (msize) Index: gcc/testsuite/gcc.target/i386/asm-flag-7.c =================================================================== --- gcc/testsuite/gcc.target/i386/asm-flag-7.c (revision 0) +++ gcc/testsuite/gcc.target/i386/asm-flag-7.c (working copy) @@ -0,0 +1,9 @@ +/* Test error conditions of asm flag outputs. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +void test(void) +{ + char x; + asm("# %0" : "=@ccz"(x)); /* { dg-error "invalid use of asm flag output" } */ +}