This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/15700] [4.0 Regression] [unit-at-a-time] Inlining problem leads to miscompilation of glibc
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Nov 2004 21:31:53 -0000
- Subject: [Bug middle-end/15700] [4.0 Regression] [unit-at-a-time] Inlining problem leads to miscompilation of glibc
- References: <20040528071502.15700.aj@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From hjl at lucon dot org 2004-11-24 21:31 -------
I am not sure why it shouldn't work. Given
static void
foo_internal ()
{
}
extern void (*foo) ();
void
xxx ()
{
foo = &foo_internal;
}
void
bar ()
{
foo_internal ();
}
Gcc 4.0 has no problems inlining foo_internal and emitting its body at the
same time. The only difference here is the address of foo_internal vs. an
external alias of foo_internal. In fact, gcc 4.0 does the right thing for
static void
foo_internal ()
{
}
extern void (*foo) ();
void
xxx ()
{
foo = &foo_internal;
}
extern __typeof (foo_internal) work __attribute__ ((alias ("foo_internal")));
void
bar ()
{
foo_internal ();
}
Gcc 4.0 has to do inlining and emitting body of a static functon anyway. How
to make it to work with external alias?
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15700