public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95045] New: wrong code at -O3 on x86_64-linux-gnu
@ 2020-05-11  5:11 qrzhang at gatech dot edu
  2020-05-11  6:55 ` [Bug tree-optimization/95045] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: qrzhang at gatech dot edu @ 2020-05-11  5:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95045
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qrzhang at gatech dot edu
  Target Milestone: ---

Recent regression. Bisection points to g:283cb9ea6293e813e4


$ gcc-trunk -v
gcc version 11.0.0 20200510 (experimental) [master revision
4ae915cdbf0:8eedda9eef3:ef6394205d7bcab00dca01182d708ad5a6360a7b] (GCC)


$ gcc-trunk abc.c ; ./a.out
4


$ gcc-trunk -O3  abc.c ; ./a.out
0


$ cat abc.c
int a, c, f;
long b;
char d;
int e[3];
int g[9][3][2];
int main() {
  {
  h:
    for (f = 0; f <= 5; f++) {
      b = 3;
      for (; b >= 0; b--) {
        e[2] = d = 0;
        for (; d <= 3; d++) {
          g[8][2][0] = e[1] = c = 0;
          for (; c <= 1; c++)
            e[c + 1] = g[d + 5][2][c] = 4;
        }
        if (a)
          goto h;
      }
    }
  }
  printf("%d\n", e[2]);
}

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

* [Bug tree-optimization/95045] wrong code at -O3 on x86_64-linux-gnu
  2020-05-11  5:11 [Bug tree-optimization/95045] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
@ 2020-05-11  6:55 ` rguenth at gcc dot gnu.org
  2020-05-11  7:27 ` [Bug tree-optimization/95045] [11 Regression] " marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-11  6:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2020-05-11
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.

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

* [Bug tree-optimization/95045] [11 Regression] wrong code at -O3 on x86_64-linux-gnu
  2020-05-11  5:11 [Bug tree-optimization/95045] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
  2020-05-11  6:55 ` [Bug tree-optimization/95045] " rguenth at gcc dot gnu.org
@ 2020-05-11  7:27 ` marxin at gcc dot gnu.org
  2020-05-11  8:01 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-05-11  7:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
      Known to work|                            |10.1.0
                 CC|                            |marxin at gcc dot gnu.org
            Summary|wrong code at -O3 on        |[11 Regression] wrong code
                   |x86_64-linux-gnu            |at -O3 on x86_64-linux-gnu
      Known to fail|                            |11.0
            Version|unknown                     |11.0

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

* [Bug tree-optimization/95045] [11 Regression] wrong code at -O3 on x86_64-linux-gnu
  2020-05-11  5:11 [Bug tree-optimization/95045] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
  2020-05-11  6:55 ` [Bug tree-optimization/95045] " rguenth at gcc dot gnu.org
  2020-05-11  7:27 ` [Bug tree-optimization/95045] [11 Regression] " marxin at gcc dot gnu.org
@ 2020-05-11  8:01 ` rguenth at gcc dot gnu.org
  2020-05-12  6:22 ` cvs-commit at gcc dot gnu.org
  2020-05-12  6:26 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-11  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, this one is an interesting one (might be also latent before the rewrite). 
I'll deal with it separately.  The issue is around the inner loop having
multiple exits, one being also the exit from the outer loop and edge
inserts on that edge getting mis-ordered (we commit them only after processing
all inserts).

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

* [Bug tree-optimization/95045] [11 Regression] wrong code at -O3 on x86_64-linux-gnu
  2020-05-11  5:11 [Bug tree-optimization/95045] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
                   ` (2 preceding siblings ...)
  2020-05-11  8:01 ` rguenth at gcc dot gnu.org
@ 2020-05-12  6:22 ` cvs-commit at gcc dot gnu.org
  2020-05-12  6:26 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-12  6:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:bb63ca63e744c08bc5a9ffa53df62ea35f098b0b

commit r11-308-gbb63ca63e744c08bc5a9ffa53df62ea35f098b0b
Author: Richard Biener <rguenther@suse.de>
Date:   Mon May 11 15:26:09 2020 +0200

    tree-optimization/95045 - fix SM with exit exiting multiple loops

    Since we apply SM to an edge which exits multiple loops we have
    to make sure to commit insertions on it immediately since otherwise
    store order is not preserved.

    2020-05-12  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/95045
            * dbgcnt.def (lim): Add debug-counter.
            * tree-ssa-loop-im.c: Include dbgcnt.h.
            (find_refs_for_sm): Use lim debug counter for store motion
            candidates.
            (do_store_motion): Rename form store_motion.  Commit edge
            insertions...
            (store_motion_loop): ... here.
            (tree_ssa_lim): Adjust.

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

* [Bug tree-optimization/95045] [11 Regression] wrong code at -O3 on x86_64-linux-gnu
  2020-05-11  5:11 [Bug tree-optimization/95045] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
                   ` (3 preceding siblings ...)
  2020-05-12  6:22 ` cvs-commit at gcc dot gnu.org
@ 2020-05-12  6:26 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-12  6:26 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-05-12  6:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11  5:11 [Bug tree-optimization/95045] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
2020-05-11  6:55 ` [Bug tree-optimization/95045] " rguenth at gcc dot gnu.org
2020-05-11  7:27 ` [Bug tree-optimization/95045] [11 Regression] " marxin at gcc dot gnu.org
2020-05-11  8:01 ` rguenth at gcc dot gnu.org
2020-05-12  6:22 ` cvs-commit at gcc dot gnu.org
2020-05-12  6:26 ` 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).