public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/94329] [8/9/10 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
Date: Sat, 28 Mar 2020 09:22:43 +0000	[thread overview]
Message-ID: <bug-94329-4-0Xwlq9Z1Dv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94329-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:679becf175c5d7f6b323cd3af0a09c6039b4123d

commit r10-7437-g679becf175c5d7f6b323cd3af0a09c6039b4123d
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Mar 28 10:21:52 2020 +0100

    reassoc: Fix -fcompare-debug bug in reassociate_bb [PR94329]

    The following testcase FAILs with -fcompare-debug, because reassociate_bb
    mishandles the case when the last stmt in a bb has zero uses.  In that case
    reassoc_remove_stmt (like gsi_remove) moves the iterator to the next stmt,
    i.e. gsi_end_p is true, which means the code sets the iterator back to
    gsi_last_bb.  The problem is that the for loop does gsi_prev on that before
    handling the next statement, which means the former penultimate stmt, now
    last one, is not processed by reassociate_bb.
    Now, with -g, if there is at least one debug stmt at the end of the bb,
    reassoc_remove_stmt moves the iterator to that following debug stmt and we
    just do gsi_prev and continue with the former penultimate non-debug stmt,
    now last non-debug stmt.

    The following patch fixes that by not doing the gsi_prev in this case;
there
    are too many continue; cases, so I didn't want to copy over the gsi_prev to
    all of them, so this patch uses a bool for that instead.  The second
    gsi_end_p check isn't needed anymore, because when we don't do the
    undesirable gsi_prev after gsi = gsi_last_bb, the loop !gsi_end_p (gsi)
    condition will catch the removal of the very last stmt from a bb.

    2020-03-28  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/94329
            * tree-ssa-reassoc.c (reassociate_bb): When calling
reassoc_remove_stmt
            on the last stmt in a bb, make sure gsi_prev isn't done immediately
            after gsi_last_bb.

            * gfortran.dg/pr94329.f90: New test.

  parent reply	other threads:[~2020-03-28  9:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: " marxin at gcc dot gnu.org
2020-03-25 13:55 ` [Bug debug/94329] " marxin at gcc dot gnu.org
2020-03-26 14:27 ` [Bug debug/94329] [8/9/10 Regression] " jakub at gcc dot gnu.org
2020-03-27 14:53 ` [Bug tree-optimization/94329] " jakub at gcc dot gnu.org
2020-03-27 14:58 ` jakub at gcc dot gnu.org
2020-03-28  9:22 ` cvs-commit at gcc dot gnu.org [this message]
2020-03-28  9:24 ` [Bug tree-optimization/94329] [8/9 " jakub at gcc dot gnu.org
2020-04-07 19:04 ` cvs-commit at gcc dot gnu.org
2020-04-07 20:02 ` [Bug tree-optimization/94329] [8 " jakub at gcc dot gnu.org
2020-09-17 17:23 ` 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-94329-4-0Xwlq9Z1Dv@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).