public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/53040] New: nested functions may trash floating point registers
@ 2012-04-19 11:11 amodra at gmail dot com
  2012-04-19 15:32 ` [Bug target/53040] " amodra at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: amodra at gmail dot com @ 2012-04-19 11:11 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53040
           Summary: nested functions may trash floating point registers
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: amodra@gmail.com


compile with -m32 -Os -fno-inline
void ws_f (void)
{
  char b[10];
  void ns_f (void)
  {
    char a[33];
    __asm __volatile ("#%0 %1" : "=m" (a), "=m" (b) : : "fr28", "fr31");
  }
  ns_f ();
}

results in

ns_f.2345:
        stwu 1,-96(1)
        mflr 0
        stfd 28,64(1)
        stw 0,100(1)
        stfd 31,88(1)
[snip]
        addi 11,1,96
        b _restfpr_28_x

_restfpr_28_x will restore fr29 and fr30 from uninitialised stack.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-02-07  1:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19 11:11 [Bug target/53040] New: nested functions may trash floating point registers amodra at gmail dot com
2012-04-19 15:32 ` [Bug target/53040] " amodra at gmail dot com
2012-04-19 15:40 ` amodra at gmail dot com
2012-04-20  9:34 ` amodra at gcc dot gnu.org
2013-02-06  2:40 ` amodra at gmail dot com
2013-02-06  2:47 ` amodra at gcc dot gnu.org
2013-02-06 11:50 ` ebotcazou at gcc dot gnu.org
2013-02-06 13:32 ` amodra at gmail dot com
2013-02-06 16:46 ` ebotcazou at gcc dot gnu.org
2013-02-06 22:26 ` dje at gcc dot gnu.org
2013-02-07  1:40 ` amodra 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).