https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63411
amker at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amker at gcc dot gnu.org --- Comment #4 from amker at gcc dot gnu.org --- (In reply to Oleg Endo from comment #3) > (In reply to bin.cheng from comment #2) > > > bt/s .L3 > > > mov r1,r2 > > > add #3,r2 <<< wrong struct offset '3' > > But r2 is initialized with [.L14] which is _OAM3+3, so the offset actually > > is 6 here, No? > > Ouch. Yes. Sorry for the fuzz. > On SH this is a performance regression (it can do only displacements that > are scaled by the access size), but not a wrong-code regression. We saw similar problems on arm too. Problem is IVOPT's model doesn't know the detail of target addressing mode. This is should be fixed by improving function get_address_cost, but that's just difficult to expose every target details to middle end, especially we need to keep it simple and fast.