https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107229
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andre Simoes Dias Vieira <avie...@gcc.gnu.org>: https://gcc.gnu.org/g:9f0d4adabe2035886a1aa8d2ca990a90de000613 commit r13-3270-g9f0d4adabe2035886a1aa8d2ca990a90de000613 Author: Andre Vieira <andre.simoesdiasvie...@arm.com> Date: Thu Oct 13 12:09:38 2022 +0100 ifcvt: Fix bitpos calculation in bitfield lowering [PR107229] The bitposition calculation for the bitfield lowering in loop if conversion was not taking DECL_FIELD_OFFSET into account, which meant that it would result in wrong bitpositions for bitfields that did not end up having representations starting at the beginning of the struct. gcc/ChangeLog: PR tree-optimization/107229 * tree-if-conv.cc (get_bitfield_rep): Fix bitposition calculation. gcc/testsuite/ChangeLog: * gcc.dg/vect/pr107229-1.c: New test. * gcc.dg/vect/pr107229-2.c: New test. * gcc.dg/vect/pr107229-3.c: New test.