public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/18655] New: Incorrect data in  .debug_frame  section for PowerPC
@ 2004-11-24 19:42 pett at ca dot ibm dot com
  2004-11-24 19:57 ` [Bug target/18655] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pett at ca dot ibm dot com @ 2004-11-24 19:42 UTC (permalink / raw)
  To: gcc-bugs

The output generated in the .debug_frame section is incorrect, as follows:

1. The return_address_register in the CIE is given as 65.  In the ABI 
supplement for the PowerPC, this is the ID of the Floating Point Status and 
Control Register.  This should probably have been 108, the ID of the Link 
Register.

2. In the body of the FDE, the return address is put into in register 108.  
Since the CIE specifies that the return is in register 65, this value is lost 
when traversing the stack

These two register IDs should be the same. (They were both 65 in the 3.2 
version of the compiler).  The simple test case provided generates one CIE, and 
three FDE entries.  The FDEs for main and sub2 are both inconsistent with the 
CIE.

Results from gcc -v:

Reading specs from /usr/lib/gcc/ppc64-redhat-linux/3.4.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-
checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-
exceptions --enable-languages=c,c++,objc,java,f77 --enable-java-awt=gtk --
host=ppc64-redhat-linux --build=ppc64-redhat-linux --target=ppc64-redhat-linux -
-with-cpu=default32
Thread model: posix
gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)


command line:
g++ -v x.cpp

Original source file (x.cpp):
//#include <stdio.h>
int sub1(int x)
{
  return x + 1;
}
int sub2(int x)
{
  for (int i = 0; i < 10; i++)
    x = sub1(x + i);
  return 0;
}
int main(int argc, char** argv)
{
  return sub2(argc);
}
//------------------------------------------------------------------------------

Preprocessed file x.ii:
# 1 "x.cpp"
# 1 "/home/pett/dev/test//"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "x.cpp"

int sub1(int x)
{
  return x + 1;
}
int sub2(int x)
{
  for (int i = 0; i < 10; i++)
    x = sub1(x + i);
  return 0;
}
int main(int argc, char** argv)
{
  return sub2(argc);
}

-- 
           Summary: Incorrect data in  .debug_frame  section for PowerPC
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pett at ca dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-06-08  2:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-24 19:42 [Bug debug/18655] New: Incorrect data in .debug_frame section for PowerPC pett at ca dot ibm dot com
2004-11-24 19:57 ` [Bug target/18655] " pinskia at gcc dot gnu dot org
2004-11-24 20:09 ` pinskia at gcc dot gnu dot org
2004-11-30 12:39 ` pinskia at gcc dot gnu dot org
2005-05-06 23:52 ` pinskia at gcc dot gnu dot org
2005-05-07  0:31 ` amodra at bigpond dot net dot au
2005-05-07  0:33 ` amodra at bigpond dot net dot au
2005-05-09 20:20 ` cvs-commit at gcc dot gnu dot org
2005-05-09 20:33 ` mmitchel at gcc dot gnu dot org
2005-05-16  4:33 ` cvs-commit at gcc dot gnu dot org
2005-05-16 11:31 ` pinskia at gcc dot gnu dot org
2005-06-08  2:45 ` cvs-commit at gcc dot gnu dot 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).