Bug 99220 - __builtin_return_address may not work on ia64
__builtin_return_address may not work on ia64
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2003-07-15 20:39 EDT by hjl
Modified: 2007-04-18 12:55 EDT (History)
0 users

See Also:
Fixed In Version: 3.2.3-14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-02 14:08:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description hjl 2003-07-15 20:39:33 EDT
# cat x.c
#include <stdio.h>
  int addr;
  addr = __builtin_return_address (0);
  printf("%d\n", addr);
  return 0;

# /usr/gcc-3.4/bin/gcc -O x.c
x.c: In function `main':
x.c:8: warning: assignment makes integer from pointer without a cast
/tmp/ccoJdxcc.o(.text+0x11): In function `main':
: undefined reference to `retaddr'
collect2: ld returned 1 exit status
Comment 1 hjl 2003-07-16 12:27:24 EDT
Another related bug:

[hjl@gnu-2 tmp]$ cat x.c
#include <stdio.h>
  int addr [10];
  addr [0] = (int) __builtin_return_address (0);
  printf("%d\n", addr [0]);
  return 0;
[hjl@gnu-2 tmp]$ gcc -c x.c -O
x.c: In function `main':
x.c:8: warning: cast from pointer to integer of different size
/tmp/ccQZPp9G.s: Assembler messages:
/tmp/ccQZPp9G.s:23: Error: Operand 2 of `st4' should be a general register

Comment 2 Jakub Jelinek 2003-08-05 10:49:30 EDT
Richard's http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00283.html
should fix it.
I'll wait till it is applied to the trunk and apply it to our gcc branches too
(maybe without the removal of the no longer used virtual register to keep the
changes smaller).

Note You need to log in before you can comment on or make changes to this bug.