public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/101250] New: adjust_iv_update_pos update the iv statement unexpectedly cause memory address offset mismatch
@ 2021-06-29  8:39 luoxhu at gcc dot gnu.org
  2021-07-07  1:05 ` [Bug tree-optimization/101250] " luoxhu at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: luoxhu at gcc dot gnu.org @ 2021-06-29  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug tree-optimization/101250] adjust_iv_update_pos update the iv statement unexpectedly cause memory address offset mismatch
  2021-06-29  8:39 [Bug middle-end/101250] New: adjust_iv_update_pos update the iv statement unexpectedly cause memory address offset mismatch luoxhu at gcc dot gnu.org
@ 2021-07-07  1:05 ` luoxhu at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: luoxhu at gcc dot gnu.org @ 2021-07-07  1:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from luoxhu at gcc dot gnu.org ---
Patch posted:

[PATCH] ivopts: Don't adjust IV update statement if both operands use the IV in
COND [PR101250]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-07  1:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  8:39 [Bug middle-end/101250] New: adjust_iv_update_pos update the iv statement unexpectedly cause memory address offset mismatch luoxhu at gcc dot gnu.org
2021-07-07  1:05 ` [Bug tree-optimization/101250] " luoxhu at gcc dot gnu.org

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).