This is the mail archive of the 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]

Re: Optimizer bug related to function pointers

This doesn't seem to be related to Bernd's recent patch.  I can reproduce it
using a toolchain without Bernd's patch.

I think this is mostly the IA-64 backend's fault.  We use (symbol_ref func)
to mean two different things, without clearly distinguishing them.  We also
have a single call pattern that accepts either a symbol_ref or a register,
even though these aren't exactly the same operation.  If we fixed either of
those, then we wouldn't see this problem.

If we want NO_FUNCTION_CSE to work as documented though, then it looks like the
right change.

Long term, we probably should get rid of NO_FUNCTION_CSE.  It doesn't make much
sense for the backends to define a macro to tell calls.c/cse.c not to do
something.  If the backend wants a function address forced to a register,
then the call/call_value patterns should have a predicate that forces it to
a register, or else the backend should use an expander that calls force_reg.
Probably few ports would want to do this.  I think most of them set


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