This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
optimization/2077: __builtin_frame_address(2) emits wrong codes.
- To: gcc-gnats at gcc dot gnu dot org
- Subject: optimization/2077: __builtin_frame_address(2) emits wrong codes.
- From: nobu dot nokada at softhome dot net
- Date: 23 Feb 2001 22:49:23 -0000
- Reply-To: nobu dot nokada at softhome dot net
>Number: 2077
>Category: optimization
>Synopsis: __builtin_frame_address(2) emits wrong codes.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Feb 23 14:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: nobu.nokada@softhome.net
>Release: gcc version 2.95.3 19991030 (prerelease)/ gcc version 2.95.2
>Organization:
>Environment:
Linux/ix86
cygwin/ix86
HP-UX
MIPS
>Description:
`__builtin_frame_address(2);' with `-fomit-frame-pointer' command line option emits wrong codes.
ex.
|void* foo(void)
|{
| return __builtin_frame_address(2);
|}
This is compiled as followings, and causes SEGV or returns unknown value.
| .file "bug.c"
| .version "01.01"
|gcc2_compiled.:
|.text
| .align 4
|.globl foo
| .type foo,@function
|foo:
| movl -12(%esp),%eax
| movl (%eax),%eax
| ret
|.Lfe1:
| .size foo,.Lfe1-foo
| .ident "GCC: (GNU) 2.95.3 19991030 (prerelease)"
Also, on some RISC architectures, I've heard it fails without `-fomit-frame-pointer'.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: