On Fri, Nov 15, 2019 at 2:40 PM Martin Liška <[email protected]> wrote: > > Hi. > > After I removed ::add_type hashing in r278207, we don't hash > types of SSA names. Moreover, compare_gimple_assign just compares > all operands and ICF does not compare types of SSA names in order > to not be too much conservative. So that, I'm suggesting to compare > LHS type of NOP_EXPRs, which is a possible place for conversion. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed?
Use CONVERT_EXPR_CODE_P (code1) please. Note there are other codes like VIEW_CONVERT_EXPR or BIT_FIELD_REF or MEM_REF which involve conversions so I'm not sure not comparing types of SSA names is a good idea. Richard. > Thanks, > Martin > > gcc/ChangeLog: > > 2019-11-15 Martin Liska <[email protected]> > > PR ipa/92529 > * ipa-icf-gimple.c (func_checker::compare_gimple_assign): > Compare LHS types of NOP_EXPR. > > gcc/testsuite/ChangeLog: > > 2019-11-15 Martin Liska <[email protected]> > > PR ipa/92529 > * gcc.dg/ipa/pr92529.c: New test. > --- > gcc/ipa-icf-gimple.c | 7 +++++++ > gcc/testsuite/gcc.dg/ipa/pr92529.c | 28 ++++++++++++++++++++++++++++ > 2 files changed, 35 insertions(+) > create mode 100644 gcc/testsuite/gcc.dg/ipa/pr92529.c > >
