+2019-11-18 Martin Liska <mliska@suse.cz>
+
+ PR ipa/92529
+ * ipa-icf-gimple.c (func_checker::compare_gimple_assign):
+ Compare LHS types of NOP_EXPR.
+
2019-11-18 Matthew Malcomson <matthew.malcomson@arm.com>
* run-rtl-passes.c (run_rtl_passes): Accept and handle empty
arg1 = gimple_op (s1, i);
arg2 = gimple_op (s2, i);
+ /* LHS types of NOP_EXPR must be compatible. */
+ if (CONVERT_EXPR_CODE_P (code1) && i == 0)
+ {
+ if (!compatible_types_p (TREE_TYPE (arg1), TREE_TYPE (arg2)))
+ return return_false_with_msg ("GIMPLE NOP LHS type mismatch");
+ }
+
if (!compare_operand (arg1, arg2))
return return_false_with_msg ("GIMPLE assignment operands "
"are different");
+2019-11-18 Martin Liska <mliska@suse.cz>
+
+ PR ipa/92529
+ * gcc.dg/ipa/pr92529.c: New test.
+
2019-11-18 Matthew Malcomson <matthew.malcomson@arm.com>
* gcc.dg/rtl/aarch64/unspecified-pass-error.c: New test.
--- /dev/null
+/* PR ipa/92529 */
+/* { dg-options "-O2 -fdump-ipa-icf-optimized" } */
+
+int
+foo(volatile int a)
+{
+ return (char)a;
+}
+
+int
+bar(volatile int a)
+{
+ return (short)a;
+}
+
+#pragma GCC optimize ("-O0")
+
+int main(int argc, char **argv)
+{
+ int r = bar(1000);
+ __builtin_printf ("global: %d\n", r);
+ if (r != 1000)
+ __builtin_abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */