From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 107373858D1E for ; Wed, 21 Dec 2022 12:41:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 107373858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x32f.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so1343273wms.2 for ; Wed, 21 Dec 2022 04:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=IDLqLb3yPUMEZLfjWI52JVYTDKkFZIulTJl1ndjCZqs=; b=SzHwRqvIU5xL7xivqdnE5t4Djg4qADIxwDYDj9/pKABcJQ2fgHwiywUL2QG0A4aQfS N/Ld2D4i57zuKzZSEudTqTbpG07AzX+Kl2ZPZ3YAon7/qvsMe9/cJ1h3RZYQq9LOJfp1 1Gev1TUokIEdS7Rsgk6iAvzTOoQRogfN1N0IXTbrR2SItItyUE3x9iyuQ8h0t80c5+CV eSAIijyvJUeawjmBw3s6wYjHJ0IN5b6BPevxephNQVjjvaJCp7xRpYKXfwt6A2GAxfpm AToTHcK/W6kftCz09/Orxa1dHTHJVsUIgRpkhkbhAyR6YuqFzhCRgFx3NybHbyZ0CfAK v8mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IDLqLb3yPUMEZLfjWI52JVYTDKkFZIulTJl1ndjCZqs=; b=JLJ8r8lFwL/d7nTYd0M79/BRye7cVLPcQX8LUUKBddzAHwThP9DZC61Vel/tq9yg+N igVmR5c/5RThjhV5yCDR+mSXtnF9jKHtwQhlChr+RJAjBXpB95GDH6c633olHrMUl+nC rChgTKJE5hBgkkXe9M2fJvLZmPRbnHcPFAtApWxE0Zim5Fzw0HS55H/i19NVk0hGRg4B 2bDSlix4ZUHv78qZyQ6jlmVvaz0qqB+mnD22RpT2PZ2SuhxF3cqd9tZTVpHVtMd658nK g0wr6Uspar1FOQccdNPFN45Uvka3Q6RWJclHABgCyLUT2kxARiU1sS7F0Hz45Mu4hfoS JerA== X-Gm-Message-State: AFqh2kpWH3oFkUrtDZKp1teNXu0m/zycXwbapvo7P3mu6T6ldpuOi/WX Y35C95A5BU6HpUV/tBeK/ts= X-Google-Smtp-Source: AMrXdXuP5rr5NnqqsO3ZF7bPlDRN9CqRISR0QmXNPhsSmqxmNsxglg0a8mMstms4SUCQxCQdOLzLoA== X-Received: by 2002:a1c:4c12:0:b0:3c6:e63e:89a6 with SMTP id z18-20020a1c4c12000000b003c6e63e89a6mr1584951wmf.2.1671626491783; Wed, 21 Dec 2022 04:41:31 -0800 (PST) Received: from lancelot ([195.147.220.46]) by smtp.gmail.com with ESMTPSA id d2-20020a05600c34c200b003d358beab9dsm2143125wmq.47.2022.12.21.04.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:41:31 -0800 (PST) Received: from gaius by lancelot with local (Exim 4.94.2) (envelope-from ) id 1p7yPY-00Dn8w-9I; Wed, 21 Dec 2022 12:41:28 +0000 From: Gaius Mulley To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Subject: Re: [committed] modula2: Fix lto profiledbootstrap on powerpc64le-linux and s390x-linux [PR108153] References: Date: Wed, 21 Dec 2022 12:41:28 +0000 In-Reply-To: (Jakub Jelinek's message of "Wed, 21 Dec 2022 09:21:05 +0100") Message-ID: <875ye50w07.fsf@debian> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: Jakub Jelinek 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 > > 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