From: Uros Bizjak Date: Tue, 28 Feb 2017 18:03:16 +0000 (+0100) Subject: i386.c (print_reg): Error out for values of 8-bit size in invalid integer register. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2af0c3edd190d66ad9caa66fd98167669487c050;p=gcc.git i386.c (print_reg): Error out for values of 8-bit size in invalid integer register. * config/i386/i386.c (print_reg): Error out for values of 8-bit size in invalid integer register. testsuite/ChangeLog: * gcc.target/i386/invsize-1.c: New test. From-SVN: r245785 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c6dbf414d2..880679112e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-02-28 Uros Bizjak + + * config/i386/i386.c (print_reg): Error out for values + of 8-bit size in invalid integer register. + 2017-02-28 Martin Sebor PR tree-optimization/79691 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b35b56cbdcf..2b11aa1c37d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -17660,6 +17660,8 @@ print_reg (rtx x, int code, FILE *file) case 1: if (regno >= ARRAY_SIZE (qi_reg_name)) goto normal; + if (!ANY_QI_REGNO_P (regno)) + error ("unsupported size for integer register in 32-bit mode"); reg = qi_reg_name[regno]; break; case 0: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3e14d498f6d..a9ff533fb99 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-02-28 Uros Bizjak + + * gcc.target/i386/invsize-1.c: New test. + 2017-02-28 Martin Sebor PR tree-optimization/79691 diff --git a/gcc/testsuite/gcc.target/i386/invsize-1.c b/gcc/testsuite/gcc.target/i386/invsize-1.c new file mode 100644 index 00000000000..f7e59211f65 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/invsize-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target ia32 } } */ + +void foo (char x) +{ + register char rx __asm ("si") = x; + + __asm__ volatile ("# %0" : : "r" (rx)); +} /* { dg-error "unsupported size" } */