[Bug target/61079] New: #pragma fini doesn't apply without definition
ro at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue May 6 13:48:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61079
Bug ID: 61079
Summary: #pragma fini doesn't apply without definition
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: ro at gcc dot gnu.org
Host: *-*-solaris2.*
Target: *-*-solaris2.*
Build: *-*-solaris2.*
Consider the following testcase:
$ cat dtor-pragma-decl.c
#pragma fini(dtor)
void dtor (void);
$ gcc -S dtor-pragma-decl.c
$ cat dtor-pragma-decl.s
.file "dtor-pragma-decl.c"
.ident "GCC: (GNU) 4.9.0"
$ cc -S dtor-pragma-decl.c
$ cat dtor-pragma-decl.s
[...]
.file "dtor-pragma-decl.c"
.section .fini,"ax"
call dtor
nop
I.e. Studio cc calls dtor from a .fini section, while gcc ignores the pragma.
I'm seeing the same behavior with __attribute__((destructor)), which newer
versions of Studio cc understand.
At least for the pragma case, which gcc implements for Studio compatiblity,
this
seems wrong.
Rainer
More information about the Gcc-bugs
mailing list