[PATCH, i386]: Fix PR target/12329

Uros Bizjak ubizjak@gmail.com
Sat Apr 5 17:37:00 GMT 2008


Hello!

This patch errors out when regparm(3) is used for nested function. 
Nested functions pass static chain pointer in %ecx register, which is 
also used as third regparm register.

It has been suggested, that it is not appropriate to fix this issue by 
silently passing third argument via stack instead of register, since 
regparm(3) nested function can be called from asm, and arguments can't 
be fixed there.

2008-04-05  Uros Bizjak  <ubizjak@gmail.com>

        PR target/12329
        * config/i386/i386.c (ix86_function_regparm): Error if regparm(3)
        attribute is used for nested functions.

testsuite/ChangeLog:

2008-04-05  Uros Bizjak  <ubizjak@gmail.com>

        PR target/12329
        * gcc.target/i386/pr12329.c: New test.

The patch was bootstrapped and regression tested on x86_64-pc-linux-gnu 
{,-m32}. I'll wait until tomorrow if there are any comments on this 
approach before committing the patch to mainline.

Uros.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: p.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080405/c2f7729c/attachment.txt>


More information about the Gcc-patches mailing list