From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30111 invoked by alias); 24 Nov 2004 19:42:36 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 29355 invoked by uid 48); 24 Nov 2004 19:42:22 -0000 Date: Wed, 24 Nov 2004 19:42:00 -0000 From: "pett at ca dot ibm dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20041124194211.18655.pett@ca.ibm.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug debug/18655] New: Incorrect data in .debug_frame section for PowerPC X-Bugzilla-Reason: CC X-SW-Source: 2004-11/txt/msg02927.txt.bz2 List-Id: 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 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 "" # 1 "" # 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