public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/94281] [8/9/10 Regression] g++: error: hash.cpp: ‘-fcompare-debug’ failure (length) since r8-5241-g8697bf9f46f36168 Date: Thu, 26 Mar 2020 09:11:05 +0000 [thread overview] Message-ID: <bug-94281-4-Gs8MZDDGuh@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94281-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94281 --- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:10ea09ee846eaa345161a3a3f519b3780d6101fa commit r10-7395-g10ea09ee846eaa345161a3a3f519b3780d6101fa Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Mar 26 10:10:21 2020 +0100 gimplify: Fix -fcompare-debug differences caused by gimplify_body [PR94281] The following testcase FAILs, because gimplify_body adds a GIMPLE_NOP only 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 never gets removed afterwards. Similarly, if the body seq after gimplification contains some DEBUG_BEGIN_STMTs plus a single gbind, then we could behave 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 than the first statement. 2020-03-26 Jakub Jelinek <jakub@redhat.com> PR debug/94281 * gimple.h (gimple_seq_first_nondebug_stmt): New function. (gimple_seq_last_nondebug_stmt): Don't return NULL if seq contains 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 and 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.
next prev parent reply other threads:[~2020-03-26 9:11 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-23 14:04 [Bug debug/94281] New: " marxin at gcc dot gnu.org 2020-03-23 14:04 ` [Bug debug/94281] [8/9/10 Regression] " marxin at gcc dot gnu.org 2020-03-23 15:23 ` rguenth at gcc dot gnu.org 2020-03-24 9:02 ` marxin at gcc dot gnu.org 2020-03-24 10:17 ` marxin at gcc dot gnu.org 2020-03-25 13:52 ` jakub at gcc dot gnu.org 2020-03-25 14:40 ` jakub at gcc dot gnu.org 2020-03-26 9:11 ` cvs-commit at gcc dot gnu.org [this message] 2020-03-30 15:07 ` [Bug debug/94281] [8/9 " jakub at gcc dot gnu.org 2021-05-14 9:53 ` [Bug debug/94281] [9 " jakub at gcc dot gnu.org 2021-06-01 8:17 ` rguenth at gcc dot gnu.org 2022-05-27 8:49 ` rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-94281-4-Gs8MZDDGuh@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).