[PATCH, i386]: Fix PR target/34312; spill failure with -O2 -fPIC -march=pentium-m on i386

Uros Bizjak ubizjak@gmail.com
Wed Dec 5 16:01:00 GMT 2007


Hello!

The problem exposed by the testcase in PR target/34312 is, that due to 
implicit regparm function call register usage (%eax, %edx, %ecx) and 
-fpic usage of (%ebx), register allocator runs out of registers to 
allocate another QImode value.

There already exists the functionality, where implicit regparm value is 
lowered due to increased register pressure caused by global_regs usage. 
However, register pressure is also increased by fixed_regs in similar 
way (they are not available to register allocator), so it is somehow 
logical, that fixed_regs registers should be handled here in the same 
way as global regs.

Patch was bootstrapped on x86_64-pc-linux-gnu and regression tested on 
x86_64 with and without -m32. Patch is committed to SVN.

2007-12-05  Uros Bizjak  <ubizjak@gmail.com>

        PR target/34312
        * config/i386/i386.c (ix86_function_regparm): Also check for fixed
        registers when checking that regparm registers are available.
        Lower regparm value due to fixed registers usage in addition to
        global regs usage.

testsuite/ChangeLog:

2007-12-05  Uros Bizjak  <ubizjak@gmail.com>

        PR target/34312
        * gcc.target/i386/pr34312.c: New test.

Uros.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr34312.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071205/191c999e/attachment.txt>


More information about the Gcc-patches mailing list