This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/61079] New: #pragma fini doesn't apply without definition
- From: "ro at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 06 May 2014 13:48:49 +0000
- Subject: [Bug target/61079] New: #pragma fini doesn't apply without definition
- Auto-submitted: auto-generated
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