From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 45FFF3857829; Thu, 18 Mar 2021 10:32:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45FFF3857829 From: "ebotcazou at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/99641] [11 Regression] opt30.adb, opt49.adb and loop_optimization3.adb fail to build at m32 Date: Thu, 18 Mar 2021 10:32:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component target_milestone bug_status assigned_to 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2021 10:32:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99641 Eric Botcazou changed: What |Removed |Added ---------------------------------------------------------------------------- Component|ada |middle-end Target Milestone|--- |11.0 Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |ebotcazou at gcc do= t gnu.org --- Comment #2 from Eric Botcazou --- The offset calculation in native_encode_initializer is incorrect: if (index && TREE_CODE (index) =3D=3D RANGE_EXPR) { if (!tree_fits_shwi_p (TREE_OPERAND (index, 0)) || !tree_fits_shwi_p (TREE_OPERAND (index, 1))) return 0; pos =3D (tree_to_shwi (TREE_OPERAND (index, 0)) - min_ind= ex) * fieldsize; count =3D (tree_to_shwi (TREE_OPERAND (index, 1)) - tree_to_shwi (TREE_OPERAND (index, 0))); } else if (index) { if (!tree_fits_shwi_p (index)) return 0; pos =3D (tree_to_shwi (index) - min_index) * fieldsize; } It must not be done in HOST_WIDE_INT but in sizetype instead, like in e.g. get_inner_reference or get_ref_base_and_extent.=