This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug inline-asm/79804] ICE in print_reg, at config/i386/i386.c:17637


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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-03-03
          Component|target                      |inline-asm
     Ever confirmed|0                           |1

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
Minimized testcase:

--cut here--
void foo (int x)
{
  register int r20 asm ("20") = x;

  asm volatile ("# %0" : : "r" (r20));
}
--cut here--

(gdb) f 2
#2  0x0000000000e8fcdc in print_reg (x=0x7ffff0265f18, code=0, file=0x1fd3620)
    at /home/uros/gcc-svn/trunk/gcc/config/i386/i386.c:17634
17634     gcc_assert (regno != ARG_POINTER_REGNUM
(gdb) list
17629     else
17630       msize = GET_MODE_SIZE (GET_MODE (x));
17631
17632     regno = REGNO (x);
17633
17634     gcc_assert (regno != ARG_POINTER_REGNUM
17635                 && regno != FRAME_POINTER_REGNUM
17636                 && regno != FPSR_REG
17637                 && regno != FPCR_REG);
17638
(gdb) p debug_rtx (x)
(reg/v:SI 20 frame [ r20 ])
$3 = void

While we can change the assert to an error, I really wonder how the numeric
name gets pass "invalid register name" check. Naming a register e.g "x20" gets
us:

pr79804.c: In function ‘foo’:
pr79804.c:3:16: error: invalid register name for ‘r20’
   register int r20 asm ("x20") = x;

I'll recategorize this PR to a generic inline-asm component.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]