From patchwork Thu Mar 31 08:30:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1612107 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=CPl3H6MZ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KVDgx1WnJz9s5V for ; Fri, 1 Apr 2022 20:02:04 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B0AA5389EC60 for ; Fri, 1 Apr 2022 09:02:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0AA5389EC60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1648803720; bh=VfUkVlUly9v3sgryzkShcbN84C9CghQwt6pkHPMD7c0=; h=Resent-From:Resent-Date:Resent-To:Date:To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:Cc:From; b=CPl3H6MZhyucjm+JbaEscsGf4znFznvfUdyh+DDwkZkcwac66Rpw1Ro1gtFUKy7Jj ZGlzaNU6a+ihoZvsGnahAsrxjZBQor/GKyHiSgc7bGmYSgNoXLHYqHPu1qBy3JXG0+ DcOUqRWKu4mKzRKYhHQwCNy44PLImMRErjRUl4/s= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C482E3857811 for ; Fri, 1 Apr 2022 09:01:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C482E3857811 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-245-UD9B4mIFPLyv32bpstF8GA-1; Fri, 01 Apr 2022 05:01:37 -0400 X-MC-Unique: UD9B4mIFPLyv32bpstF8GA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C1B61100BAA4; Fri, 1 Apr 2022 09:01:36 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77A5D5E1950; Fri, 1 Apr 2022 09:01:36 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 23191Xdk002705 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 1 Apr 2022 11:01:33 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 23191WQw002704; Fri, 1 Apr 2022 11:01:32 +0200 Resent-From: Jakub Jelinek Resent-Date: Fri, 1 Apr 2022 11:01:32 +0200 Resent-Message-ID: Resent-To: Alexandre Oliva , Oleg Endo , Jeff Law , gcc-patches@gcc.gnu.org, Martin =?utf-8?b?TGnFoWth?= Date: Thu, 31 Mar 2022 10:30:54 +0200 To: Alexandre Oliva , Oleg Endo , Jeff Law Subject: [PATCH] sh: Fix up __attribute__((optimize ("Os"))) handling on SH [PR105069] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! As mentioned in the PR, various tests on sh-elf ICE like: make check-gcc RUNTESTFLAGS="compile.exp='pr104327.c pr58332.c pr81360.c pr84425.c'" FAIL: gcc.c-torture/compile/pr104327.c -O0 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr104327.c -O0 (test for excess errors) FAIL: gcc.c-torture/compile/pr104327.c -O1 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr104327.c -O1 (test for excess errors) FAIL: gcc.c-torture/compile/pr104327.c -O2 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr104327.c -O2 (test for excess errors) FAIL: gcc.c-torture/compile/pr104327.c -O3 -g (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr104327.c -O3 -g (test for excess errors) FAIL: gcc.c-torture/compile/pr104327.c -Os (test for excess errors) FAIL: gcc.c-torture/compile/pr58332.c -O0 (test for excess errors) FAIL: gcc.c-torture/compile/pr58332.c -O1 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr58332.c -O1 (test for excess errors) FAIL: gcc.c-torture/compile/pr58332.c -O2 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr58332.c -O2 (test for excess errors) FAIL: gcc.c-torture/compile/pr58332.c -O3 -g (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr58332.c -O3 -g (test for excess errors) FAIL: gcc.c-torture/compile/pr58332.c -Os (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr58332.c -Os (test for excess errors) FAIL: gcc.c-torture/compile/pr81360.c -O0 (test for excess errors) FAIL: gcc.c-torture/compile/pr81360.c -O1 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr81360.c -O1 (test for excess errors) FAIL: gcc.c-torture/compile/pr81360.c -O2 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr81360.c -O2 (test for excess errors) FAIL: gcc.c-torture/compile/pr81360.c -O3 -g (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr81360.c -O3 -g (test for excess errors) FAIL: gcc.c-torture/compile/pr81360.c -Os (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr81360.c -Os (test for excess errors) FAIL: gcc.c-torture/compile/pr84425.c -O0 (test for excess errors) FAIL: gcc.c-torture/compile/pr84425.c -O1 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr84425.c -O1 (test for excess errors) FAIL: gcc.c-torture/compile/pr84425.c -O2 (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr84425.c -O2 (test for excess errors) FAIL: gcc.c-torture/compile/pr84425.c -O3 -g (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr84425.c -O3 -g (test for excess errors) FAIL: gcc.c-torture/compile/pr84425.c -Os (internal compiler error: 'global_options' are modified in local context) FAIL: gcc.c-torture/compile/pr84425.c -Os (test for excess errors) With the following patch, none of those tests ICE anymore, though pr104327.c still FAILs with: Excess errors: /usr/src/gcc/gcc/testsuite/gcc.c-torture/compile/pr104327.c:6:1: error: inlining failed in call to 'always_inline' 'bar': target specific option mismatch I think that would be fixable by overriding TARGET_CAN_INLINE_P hook and allowing at least for always_inline changes in sh_div_str. Is the following patch ok for trunk as at least a small step forward? 2022-03-31 Jakub Jelinek PR target/105069 * config/sh/sh.opt (mdiv=): Add Save. Jakub --- gcc/config/sh/sh.opt.jj 2022-01-11 23:11:21.990295775 +0100 +++ gcc/config/sh/sh.opt 2022-03-31 09:43:45.916244944 +0200 @@ -207,7 +207,7 @@ Target RejectNegative Mask(ALIGN_DOUBLE) Align doubles at 64-bit boundaries. mdiv= -Target RejectNegative Joined Var(sh_div_str) Init("") +Target Save RejectNegative Joined Var(sh_div_str) Init("") Division strategy, one of: call-div1, call-fp, call-table. mdivsi3_libfunc=