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]

AIX: segfault in GCC compiled program using __builtin_return_address() and dynamic variables


(If this goes to a mailing list, I'm not subscribed, so please CC
any replies to me.)

Dear GCC developers.

On an AIX system, a program compiled with GCC (both with 2.95.2 and
2.8.1) segfaults when it calls __builtin_return_address(0) after
using some dynamic variables. (With slightly different code, it will
only give a wrong result for __builtin_return_address(0).)

Besides hoping for a bug fix obviously, I'd be interested to know
whether the bug is in __builtin_return_address(), so I only have to
avoid using it, or if the dynamic variables trash the stack or
something and the failure in __builtin_return_address() is only a
symptom, and I can expect any kind of other problems.

Detailed description (sample code attached):

System: powerpc-ibm-aix4.3.2.0
GCC Version: 2.95.2 19991024 (release) or 2.8.1

Command line: gcc a.i
Compiler Output: none
Program output:
268435932
Segmentation fault

Command line: gcc b.i
Compiler Output: none
Program output:
268435932
0

Frank

-- 
Frank Heckenbach, frank@g-n-u.de
http://fjf.gnu.de/
PGP and GPG keys: http://fjf.gnu.de/plan

a.i

b.i


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