From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8A459385E013; Thu, 26 Mar 2020 09:11:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A459385E013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585213865; bh=ZAXfNl2RTqP1pbMFi6UjP/pdT2OrrmZPIAHg1qELSpU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=l2BXdqC3S8Ot7mMexLJTfOtXm5HwOBI7hgvwDD7Nu6vJx7Ijl0huLdYN4rWeCm7bp 4vIjINfKNIZIjjW72tHn/kUkk8LmO7GmGct5jbYxRRm/kiSvmY3O4C2y9OjnoDSUQq LgicCvPxxi6+EuLueCCzCbFiZ/s4H997oK0OEV3o= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBkZWJ1Zy85NDI4MV0gWzgvOS8xMCBSZWdyZXNzaW9uXSBn?= =?UTF-8?B?Kys6IGVycm9yOiBoYXNoLmNwcDog4oCYLWZjb21wYXJlLWRlYnVn4oCZIGZh?= =?UTF-8?B?aWx1cmUgKGxlbmd0aCkgc2luY2UgcjgtNTI0MS1nODY5N2JmOWY0NmYzNjE2?= =?UTF-8?B?OA==?= Date: Thu, 26 Mar 2020 09:11:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 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 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: Thu, 26 Mar 2020 09:11:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94281 --- Comment #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:10ea09ee846eaa345161a3a3f519b3780d6101fa commit r10-7395-g10ea09ee846eaa345161a3a3f519b3780d6101fa Author: Jakub Jelinek Date: Thu Mar 26 10:10:21 2020 +0100 gimplify: Fix -fcompare-debug differences caused by gimplify_body [PR94= 281] The following testcase FAILs, because gimplify_body adds a GIMPLE_NOP o= nly when there are no statements in the function and with -g there is a DEBUG_BEGIN_STMT, so it doesn't add it and due to -fno-tree-dce that ne= ver gets removed afterwards. Similarly, if the body seq after gimplificati= on contains some DEBUG_BEGIN_STMTs plus a single gbind, then we could beha= ve differently between -g0 and -g, by using that gbind as the body in the = -g0 case and not in the -g case. This patch fixes that by ignoring DEBUG_BEGIN_STMTs (other debug stmts can't appear at this point yet thankfully) during decisions and if we pick the single gbind and there are DEBUG_BEGIN_STMTs next to it, it moves them = into the gbind. While debugging this, I found also a bug in the gimple_seq_last_nondebug_stmt function, for a seq that has a single non-DEBUG_BEGIN_STMT statement followed by one or more DEBUG_BEGIN_STMTs it would return NULL rather t= han the first statement. 2020-03-26 Jakub Jelinek PR debug/94281 * gimple.h (gimple_seq_first_nondebug_stmt): New function. (gimple_seq_last_nondebug_stmt): Don't return NULL if seq conta= ins a single non-debug stmt followed by one or more debug stmts. * gimplify.c (gimplify_body): Use gimple_seq_first_nondebug_stmt instead of gimple_seq_first_stmt, use gimple_seq_first_nondebug_stmt and gimple_seq_last_nondebug_stmt instead of gimple_seq_first a= nd gimple_seq_last to check if outer_stmt gbind could be reused and if yes and it is surrounded by any debug stmts, move them into = the gbind body. * g++.dg/debug/pr94281.C: New test.=