https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83629
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rsandifo at gcc dot gnu.org,
| |segher at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, the ICE is in the code introduced for PR55049, which doesn't like the
powerpc32 load_toc_v4_PIC_2 and similar patterns.
I think those are invalid RTL, because minus of 2 immediates should be really
wrapped in const and indeed doing:
--- gcc/config/rs6000/rs6000.md.jj 2018-01-03 10:20:15.819537262 +0100
+++ gcc/config/rs6000/rs6000.md 2018-01-03 17:39:47.408873326 +0100
@@ -10647,8 +10647,8 @@
(define_insn "load_toc_v4_PIC_2"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
- (minus:SI (match_operand:SI 2 "immediate_operand" "s")
- (match_operand:SI 3 "immediate_operand" "s")))))]
+ (const:SI (minus:SI (match_operand:SI 2 "immediate_operand" "s")
+ (match_operand:SI 3 "immediate_operand"
"s"))))))]
"TARGET_ELF && DEFAULT_ABI == ABI_V4 && flag_pic == 2"
"lwz %0,%2-%3(%1)"
[(set_attr "type" "load")])
fixes the ICE (but the powerpc backend has several other spots with this).
Or decompose_normal_address needs to be tweaked to handle these, like:
--- gcc/rtlanal.c.jj 2018-01-03 10:19:55.748534052 +0100
+++ gcc/rtlanal.c 2018-01-03 17:48:48.228033733 +0100
@@ -6333,6 +6333,11 @@ decompose_normal_address (struct address
set_address_disp (info, loc, inner);
else if (GET_CODE (*inner) == UNSPEC)
set_address_segment (info, loc, inner);
+ /* This is used in the powerpc backend without CONST wrapping it. */
+ else if (GET_CODE (*inner) == MINUS
+ && CONSTANT_P (XEXP (*inner, 0))
+ && CONSTANT_P (XEXP (*inner, 1)))
+ set_address_disp (info, loc, inner);
else
{
/* The only other possibilities are a base or an index. */
All patches completely untested.