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/102951] failure to optimize MIN_EXPR of subobject addresses of the same object Date: Thu, 28 Oct 2021 18:11:15 +0000 [thread overview] Message-ID: <bug-102951-4-GXl12ZYzbC@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102951-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102951 --- 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:6123b998b185572abac7d7224b34f03955bb91a2 commit r12-4776-g6123b998b185572abac7d7224b34f03955bb91a2 Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Oct 28 20:10:15 2021 +0200 match.pd: Optimize MIN_EXPR <addr1, addr2> etc. addr1 < addr2 would be simplified [PR102951] This patch outlines the decision whether address comparison can be folded or not from the match.pd simple comparison simplification and uses it both there and in a new minmax simplification, such that we fold e.g. MAX (&a[2], &a[1]) etc. Some of the Wstringop-overflow-62.c changes might look weird, but that seems to be mainly due to gimple_fold_builtin_memset not bothering to copy over location, will fix that incrementally. 2021-10-28 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/102951 * fold-const.h (address_compare): Declare. * fold-const.c (address_compare): New function. * match.pd (cmp (convert1?@2 addr@0) (convert2? addr@1)): Use address_compare helper. (minmax cmp (convert1?@2 addr@0) (convert2?@3 addr@1)): New simplification. * gcc.dg/tree-ssa/pr102951.c: New test. * gcc.dg/Wstringop-overflow-62.c: Adjust expected diagnostics.
prev parent reply other threads:[~2021-10-28 18:11 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-26 15:24 [Bug tree-optimization/102951] New: " msebor at gcc dot gnu.org 2021-10-26 16:49 ` [Bug tree-optimization/102951] " jakub at gcc dot gnu.org 2021-10-27 2:43 ` pinskia at gcc dot gnu.org 2021-10-27 6:56 ` rguenth at gcc dot gnu.org 2021-10-27 10:37 ` jakub at gcc dot gnu.org 2021-10-28 18:11 ` cvs-commit at gcc dot gnu.org [this message]
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-102951-4-GXl12ZYzbC@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).