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

            Bug ID: 84683
           Summary: internal compiler error: in move_for_stack_reg, at
                    reg-stack.c:1173
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vegard.nossum at gmail dot com
  Target Milestone: ---

Input:

void a(float b, double c) {
  for (int e = 0; e < 2; e++) {
    asm volatile ("" : "+f" (c));
    asm ("" : "+rm" (c = b));
  }
}

Output:

$ xgcc -x c++ -S -Wall -fpermissive -O3 -
<stdin>: In function 'void a(float, double)':
<stdin>:3:34: error: output constraint 0 must specify a single register
during RTL pass: stack
<stdin>:6:1: internal compiler error: in move_for_stack_reg, at
reg-stack.c:1173
0x2d49787 move_for_stack_reg
        /home/vegard/git/gcc/gcc/reg-stack.c:1173
0x2d5c1fa subst_stack_regs
        /home/vegard/git/gcc/gcc/reg-stack.c:2437
0x2d5ced7 convert_regs_1
        /home/vegard/git/gcc/gcc/reg-stack.c:3062
0x2d5ced7 convert_regs_2
        /home/vegard/git/gcc/gcc/reg-stack.c:3197
0x2d64844 convert_regs
        /home/vegard/git/gcc/gcc/reg-stack.c:3232
0x2d64844 reg_to_stack
        /home/vegard/git/gcc/gcc/reg-stack.c:3357
0x2d64844 rest_of_handle_stack_regs
        /home/vegard/git/gcc/gcc/reg-stack.c:3412
0x2d64844 execute
        /home/vegard/git/gcc/gcc/reg-stack.c:3443

$ xgcc --version
xgcc (GCC) 8.0.1 20180301 (experimental)

Built from git c435a9e730c6e8f10da09d58b4fc9aaeb401b0d5 (r258097).

4.8.5 seems to produce this:

<source>: In function 'void a(float, double)':
<source>:3:33: error: output constraint 0 must specify a single register
     asm volatile ("" : "+f" (c));
                                 ^
<source>:3:33: error: output constraint 0 must specify a single register
<source>:3:33: error: implicitly popped regs must be grouped at top of stack
Compiler returned: 1

Test case was minimised by C-Reduce.

Reply via email to