https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110496
--- Comment #3 from CVS 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:4f8e31e01bd04ab17a53deb5aa44bd82c885b228 commit r14-2211-g4f8e31e01bd04ab17a53deb5aa44bd82c885b228 Author: Richard Biener <rguent...@suse.de> Date: Fri Jun 30 12:03:26 2023 +0200 tree-optimization/110496 - TYPE_PRECISION issue with store-merging When store-merging looks for bswap opportunities we also handle BIT_FIELD_REFs where we verify the refed object is of scalar type but we don't check for the result type we eventually use. That's done later but after we eventually query TYPE_PRECISION. The following re-orders this. PR tree-optimization/110496 * gimple-ssa-store-merging.cc (find_bswap_or_nop_1): Re-order verifying and TYPE_PRECISION query for the BIT_FIELD_REF case. * gcc.dg/pr110496.c: New testcase.