x86_64: Fix indirection in struct paramaters
commit86ac6b9beec1c142867b53350006c02e20e4a7ef
authorMichael Matz <matz@suse.de>
Sun, 15 Apr 2012 03:12:43 +0000 (15 05:12 +0200)
committerMichael Matz <matz@suse.de>
Wed, 18 Apr 2012 18:57:13 +0000 (18 20:57 +0200)
treea41108adeb4cd36908b584e667b80d22cfc838fa
parent5c0a2366a3bb5bdeb3b3617389d4584375d5bfbc
x86_64: Fix indirection in struct paramaters

The first loop setting up struct arguments must not remove
elements from the vstack (via vtop--), as gen_reg needs them to
potentially evict some argument still held in registers to stack.

Swapping the arg in question to top (and back to its place) also
simplifies the vstore call itself, as not funny save/restore
or some "non-existing" stack elements need to be done.

Generally for a stack a vop-- operation conceptually clobbers
that element, so further references to it aren't allowed anymore.
tests/tcctest.c
x86_64-gen.c