https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:ed03af4ef3b9ad0bd3b7c5c678c02253e5cb9e0f commit r15-2478-ged03af4ef3b9ad0bd3b7c5c678c02253e5cb9e0f Author: Richard Biener <rguent...@suse.de> Date: Sun Jul 21 11:56:07 2024 +0200 tree-optimization/114659 - VN and FP to int punning The following addresses another case where x87 FP loads mangle the bit representation and thus are not suitable for a representative in other types. VN was value-numbering a later integer load of 'x' as the same as a former float load of 'x'. We can use the new TARGET_MODE_CAN_TRANSFER_BITS hook to identify problematic modes and enforce strict compatibility for those in the reference comparison, improving the handling of modes with padding in visit_reference_op_load. PR tree-optimization/114659 * tree-ssa-sccvn.cc (visit_reference_op_load): Do not prevent punning from modes with padding here, but ... (vn_reference_eq): ... ensure this here, also honoring types with modes that cannot act as bit container. * gcc.target/i386/pr114659.c: New testcase.