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/99230] [11 Regression] gcc.dg/pr83527.c excess errors: '-fcompare-debug' failure (length) Date: Sat, 20 Mar 2021 16:02:54 +0000 [thread overview] Message-ID: <bug-99230-4-nEWedJOC9D@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-99230-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99230 --- Comment #7 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:9f59cb7cac009f3c6eba81eb09714699b9ac9f8d commit r11-7750-g9f59cb7cac009f3c6eba81eb09714699b9ac9f8d Author: Jakub Jelinek <jakub@redhat.com> Date: Sat Mar 20 17:02:06 2021 +0100 c-family: Fix PR94272 -fcompare-debug issue even for C [PR99230] The following testcase results in -fcompare-debug failure. The problem is the similar like in PR94272 https://gcc.gnu.org/pipermail/gcc-patches/2020-March/542562.html When genericizing, with -g0 we have just a TREE_SIDE_EFFECTS DO_STMT in a branch of if, while with -g we have that wrapped into TREE_SIDE_EFFECTS STATEMENT_LIST containing DEBUG_BEGIN_STMT and that DO_STMT. The do loop is empty with 0 condition, so c_genericize_control_stmt turns it into an empty statement (without TREE_SIDE_EFFECTS). For -g0 that means that suddenly the if branch doesn't have side effects and is expanded differently. But with -g we still have TREE_SIDE_EFFECTS STATEMENT_LIST containing DEBUG_BEGIN_STMT and non-TREE_SIDE_EFFECTS stmt. The following patch fixes that by detecting this case and removing TREE_SIDE_EFFECTS. And, so that we don't duplicate the same code, changes the C++ FE to just call the c_genericize_control_stmt function that can now handle it. 2021-03-20 Jakub Jelinek <jakub@redhat.com> PR debug/99230 * c-gimplify.c (c_genericize_control_stmt): Handle STATEMENT_LIST. * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove special code, instead call c_genericize_control_stmt. * gcc.dg/pr99230.c: New test.
next prev parent reply other threads:[~2021-03-20 16:02 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-23 21:40 [Bug debug/99230] New: " hp at gcc dot gnu.org 2021-02-23 21:42 ` [Bug debug/99230] " hp at gcc dot gnu.org 2021-02-24 8:30 ` rguenth at gcc dot gnu.org 2021-02-24 16:59 ` jakub at gcc dot gnu.org 2021-02-26 12:59 ` rguenth at gcc dot gnu.org 2021-03-01 11:53 ` jakub at gcc dot gnu.org 2021-03-01 12:46 ` jakub at gcc dot gnu.org 2021-03-17 18:56 ` jakub at gcc dot gnu.org 2021-03-18 14:57 ` hp at gcc dot gnu.org 2021-03-20 16:02 ` cvs-commit at gcc dot gnu.org [this message] 2021-03-24 15:09 ` jakub 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-99230-4-nEWedJOC9D@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).