Bug 99220 - __builtin_return_address may not work on ia64
Summary: __builtin_return_address may not work on ia64
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc
Version: 1.0
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-07-16 00:39 UTC by hjl
Modified: 2007-04-18 16:55 UTC (History)
0 users

Fixed In Version: 3.2.3-14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-02 18:08:38 UTC
Embargoed:


Attachments (Terms of Use)

Description hjl 2003-07-16 00:39:33 UTC
# cat x.c
#include <stdio.h>
 
int
main()
{
  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 16:27:24 UTC
Another related bug:

[hjl@gnu-2 tmp]$ cat x.c
#include <stdio.h>
  
int
main()
{
  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 14:49:30 UTC
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.