[PATCH, i386]: FIx PR target/12329, x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer
Uros Bizjak
ubizjak@gmail.com
Fri Mar 21 13:36:00 GMT 2008
Hello!
Attached patch fixes a couple of cases where %ecx register gets
corrupted wher regparm(3) is in effect. The patch limits the number of
regparms to 2 to preserve %ecx in these corner cases. Please note,
that the detection of clash between regparm(3) and attribute
__force_align_arg_pointer__ (i386.c, line 3124) doesn't work when
__force_align_arg_pointer__ is specified after __regparm__.
2008-03-21 Uros Bizjak <ubizjak@gmail.com>
PR target/12329
* config/i386/i386.c (ix86_function_regparm): Limit the number of
register passing arguments to 2 for nested functions and functions
that realign their stack.
testsuite/ChangeLog:
2008-03-21 Uros Bizjak <ubizjak@gmail.com>
PR target/12329
* gcc.target/i386/pr12329.c: New test.
The patch was bootstrapped and regression tested on i686-pc-linux-gnu.
I will wait some time for possible comments before this patch is
committed to SVN.
Uros.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: p.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080321/f9da359a/attachment.txt>
More information about the Gcc-patches
mailing list