From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1035) id EA1DC3853C05; Mon, 23 Aug 2021 14:40:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA1DC3853C05 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Earnshaw To: gcc-cvs@gcc.gnu.org Subject: [gcc r9-9688] arm: ensure the arch_name is always set for the build target X-Act-Checkin: gcc X-Git-Author: Richard Earnshaw X-Git-Refname: refs/heads/releases/gcc-9 X-Git-Oldrev: 09e0bac0d5b9548131c0dd6f69c235fb228c28e8 X-Git-Newrev: 140a8089000ffa340b2f188be8abec134f1b888f Message-Id: <20210823144052.EA1DC3853C05@sourceware.org> Date: Mon, 23 Aug 2021 14:40:52 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2021 14:40:53 -0000 https://gcc.gnu.org/g:140a8089000ffa340b2f188be8abec134f1b888f commit r9-9688-g140a8089000ffa340b2f188be8abec134f1b888f Author: Richard Earnshaw Date: Mon Jul 26 17:07:14 2021 +0100 arm: ensure the arch_name is always set for the build target This should never happen now if GCC is invoked by the driver, but in the unusual case of calling cc1 (or its ilk) directly from the command line the build target's arch_name string can remain NULL. This can complicate later processing meaning that we need to check for this case explicitly in some circumstances. Nothing should rely on this behaviour, so it's simpler to always set the arch_name when configuring the build target and be done with it. gcc: * config/arm/arm.c (arm_configure_build_target): Ensure the target's arch_name is always set. (cherry picked from commit 62e66c6a6cc52dc0e014141d369cff52757cd7ae) Diff: --- gcc/config/arm/arm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 19b9cc37324..4685fd88327 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3357,6 +3357,8 @@ arm_configure_build_target (struct arm_build_target *target, const cpu_tune *tune_data = &all_tunes[arm_selected_tune - all_cores]; /* Finish initializing the target structure. */ + if (!target->arch_name) + target->arch_name = arm_selected_arch->common.name; target->arch_pp_name = arm_selected_arch->arch; target->base_arch = arm_selected_arch->base_arch; target->profile = arm_selected_arch->profile;