https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121488
Bug ID: 121488 Summary: A missing BIT_FIELD_REF mem optimization due to type differences Product: gcc Version: 16.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Created attachment 62091 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62091&action=edit Reduced testcase This shows up in the testcase of PR 92645: ``` vector(2) long long int _18; vector(2) long long int _22; vector(32) unsigned char _23; vector(4) float _34; vector(4) float _35; D.215655 ={v} {CLOBBER(bob)}; D.215655.fLo.fVec = _18; D.215655.fHi.fVec = _22; _23 = MEM <vector(32) unsigned char> [(char * {ref-all})&D.215655]; D.215655 ={v} {CLOBBER(eos)}; ... _34 = BIT_FIELD_REF <_23, 128, 0>; _35 = BIT_FIELD_REF <_23, 128, 128>; ``` Attached is the reduced testcase. In the reduced testcase if I change all of the vector types to int, FRE1 is able to optimize this.