public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/44618]  New: Arguments are not passed correctly to out-of-line restore functions. [4.4][4.5][4.6]
@ 2010-06-21 20:14 edmar at freescale dot com
  2010-06-21 20:15 ` [Bug rtl-optimization/44618] " edmar at freescale dot com
                   ` (16 more replies)
  0 siblings, 17 replies; 19+ messages in thread
From: edmar at freescale dot com @ 2010-06-21 20:14 UTC (permalink / raw)
  To: gcc-bugs

On 32 bit powerpc targets, the family of out-of-line restore functions
(_restgpr_<xx>_x), expects r11 (or something else, depending on the
ABI used) to have the new value of the stack pointer.

Gcc emits rtl that sets r11, and a jump_insn that flags the use of r11.

When compiling the test case with "-Os -frename-registers", the register
rename pass (regrename.c) may rename this r11 def-use chain.

test case:
int
calc (int j)
{
  if (j==0) return 0;
  return calc(j-1)*(j+1);
}

compiled with:
-Os -frename-registers -S

results in assembler like this:
.
.
.
.L3:
        addi 4,1,16
        b _restgpr_31_x

This problem exists in the 4.4 branch, the 4.5 branch, and in the main
trunk as well.

In general, the optimization avoids renaming registers involved in
argument passing, but only when a call_insn is involved. The attached
patches extends this behavior to jump_insn as well.

Is my approach to fix the problem adequate ?

In case it is, attached are a patch that can be applied to gcc-4.5 and
the trunk, and a specific one for the 4.4 branch. I have bootstraped
and regression tested each of the following:
(All of them completed with no regressions)
Note: I have no WAA privilege.


4.4 branch rev 160848 on target powerpc-unkown-linux-gnu (--with-cpu=603e, G5
hardware)
4.4 branch rev 160838 on target powerpc64-unkown-linux-gnu (--with-cpu=970, G5
hardware)
4.4 branch rev 160837 on target i686-pc-linux (--with-cpu=generic,
--with-arch=i686, Xeon hardware)
4.4 branch rev 160837 on target x86_64-pc-linux (--with-cpu=generic, Xeon
hardware)

4.5 branch rev 160890 on target powerpc-unkown-linux-gnu (--with-cpu=603e, G5
hardware)
4.5 branch rev 160869 on target powerpc64-unkown-linux-gnu (--with-cpu=970, G5
hardware)
4.5 branch rev 160869 on target i686-pc-linux (--with-cpu=generic,
--with-arch=i686, Xeon hardware)
4.5 branch rev 160857 on target x86_64-pc-linux (--with-cpu=generic, Xeon
hardware)

4.6 (trunk) rev 160955 on target powerpc-unkown-linux-gnu (--with-cpu=603e, G5
hardware)
4.6 (trunk) rev 161009 on target powerpc64-unkown-linux-gnu (--with-cpu=970, G5
hardware)
4.6 (trunk) rev 160906 on target i686-pc-linux (--with-cpu=generic,
--with-arch=i686, Xeon hardware)
4.6 (trunk) rev 160919 on target x86_64-pc-linux (--with-cpu=generic, Xeon
hardware)


-- 
           Summary: Arguments are not passed correctly to out-of-line
                    restore functions. [4.4][4.5][4.6]
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: edmar at freescale dot com
  GCC host triplet: powerpc-unkonw-linux-gnu
GCC target triplet: powerpc-unkonw-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44618


^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <bug-44618-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-04-27 10:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-21 20:14 [Bug rtl-optimization/44618] New: Arguments are not passed correctly to out-of-line restore functions. [4.4][4.5][4.6] edmar at freescale dot com
2010-06-21 20:15 ` [Bug rtl-optimization/44618] " edmar at freescale dot com
2010-06-21 20:15 ` edmar at freescale dot com
2010-06-21 20:17 ` edmar at freescale dot com
2010-06-21 20:18 ` edmar at freescale dot com
2010-06-21 20:25 ` edmar at freescale dot com
2010-06-21 20:34 ` [Bug target/44618] Arguments are not passed correctly to out-of-line restore functions pinskia at gcc dot gnu dot org
2010-06-21 21:18 ` edmar at freescale dot com
2010-06-21 21:30 ` pinskia at gcc dot gnu dot org
2010-06-21 23:36 ` edmar at freescale dot com
2010-06-21 23:54 ` pinskia at gcc dot gnu dot org
2010-06-22 16:53 ` edmar at freescale dot com
2010-06-22 20:51 ` edmar at freescale dot com
2010-06-22 20:56 ` jakub at gcc dot gnu dot org
2010-06-28 15:16 ` edmar at freescale dot com
2010-06-28 15:18 ` edmar at freescale dot com
2010-06-28 15:18 ` edmar at freescale dot com
2010-06-28 15:19 ` edmar at freescale dot com
     [not found] <bug-44618-4@http.gcc.gnu.org/bugzilla/>
2011-04-27 10:21 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).