This is the mail archive of the gcc-bugs@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]

[Bug target/53040] New: nested functions may trash floating point registers


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.


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