public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/109777] New: [14 regression] Compare-debug failure after recent changes
@ 2023-05-08 18:20 law at gcc dot gnu.org
2023-05-08 18:38 ` [Bug middle-end/109777] " pinskia at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: law at gcc dot gnu.org @ 2023-05-08 18:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109777
Bug ID: 109777
Summary: [14 regression] Compare-debug failure after recent
changes
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: law at gcc dot gnu.org
Target Milestone: ---
This change:
commit 21e2ef2dc25de318de29ec32d5390350c6717c6a (refs/bisect/bad)
Author: Andrew Pinski <apinski@marvell.com>
Date: Tue May 2 00:10:46 2023 -0700
Move substitute_and_fold over to use simple_dce_from_worklist
While looking into a different issue, I noticed that it
would take until the second forwprop pass to do some
forward proping and it was because the ssa name was
used more than once but the second statement was
"dead" and we don't remove that until much later.
So this uses simple_dce_from_worklist instead of manually
removing of the known unused statements instead.
Propagate engine does not do a cleanupcfg afterwards either but manually
cleans up possible EH edges so simple_dce_from_worklist
needs to communicate that back to the propagate engine.
Some testcases needed to be updated/changed even because of better
optimization.
gcc.dg/pr81192.c even had to be changed to be using the gimple FE so it
would
be less fragile in the future too.
gcc.dg/tree-ssa/pr98737-1.c was failing because __atomic_fetch_ was being
matched
but in those cases, the result was not being used so both __atomic_fetch_
and
__atomic_x_and_fetch_ are valid choices and would not make a code
generation difference.
evrp7.c, evrp8.c, vrp35.c, vrp36.c: just needed a slightly change as the
removal message
is different slightly.
kernels-alias-8.c: ccp1 is able to remove an unused load which causes
ealias to have
one less load to analysis so update the expected scan #.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
PR tree-optimization/109691
* tree-ssa-dce.cc (simple_dce_from_worklist): Add need_eh_cleanup
argument.
If the removed statement can throw, have need_eh_cleanup
include the bb of that statement.
* tree-ssa-dce.h (simple_dce_from_worklist): Update declaration.
* tree-ssa-propagate.cc (struct prop_stats_d): Remove
num_dce.
(substitute_and_fold_dom_walker::substitute_and_fold_dom_walker):
Initialize dceworklist instead of stmts_to_remove.
(substitute_and_fold_dom_walker::~substitute_and_fold_dom_walker):
Destore dceworklist instead of stmts_to_remove.
(substitute_and_fold_dom_walker::before_dom_children):
Set dceworklist instead of adding to stmts_to_remove.
(substitute_and_fold_engine::substitute_and_fold):
Call simple_dce_from_worklist instead of poping
from the list.
Don't update the stat on removal statements.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/evrp7.c: Update for output change.
* gcc.dg/tree-ssa/evrp8.c: Likewise.
* gcc.dg/tree-ssa/vrp35.c: Likewise.
* gcc.dg/tree-ssa/vrp36.c: Likewise.
* gcc.dg/tree-ssa/pr98737-1.c: Update scan-tree-dump-not
to check for assignment too instead of just a call.
* c-c++-common/goacc/kernels-alias-8.c: Update test
for removal of load.
* gcc.dg/pr81192.c: Rewrite testcase in gimple based test.
Is triggering a compare-debug failure on the bfin-elf port:
bfin-sim: gcc.dg/pr44023.c (test for excess errors)
If you dig into the log file:
xgcc: error: /home/jlaw/test/gcc/gcc/testsuite/gcc.dg/pr44023.c:
'-fcompare-debug' failure (length)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/109777] [14 regression] Compare-debug failure after recent changes
2023-05-08 18:20 [Bug tree-optimization/109777] New: [14 regression] Compare-debug failure after recent changes law at gcc dot gnu.org
@ 2023-05-08 18:38 ` pinskia at gcc dot gnu.org
2023-05-08 18:51 ` [Bug target/109777] " pinskia at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-08 18:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109777
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |compare-debug-failure
Target Milestone|--- |14.0
Component|tree-optimization |middle-end
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This could be a latent bug, Let me at least look into where the compare debug
issue is coming from.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/109777] [14 regression] Compare-debug failure after recent changes
2023-05-08 18:20 [Bug tree-optimization/109777] New: [14 regression] Compare-debug failure after recent changes law at gcc dot gnu.org
2023-05-08 18:38 ` [Bug middle-end/109777] " pinskia at gcc dot gnu.org
@ 2023-05-08 18:51 ` pinskia at gcc dot gnu.org
2023-05-08 19:05 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-08 18:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109777
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Component|middle-end |target
Status|UNCONFIRMED |NEW
Last reconfirmed| |2023-05-08
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The place where the first difference in IR (not withstanding the debug insns)
is mach.
Without -g, there is an forced_nop instruction being added:
(insn:SI # # # 6 (set (reg:SI 3 R3 [177])
(ashift:SI (reg:SI 4 R4 [orig:87 x$0 ] [87])
(const_int 1 [0x1]))) "t.c":44:47# {*ashlsi3_insn}
(nil))
(insn:SI # # # 6 (set (reg:SI 2 R2)
(mem/c:SI (plus:SI (reg/f:SI 14 SP)
(const_int 8 [0x8])) [4 %sfp+-4 S4 A32])) "t.c":44:47#
{*movsi_insn}
(nil))
(insn:QI # # # 6 (unspec [
(const_int 0 [0])
] 12) "t.c":44:47# {forced_nop}
(nil))
(insn:TI # # # 6 (set (reg:SI 6 R6)
(reg:SI 19 I3 [165])) "t.c":44:53# {*movsi_insn}
(nil))
While with -g, it is not there:
(insn:TI # # # 6 (set (reg:SI 3 R3 [177])
(ashift:SI (reg:SI 4 R4 [orig:87 x$0 ] [87])
(const_int 1 [0x1]))) "t.c":44:47# {*ashlsi3_insn}
(nil))
(debug_insn # # # 6 (var_location:SI D#14 (ior:SI (reg:SI 3 R3 [177])
(const_int 31 [0x1f])))#
(nil))
(insn # # # 6 (set (reg:SI 2 R2)
(mem/c:SI (plus:SI (reg/f:SI 14 SP)
(const_int 8 [0x8])) [4 %sfp+-4 S4 A32])) "t.c":45:14#
{*movsi_insn}
(nil))
(insn:TI # # # 6 (set (reg:SI 6 R6)
(reg:SI 19 I3 [165])) "t.c":44:53# {*movsi_insn}
(nil))
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/109777] [14 regression] Compare-debug failure after recent changes
2023-05-08 18:20 [Bug tree-optimization/109777] New: [14 regression] Compare-debug failure after recent changes law at gcc dot gnu.org
2023-05-08 18:38 ` [Bug middle-end/109777] " pinskia at gcc dot gnu.org
2023-05-08 18:51 ` [Bug target/109777] " pinskia at gcc dot gnu.org
@ 2023-05-08 19:05 ` pinskia at gcc dot gnu.org
2023-05-08 19:37 ` law at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-08 19:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109777
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Something is going different inside bfin_gen_bundles with and without debug
instructions but that is all I can tell from my quick debugging.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/109777] [14 regression] Compare-debug failure after recent changes
2023-05-08 18:20 [Bug tree-optimization/109777] New: [14 regression] Compare-debug failure after recent changes law at gcc dot gnu.org
` (2 preceding siblings ...)
2023-05-08 19:05 ` pinskia at gcc dot gnu.org
@ 2023-05-08 19:37 ` law at gcc dot gnu.org
2023-05-08 19:52 ` pinskia at gcc dot gnu.org
2024-05-07 7:40 ` [Bug target/109777] [14/15 " rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: law at gcc dot gnu.org @ 2023-05-08 19:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109777
Jeffrey A. Law <law at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
--- Comment #4 from Jeffrey A. Law <law at gcc dot gnu.org> ---
If it's inside the bfin bundling code, let's just mark it as a p4 and we can
chase it down whenever it's convenient. My primary motivation is to catch
generic issues. A target specific issue on a barely used target just isn't
that interesting IMHO.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/109777] [14 regression] Compare-debug failure after recent changes
2023-05-08 18:20 [Bug tree-optimization/109777] New: [14 regression] Compare-debug failure after recent changes law at gcc dot gnu.org
` (3 preceding siblings ...)
2023-05-08 19:37 ` law at gcc dot gnu.org
@ 2023-05-08 19:52 ` pinskia at gcc dot gnu.org
2024-05-07 7:40 ` [Bug target/109777] [14/15 " rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-08 19:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109777
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #4)
> If it's inside the bfin bundling code, let's just mark it as a p4 and we can
> chase it down whenever it's convenient. My primary motivation is to catch
> generic issues. A target specific issue on a barely used target just isn't
> that interesting IMHO.
Thanks, it actaully might be the scheduler which is introducing the difference
such that bfin bundling is different.
I just noticed the modes of the two instructions:
(insn:SI # # # 6 (set (reg:SI 3 R3 [177])
(ashift:SI (reg:SI 4 R4 [orig:87 x$0 ] [87])
(const_int 1 [0x1]))) "t.c":44:47# {*ashlsi3_insn}
(nil))
vs with -g:
(insn:TI # # # 6 (set (reg:SI 3 R3 [177])
(ashift:SI (reg:SI 4 R4 [orig:87 x$0 ] [87])
(const_int 1 [0x1]))) "t.c":44:47# {*ashlsi3_insn}
(nil))
---
I think this is caused by having the debug insn afterwards:
(debug_insn # # # 6 (var_location:SI D#14 (ior:SI (reg:SI 3 R3 [177])
(const_int 31 [0x1f])))#
(nil))
which might be saying it is scheduled with the above one while without -g, it
is not schedule with another instruction; hence the SImode.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/109777] [14/15 regression] Compare-debug failure after recent changes
2023-05-08 18:20 [Bug tree-optimization/109777] New: [14 regression] Compare-debug failure after recent changes law at gcc dot gnu.org
` (4 preceding siblings ...)
2023-05-08 19:52 ` pinskia at gcc dot gnu.org
@ 2024-05-07 7:40 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-07 7:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109777
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|14.0 |14.2
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 14.1 is being released, retargeting bugs to GCC 14.2.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-05-07 7:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08 18:20 [Bug tree-optimization/109777] New: [14 regression] Compare-debug failure after recent changes law at gcc dot gnu.org
2023-05-08 18:38 ` [Bug middle-end/109777] " pinskia at gcc dot gnu.org
2023-05-08 18:51 ` [Bug target/109777] " pinskia at gcc dot gnu.org
2023-05-08 19:05 ` pinskia at gcc dot gnu.org
2023-05-08 19:37 ` law at gcc dot gnu.org
2023-05-08 19:52 ` pinskia at gcc dot gnu.org
2024-05-07 7:40 ` [Bug target/109777] [14/15 " 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).