From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from franke.ms (serveronline.org [136.243.37.185]) by sourceware.org (Postfix) with ESMTPS id 767603858D33 for ; Wed, 17 Jan 2024 15:19:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 767603858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=franke.ms Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=franke.ms ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 767603858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=136.243.37.185 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705504770; cv=none; b=FVgcZNQ1hKFzdgIkwJV+3+Q7EQPweGlTcq9j+LzCyAl3TlGWv0LFJ2xXrRQZ7YvHOsYhLrT/KMAnmUDvo92X4iPdwp6VfOWUBT2HiBnDweaB7itGHW7Q7geQd6QLgRdhhhMEu4pZzdeRkz3FdW1XZfj3qx2TuHYjg8tBQgPMXbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705504770; c=relaxed/simple; bh=jjJZIExPMx/EWZlghp8TzyWwyoDcSWCKPnB3wquUM70=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=P3vqhSRSeSSqqVrRRZ1N5SPwP5hlX5GjGWAB4g4sfy5RmOHGiIO2ZfIrUYDELkFv3qyDwZt0mJ3GnJZmTZllQDwY3nLHXg3fP83F0vHldlX96Sb68jLTOogg/zbcomFEJpmnq7o15fwxQHpw1Jh5Zyu0YzDrm1XEX6upEjHnpTA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from HP (i59F6C356.versanet.de [89.246.195.86]) by serveronline.org (BEJY V1.6.12-SNAPSHOT (c) 2000-2021 by BebboSoft, Stefan "Bebbo" Franke, all rights reserved) with SMTP id 18d1801593ea588ec4358db612a from stefan@franke.ms for gcc-help@gcc.gnu.org; Wed, 17 Jan 2024 16:19:18 +0100 From: To: References: <00ae01da48b6$f4e5ce80$deb16b80$@franke.ms> <4e42947a1c9577da0d86b3fe266b2ffeb49cc743.camel@t-online.de> In-Reply-To: <4e42947a1c9577da0d86b3fe266b2ffeb49cc743.camel@t-online.de> Subject: AW: autoinc / postinc not used Date: Wed, 17 Jan 2024 16:19:16 +0100 Message-ID: <013001da4958$89670230$9c350690$@franke.ms> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: de Thread-Index: AQIRvRK6JjCr7UdhyUcPI9qIXfxqmQHVZMRosGCJdaA= X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_05,KAM_DMARC_STATUS,SPF_HELO_PASS,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: > -----Urspr=C3=BCngliche Nachricht----- > Von: Gcc-help Im = Auftrag >=20 > Hi, >=20 >=20 > On Tue, 2024-01-16 at 21:02 +0100, stefan@franke.ms wrote: > > Hi all, > > > > > > > > I work a lot with the good old m68k target where post-increment is > supported, and I was surprised that there almost no post-increments = are used > in the generated code. > > > > This simple code: > > > > > > > > void memclr (int length, long * ptr) { > > > > for(;length--;){ > > > > *ptr++=3D 0; > > > > } > > > > } > > > > > > > > does not use post-increments on AVR or SH. See also > > https://godbolt.org/z/fTvdv65rr > > > > >=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. >=20 > 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 also not > utilized in this case. >=20 > Cheers, > Oleg There are some more hacks needed to fix the handling here and there, = most work is needed for -funroll-loops. After all, gcc creates beautiful = code as shown here http://franke.ms/cex/z/MGTb5P . There it's still the = old version 6.5.0, but maybe I'll port that to a more recent version. If there is interest for other targets, I can provide the information to = apply my changes. Or you grab it yourself from my github repo. Regards Stefan