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]

optimization/2077: __builtin_frame_address(2) emits wrong codes.



>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:


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