------- Comment #4 from mikulas at artax dot karlin dot mff dot cuni dot cz  
2009-08-09 21:16 -------
Regparm changed between gcc 3.x -> 4.x (I remember it too painfully, I had to
rewrite some assembler files). In 3.x, all arguments were incrementing register
count, even if they were on stack, if you had (float f1, int i2, int i3), f1
was on stack, i2 was in EDX and i3 was in ECX. In 4.x it changed so that f1 is
on stack, i2 is in EAX and i3 is in EDX. Similarly, (double f1, int i2, int i3)
was (stack, ECX, stack) in 3.x and (stack, EAX, EDX) in 4.x.

If we change it so that structures are always in registers, it will be the
least painful thing, because they already are in registers almost always
(except few pathological cases, like struct containing only float or double).
So it won't likely hurt too much, because few programmers rely on regparm(3)
for external ABI, few programmers pass structures directly and few programmers
declare structure with only one member. And the programmer will be hurt only if
he does all these three things.

If you want to change it to be consistent with the documentation (not with
existing implementation) and pass structures always on stack, I wouldn't object
against it. Just don't change it later.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41017

Reply via email to