]> gcc.gnu.org Git - gcc.git/commit
Only compare sizes of automatic variables
authorJan Hubicka <jh@suse.cz>
Fri, 20 Nov 2020 19:33:04 +0000 (20:33 +0100)
committerJan Hubicka <jh@suse.cz>
Fri, 20 Nov 2020 19:33:04 +0000 (20:33 +0100)
commit4c3b16f3c11088f4c3a25ddd59ee5bc38c15f379
tree3289563d012bcaaaa6440a2b2a33a2768a02f6db
parent65854626304d50cf348af53de1c29ccec06d33c6
Only compare sizes of automatic variables

one of common remaining reasons for ICF to fail after loading in fuction
body is mismatched type of automatic vairable.   This is becuase
compatible_types_p resorts to checking TYPE_MAIN_VARIANTS for
euqivalence that prevents merging many TBAA compaitle cases.  (And thus
is also not reflected by the hash extended by alias sets of accesses.)

Since in gimple
automatic variables are just blocks of memory I think we should only
check its size only. All accesses are matched when copmparing the actual
loads/stores.

I am not sure if we need to match types of other DECLs but I decided I can try
to be safe here: for PARM_DECl/RESUILT_DECL we match them anyway to be sure
that functions are ABI compatible.  For CONST_DECL and readonly global
VAR_DECLs they are matched when comparing their constructors.

* ipa-icf-gimple.c (func_checker::compare_decl): Do not compare types
of local variables.
gcc/ipa-icf-gimple.c
This page took 0.056856 seconds and 5 git commands to generate.