diff options
author | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2021-01-15 10:34:05 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2021-01-15 17:50:16 +0100 |
commit | 15f354788a954635b44b3d2fae1057f67006509e (patch) | |
tree | 926c3a637c47c833126e98140290560d1b3844eb /powerpc | |
parent | 0895388e7ebf9c9f3176d225107e21968919fb97 (diff) | |
download | compcert-kvx-15f354788a954635b44b3d2fae1057f67006509e.tar.gz compcert-kvx-15f354788a954635b44b3d2fae1057f67006509e.zip |
PowerPC: wrong computation of the position of the first vararg argument
In function Asmexpand.next_arg_locations:
If 7 integer parameter passing registers have been used already,
and the next fixed arguments are Tlong then Tint, the Tlong argument
was correctly analyzed as being passed on the stack, but the Tint
argument was incorrectly analyzed as being passed in the 8th register.
Diffstat (limited to 'powerpc')
-rw-r--r-- | powerpc/Asmexpand.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index fcd7c426..df712b9d 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -388,8 +388,9 @@ let rec next_arg_locations ir fr ofs = function then next_arg_locations ir (fr + 1) ofs l else next_arg_locations ir fr (align ofs 8 + 8) l | Tlong :: l -> - if ir < 7 - then next_arg_locations (align ir 2 + 2) fr ofs l + let ir = align ir 2 in + if ir < 8 + then next_arg_locations (ir + 2) fr ofs l else next_arg_locations ir fr (align ofs 8 + 8) l let expand_builtin_va_start r = |