public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "luoxhu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/101250] New: adjust_iv_update_pos update the iv statement unexpectedly cause memory address offset mismatch
Date: Tue, 29 Jun 2021 08:39:48 +0000	[thread overview]
Message-ID: <bug-101250-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101250
           Summary: adjust_iv_update_pos update the iv statement
                    unexpectedly cause memory address offset mismatch
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luoxhu at gcc dot gnu.org
  Target Milestone: ---

Test case:

unsigned int foo (unsigned char *ip, unsigned char *ref, unsigned int maxlen)
{
  unsigned int len = 2;
  do {
      len++;
  }while(len < maxlen && ip[len] == ref[len]);
  return len;
}


ivopts:

  <bb 4> [local count: 1014686026]:
  _3 = MEM[(unsigned char *)ip_10(D) + ivtmp.16_15 * 1];
  ivtmp.16_16 = ivtmp.16_15 + 1;
  _19 = ref_12(D) + 18446744073709551615;
  _6 = MEM[(unsigned char *)_19 + ivtmp.16_16 * 1];
  if (_3 == _6)
    goto <bb 6>; [94.50%]
  else
    goto <bb 10>; [5.50%]

Disable adjust_iv_update_pos will produce:

  <bb 4> [local count: 1014686026]:
  _3 = MEM[(unsigned char *)ip_10(D) + ivtmp.16_15 * 1];
  _6 = MEM[(unsigned char *)ref_12(D) + ivtmp.16_15 * 1];
  ivtmp.16_16 = ivtmp.16_15 + 1;
  if (_3 == _6)
    goto <bb 6>; [94.50%]
  else
    goto <bb 10>; [5.50%]


discussions:
https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573709.html

             reply	other threads:[~2021-06-29  8:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  8:39 luoxhu at gcc dot gnu.org [this message]
2021-07-07  1:05 ` [Bug tree-optimization/101250] " luoxhu 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-101250-4@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).