]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[RS6000] ICE in decompose, at rtl.h:2282
authorAlan Modra <amodra@gmail.com>
Thu, 1 Oct 2020 09:44:09 +0000 (19:14 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 8 Oct 2020 01:29:21 +0000 (11:59 +1030)
during RTL pass: fwprop1
gcc.dg/pr82596.c: In function 'test_cststring':
gcc.dg/pr82596.c:27:1: internal compiler error: in decompose, at rtl.h:2282

-m32 gcc/testsuite/gcc.dg/pr82596.c fails along with other tests after
applying rtx_cost patches, which exposed a backend bug.
legitimize_address when presented with the following address
(plus (reg) (const_int 0x7ffffffff))
attempts to rewrite it as a high/low sum.  The low part is 0xffff, or
-1, making the high part 0x80000000.  But this is no longer canonical
for SImode.

* config/rs6000/rs6000.c (rs6000_legitimize_address): Use
gen_int_mode for high part of address constant.

(cherry picked from commit 4c69e61f4307865b95151006e480ae2022b30454)

gcc/config/rs6000/rs6000.c

index 7e5f289d379c07d799b64f19f0c7f98c7c1ab89d..7aff1d2d58998fe8d21d192bfb887b0d7e8f5e07 100644 (file)
@@ -8287,7 +8287,7 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
        low_int = 0;
       high_int = INTVAL (XEXP (x, 1)) - low_int;
       sum = force_operand (gen_rtx_PLUS (Pmode, XEXP (x, 0),
-                                        GEN_INT (high_int)), 0);
+                                        gen_int_mode (high_int, Pmode)), 0);
       return plus_constant (Pmode, sum, low_int);
     }
   else if (GET_CODE (x) == PLUS