[Bug target/20927] [4.0/4.1 Regression] ICE in smallest_mode_for_size, at stor-layout.c:221 (s390x)

uweigand at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Apr 11 19:41:00 GMT 2005


------- Additional Comments From uweigand at gcc dot gnu dot org  2005-04-11 19:40 -------
Reduced testcase:

struct point { double x, y; };
extern void use (struct point);

void test (struct point *pc, struct point p1)
{
  struct point p0 = *pc;

  if (p0.x == p1.x && p0.y == p1.y)
    use (p0);

  asm ("" : : : "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10");

  p1.y -= p0.y;

  use (p0);
  use (p1);
}

The problem is when reload tries to find an inheritance register for
Reload 0: reload_in (DF) = (subreg:DF (reg/v:TI 48 [ p0 ]) 8)
        FP_REGS, RELOAD_FOR_INPUT (opnum = 1)
        reload_in_reg: (subreg:DF (reg/v:TI 48 [ p0 ]) 8)
        reload_reg_rtx: (reg:DF 24 %f8 [orig:45 p0$y ] [45])

because the code in choose_reload_regs tries to reload the inner REG
in a MODE_FLOAT mode of the same size as TImode, and such a mode does
not exist on s390 (the largest floating point mode is DFmode).

However, this shouldn't cause an ICE here; at worst the search for an
inheritance register should be omitted.  Thus I guess the bug is for
choose_reload_regs to call smallest_mode_for_size in the first place.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20927



More information about the Gcc-bugs mailing list