This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/21080] Excecution test failure for avr for pr17377 test case.
- From: "hutchinsonandy at aim dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Mar 2008 12:55:55 -0000
- Subject: [Bug target/21080] Excecution test failure for avr for pr17377 test case.
- References: <bug-21080-9887@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from hutchinsonandy at aim dot com 2008-03-29 12:55 -------
Created an attachment (id=15396)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15396&action=view)
Patch to correct return_address
The attached patch fixes this problem and PR21078
The AVR target support for builtin_return_address only returned value of
frame_pointer+1 - so it would only be correct if stack and frame were empty.
The attached patch calculates the stack usage in the function prolog. This is
placed in symbol stack_usage using UNSPEC instruction pattern. Builtin Return
address uses RETURN_ADDR_RTX(count, tem) to add this to frame pointer to get to
correct address. This only supports level 0 (same function). Other levels (ie
upper functions) return 0 - which is correct response if not supported.
The address is that read from the stack - ie word address.
Testsuite torture/execute/20010122-1.c and PR17377.c both pass with this patch
applied.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21080