From patchwork Mon Aug 14 03:57:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yujie X-Patchwork-Id: 135118 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2505067vqi; Sun, 13 Aug 2023 20:59:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuMM0A7uadNwUjSUxEyUkb8vnm5xbVgqufwRW8Q7rYkzRHLuyeJVuWCI6Y1H5WNGm37xw1 X-Received: by 2002:aa7:c956:0:b0:523:b1b0:f69f with SMTP id h22-20020aa7c956000000b00523b1b0f69fmr7169008edt.32.1691985595261; Sun, 13 Aug 2023 20:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691985595; cv=none; d=google.com; s=arc-20160816; b=VyTjnUCQJR6N1DAqSFhQkwU7Dssf0Y5LVew5w7AAGZCEMkp+Z5R4Rm7C+1KJVRwc87 wkcwn8/pSBoQFemjpkUAGJ5zahd51wEKwcBSaT09lGHszDZGh/7mxaWGnaJFUqyQil2d 2KloPYFSrwQhvsVu14a99bUiLZuqsYA0Jx/VvtRk08srBEGJOyCXgTUM/YXXodMcc00B 8IsJmIXJrSHo7b9bb/VvnWDznq8386IrG+oSskSGCP5iWgDnIwQTa4nHpWqHAPooHM+h YR7HD7QwRqmYaAYm3j3VTCf7g4HhytR7qyosYgmuFuelcwGT3cWXb8yWi2a3CGRzLJOJ jfdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=hghyzX8lx83jTdOCnS4oqg+MIUaV8/tdZAOI0vgG0ek=; fh=IxMqdJj3G+v5QmZpidO3uwMg7Jqu8kY37TcqbgmfO1o=; b=OhvPLMaDYbqAgUYT7Q6F30jmlFQjVGjf4AdS05Nw6Iu7/a0UAY2XseQEXdhcW19cpU ArEUdDorJqhrGStVSq6u/2nY/D2jJbJ70fdYTFHqncPEhkqBYx6Qiff2lbq+79iDMoUv T8AGOUbSsLnVK6wPwm5/jNu+jYx2b+n6XS4Zg6aCe83sSWNuNqNydulDthhzJV/3GatZ 2HtqbjBbP0ic9FH2zfRP3ch1jwmNc7QxCBpM/PLF3e/2Krvyo06l/ehMp9CpS4pGUWac 7t9acx1YJLLT5NgvuMJogFsy+aNzAotvMfJONwGqDnT2VUya8g/3ZyJGKXRjxzEMWBUR +djg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n9-20020a05640206c900b0052338adde17si7127534edy.383.2023.08.13.20.59.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 20:59:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16776385DC33 for ; Mon, 14 Aug 2023 03:58:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id C0B483858284 for ; Mon, 14 Aug 2023 03:57:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0B483858284 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVOi1-0004wd-Cq for gcc-patches@gcc.gnu.org; Sun, 13 Aug 2023 23:57:40 -0400 Received: from loongson.cn (unknown [192.168.100.1]) by gateway (Coremail) with SMTP id _____8AxDOsoptlk++UXAA--.44002S3; Mon, 14 Aug 2023 11:57:28 +0800 (CST) Received: from localhost.localdomain (unknown [192.168.100.1]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxTs8jptlkPVFZAA--.25099S5; Mon, 14 Aug 2023 11:57:28 +0800 (CST) From: Yang Yujie To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, xuchenghua@loongson.cn, panchenghui@loongson.cn, chenglulu@loongson.cn, Yang Yujie Subject: [PATCH v1 4/6] LoongArch: use -mstrict-align by default when building libraries Date: Mon, 14 Aug 2023 11:57:05 +0800 Message-Id: <20230814035707.11272-4-yangyujie@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814035707.11272-1-yangyujie@loongson.cn> References: <20230814035707.11272-1-yangyujie@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxTs8jptlkPVFZAA--.25099S5 X-CM-SenderInfo: 51dqw5pxmlvqxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBj93XoW7ZrW3GryfZFW5Gw4kurWfWFX_yoW8JF47pa 9Iv34UAFW8CFs5KwsrK34fWa13Z3sxWa17X3yUK34UC3s5X34xX3ZxKF97uFnxWw47ZrWx Zry8Kw4UXa47A3cCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1a6r1DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r126r1DMcIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07UQdbbUUUUU= Received-SPF: pass client-ip=114.242.206.163; envelope-from=yangyujie@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-15.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_FAIL, SPF_HELO_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774175487527262650 X-GMAIL-MSGID: 1774175487527262650 LoongArch processors may not support memory accesses without natural alignments. Building libraries with -mstrict-align may help with toolchain binary compatiblity and performance on these implementations (e.g. Loongson 2K1000LA). With this patch, no significant performance degredation is observed on current mainstream LoongArch processors. gcc/ChangeLog: * gcc/config/t-linux: add -mstrict-align via self_specs when building GCC libraries. --- gcc/config/loongarch/t-linux | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux index 75bb430c555..2a170d600a9 100644 --- a/gcc/config/loongarch/t-linux +++ b/gcc/config/loongarch/t-linux @@ -35,6 +35,9 @@ gen_mlib_spec = $(if $(word 2,$1),\ # clean up the result of DRIVER_SELF_SPEC to avoid conflict lib_build_self_spec = %