This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: FIx PR target/12329, x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer


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.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]