]> git.ipfire.org Git - thirdparty/gcc.git/commit
arm: Don't reconfigure globals in arm_configure_build_target
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 27 Jul 2021 14:44:57 +0000 (15:44 +0100)
committerRichard Earnshaw <Richard.Earnshaw@arm.com>
Wed, 18 Aug 2021 15:22:38 +0000 (16:22 +0100)
commit302eb5361d703e279043560a3d4ffefe6b610ad6
tree49dac2a60510c21dc5fa5008bf95420940486da3
parent95c56f26a9e43cfe38d23f3e52e83c500ac1e652
arm: Don't reconfigure globals in arm_configure_build_target

arm_configure_build_target is usually used to reconfigure the
arm_active_target structure, which is then used to reconfigure a
number of other global variables describing the current target.
Occasionally, however, we need to use arm_configure_build_target to
construct a temporary target structure and in that case it is wrong to
try to reconfigure the global variables (although probably harmless,
since arm_option_reconfigure_globals() only looks at
arm_active_target).  At the very least, however, this is wasted work,
so it is best not to do it unless needed.  What's more, several
callers of arm_configure_build target call
arm_option_reconfigure_globals themselves within a few lines, making
the call from within arm_configure_build_target completely redundant.

So this patch moves the responsibility of calling of
arm_configure_build_target to its callers (only two places needed
updating).

gcc:
* config/arm/arm.c (arm_configure_build_target): Don't call
arm_option_reconfigure_globals.
(arm_option_restore): Call arm_option_reconfigure_globals after
reconfiguring the target.
* config/arm/arm-c.c (arm_pragma_target_parse): Likewise.
(cherry picked from commit 6a37d0331c25f23628d4308e5a75624005c223b2)
gcc/config/arm/arm-c.c
gcc/config/arm/arm.c