[Bug rtl-optimization/84682] internal compiler error: Segmentation fault (process_address_1)

2018-03-02 Thread vegard.nossum at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84682

--- Comment #2 from Vegard Nossum  ---
I'm also seeing a different crash with this (using -O3):

int a;
void b() {
  float c;
  for (int d; d;)
;
  a = c;
  asm("" : : "pIr"(c));
}

Output:

$ xgcc -x c++ -S -Wall -fpermissive -O3 -
: In function 'void b()':
:4:15: warning: 'd' is used uninitialized in this function
[-Wuninitialized]
:6:5: warning: 'c' is used uninitialized in this function
[-Wuninitialized]
during RTL pass: reload
:8:1: internal compiler error: in emit_move_insn, at expr.c:3717
0x1e906d7 emit_move_insn(rtx_def*, rtx_def*)
/home/vegard/git/gcc/gcc/expr.c:3716
0x280edaa lra_emit_move(rtx_def*, rtx_def*)
/home/vegard/git/gcc/gcc/lra.c:497
0x28a3871 process_address_1
/home/vegard/git/gcc/gcc/lra-constraints.c:3368
0x28a7ba3 process_address
/home/vegard/git/gcc/gcc/lra-constraints.c:3521
0x28a7ba3 curr_insn_transform
/home/vegard/git/gcc/gcc/lra-constraints.c:3836
0x28bbf56 lra_constraints(bool)
/home/vegard/git/gcc/gcc/lra-constraints.c:4877
0x282c524 lra(_IO_FILE*)
/home/vegard/git/gcc/gcc/lra.c:2419
0x260b334 do_reload
/home/vegard/git/gcc/gcc/ira.c:5465
0x260b334 execute
/home/vegard/git/gcc/gcc/ira.c:5649

I'm not opening a new bug because the stack trace is quite similar and also it
seems that making very small changes to this test case makes it crash in the
original way, so I figure it's probably related.

[Bug rtl-optimization/84682] internal compiler error: Segmentation fault (process_address_1)

2018-03-02 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84682

David Malcolm  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-02
 CC||dmalcolm at gcc dot gnu.org
  Component|inline-asm  |rtl-optimization
 Ever confirmed|0   |1

--- Comment #1 from David Malcolm  ---
Confirmed.

Segfault reading through NULL in reload here:

process_address_1 (nop=nop@entry=0, check_only_p=check_only_p@entry=false,
before=before@entry=0x7fffcea0, 
after=after@entry=0x7fffcea8) at ../../src/gcc/lra-constraints.c:3424
3424  if (poly_int_rtx_p (*ad.disp, _offset)

(gdb) p ad.disp
$1 = (rtx *) 0x0