public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length)
@ 2020-03-25 13:55 marxin at gcc dot gnu.org
2020-03-25 13:55 ` [Bug debug/94329] " marxin at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-25 13:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
Bug ID: 94329
Summary: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure
(length)
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
CC: jakub at gcc dot gnu.org
Target Milestone: ---
Fails since GCC 4.9.0:
$ cat use_only.f90
SUBROUTINE r_to_s1b ( s, hinv )
REAL hinv(:,:)
DO I=1,3
DO J=1,3
S = hinv(i,j)
END DO
END DO
END
$ gcc -Werror -fcompare-debug -O1 -fno-tree-loop-optimize -fwrapv -c
use_only.f90
gcc: error: use_only.f90: ‘-fcompare-debug’ failure (length)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/94329] gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) marxin at gcc dot gnu.org
@ 2020-03-25 13:55 ` marxin at gcc dot gnu.org
2020-03-26 14:27 ` [Bug debug/94329] [8/9/10 Regression] " jakub at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-25 13:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
Last reconfirmed| |2020-03-25
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/94329] [8/9/10 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) 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 ` jakub at gcc dot gnu.org
2020-03-27 14:53 ` [Bug tree-optimization/94329] " jakub at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-26 14:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|gcc-9: error: use_only.f90: |[8/9/10 Regression] error:
|‘-fcompare-debug’ failure |use_only.f90:
|(length) |‘-fcompare-debug’ failure
| |(length)
Target Milestone|--- |8.5
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with my r0-126015-g5e40da4f64effc4104fd5d787c37da9cd04c06fe
Will have a look.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/94329] [8/9/10 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) 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 ` jakub at gcc dot gnu.org
2020-03-27 14:58 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-27 14:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Component|debug |tree-optimization
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/94329] [8/9/10 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) marxin at gcc dot gnu.org
` (2 preceding siblings ...)
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
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-27 14:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48131
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48131&action=edit
gcc10-pr94329.patch
Untested fix.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/94329] [8/9/10 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) marxin at gcc dot gnu.org
` (3 preceding siblings ...)
2020-03-27 14:58 ` jakub at gcc dot gnu.org
@ 2020-03-28 9:22 ` cvs-commit at gcc dot gnu.org
2020-03-28 9:24 ` [Bug tree-optimization/94329] [8/9 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-03-28 9:22 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/94329] [8/9 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) marxin at gcc dot gnu.org
` (4 preceding siblings ...)
2020-03-28 9:22 ` cvs-commit at gcc dot gnu.org
@ 2020-03-28 9:24 ` jakub at gcc dot gnu.org
2020-04-07 19:04 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-28 9:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[8/9/10 Regression] error: |[8/9 Regression] error:
|use_only.f90: |use_only.f90:
|‘-fcompare-debug’ failure |‘-fcompare-debug’ failure
|(length) |(length)
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/94329] [8/9 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) marxin at gcc dot gnu.org
` (5 preceding siblings ...)
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
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-07 19:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:aa9c08ef97f4df1ebb1fc8d72f2e7f9f8c1045c2
commit r9-8472-gaa9c08ef97f4df1ebb1fc8d72f2e7f9f8c1045c2
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/94329] [8 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) marxin at gcc dot gnu.org
` (6 preceding siblings ...)
2020-04-07 19:04 ` cvs-commit at gcc dot gnu.org
@ 2020-04-07 20:02 ` jakub at gcc dot gnu.org
2020-09-17 17:23 ` jakub at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-07 20:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[8/9 Regression] error: |[8 Regression] error:
|use_only.f90: |use_only.f90:
|‘-fcompare-debug’ failure |‘-fcompare-debug’ failure
|(length) |(length)
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 9.4+ too.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/94329] [8 Regression] error: use_only.f90: ‘-fcompare-debug’ failure (length)
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) marxin at gcc dot gnu.org
` (7 preceding siblings ...)
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
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-17 17:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94329
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 8.5 in r8-10476-gc53f6b6c38fd3c61257c9f311ca9dc21135223b4.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-09-17 17:23 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 13:55 [Bug debug/94329] New: gcc-9: error: use_only.f90: ‘-fcompare-debug’ failure (length) 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
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
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).