]> git.ipfire.org Git - thirdparty/gcc.git/commit
Avoid pointer compares on TYPE_MAIN_VARIANT in TBAA
authorJan Hubicka <jh@suse.cz>
Wed, 15 May 2024 12:14:27 +0000 (14:14 +0200)
committerJan Hubicka <jh@suse.cz>
Wed, 15 May 2024 12:14:27 +0000 (14:14 +0200)
commit9b7cad5884f21cc5783075be0043777448db3fab
tree75605b4c2d45a6bda66b7386ce48a56327597c37
parentff105c39bde43bdb57615e3a4c7af71fbef5f26e
Avoid pointer compares on TYPE_MAIN_VARIANT in TBAA

while building more testcases for ipa-icf I noticed that there are two places
in aliasing code where we still compare TYPE_MAIN_VARIANT for pointer equality.
This is not good idea for LTO since type merging may not happen for example
when in one unit pointed to type is forward declared while in other it is fully
defined.  We have same_type_for_tbaa for that.

Bootstrapped/regtested x86_64-linux, OK?

gcc/ChangeLog:

* alias.cc (reference_alias_ptr_type_1): Use view_converted_memref_p.
* alias.h (view_converted_memref_p): Declare.
* tree-ssa-alias.cc (view_converted_memref_p): Export.
(ao_compare::compare_ao_refs): Use same_type_for_tbaa.
gcc/alias.cc
gcc/alias.h
gcc/tree-ssa-alias.cc