===================================================================
@@ -8525,6 +8525,14 @@
operands[2] = shallow_copy_rtx (operands[2]);
PUT_MODE (operands[2], SImode);
}
+ else if (GET_CODE (operands[2]) == CONST)
+ {
+ /* (const:DI (plus:DI (symbol_ref:DI ("...")) (const_int N))) */
+ operands[2] = copy_rtx (operands[2]);
+ PUT_MODE (operands[2], SImode);
+ PUT_MODE (XEXP (operands[2], 0), SImode);
+ PUT_MODE (XEXP (XEXP (operands[2], 0), 0), SImode);
+ }
else
operands[2] = gen_lowpart (SImode, operands[2]);
})
===================================================================
@@ -0,0 +1,21 @@
+/* PR target/90547 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo ()
+{
+ void *g[] = {&&a, &&b};
+
+ for (unsigned c = 0x1F;; c >>= 1)
+ {
+ unsigned d = (long)("a"+1);
+ long e = 8;
+
+ while (e)
+ {
+ a: goto *g[c&d];
+ b: e--;
+ }
+ }
+}