From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1FF1F3858D28; Mon, 5 Sep 2022 21:43:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FF1F3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662414203; bh=mNNvoYPYDV5UjeulJM/q6y3AOIRUs38BAo+05EJYKa4=; h=From:To:Subject:Date:From; b=YrFM1LWb+2ByFRcwBW8aY/7RGHuofwyzddWIGf4nw3Lul4xX+T04byJP0OfYWG95d MDutcO4JbFdD3MivmcWqyhqp9aV0okxu9R2p6TbQqb/OhEg5wYTL1Xmv6Koh6P9IDB xWjzWkAvrl29Y+56MtNzChmUv3see2/7XpgCKNJw= From: "franckbehaghel_gcc at protonmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/106842] New: misleading warning : iteration X invokes undefined behavior Date: Mon, 05 Sep 2022 21:43:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: franckbehaghel_gcc at protonmail 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone 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=3D106842 Bug ID: 106842 Summary: misleading warning : iteration X invokes undefined behavior Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: franckbehaghel_gcc at protonmail dot com Target Milestone: --- Hello, I get the following misleading warning with gcc 12.2 with -O2/-O3. 11.3 seems fine. gcc -O2 main.c=20 main.c: In function =E2=80=98main=E2=80=99: main.c:16:38: warning: iteration 9 invokes undefined behavior [-Waggressive-loop-optimizations] 16 | for(int64_t k =3D0; k