arm: temporarily disable 'local' pcs selection (PR96882)
commit1dca4ca1bf2f1b05537a1052e373d8b0ff11e53c
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 29 Mar 2022 15:59:37 +0000 (29 16:59 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Tue, 29 Mar 2022 15:59:37 +0000 (29 16:59 +0100)
treefd71996db342fdff79b0dbdfa519a2c3df39750c
parenta2eacdbd4c4a698b3b6f27ef5e1f8dd3d836b2e5
arm: temporarily disable 'local' pcs selection (PR96882)

The arm port has an optimization used during selection of the
function's ABI to permit deviation from the strict ABI when the
function does not escape the current translation unit.

Unfortunately, the ABI selection it makes can be unsafe if it changes
how a result is returned because not enough information is available
via the RETURN_IN_MEMORY hook to determine where the function gets
used.  This can result in some parts of the compiler thinking a value
is returned in memory while others think it is returned in registers.

To mitigate this, this patch temporarily disables the optimization and
falls back to using the default ABI for the translation.

gcc/ChangeLog:

PR target/96882
* config/arm/arm.cc (arm_get_pcs_model): Disable selection of
ARM_PCS_AAPCS_LOCAL.
gcc/config/arm/arm.cc