https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126260
Bug ID: 126260
Summary: Failure to CSE BIT_FIELD_REF of different sign
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
I see in .optimized for some testcase:
unsigned int _163;
unsigned int _164;
int _166;
...
vect_patt_204.14_167 = (vector(2) int) vect_patt_203.13_168;
_166 = BIT_FIELD_REF <vect_patt_204.14_167, 32, 0>;
...
_164 = BIT_FIELD_REF <vect_patt_204.14_167, 32, 0>;
_163 = BIT_FIELD_REF <vect_patt_204.14_167, 32, 32>;
_162 = _163 + _164;
_164 could be just _164 = (unsigned int) _166, possibly not profitable
in this case (_167 is live anyway).
Could be handled in some way in VN or by a match pattern with (convert!
(bit_field_ref:[us]type ...)) result.