From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 079D13858402; Mon, 12 Feb 2024 16:07:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 079D13858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707754046; bh=o7z8CFOqC/ZA8THxdk/4srifZRYX1lhiXlMa4LTSoJ8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n+LCCRlrbLeF1y/x2f3IrQjHLoIMJ1z5PcEw0CfTbpvReIOtfSHRCLTV8NHxY8Nqa 83//XirIHzg7D2XdkazGMPHtHK1QLIcydLpSqdq3gpdz5nMbkVQkJLPC9H9i1IKOlD 3VlwFaexsOd8iRAQ0woedqDUeZV+/WKsJMWl3kfA= 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: Mon, 12 Feb 2024 16:07:25 +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 #23 from Tamar Christina --- small standalone reducer: #include #include #include #define N 306 #define NEEDLE 136 __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 11; while (i < N && parse_tables_n--) table[i++] =3D 0; return use (table); } int main () { if (foo (0, 0xFFFF) !=3D 0) abort (); return 0; } --- > gcc incorrect.c -O3 -o incorrect.exe; and ./incorrect.exe; echo $status res=3D-1 1 > gcc incorrect.c -O1 -o incorrect.exe; and ./incorrect.exe; echo $status res=3D0 0 > gcc incorrect.c -O3 -fdisable-tree-cunroll -o incorrect.exe; and ./incorr= ect.exe; echo $status res=3D0 0=