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

            Bug ID: 82837
           Summary: [8 Regression] ICE in output_operand: invalid
                    expression as operand
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---
              Host: i686-linux-gnu
            Target: i686-linux-gnu

Following test-case ICEs, unfortunately can't be reproduced on
x86_64-linux-gnu:

$ cat /tmp/ice.i
static char b[100];
static int *c;
char *e;
void a(char *f, char *i) {
  int d = __builtin_object_size(f, 1);
  __builtin___strcpy_chk(f, i, d);
}
void g(void) {
  int h;
  switch (*c) {
  case 8:
    e = "swapgs";
    break;
  case 9:
    e = "rdtscp";
    break;
  default:
    return;
  }
  h = __builtin_strlen(b);
  a(b + h - 6, e);
  c++;
}

$ ./xgcc -B. /tmp/ice.i -O2 -g -fPIE
/tmp/ice.i:23:1: internal compiler error: output_operand: invalid expression as
operand
 }
 ^
0x86bb32f output_operand_lossage(char const*, ...)
        ../../gcc/final.c:3442
0x86bc7cb output_addr_const(_IO_FILE*, rtx_def*)
        ../../gcc/final.c:4031
0x86bc426 output_addr_const(_IO_FILE*, rtx_def*)
        ../../gcc/final.c:3940
0x85f09a9 dw2_assemble_integer(int, rtx_def*)
        ../../gcc/dwarf2asm.c:56
0x85f0f86 dw2_asm_output_addr_rtx(int, rtx_def*, char const*, ...)
        ../../gcc/dwarf2asm.c:305
0x85ff836 output_loc_operands
        ../../gcc/dwarf2out.c:2197
0x85fff74 output_loc_sequence(dw_loc_descr_node*, int)
        ../../gcc/dwarf2out.c:2419
0x860ac7e output_loc_list
        ../../gcc/dwarf2out.c:9851
0x86084cf output_location_lists
        ../../gcc/dwarf2out.c:8451
0x8608500 output_location_lists
        ../../gcc/dwarf2out.c:8453
0x8608500 output_location_lists
        ../../gcc/dwarf2out.c:8453
0x8608500 output_location_lists
        ../../gcc/dwarf2out.c:8453
0x863a82b dwarf2out_finish
        ../../gcc/dwarf2out.c:30118

Reply via email to