@@ -30824,7 +30824,7 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
case MINUS:
if (CONST_INT_P (value))
{
- value = GEN_INT (-INTVAL (value));
+ value = gen_int_mode (-INTVAL (value), wmode);
code = PLUS;
}
/* FALLTHRU */
new file mode 100644
@@ -0,0 +1,9 @@
+/* PR target/97534 - ICE in decompose on arm*-*-*. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O2 -g" } */
+
+int f (int a)
+{
+ int b;
+ __atomic_fetch_sub(&b, (int)(-__INT_MAX__ - 1), (int)0);
+}