On Mon, Nov 18, 2019 at 10:04 AM Martin Liška <[email protected]> wrote: > > On 11/15/19 2:59 PM, Richard Biener wrote: > > 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. > > Sure. > > > > > 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. > > Note that all these go through operand_compare::operand_equal_p which > considers types accordingly. I would like to go with this patch and > we can eventually come up with a more strict type comparison for SSA > NAMEs.
Sure, the fix in itself is OK. Richard. > Martin > > > > > 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 > >> > >> >
