From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout01.t-online.de (mailout01.t-online.de [194.25.134.80]) by sourceware.org (Postfix) with ESMTPS id 287D4384AB62 for ; Thu, 11 Apr 2024 00:32:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 287D4384AB62 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=t-online.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 287D4384AB62 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=194.25.134.80 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712795560; cv=none; b=BfrrZBZHi33dyn7nc1bqxZrAyRmzAKW1I1NkjqeDHcH5E4KzO0wadjdG7HM1z2votOzTEtNaNJV7dvuMBVe8x5VcU729IBxr0wIzD4ryCWzVc+KBsc7GJLL+XtubJSdZ8VSwMYIuksqttmfyxxFzpLix5cBv/qkWkT1C7Jeohj0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712795560; c=relaxed/simple; bh=NMpLd/N3RYkcTuJDWPA5p1mtbpThYEvPGunOfkocGOk=; h=Message-ID:Subject:From:To:Date:MIME-Version; b=XyK9NVfNLProlxDNk0HzpK5jUs2InAbSmu47DWo4Pqol2uPpLW9viCFTPNxpT2Gexa1o8duz3+McIZEsCjKC5giwbTacPosKsJ11f7WSii2ewba71YyapvQwBlH/5oNDQOT6XD6LqK35bxziV4ASp6jegoCOG0JtsmnAd/QFOuo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fwd78.aul.t-online.de (fwd78.aul.t-online.de [10.223.144.104]) by mailout01.t-online.de (Postfix) with SMTP id BBD821E7D0; Thu, 11 Apr 2024 02:32:28 +0200 (CEST) Received: from localhost.localdomain ([115.165.108.210]) by fwd78.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1ruiMc-0ieFLk0; Thu, 11 Apr 2024 02:32:27 +0200 Message-ID: <3ae43538e724dcbcd2a8cad2ac8248b73e17f7c7.camel@t-online.de> Subject: Re: AW: optimizer discards sign information From: Oleg Endo To: Stefan Franke , gcc-help@gcc.gnu.org Date: Thu, 11 Apr 2024 09:32:22 +0900 In-Reply-To: <51BFC92A-35A4-4287-8FB0-F8258DAF0D9D@franke.ms> References: <016501da8b24$735d5170$5a17f450$@franke.ms> <018301da8b28$e7a601e0$b6f205a0$@franke.ms> <51BFC92A-35A4-4287-8FB0-F8258DAF0D9D@franke.ms> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1712795547-3EAE4D4A-E62C99D3/0/0 CLEAN NORMAL X-TOI-MSGID: 2e7e07d2-0758-4525-bce8-9b7645677546 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_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 List-Id: On Wed, 2024-04-10 at 16:25 +0200, Stefan Franke wrote: >=20 > Thank you for the detailed explanation. > It still doesn't fit together, since if the compiler knows that it's unsi= gned, why does it emit code for sign extension on the m68k target? >=20 > Well. Since there are enough explanations and my expectations are simply = wrong consider this as closed. >=20 >=20 By the way, on targets that can do widening multiplication the sign extensions are omitted. E.g. on SH -- https://godbolt.org/z/7hr4njEx8 _foo: mulu.w r4,r5 sts macl,r1 sts macl,r0 shll r1 rts =20 subc r1,r1 Best regards, Oleg Endo