public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/95097] Missed optimization with bitfield value ranges
Date: Wed, 13 May 2020 06:31:14 +0000	[thread overview]
Message-ID: <bug-95097-4-NedV4clNOP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95097-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95097

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Just to quote EVRP sees

  <bb 2> :
  _1 = VIEW_CONVERT_EXPR<unsigned int>(f);
  _2 = _1 & 1048575;
  if (_2 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  _3 = f.x;
  _4 = (unsigned int) _3;
  y_8 = _4 * 4096;
  if (y_8 <= 199)

thus the f.x != 0 test has been folded by one of those $?%&! permature
fold-const transforms to

  if ((BIT_FIELD_REF <f, 32, 0> & 1048575) != 0)

the fix is to get rid of those (and fix the "fallout").

  parent reply	other threads:[~2020-05-13  6:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  3:00 [Bug tree-optimization/95097] New: " bugdal at aerifal dot cx
2020-05-13  4:05 ` [Bug tree-optimization/95097] " egallager at gcc dot gnu.org
2020-05-13  6:08 ` pinskia at gcc dot gnu.org
2020-05-13  6:31 ` rguenth at gcc dot gnu.org [this message]
2021-08-22  0:32 ` pinskia at gcc dot gnu.org
2021-08-22  0:39 ` 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-95097-4-NedV4clNOP@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: link
Be 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).