Hi Bernd, I agree you with the mode problem. And I have not change the stack alignment.What I change is the virtual register base's alignment. Realignment must be make in !STRICT_ALIGNMENT machine,or emitting the efficient code is impossible. For example 4 set mem:QI X,REG:QI Y will not combine into one set mem:SI X1,REG:SI Y1,if X is not mentioned as SI mode aligned. To make sure X is SI mode algined,virtual register base must be realigned.
For this patch,I only intent to make it right.Making it best is next task. -- Regards lin zuojian. 于 2014年02月28日 15:47, Bernd Edlinger 写道: > Hi, > > I see the problem too. > > But I think it is not necessary to change the stack alignment > to solve the problem. > > It appears to me that the code in asan_emit_stack_protection > is just wrong. It uses SImode when the memory is not aligned > enough for that mode. This would not happen if that code > is rewritten to use get_best_mode, and by the way, even on > x86_64 the emitted code is not optimal, because that target > could work with DImode more efficiently. > > So, to fix that, it would be better to concentrate on that function, > and use word_mode instead of SImode, and let get_best_mode > choose the required mode. > > > Regards > Bernd Edlinger.