Commit 44609614 by Martin Liska Committed by Martin Liska

Verify NOP_EXPR LHS type in IPA ICF.

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  Martin Liska  <mliska@suse.cz>

	PR ipa/92529
	* gcc.dg/ipa/pr92529.c: New test.

From-SVN: r278395
parent 20a38017
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
......@@ -620,6 +620,13 @@ func_checker::compare_gimple_assign (gimple *s1, gimple *s2)
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.
......
/* 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" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment