i386.c (print_reg): Warn for values of unsupported size in integer register.

* config/i386/i386.c (print_reg): Warn for values of
	unsupported size in integer register.

testsuite/ChangeLog:

	* gcc.target/i386/invsize-2.c: New test.
	* gcc.target/i386/invsize-3.c: Ditto.
	* gcc.target/i386/invsize-4.c: Ditto.
	* gcc.target/i386/pr66274.c: Expect "unsuported size" warning.
	* gcc.target/i386/stackalign/asm-1.c: Ditto.

From-SVN: r245815
This commit is contained in:
Uros Bizjak 2017-03-01 20:24:53 +01:00 committed by Uros Bizjak
parent c85ac396f1
commit 489909059b
9 changed files with 48 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2017-03-01 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (print_reg): Warn for values of
unsupported size in integer register.
2017-03-01 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/79439

View File

@ -17646,13 +17646,16 @@ print_reg (rtx x, int code, FILE *file)
switch (msize)
{
case 8:
case 4:
if (LEGACY_INT_REGNO_P (regno))
putc (msize == 8 && TARGET_64BIT ? 'r' : 'e', file);
/* FALLTHRU */
case 16:
case 12:
case 8:
if (GENERAL_REGNO_P (regno) && msize > GET_MODE_SIZE (word_mode))
warning (0, "unsupported size for integer register");
/* FALLTHRU */
case 4:
if (LEGACY_INT_REGNO_P (regno))
putc (msize > 4 && TARGET_64BIT ? 'r' : 'e', file);
/* FALLTHRU */
case 2:
normal:
reg = hi_reg_name[regno];
@ -17661,7 +17664,7 @@ print_reg (rtx x, int code, FILE *file)
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");
error ("unsupported size for integer register");
reg = qi_reg_name[regno];
break;
case 0:

View File

@ -1,3 +1,11 @@
2017-03-01 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/invsize-2.c: New test.
* gcc.target/i386/invsize-3.c: Ditto.
* gcc.target/i386/invsize-4.c: Ditto.
* gcc.target/i386/pr66274.c: Expect "unsuported size" warning.
* gcc.target/i386/stackalign/asm-1.c: Ditto.
2017-03-01 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/79439

View File

@ -1,4 +1,5 @@
/* { dg-do compile { target ia32 } } */
/* { dg-options "" } */
void foo (char x)
{

View File

@ -0,0 +1,7 @@
/* { dg-do compile { target ia32 } } */
/* { dg-options "" } */
void foo (long long x)
{
__asm__ volatile ("# %0" : : "r" (x));
} /* { dg-warning "unsupported size" } */

View File

@ -0,0 +1,7 @@
/* { dg-do compile } */
/* { dg-options "" } */
void foo (long double x)
{
__asm__ volatile ("# %0" : : "r" (x));
} /* { dg-warning "unsupported size" } */

View File

@ -0,0 +1,7 @@
/* { dg-do compile { target int128 } } */
/* { dg-options "" } */
void foo (__int128 x)
{
__asm__ volatile ("# %0" : : "r" (x));
} /* { dg-warning "unsupported size" } */

View File

@ -3,7 +3,7 @@
void f()
{
asm ("push %0" : : "r" ((unsigned long long) 456));
}
asm ("push %0" : : "r" ((unsigned long long) 456 >> 32));
} /* { dg-warning "unsupported size" } */
/* { dg-final { scan-assembler-not "push %r" } } */
/* { dg-final { scan-assembler-not "push\[ \t]+%r" } } */

View File

@ -4,4 +4,4 @@
/* This case is to detect a compile time regression introduced in stack
branch development. */
void f(){asm("%0"::"r"(1.5F));}void g(){asm("%0"::"r"(1.5));}
void f(){asm("%0"::"r"(1.5F));}void g(){asm("%0"::"r"(1.5));} /* { dg-warning "unsupported size" } */