[committed] modula2: Fix lto profiledbootstrap on powerpc64le-linux and s390x-linux [PR108153]
Message ID | Y6LB8TGAbA1fAFe4@tucnak |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3402913wrn; Wed, 21 Dec 2022 00:22:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXufpa5rr7+OvfQAtpWQjWc2S2NfTuThHtX3SQ7B0OGb6UXAZEQoVnORpSuh1sgPBgE2CsBL X-Received: by 2002:a17:906:910:b0:7ad:aed7:a5da with SMTP id i16-20020a170906091000b007adaed7a5damr744875ejd.28.1671610930810; Wed, 21 Dec 2022 00:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671610930; cv=none; d=google.com; s=arc-20160816; b=A+j3oexfE2AseAV6b+cqCZIip51NmJIqKtLEwgIBum2cpgjDXhmuW4sLBg7bcjQpR0 PrTWAdKv1rybTjQvoDTnc9xtq99UGy2GK+lak3HSmCwpyARpPNkTUCdEANIOe197ws8p F9T9R88wx5c8rDWES23kvDNKTnhxbS5nmGC/HYIvPOHGvJam8nfnlQ6bvYhe11oJFj7N p4nphGZi4qCxIcfLFA46Z9tg5sNYVln6Tu0nEOmL30TA9Q40MntChR95cDEBqD/mmswo rpGXeLLHZtFMpz3LsL+icK7QNwkQoOAHncg5G0HX18WilvRSKrEtkOmOoVz1bdRuiIjp aO6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=N6lmPXopKMZbuxEB8Rsvr4RIOOI3V2YRMR16mLKD5BQ=; b=acEjm2Y+GOCUBRRGUVc1p3onNkwWlX+v78Zk1oEaap5+nkUA9Vw0Ju/HhwxNxsXkuI D831OzT3u8gsYZCq/IiGJPnfsEo/BUXuvIyFNIoncHD6i2Cz3BlAU+0Np1P2RmFUbDrO t9bCMNHOrQy/ercXGyYgzycpojA3i2ANfH6X0wkY9VmPnEle4hmYCcX/TJjid6ry3xvF tPOTnXOxPducsIR6jRHSWp6slmjLTujWeyuxQyxYVjMpWl0ewuWXtM0IsH+MOVDCwweA 6NNDWoAiQQYDCKWZilCcU9qr0Li2FeDM4D9Maton5wLHmUYsYSuEimrL5ahmD7oQMWK1 PBvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dZljVQss; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id sc9-20020a1709078a0900b007c170f6b308si15975466ejc.515.2022.12.21.00.22.10 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 00:22:10 -0800 (PST) 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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dZljVQss; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4B733858281 for <ouuuleilei@gmail.com>; Wed, 21 Dec 2022 08:22:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4B733858281 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671610929; bh=N6lmPXopKMZbuxEB8Rsvr4RIOOI3V2YRMR16mLKD5BQ=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=dZljVQssWW7hFOvGsivWg2ipPj+9sw9Tnr9ThDW4oiI9LluAF/CGai2D7ET/g5MOB t5jJgQc2w6jJerwHhEMjZgAJzWzk0hfBgeYwkePRsJppZUOYv8tLZO+W1OzT/7M5jv 1AHghmVcvkWX1Lkfz0+VJ4aha0zStzReFaVKaAjk= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 0EED43858D1E for <gcc-patches@gcc.gnu.org>; Wed, 21 Dec 2022 08:21:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0EED43858D1E 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-488-G_O8YK_OOOSUs3K_fmnH5Q-1; Wed, 21 Dec 2022 03:21:09 -0500 X-MC-Unique: G_O8YK_OOOSUs3K_fmnH5Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 04047101A55E; Wed, 21 Dec 2022 08:21:09 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7FF71731B; Wed, 21 Dec 2022 08:21:08 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2BL8L55L3214021 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 09:21:06 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2BL8L5kv3214020; Wed, 21 Dec 2022 09:21:05 +0100 Date: Wed, 21 Dec 2022 09:21:05 +0100 To: Gaius Mulley <gaiusmod2@gmail.com> Cc: gcc-patches@gcc.gnu.org Subject: [committed] modula2: Fix lto profiledbootstrap on powerpc64le-linux and s390x-linux [PR108153] Message-ID: <Y6LB8TGAbA1fAFe4@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, WEIRD_PORT 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jakub Jelinek <jakub@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752811103600490728?= X-GMAIL-MSGID: =?utf-8?q?1752811103600490728?= |
Series |
[committed] modula2: Fix lto profiledbootstrap on powerpc64le-linux and s390x-linux [PR108153]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jakub Jelinek
Dec. 21, 2022, 8:21 a.m. UTC
Hi! Lto profiledbootstrap was failing for me on {powerpc64le,s390x}-linux with modula 2 enabled, with: cc1gm2: internal compiler error: the location value is corrupt 0x11a3d2d m2assert_AssertLocation(unsigned int) ../../gcc/m2/gm2-gcc/m2assert.cc:40 0x11a3d2d m2statement_BuildAssignmentTree ../../gcc/m2/gm2-gcc/m2statement.cc:177 ICE. The problem was that caller (m2assert_AssertLocation used location_t M2Options_OverrideLocation (location_t); prototype with the libcpp/line-map.h typedef unsigned int location_t; typedef, but the callee defined in Modula 2 was using: TYPE location_t = INTEGER ; and PROCEDURE OverrideLocation (location: location_t) : location_t ; Now, on powerpc64le-linux unsigned int is returned and passed zero extended into 64-bits, while signed int is returned and passed sign-extended into 64-bits and Modula 2 INTEGER is signed 32-bit type, so when the caller then compared M2Options_OverrideLocation (location) != location and powerpc64le-linux performed the comparison as 64-bit compare, there was a mismatch for location_t of 0x8000007 or others with the MSB set. Fixed by making Modula 2 location_t a CARDINAL, which is 32-bit unsigned type. Bootstrapped/regtested normally on x86_64-linux and i686-linux, with bootstrap-lto profiledbootstrap on powerpc64le-linux and aarch64-linux so far (and in regtesting on x86_64-linux, i686-linux and s390x-linux), approved in the PR by Gaius, committed to trunk. 2022-12-21 Jakub Jelinek <jakub@redhat.com> PR modula2/108153 * gm2-gcc/m2linemap.def (location_t): Use CARDINAL instead of INTEGER. Jakub
Comments
Jakub Jelinek <jakub@redhat.com> writes: > Hi! > > Lto profiledbootstrap was failing for me on {powerpc64le,s390x}-linux with > modula 2 enabled, with: > cc1gm2: internal compiler error: the location value is corrupt > 0x11a3d2d m2assert_AssertLocation(unsigned int) > ../../gcc/m2/gm2-gcc/m2assert.cc:40 > 0x11a3d2d m2statement_BuildAssignmentTree > ../../gcc/m2/gm2-gcc/m2statement.cc:177 > ICE. The problem was that caller (m2assert_AssertLocation used > location_t M2Options_OverrideLocation (location_t); > prototype with the libcpp/line-map.h > typedef unsigned int location_t; > typedef, but the callee defined in Modula 2 was using: > TYPE > location_t = INTEGER ; > and > PROCEDURE OverrideLocation (location: location_t) : location_t ; > Now, on powerpc64le-linux unsigned int is returned and passed zero extended > into 64-bits, while signed int is returned and passed sign-extended into 64-bits > and Modula 2 INTEGER is signed 32-bit type, so when the caller then compared > M2Options_OverrideLocation (location) != location > and powerpc64le-linux performed the comparison as 64-bit compare, there > was a mismatch for location_t of 0x8000007 or others with the MSB set. > > Fixed by making Modula 2 location_t a CARDINAL, which is 32-bit unsigned type. > > Bootstrapped/regtested normally on x86_64-linux and i686-linux, with > bootstrap-lto profiledbootstrap on powerpc64le-linux and aarch64-linux so > far (and in regtesting on x86_64-linux, i686-linux and s390x-linux), > approved in the PR by Gaius, committed to trunk. > > 2022-12-21 Jakub Jelinek <jakub@redhat.com> > > PR modula2/108153 > * gm2-gcc/m2linemap.def (location_t): Use CARDINAL instead of INTEGER. > > --- gcc/m2/gm2-gcc/m2linemap.def.jj 2022-12-19 14:59:50.169762747 +0100 > +++ gcc/m2/gm2-gcc/m2linemap.def 2022-12-20 16:36:18.321555969 +0100 > @@ -30,7 +30,7 @@ EXPORT QUALIFIED StartFile, EndFile, Sta > WarningAtf, NoteAtf, internal_error, location_t ; > > TYPE > - location_t = INTEGER ; > + location_t = CARDINAL ; > > > PROCEDURE StartFile (filename: ADDRESS; linebegin: CARDINAL) ; > > Jakub Hi Jakub, thanks for finding the bug and the fix! regards, Gaius
--- gcc/m2/gm2-gcc/m2linemap.def.jj 2022-12-19 14:59:50.169762747 +0100 +++ gcc/m2/gm2-gcc/m2linemap.def 2022-12-20 16:36:18.321555969 +0100 @@ -30,7 +30,7 @@ EXPORT QUALIFIED StartFile, EndFile, Sta WarningAtf, NoteAtf, internal_error, location_t ; TYPE - location_t = INTEGER ; + location_t = CARDINAL ; PROCEDURE StartFile (filename: ADDRESS; linebegin: CARDINAL) ;