https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86968
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.org --- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > Therefore unaligned access are handled by extract_bit_field. This in turns > call extract_bit_field_1 and later extract_integral_bit_field where things > are different between little endian and big endian. For little endian, it > goes in the following if block: > > /* If OP0 is a memory, try copying it to a register and seeing if a > cheap register alternative is available. */ > if (MEM_P (op0) & !reverse) > > For big endian it continues and calls extract_fixed_bit_field. I'm wondering > if an extra call to flip_storage_order when reverse is true would solve the > issue. Need to understand better whe is it safe to call flip_storage_order. Where do you want to add a call to flip_storage_order exactly? The correct thing to do would be to move the !reverse test from the top-level if to the first inner if (in order to bypass only the extv business) and see what happens next (and be prepared for adjusting adjust_bit_field_mem_for_reg to reverse SSO).