From 979455ea0ebfeb68f143f1c369fa83c6d2101201 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 25 May 2015 19:49:28 +0200 Subject: [PATCH] re PR target/66274 (gcc6: x86 -m32 emits 64bit register in inline asm) PR target/66274 * config/i386/i386.c (print_reg): Only print "r" for TARGET_64BIT when LEGACY_INT_REGNO_P is processed. testsuite/ChangeLog: PR target/66274 * gcc.target/i386/pr66274.c: New test. From-SVN: r223649 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr66274.c | 9 +++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr66274.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a58e245ada7..c30a6434398 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-05-25 Uros Bizjak + + PR target/66274 + * config/i386/i386.c (print_reg): Only print "r" for TARGET_64BIT + when LEGACY_INT_REGNO_P is processed. + 2015-05-25 Alexander Monakov * config/i386/i386.c (ix86_function_ok_for_sibcall): Check flag_plt. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 99322b42ac3..e77cd0448bf 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -15230,7 +15230,7 @@ print_reg (rtx x, int code, FILE *file) case 8: case 4: if (LEGACY_INT_REGNO_P (regno)) - putc (msize == 8 ? 'r' : 'e', file); + putc (msize == 8 && TARGET_64BIT ? 'r' : 'e', file); case 16: case 12: case 2: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2d8cd01f8a6..91fd4c55b69 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-05-25 Uros Bizjak + + PR target/66274 + * gcc.target/i386/pr66274.c: New test. + 2015-05-25 Eric Botcazou * gnat.dg/renaming6.ad[sb]: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr66274.c b/gcc/testsuite/gcc.target/i386/pr66274.c new file mode 100644 index 00000000000..59969eb9037 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr66274.c @@ -0,0 +1,9 @@ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-O" } */ + +void f() +{ + asm ("push %0" : : "r" ((unsigned long long) 456)); +} + +/* { dg-final { scan-assembler-not "push %r" } } */ -- 2.30.2