https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61330

--- Comment #5 from wangzheyu <tony.wang at arm dot com> ---
(In reply to Richard Biener from comment #1)
> Seems the parser fails to set DECL_HARD_REGISTER on that bogus decl.
Hi Richard,
I find that in function make_decl_rtl(gcc/varasm.c:1357), there's one line
comment: 
/* As a register variable, it has no section.  */

And for the correct reigster type declaration like: register int *a asm(“r1”),
the program will just directly return(gcc/varasm.c:1358), and won't sink into
the symbol ref generation part. So symtab_get_node won't be called.

It seems to be a long time for the invalid register type declaration to be sink
into the symbol ref generation part of function make_decl_rtl, which will also
lead to wrong rtx generation.
register int *a asm("r1")=>(reg:SI 1 r1 [orig:0 a] [0])
register int *a asm("unknown register")=>(symbol_ref:SI ("unknown register")
[flag 0x80])

Reply via email to