https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78255

--- Comment #10 from wilco at gcc dot gnu.org ---
(In reply to Richard Earnshaw from comment #8)
> Hmm, why is this even being considered on ARM?
> 
> arm.h:#define NO_FUNCTION_CSE 1
> 
> doc/tm.texi
> @defmac NO_FUNCTION_CSE
> Define this macro to be true if it is as good or better to call a constant
> function address than to call an address kept in a register.
> @end defmac

(In reply to Jeffrey A. Law from comment #9)
> Also note that on some targets indirect calls have a different ABI than
> calls to named function.  SO changing between direct and indirect calls is
> strictly forbidden on some targets.
> 
> I suspect there's some magic we need to replicate in postreload-gcse from
> cse/gcse/combine to prevent this from occurring unnecessarily.

Well it's easy to add NO_FUCNTION_CSE to postreload. However a quick experiment
shows combine still changes indirect calls to direct calls, so if the ABI is
not identical this would be incorrect. So there are multiple places where this
would need to be fixed.

Reply via email to