This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/27781] New: weak-attribute over-optimisation with 4.1
- From: "jan dot kiszka at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 May 2006 09:38:59 -0000
- Subject: [Bug c/27781] New: weak-attribute over-optimisation with 4.1
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
file-a.c:
---------
void __attribute__((weak)) func(void)
{
/* no code */
}
main()
{
func();
}
file-b.c:
---------
void func(void)
{
printf("func\n");
}
# gcc -c file-a.c file-b.c -O2
# gcc -o program file-a.o file-b.o
The program will not print "func", because the call to func() was optimised out
during the compilation of file-a.c. This happens with -O2, but not when using
-fno-unit-at-a-time. First sighted in 4.1.
--
Summary: weak-attribute over-optimisation with 4.1
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jan dot kiszka at web dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781