+2015-06-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm.c (arm_option_params_internal): When optimising
+ for speed set max_insns_skipped when arm_restrict_it.
+
2015-06-11 Christian Bruel <christian.bruel@st.com>
PR target/52144
max_insns_skipped = opts->x_arm_restrict_it ? 1 : 4;
}
else
- max_insns_skipped = current_tune->max_insns_skipped;
+ /* When -mrestrict-it is in use tone down the if-conversion. */
+ max_insns_skipped
+ = (TARGET_THUMB2_P (opts->x_target_flags) && opts->x_arm_restrict_it)
+ ? 1 : current_tune->max_insns_skipped;
}
/* Options after initial target override. */
+2015-06-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/arm/short-it-ifcvt-1.c: New test.
+ * gcc.target/arm/short-it-ifcvt-2.c: Likewise.
+
2015-06-11 Christian Bruel <christian.bruel@st.com>
PR target/52144
--- /dev/null
+/* Test that ifcvt is not being too aggressive when -mrestrict-it. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mrestrict-it" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+
+int
+f1(int x, int y, int z)
+{
+ if (x > 100)
+ {
+ x++;
+ z = -z;
+ }
+ else
+ {
+ x = -x;
+ y = -y;
+ z = 1;
+ }
+ return x + y + z;
+}
+
+/* { dg-final { scan-assembler "b(gt|le)" } } */
--- /dev/null
+/* Test that ifcvt is not being too aggressive when -mrestrict-it. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mrestrict-it" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+
+int
+f1(int x, int y, int z)
+{
+ if (x > 100)
+ {
+ x++;
+ z = -z;
+ }
+ else
+ {
+ x = -x;
+ y = -y;
+ }
+ return x + y + z;
+}
+/* { dg-final { scan-assembler "b(gt|le)" } } */