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 tree-optimization/107618] Incorrect diagnostics when using -Og, builtin_expect(), and function attribute "warning" or "error" Date: Fri, 11 Nov 2022 13:32:12 +0000 [thread overview] Message-ID: <bug-107618-4-6p6gjGOMBe@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107618-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107618 --- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:af96500eea72c674a5686b35c66202ef2bd9688f commit r13-3898-gaf96500eea72c674a5686b35c66202ef2bd9688f Author: Richard Biener <rguenther@suse.de> Date: Fri Nov 11 10:12:28 2022 +0100 tree-optimization/107618 - enhance copy propagation of constants The following enhances copy propagation of constants to also see through simple operations like conversions but also operations with otherwise constant operands. That's required to fulfill the promise /* Copy propagation also copy-propagates constants, this is necessary to forward object-size and builtin folding results properly. */ NEXT_PASS (pass_copy_prop); and avoid false diagnostics as shown in the testcase. We're using gimple_fold_stmt_to_constant_1 with not following SSA edges and accordingly adjust what stmts we simulate during SSA propagation. PR tree-optimization/107618 * tree-ssa-copy.cc (stmt_may_generate_copy): Simulate all assignments with a single SSA use. (copy_prop_visit_assignment): Use gimple_fold_stmt_to_constant_1 to perform simple constant folding. (copy_prop::visit_stmt): Visit all assignments. * gcc.dg/pr107618.c: New testcase.
next prev parent reply other threads:[~2022-11-11 13:32 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-10 15:42 [Bug other/107618] New: " yann at droneaud dot fr 2022-11-10 17:21 ` [Bug middle-end/107618] " yann at droneaud dot fr 2022-11-10 17:45 ` yann at droneaud dot fr 2022-11-11 7:47 ` [Bug tree-optimization/107618] " rguenth at gcc dot gnu.org 2022-11-11 13:32 ` cvs-commit at gcc dot gnu.org [this message] 2022-11-11 13:33 ` rguenth at gcc dot gnu.org 2022-11-11 14:37 ` yann at droneaud dot fr 2022-11-28 22:19 ` pinskia 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-107618-4-6p6gjGOMBe@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).