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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |target

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
I wonder what the difference to PA is between the reloaded

+(insn 20 181 182 2 (set (reg:DI 50 %fr22 [95])
+        (mult:DI (zero_extend:DI (reg:SI 52 %fr24))
+            (reg:DI 53 %fr25))) 179 {*pa.md:5338}

and the original

-(insn 20 10 21 2 (set (reg:DI 95)
-        (mult:DI (zero_extend:DI (subreg:SI (reg/f:DI 146) 4))
-            (const_int 4294967295 [0xffffffff]))) 179 {*pa.md:5338}


most definitely a reload as

+(insn 177 176 178 2 (set (reg:SI 52 %fr24)
+        (subreg:SI (reg:DI 51 %fr23) 4)) -1
+     (nil))

which isn't recognized isn't good.  I don't know PA on what it can
and what not but these kind of sets from subregs appear during RTL
expansion for

;; _26 = _27 * 18446744073709551613;

and RTL opts push them into the mult.

To me it looks like a testcase like

int a;
__SIZE_TYPE__ foo ()
{
  return (__SIZE_TYPE__)&a * 18446744073709551613ull;
}

should trigger the same issue.  It creates the same RTL with
-O2 -fno-tree-vrp -fdisable-tree-evrp but the doesn't ICE beause
we reload

(insn 16 10 19 2 (set (reg:DI 77)
        (mult:DI (zero_extend:DI (subreg:SI (reg:DI 81) 4))
            (const_int 4294967293 [0xfffffffd]))) "t.c":6:14 179 {*pa.md:5338}

via memory as

(insn 47 52 48 2 (set (mem/c:DI (plus:DI (reg/f:DI 30 %r30)
                (const_int -56 [0xffffffffffffffc8])) [0  S8 A64])
        (reg:DI 19 %r19)) "t.c":6:14 128 {*pa.md:4178}
     (nil))
(insn 48 47 16 2 (set (reg:DI 51 %fr23)
        (mem/c:DI (plus:DI (reg/f:DI 30 %r30)
                (const_int -56 [0xffffffffffffffc8])) [0  S8 A64])) "t.c":6:14
128 {*pa.md:4178}
     (nil))

(insn 16 48 53 2 (set (reg:DI 52 %fr24)
        (mult:DI (zero_extend:DI (reg:SI 51 %fr23))
            (reg:DI 52 %fr24))) "t.c":6:14 179 {*pa.md:5338}
     (nil))

not sure if we're just lucky here or what.

Anyhow this is IMHO clearly a target issue.

Reply via email to