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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-06-14
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We RTL expand from

f (long double x)
{
  unsigned int _3;
  _3 = BIT_FIELD_REF <x_2(D), 32, 0>;
  return _3;

that should be "perfect".  But we already spill:

;; return _3;

(insn 6 5 7 (set (mem/c:XF (plus:SI (reg/f:SI 82 virtual-stack-vars)
                (const_int -16 [0xfffffffffffffff0])) [0  S12 A128])
        (reg/v:XF 88 [ x ])) "t7.c":2 -1
     (nil))

(insn 7 6 8 (set (reg:SI 90)
        (mem/c:SI (plus:SI (reg/f:SI 82 virtual-stack-vars)
                (const_int -16 [0xfffffffffffffff0])) [0  S4 A128])) "t7.c":2
-1
     (nil))

(insn 8 7 9 (set (reg:SI 87 [ <retval> ])
        (reg:SI 90)) "t7.c":2 -1
     (nil))

with -m64 we expand to

;; return _3;

(insn 6 5 7 (set (reg:TI 90)
        (subreg:TI (reg/v:XF 88 [ x ]) 0)) "t7.c":2 -1
     (nil))

(insn 7 6 8 (set (reg:SI 87 [ <retval> ])
        (subreg:SI (reg:TI 90) 0)) "t7.c":2 -1
     (nil))

not sure why we need the intermediate TImode subreg -- this one might not
be possible with 32bits.  Thus this might be a middle-end issue as well.

Reply via email to