From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9CF853858C66; Wed, 28 Aug 2024 03:03:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CF853858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1724814211; bh=Ogjdkab06mezs3L10hKrBwSLkA94a1eeQSa8nEyZjm4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pJSQ8+ojGY7Ac3SXOvjgE8Hq/HCNyp87+Mzwq7lRkRLmeGKAIkzzLq53upEo5Qh7K ZXX8tLp+oXzMEEtIXFZXe38SAWoCy0FPtKQEt5dmID5g94sDYyOqLpldEicn7/J58Z HzYCryIBpbyCbAMOuDQrPrFvDaaPeNc6zRPp4VRQ= From: "alancf0 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/116498] gnat enters busy wait trying to compile for msp430-none-elf with -mlarge flag Date: Wed, 28 Aug 2024 03:03:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: alancf0 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D116498 --- Comment #3 from Alan Fisher --- > It seems odd that neither Pmode nor ptr_mode is in the set of integer mod= es though. This does seem odd... One would think PSI should sit between HI and SI as h= ere: https://gcc.gnu.org/onlinedocs/gccint/Machine-Modes.html . Again, as someone who knows little about gcc internals maybe this is not that useful but... Upon investigation this appears to be a result of how calc_wider_mode() in genmodes.cc works. From what I can see, - Each mode is iterated through - The objects in each mode are sorted according to some set of criteria (= see below) - but the sorting is done only within the mode, not between modes - Following the sorting process of a mode in calc_wider_mode, the 'wider' member of the mode structure is set to the next member in the sorted list - The algorithm for emitting the mode_wider array involves iterating over each mode, printing out each object within, and its 'wider' member. - This means that all of the integer modes are sorted together within the= ir category (2); the single partial integer mode is "sorted" within its category (3); and the latter is emitted in the mode_wider text output below the former - The comparison used to sort the objects within modes involves the 'bytesize' and 'precision' fields, the latter of which is used for partial integers to indicate their bit length. A number of other fields are also used. Most of this code / design seems to have been around untouched for a long t= ime. Perhaps someone else can comment on whether this is correct output for genmodes. All the best, Alan=