From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2EB613858424; Mon, 31 Oct 2022 20:53:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EB613858424 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667249641; bh=6Lu9474hAzL+6chs364sibNICC+v1JahBk7pGhy1GX0=; h=From:To:Subject:Date:From; b=G8wscswInXIpFRSIdN1JEbos07bQKn7yv6ji4DwlXJq96nbO20aMBHTT8EwdzaSs8 0tmeiQFasCMjaZK+iFGA1OoSdd8Zp5Jxp5eHY4ICXQxAPoif0Tnrn8kInWv6kRwmPT ylF2/iqA4oFA9flMD+qfxyWMAnl5Gku/Q78wvJcI= From: "jcmvbkbc at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107482] New: out-of-bounds heap access in IRA Date: Mon, 31 Oct 2022 20:53:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jcmvbkbc at gcc dot gnu.org 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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=3D107482 Bug ID: 107482 Summary: out-of-bounds heap access in IRA Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: jcmvbkbc at gcc dot gnu.org Target Milestone: --- Created attachment 53806 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53806&action=3Dedit _gcov.i Inside the functions update_costs_from_allocno and assign_hard_reg the macro ALLOCNO_COLOR_DATA may be applied to objects of type 'struct ira_allocno' whose add_data field wasn't changed in the function color_pass to point to a memory area sized for struct allocno_color_data. It triggers ASAN and can be reproduced without ASAN with the attached patch on a compiler built from revision gcc-13-3563-gf36bba013361 for target=3Dmicroblazeel-linux-gnu: $ gcc/cc1 -O2 _gcov.i ../../../../gcc/libgcc/libgcov-driver.c: In function =E2=80=98gcov_do_dump.= constprop=E2=80=99: ../../../../gcc/libgcc/libgcov-driver.c:704:1: internal compiler error: in assign_hard_reg, at ira-color.cc:2006=