From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ste-pvt-msa1.bahnhof.se (ste-pvt-msa1.bahnhof.se [213.80.101.70]) by sourceware.org (Postfix) with ESMTPS id E02B3386F811 for ; Wed, 13 Jan 2021 17:27:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E02B3386F811 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nocrew.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=noring@nocrew.org Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id 159903FA44; Wed, 13 Jan 2021 18:27:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=no autolearn_force=no version=3.4.2 Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8O-OV6dB_DCw; Wed, 13 Jan 2021 18:27:44 +0100 (CET) Received: by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 15B653F895; Wed, 13 Jan 2021 18:27:41 +0100 (CET) Date: Wed, 13 Jan 2021 18:27:41 +0100 From: Fredrik Noring To: stefan@franke.ms Cc: gcc-help@gcc.gnu.org Subject: Re: m68k: Simple loop compiles into boundless recursion with -O2 Message-ID: References: <030401d6e9c8$68dc7e20$3a957a60$@bebbosoft.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <030401d6e9c8$68dc7e20$3a957a60$@bebbosoft.de> X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2021 17:27:59 -0000 Thanks Stefan, > I guess that the label here > > > 1a: 4eb9 0000 0000 jsr 0 /* <<<--- recursion > > is printed incorrectly and instead a call to memset is done. I think so too! > objdump is known to use the first label it finds for an offset, and also > often uses the wrong section... You should look at the assembly or run > objdump with `-dr` to also print relocations. Indeed. > You may also use the compiler explorer here https://franke.ms/cex/ to > view the results for some different m68k gcc versions. (note that the % > for registers is omitted and labels have an underscore). Neat, so it's printing Motorola (MRI) rather than MIT syntax too. :) Incidentally, I recently contributed a (small) fix to m68k/Binutils, and was wondering if anyone would be interested in improving its disassembler: https://sourceware.org/pipermail/binutils/2021-January/114809.html Perhaps your Amiga menu could be supplemented with Atari, eventually? ;) A few weeks ago I begun TOS/libc and it's quite functional already. TOS is rather small, after all, compared to the Freemint project for instance. I provisionally use the restricted Vlink to produce the program from the final object file produced by GCC but I plan to write my own free TOS-linker, or, if possible, extend GCC. Fredrik