From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout10.t-online.de (mailout10.t-online.de [194.25.134.21]) by sourceware.org (Postfix) with ESMTPS id 3D50D3858D1E for ; Tue, 16 Jan 2024 23:52:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D50D3858D1E 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 3D50D3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=194.25.134.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705449148; cv=none; b=wkW8U0vugEYXr1erwlwoFYxZNoetRpOSxf1FfQOV2q00nsJsaXBQmkME7fvsEI5Dg1oW0G6shpahONqjTmpx9esXyXt2GBwxM5ZmQlW/S+DtsQZDDvTuc0sqgdy3nhBzw35vPdRjArY0A/qQUiscHhwa4M8Mx7znqYDsAlL4cAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705449148; c=relaxed/simple; bh=ADgbJtcrjmuJkMfwcl84Pul0UzEHXvaoM2qUzAFQ0/U=; h=Message-ID:Subject:From:To:Date:MIME-Version; b=qIT8owvW4K/KSGzbzvC1rGYY5b4Ln27nv4UvXd2BTjOJGwMFWQfudQrxvbWwpyVIe0kBDqAZEFEUjbnHRAX2m1VECDuMGKABUZju1etyMNGldxciqDGa2ty1rrnTKFvr96yNvPCrdImA/Xin4l7FlhkOY6KBDcr4Oeyg1/h6LMU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fwd72.aul.t-online.de (fwd72.aul.t-online.de [10.223.144.98]) by mailout10.t-online.de (Postfix) with SMTP id E313B23CF6; Wed, 17 Jan 2024 00:52:24 +0100 (CET) Received: from localhost.localdomain ([115.165.108.210]) by fwd72.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1rPtEF-4CCOFU0; Wed, 17 Jan 2024 00:52:24 +0100 Message-ID: <4e42947a1c9577da0d86b3fe266b2ffeb49cc743.camel@t-online.de> Subject: Re: autoinc / postinc not used From: Oleg Endo To: stefan@franke.ms, gcc-help@gcc.gnu.org Date: Wed, 17 Jan 2024 08:52:20 +0900 In-Reply-To: <00ae01da48b6$f4e5ce80$deb16b80$@franke.ms> References: <00ae01da48b6$f4e5ce80$deb16b80$@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::1705449144-5181C95D-5DACFF0E/0/0 CLEAN NORMAL X-TOI-MSGID: f9fa9d84-f1e8-45f1-8a75-81376003ad17 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Hi, On Tue, 2024-01-16 at 21:02 +0100, stefan@franke.ms wrote: > Hi all, >=20 > =20 >=20 > I work a lot with the good old m68k target where post-increment is suppor= ted, and I was surprised that there almost no post-increments are used in t= he generated code. >=20 > This simple code: >=20 > =20 >=20 > void memclr (int length, long * ptr) { >=20 > for(;length--;){ >=20 > *ptr++=3D 0; >=20 > } >=20 > }=20 >=20 > =20 >=20 > does not use post-increments on AVR or SH. See also https://godbolt.org/z= /fTvdv65rr >=20 >=20 This issue has been around for a very long time. I guess auto-inc is not important enough on modern architectures to be of a major concern. On SH{1,2,3,4} post-inc is only available for mem stores, not for mem loads= . SH2A adds support for stores with post-inc. You have to specify "-mb -m2a" for that, as the default target of sh-elf is SH1 (-m1). But yeah, it's als= o not utilized in this case. Cheers, Oleg