From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 12CD63858C52; Tue, 13 Feb 2024 04:33:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12CD63858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707798800; bh=BzAbAhFhwkuYR9mlOKNYY4bxj/sZi+5a+hhQogWEZPo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ygSd0kIPgLJEBqvmt8+22p2yv67tMCWIbUDkJTVRuUBR4NPjdMQi5txuSVR7JmWZ8 24tKLVbRtAQ+JtMZ8xz0HnVjgIgncmx2HMUq5UKsNaVG1A8aogLbl8qFWAna0emaOk SQm2Q7KMlNII6DpC0LQhpSpu46a3GHkqDtjKusUQ= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113734] [14 regression] libarchive miscompiled (fails libarchive_test_read_format_rar5_extra_field_version test) since r14-8768-g85094e2aa6dba7 Date: Tue, 13 Feb 2024 04:33:18 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D113734 --- Comment #24 from Tamar Christina --- The case I thought would go wrong with the above fix is: #include #include #include #define N 306 #define NEEDLE 135 __attribute__ ((noipa, noinline)) int use(int x[N]) { printf("res=3D%d\n", x[NEEDLE]); return x[NEEDLE]; } __attribute__ ((noipa, noinline)) int foo (int i, unsigned short parse_tables_n) { int table[N]; memset (table, -1, sizeof (table)); parse_tables_n >>=3D 9; parse_tables_n +=3D 9; while (i < N && parse_tables_n--) table[i++] =3D 0; return use (table); } int main () { if (foo (0, 0xFFFF) !=3D 0) abort (); return 0; } --- but this seems fine because of the bias_for_lowest which I now understand t= o be there to account for this. So starting a regtest for that patch.=