On Tue, Jan 12, 2016 at 11:56:43AM +0000, Jiong Wang wrote: > gcc combine should have combined: > > add x0, x0, :lo12:.LANCHOR0 > ldr x0, [x0,8] > > into: > > ldr x0, [x0,#:lo12:.LANCHOR0+8] > > It's not happen because combine pass invoked "init_recog_no_volatile" to > prevent volatile memory to be combined. I guess combine is too > conservative on this, purely combine contant offsets inside volatile > memory should be safe. (CCed Segher). [ For some reason I didn't see this mail before, sorry about that. ] This is a well-known issue, see PR60749, PR50677, PR49807, likely more. Simply allowing volatile refs is not conservative enough. Backends can use a workaround like the msp430 port does, for those cases where it knows it will work. Segher