public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/95123] New: [10/11 Regression] Wrong code w/ -O2 -fselective-scheduling2 -funroll-loops --param early-inlining-insns=5 --param loop-invariant-max-bbs-in-loop=3 --param max-jump-thread-duplication-stmts=0
@ 2020-05-14  8:20 asolokha at gmx dot com
  2020-05-14  9:53 ` [Bug rtl-optimization/95123] " amonakov at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: asolokha at gmx dot com @ 2020-05-14  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95123
           Summary: [10/11 Regression] Wrong code w/ -O2
                    -fselective-scheduling2 -funroll-loops --param
                    early-inlining-insns=5 --param
                    loop-invariant-max-bbs-in-loop=3 --param
                    max-jump-thread-duplication-stmts=0
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: x86_64-unknown-linux-gnu

The following program, compiled w/ gcc-11.0.0-alpha20200510 snapshot
(g:13a46321516e2efd3bbb1f1899c539c6724240a9) w/ -O2 -fselective-scheduling2
-funroll-loops --param early-inlining-insns=5 --param
loop-invariant-max-bbs-in-loop=3 --param max-jump-thread-duplication-stmts=0,
segfauls on run-time:

int ak, mt;
const int g5[1] = { -1 }, ip[5] = { 0 };
unsigned int eu;

void
cm (unsigned char t9)
{
  (void) t9;
  eu = (eu & (~0 - 1)) + ip[eu + 1 > 1];
}

void
qe (unsigned int nc)
{
  cm (nc);
  cm (nc);
  cm (nc);
  asm ("");
  cm (nc);
}

int
main (void)
{
  int xh, bc = mt == 2;

  mt = ak;

  for (xh = 0; xh < 1; ++xh)
    {
      qe (g5[xh]);
      asm (";");
      if (!!bc)
        __builtin_puts ("");
    }

  for (xh = 0; xh < 5; ++xh)
    {
      qe (ip[xh]);
      asm (";");
      if (!!bc)
        __builtin_printf ("%d\n", xh);

    }

  for (xh = 0; xh < 3; ++xh)
    {
      qe (ip[xh]);
      if (!!bc)
        mt += xh;
    }

  return 0;
}

% x86_64-unknown-linux-gnu-gcc-11.0.0 -O2 -fselective-scheduling2 --param
early-inlining-insns=5 --param loop-invariant-max-bbs-in-loop=3 --param
max-jump-thread-duplication-stmts=0 -o good cd8zuepp.c
% ./good
% echo $?
0

% x86_64-unknown-linux-gnu-gcc-11.0.0 -O2 -fselective-scheduling2
-funroll-loops --param early-inlining-insns=5 --param
loop-invariant-max-bbs-in-loop=3 --param max-jump-thread-duplication-stmts=0 -o
bad cd8zuepp.c
% ./bad 
zsh: segmentation fault (core dumped)  ./bad

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

end of thread, other threads:[~2023-07-07 10:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14  8:20 [Bug rtl-optimization/95123] New: [10/11 Regression] Wrong code w/ -O2 -fselective-scheduling2 -funroll-loops --param early-inlining-insns=5 --param loop-invariant-max-bbs-in-loop=3 --param max-jump-thread-duplication-stmts=0 asolokha at gmx dot com
2020-05-14  9:53 ` [Bug rtl-optimization/95123] " amonakov at gcc dot gnu.org
2020-05-14 10:16 ` marxin at gcc dot gnu.org
2020-05-14 10:33 ` asolokha at gmx dot com
2020-05-14 10:35 ` asolokha at gmx dot com
2020-05-14 10:39 ` asolokha at gmx dot com
2020-05-14 10:41 ` amonakov at gcc dot gnu.org
2020-05-14 10:47 ` asolokha at gmx dot com
2020-05-14 11:11 ` marxin at gcc dot gnu.org
2020-05-14 11:57 ` rguenth at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2021-01-14  8:48 ` rguenth at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2022-01-30  0:26 ` [Bug rtl-optimization/95123] [10/11/12 Regression] Wrong code w/ -O2 -fselective-scheduling2 -funroll-loops --param early-inlining-insns=5 --param loop-invariant-max-bbs-in-loop=3 --param max-jump-thread-duplication-stmts=0 -fPIE pinskia at gcc dot gnu.org
2022-01-31  9:04 ` marxin at gcc dot gnu.org
2022-06-28 10:40 ` [Bug rtl-optimization/95123] [10/11/12/13 " jakub at gcc dot gnu.org
2023-07-07 10:37 ` [Bug rtl-optimization/95123] [11/12/13/14 " rguenth 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).