Elimination of duplicate sign extensions

Mark Mitchell mark@codesourcery.com
Thu Sep 20 08:32:00 GMT 2007

Mark Shinwell wrote:
>>>>> To be clear, the case where the optimization you're working on is
>>>>> interesting is when the ABI does not require that callers sign-extend
>>>>> arguments to functions -- but we do it anyhow.  Is that correct?

>>> Not quite. This code relies on the fact that the caller has already
>>> performed the argument  promotion due to the prototype definition --
>>> so we were performing the promotion twice, once in the caller and
>>> once in the callee.
> The patch below (same as that attached previously) produces no
> regressions on x86_64-unknown-linux-gnu bootstrap nor on
> mips64el-linux-gnu (using the n32 ABI).

Thank you for the very comprehensive analysis.  I've read through your
argument, and I believe it.  The patch is OK.


Mark Mitchell
(650) 331-3385 x713

More information about the Gcc-patches mailing list