public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103037] [11/12 Regression] Wrong code with -O2 since r11-6100-gd41b097350d3c5d0
Date: Tue, 02 Nov 2021 07:36:29 +0000	[thread overview]
Message-ID: <bug-103037-4-00MaQ9jR5T@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103037-4@http.gcc.gnu.org/bugzilla/>

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-11-02
            Summary|[11/12 Regression] Wrong    |[11/12 Regression] Wrong
                   |code with -O2               |code with -O2 since
                   |                            |r11-6100-gd41b097350d3c5d0
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
   Target Milestone|---                         |11.3
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r11-6100-gd41b097350d3c5d0.

A bit reduced:

short var_3 = 2;
unsigned char var_9 = 23;
unsigned short var_11;
unsigned short arr_4 [23];

void test() __attribute__((noipa));

const unsigned short &min(unsigned short &d, const unsigned short &e) {
  return e < d ? e : d;
}

void test() {
  for (int a = 0; a < var_9; a += 3)
      var_11 = min(arr_4[a], 1) / (arr_4[a] ? arr_4[a] : var_3);
}


int main() {
    for (unsigned long i_0 = 0; i_0 < 23; ++i_0)
        arr_4 [i_0] = 2;
    test();
    __builtin_printf("%hu\n", var_11);
    if (var_11 != 0)
        __builtin_abort();
    return 0;
}

  reply	other threads:[~2021-11-02  7:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02  7:17 [Bug tree-optimization/103037] New: [11/12 Regression] Wrong code with -O2 vsevolod.livinskij at frtk dot ru
2021-11-02  7:36 ` marxin at gcc dot gnu.org [this message]
2021-11-02  7:52 ` [Bug tree-optimization/103037] [11/12 Regression] Wrong code with -O2 since r11-6100-gd41b097350d3c5d0 pinskia at gcc dot gnu.org
2021-11-02  8:43 ` rguenth at gcc dot gnu.org
2021-11-02  8:51 ` jakub at gcc dot gnu.org
2021-11-02  9:08 ` jakub at gcc dot gnu.org
2021-11-02 14:18 ` rguenther at suse dot de
2021-11-03 10:08 ` rguenth at gcc dot gnu.org
2021-11-05 13:39 ` rguenth at gcc dot gnu.org
2022-02-23 15:25 ` rguenth at gcc dot gnu.org
2022-02-25 12:21 ` cvs-commit at gcc dot gnu.org
2022-02-25 12:21 ` [Bug tree-optimization/103037] [11 " rguenth at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2023-05-29 10:05 ` jakub 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-103037-4-00MaQ9jR5T@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).