re PR target/79804 (ICE in print_reg, at config/i386/i386.c:17637)

PR target/79804
	* config/i386/i386.c (print_reg): Remove assert for disalowed
	regno values, call output_operand_lossage instead.

testsuite/ChangeLog:

	PR target/79804
	* gcc.target/i386/pr79804.c: New test.

From-SVN: r247037
This commit is contained in:
Uros Bizjak 2017-04-20 22:25:17 +02:00 committed by Uros Bizjak
parent 2091733634
commit 8749b11fe2
4 changed files with 31 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2017-04-20 Uros Bizjak <ubizjak@gmail.com>
PR target/79804
* config/i386/i386.c (print_reg): Remove assert for disalowed
regno values, call output_operand_lossage instead.
2017-04-20 Uros Bizjak <ubizjak@gmail.com>
PR target/78090

View File

@ -17650,12 +17650,16 @@ print_reg (rtx x, int code, FILE *file)
regno = REGNO (x);
gcc_assert (regno != ARG_POINTER_REGNUM
&& regno != FRAME_POINTER_REGNUM
&& regno != FPSR_REG
&& regno != FPCR_REG);
if (regno == FLAGS_REG)
if (regno == ARG_POINTER_REGNUM
|| regno == FRAME_POINTER_REGNUM
|| regno == FPSR_REG
|| regno == FPCR_REG)
{
output_operand_lossage
("invalid use of register '%s'", reg_names[regno]);
return;
}
else if (regno == FLAGS_REG)
{
output_operand_lossage ("invalid use of asm flag output");
return;

View File

@ -1,3 +1,8 @@
2017-04-20 Uros Bizjak <ubizjak@gmail.com>
PR target/79804
* gcc.target/i386/pr79804.c: New test.
2017-04-20 Uros Bizjak <ubizjak@gmail.com>
PR target/78090

View File

@ -0,0 +1,10 @@
/* PR target/79804 */
/* { dg-do compile } */
/* { dg-options "" } */
void foo (void)
{
register int r20 asm ("20");
asm volatile ("# %0" : "=r"(r20)); /* { dg-error "invalid use of register" } */
}