From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 52B433890417; Mon, 11 May 2020 12:50:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52B433890417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589201432; bh=nWL73Tb8ZOv+j/4O1SRrVOKSCE4TzUs8cVyCOhYXx2I=; h=From:To:Subject:Date:From; b=iOKX5IXIaBAv1zi1XXcV0P/NaOXS4Ugf1OxujAQTPXauI7G6UuhNENyCZG5ZMtAoC VjLPU2dXy3Mk/7t9CNNWVeCUuJOLpxnN19mym6I/ZM7AHW2PrbvJxZ+IPkfm8VLQGZ BK4B20FrdZDnUw6MDqNjHpl76N9MF5RXeEhyU44g= From: "vincent-gcc at vinc17 dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/95057] New: missing -Wunused-but-set-variable warning on multiple assignments, not all of them used Date: Mon, 11 May 2020 12:50:32 +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: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincent-gcc at vinc17 dot net 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 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: Mon, 11 May 2020 12:50:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95057 Bug ID: 95057 Summary: missing -Wunused-but-set-variable warning on multiple assignments, not all of them used Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: vincent-gcc at vinc17 dot net Target Milestone: --- With -Wunused-but-set-variable, GCC does not warn in the following cases: int f (int i) { int j; j =3D i + 1; /* unused */ j =3D i + 2; return j; } int g (int i) { int j, k; j =3D i + 1; k =3D j + 1; j =3D i + 2; /* unused */ return k; } Note: it is possible that PR44677 may be regarded as a particular case of t= his bug.=