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]
Other format: [Raw text]

[Bug middle-end/15700] [4.0 Regression] [unit-at-a-time] Inlining problem leads to miscompilation of glibc


------- 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


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