CVSROOT: /cvs Module name: src Changes by: m...@cvs.openbsd.org 2025/08/25 15:29:24
Modified files: gnu/gcc/gcc/config/m88k: m88k.c m88k.h Log message: The switch to FRAME_GROWS_DOWNWARD requires that the spill area for registers, when expanding the prologue of a variadic function, can no longer use room on top of the logical frame pointer, after the local variables, by returning a non-zero pretend_args_size of the room needed. Doing this confuses the rest of the compiler code and bad addresses get computed, especially on platforms where variadic arguments, depending on their type, can be passed in registers, then on the stack, then in more registers, then on the stack, then in registers again, and m88k is probably the most versatile example of this. Move the register save area immediately below the hard frame pointer, and do not set pretend_args_size. This fixes the worst cases of variadic function torture, while still letting __builtin_apply_args() compute the right address. After these changes, the (logical) frame pointer and the argument pointer are now identical, so it is possible to partly undo the addition of the logical frame pointer by sharing the same logical register between the fp and the ap.