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/98513] [10/11 Regression] Wrong code with -O3 since r10-2804-gbf05a3bbb58b3558
Date: Mon, 04 Jan 2021 15:41:13 +0000	[thread overview]
Message-ID: <bug-98513-4-UBCUv6EPoH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98513-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
A cleaner test-case:

$ cat combined.cc
extern unsigned long long var_20;
extern unsigned short arr_8[][26][1][1][11];
const int &max(int &a, const int &b) { return a > b ? a : b; }
int test___trans_tmp_1, var_5 = -1, var_6 = -2;
void test(int var_5, int var_6,
          signed char arr_1[1][1][1]) {
  for (unsigned i_0 = 0; i_0 < 21; i_0 += 2)
    for (int i_2 = 0; i_2 < 8; i_2 += 82) {
      for (int i_3 = 0; i_3 < test___trans_tmp_1; i_3++)
        for (short i_4 = 0; i_4 < 20; i_4 += 4)
          var_20 = max(var_5, 0);
      for (int i_5 = 0; i_5 < 19;
           i_5 += 20)
        for (int i_6 = var_6 + 2; i_6 < var_5 + 3; i_6++)
          arr_8[3][2][i_2][i_5][i_6] = arr_1[0][0][0];
    }
}
unsigned long long var_20;
signed char arr_1[1][1][1];
unsigned short arr_8[22][26][1][1][11];
int main() { test(var_5, var_6, arr_1); }

Optimized dump contains:

  <bb 11> [local count: 17523394]:
  _93 = MEM[(signed char[26][19] *)arr_1_31(D) + 1482B][2][0];
  _94 = (short unsigned int) _93;
  arr_8[3][2][0][0][-2147483648] = _94; <---- HERE
  if (i_6_103 > _131)
    goto <bb 9>; [11.00%]
  else
    goto <bb 12>; [89.00%]

which is instruction that causes the segfault. I'm going to take a look.

  parent reply	other threads:[~2021-01-04 15:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 15:21 [Bug tree-optimization/98513] New: " marxin at gcc dot gnu.org
2021-01-04 15:21 ` [Bug tree-optimization/98513] " marxin at gcc dot gnu.org
2021-01-04 15:41 ` marxin at gcc dot gnu.org [this message]
2021-01-04 16:24 ` marxin at gcc dot gnu.org
2021-01-04 16:33 ` marxin at gcc dot gnu.org
2021-01-05  9:21 ` marxin at gcc dot gnu.org
2021-01-05  9:24 ` marxin at gcc dot gnu.org
2021-01-05  9:28 ` marxin at gcc dot gnu.org
2021-01-05  9:28 ` rguenth at gcc dot gnu.org
2021-01-05 15:55 ` amacleod at redhat dot com
2021-01-05 16:04 ` rguenth at gcc dot gnu.org
2021-01-05 16:40 ` rguenth at gcc dot gnu.org
2021-01-06  8:02 ` rguenth at gcc dot gnu.org
2021-01-06  8:26 ` rguenth at gcc dot gnu.org
2021-01-06  9:21 ` cvs-commit at gcc dot gnu.org
2021-01-06  9:33 ` [Bug tree-optimization/98513] [10 " marxin at gcc dot gnu.org
2021-01-12 15:23 ` cvs-commit at gcc dot gnu.org
2021-01-12 15:26 ` rguenth at gcc dot gnu.org
2021-10-06 22:34 ` 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-98513-4-UBCUv6EPoH@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).