From d7cb4840b72b7ce93b2419fd4780b069ef1a8440 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 10 Jul 2015 13:56:48 +0200 Subject: [PATCH] re PR target/66813 (gcc.target/i386/asm-flag-5.c failed with -march=pentium) PR target/66813 * config/i386/i386.c (ix86_md_asm_adjust): Emit movstrictqi sequence for TARGET_ZERO_EXTEND_WITH_AND targets. testsuite/ChangeLog: PR target/66813 * gcc.target/i386/pr66813.c: New test. From-SVN: r225662 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 12 +++++++++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr66813.c | 5 +++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr66813.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e3b8d27da86..f305c72481a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-07-10 Uros Bizjak + + PR target/66813 + * config/i386/i386.c (ix86_md_asm_adjust): Emit movstrictqi + sequence for TARGET_ZERO_EXTEND_WITH_AND targets. + 2015-07-10 Jakub Jelinek PR middle-end/66820 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a18c733d211..007e0e13955 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -45842,7 +45842,17 @@ ix86_md_asm_adjust (vec &outputs, vec &/*inputs*/, { rtx destqi = gen_reg_rtx (QImode); emit_insn (gen_rtx_SET (destqi, x)); - x = gen_rtx_ZERO_EXTEND (dest_mode, destqi); + + if (TARGET_ZERO_EXTEND_WITH_AND + && optimize_function_for_speed_p (cfun)) + { + x = force_reg (dest_mode, const0_rtx); + + emit_insn (gen_movstrictqi + (gen_lowpart (QImode, x), destqi)); + } + else + x = gen_rtx_ZERO_EXTEND (dest_mode, destqi); } emit_insn (gen_rtx_SET (dest, x)); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 04c64c45ff9..23782757548 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-07-10 Uros Bizjak + + PR target/66813 + * gcc.target/i386/pr66813.c: New test. + 2015-07-10 Jakub Jelinek PR middle-end/66820 diff --git a/gcc/testsuite/gcc.target/i386/pr66813.c b/gcc/testsuite/gcc.target/i386/pr66813.c new file mode 100644 index 00000000000..d4d8cc69d2d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr66813.c @@ -0,0 +1,5 @@ +/* { dg-do compile { target { ia32 } } } */ +/* { dg-options "-march=pentium" } */ + +void f_s(void) { short x; asm("" : "=@ccc"(x)); } +void f_i(void) { int x; asm("" : "=@ccc"(x)); } -- 2.30.2