Fix SSA inconsistencies with invalid asm reg names (PR67639)

PR middle-end/67639
	* varasm.c (make_decl_rtl): Mark invalid register vars as
	DECL_EXTERNAL.

testsuite/
	PR middle-end/67639
	* c-c++-common/pr67639.c: New test.

From-SVN: r232125
This commit is contained in:
Bernd Schmidt 2016-01-07 12:17:39 +00:00 committed by Bernd Schmidt
parent c6a0add9d0
commit 7e33d4dc9e
4 changed files with 20 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2015-12-15 Bernd Schmidt <bschmidt@redhat.com>
PR middle-end/67639
* varasm.c (make_decl_rtl): Mark invalid register vars as
DECL_EXTERNAL.
PR rtl-optimization/66206
* bt-load.c (find_btr_use): Change first arg to be a pointer to an rtx.
All callers changed.

View File

@ -1,3 +1,8 @@
2015-12-15 Bernd Schmidt <bschmidt@redhat.com>
PR middle-end/67639
* c-c++-common/pr67639.c: New test.
2016-01-07 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/69141

View File

@ -0,0 +1,8 @@
/* { dg-do compile } */
void
foo (int p)
{
int t;
register long x asm ("rhubarb") = p; /* { dg-error "register name" } */
__asm ("" : "=r" (t), "=r" (t), "=r" (t), "=r" (x) : "0" (x));
}

View File

@ -1420,6 +1420,9 @@ make_decl_rtl (tree decl)
specifications. */
SET_DECL_ASSEMBLER_NAME (decl, NULL_TREE);
DECL_HARD_REGISTER (decl) = 0;
/* Also avoid SSA inconsistencies by pretending this is an external
decl now. */
DECL_EXTERNAL (decl) = 1;
return;
}
/* Now handle ordinary static variables and functions (in memory).