public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions
@ 2022-01-28 2:51 asolokha at gmx dot com
2022-01-28 8:16 ` [Bug debug/104263] " rguenth at gcc dot gnu.org
` (15 more replies)
0 siblings, 16 replies; 17+ messages in thread
From: asolokha at gmx dot com @ 2022-01-28 2:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
Bug ID: 104263
Summary: [10/11/12 Regression] '-fcompare-debug' failure
(length) w/ -O2 -fnon-call-exceptions
-fno-inline-small-functions
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: compare-debug-failure
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
gcc 12.0.1 20220123 snapshot (g:2da90ad39bf8fa9ee287e040d1f4411cb7a2e7ed) fails
-fcompare-debug check when compiling the following testcase w/ -O2
-fnon-call-exceptions -fno-inline-small-functions:
int n;
int
bar (void)
{
int a;
n = 0;
a = 0;
return n;
}
__attribute__ ((pure, returns_twice)) int
foo (void)
{
n = bar () + 1;
foo ();
return 0;
}
% gcc-12.0.1 -O2 -fcompare-debug -fnon-call-exceptions
-fno-inline-small-functions -gno-statement-frontiers -c ovslsrlb.c
x86_64-pc-linux-gnu-gcc-12.0.1: error: ovslsrlb.c: '-fcompare-debug' failure
(length)
For x86_64 the difference looks like this, though the failure is not
target-specific:
--- ovslsrlb.c.gkd 2022-01-28 09:42:43.969435346 +0700
+++ ovslsrlb.gk.c.gkd 2022-01-28 09:42:43.987435394 +0700
@@ -40,8 +40,8 @@
(note # 0 0 [bb 2] NOTE_INSN_BASIC_BLOCK)
(note # 0 0 NOTE_INSN_PROLOGUE_END)
(note # 0 0 NOTE_INSN_FUNCTION_BEG)
-(insn:TI # 0 0 2 (set (mem/c:SI (symbol_ref:DI ("n") [flags 0x2] <var_decl #
n>) [ MEM[(int *)&n]+0 S4 A32])
- (const_int 1 [0x1])) "ovslsrlb.c":8:5# {*movsi_internal}
+(insn:TI # 0 0 2 (set (mem/c:SI (symbol_ref:DI ("n") [flags 0x2] <var_decl #
n>) [ n+0 S4 A32])
+ (const_int 1 [0x1])) "ovslsrlb.c":17:5# {*movsi_internal}
(nil))
(insn # 0 0 2 (parallel [
(set (reg:DI 0 ax)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug debug/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
@ 2022-01-28 8:16 ` rguenth at gcc dot gnu.org
2022-01-28 8:22 ` [Bug tree-optimization/104263] " rguenth at gcc dot gnu.org
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-28 8:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.4
Ever confirmed|0 |1
Last reconfirmed| |2022-01-28
Priority|P3 |P2
Status|UNCONFIRMED |NEW
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. Caused by store-merging:
-Coalescing successful!
-Merged into 1 stores
-New sequence of 1 stores to replace old one of 2 stores
-Merging successful!
__attribute__((returns_twice, pure))
int foo ()
{
<bb 2> [local count: 1073741824]:
+ # DEBUG BEGIN_STMT
+ # DEBUG INLINE_ENTRY bar
+ # DEBUG BEGIN_STMT
+ # DEBUG BEGIN_STMT
+ n = 0;
+ # DEBUG BEGIN_STMT
+ # DEBUG a => 0
+ # DEBUG BEGIN_STMT
<bb 3> [local count: 1073312329]:
- MEM[(int *)&n] = 1;
+ n = 1;
+ # DEBUG BEGIN_STMT
<bb 4> [local count: 1073741824]:
+ # DEBUG BEGIN_STMT
return 0;
<bb 5> [local count: 429496]:
so we fail to merge n = 0 and n = 1 with -g.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
2022-01-28 8:16 ` [Bug debug/104263] " rguenth at gcc dot gnu.org
@ 2022-01-28 8:22 ` rguenth at gcc dot gnu.org
2022-01-28 9:33 ` jakub at gcc dot gnu.org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-28 8:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note we have an abnormal edge from BB2 to the abnormal dispatcher (missed
optimization, we should get rid of it), but the last stmts in the abnormal
edge sources are debug vs. non-debug stmts (but neither are calls which
are the only sources of abnormal control flow - thus the missed optimization,
to be rectified in CFG cleanup I guess or some pass missing to call
abnormal cleanup - that would be IPA inlining in this case).
int foo ()
{
;; basic block 2, loop depth 0
;; pred: ENTRY
# DEBUG BEGIN_STMT
# DEBUG INLINE_ENTRY bar
# DEBUG BEGIN_STMT
# DEBUG BEGIN_STMT
n = 0;
# DEBUG BEGIN_STMT
# DEBUG a => 0
# DEBUG BEGIN_STMT
;; succ: 3
;; 5
;; basic block 3, loop depth 0
;; pred: 2
n = 1;
# DEBUG BEGIN_STMT
;; succ: 4
;; basic block 4, loop depth 0
;; pred: 3
;; 5
# DEBUG BEGIN_STMT
return 0;
;; succ: EXIT
;; basic block 5, loop depth 0
;; pred: 2
.ABNORMAL_DISPATCHER (0);
;; succ: 4
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
2022-01-28 8:16 ` [Bug debug/104263] " rguenth at gcc dot gnu.org
2022-01-28 8:22 ` [Bug tree-optimization/104263] " rguenth at gcc dot gnu.org
@ 2022-01-28 9:33 ` jakub at gcc dot gnu.org
2022-01-28 9:50 ` [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531 marxin at gcc dot gnu.org
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-28 9:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'll have a look.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (2 preceding siblings ...)
2022-01-28 9:33 ` jakub at gcc dot gnu.org
@ 2022-01-28 9:50 ` marxin at gcc dot gnu.org
2022-01-28 9:54 ` rguenth at gcc dot gnu.org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-28 9:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11/12 Regression] |[10/11/12 Regression]
|'-fcompare-debug' failure |'-fcompare-debug' failure
|(length) w/ -O2 |(length) w/ -O2
|-fnon-call-exceptions |-fnon-call-exceptions
|-fno-inline-small-functions |-fno-inline-small-functions
| |since
| |r10-3575-g629387a6586a7531
CC| |ebotcazou at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-3575-g629387a6586a7531.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (3 preceding siblings ...)
2022-01-28 9:50 ` [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531 marxin at gcc dot gnu.org
@ 2022-01-28 9:54 ` rguenth at gcc dot gnu.org
2022-01-28 9:54 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-28 9:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so with the abnormal edges the issue is that DCE1 removes the recursive
call to foo () (because the function is "wrongly" pure) which causes us to
clear
cfun->calls_setjmp but then any further gimple_purge_dead_abnormal_call_edges
will simply do nothing (as premature optimization one could guess). So the
bug would be that we fail to wipe all abnormal edges when a function no
longer calls setjmp or has a nonlocal label.
The easiest fix is to remove the premature optimization in
gimple_purge_dead_abnormal_call_edges. That leaves the abnormal edges from
bar() even after DCE removes the recursive call to foo() (still a missed
optimization) but it at least will not leave us with stray abnormal edges
from non-call / non-computed goto stmts in the IL.
It also resolves the compare-debug failure for this testcase (but maybe there's
a latent issue in store-merging still).
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (4 preceding siblings ...)
2022-01-28 9:54 ` rguenth at gcc dot gnu.org
@ 2022-01-28 9:54 ` rguenth at gcc dot gnu.org
2022-01-28 10:37 ` jakub at gcc dot gnu.org
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-28 9:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm testing a patch to gimple_purge_dead_abnormal_call_edges, leaving the
store-merging issue to Jakub.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (5 preceding siblings ...)
2022-01-28 9:54 ` rguenth at gcc dot gnu.org
@ 2022-01-28 10:37 ` jakub at gcc dot gnu.org
2022-01-28 10:48 ` ebotcazou at gcc dot gnu.org
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-28 10:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52309
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52309&action=edit
gcc12-pr104263.patch
Untested fix for the store-merging bug.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (6 preceding siblings ...)
2022-01-28 10:37 ` jakub at gcc dot gnu.org
@ 2022-01-28 10:48 ` ebotcazou at gcc dot gnu.org
2022-01-28 12:30 ` cvs-commit at gcc dot gnu.org
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-01-28 10:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #8 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Untested fix for the store-merging bug.
FWIW it looks good to me, thanks!
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (7 preceding siblings ...)
2022-01-28 10:48 ` ebotcazou at gcc dot gnu.org
@ 2022-01-28 12:30 ` cvs-commit at gcc dot gnu.org
2022-01-28 18:03 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-28 12:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #9 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:5b6f04276e3d1f20817ed37b2e26e43bd12cc0d2
commit r12-6917-g5b6f04276e3d1f20817ed37b2e26e43bd12cc0d2
Author: Richard Biener <rguenther@suse.de>
Date: Fri Jan 28 10:55:29 2022 +0100
tree-optimization/104263 - avoid retaining abnormal edges for non-call/goto
stmts
This removes a premature optimization from
gimple_purge_dead_abnormal_call_edges which, after eliding the
last setjmp (or computed goto) statement from a function and
thus clearing cfun->calls_setjmp, leaves us with the abnormal
edges from other calls that are elided for example via inlining
or DCE. That's a CFG / IL combination that should be impossible
(not addressing the fact that with cfun->calls_setjmp and
cfun->has_nonlocal_label cleared we should not have any abnormal
edge at all).
For the testcase in the PR this means that IPA inlining will
remove the abormal edges from the block after inlining the call
the edge was coming from.
2022-01-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/104263
* tree-cfg.cc (gimple_purge_dead_abnormal_call_edges):
Purge edges also when !cfun->has_nonlocal_label
and !cfun->calls_setjmp.
* gcc.dg/tree-ssa/inline-13.c: New testcase.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (8 preceding siblings ...)
2022-01-28 12:30 ` cvs-commit at gcc dot gnu.org
@ 2022-01-28 18:03 ` cvs-commit at gcc dot gnu.org
2022-01-28 18:05 ` [Bug tree-optimization/104263] [10/11 " jakub at gcc dot gnu.org
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-28 18:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #10 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:a591c71b41e18e4ff86852a974592af4962aef57
commit r12-6923-ga591c71b41e18e4ff86852a974592af4962aef57
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jan 28 19:02:26 2022 +0100
store-merging: Fix up a -fcompare-debug bug in get_status_for_store_merging
[PR104263]
As mentioned in the PRthe following testcase fails, because the last
stmt of a bb with -g is a debug stmt and get_status_for_store_merging
uses gimple_seq_last_stmt (bb_seq (bb)) when testing if it is valid
for store merging. The debug stmt isn't valid, while a stmt at that
position with -g0 is valid and so the divergence.
As we walk the whole bb already, this patch just remembers the last
non-debug stmt, so that we don't need to skip backwards debug stmts at the
end of the bb to find last real stmt.
2022-01-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/104263
* gimple-ssa-store-merging.cc (get_status_for_store_merging): For
cfun->can_throw_non_call_exceptions && cfun->eh test whether
last non-debug stmt in the bb is store_valid_for_store_merging_p
rather than last stmt.
* gcc.dg/pr104263.c: New test.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (9 preceding siblings ...)
2022-01-28 18:03 ` cvs-commit at gcc dot gnu.org
@ 2022-01-28 18:05 ` jakub at gcc dot gnu.org
2022-02-19 8:02 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-28 18:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11/12 Regression] |[10/11 Regression]
|'-fcompare-debug' failure |'-fcompare-debug' failure
|(length) w/ -O2 |(length) w/ -O2
|-fnon-call-exceptions |-fnon-call-exceptions
|-fno-inline-small-functions |-fno-inline-small-functions
|since |since
|r10-3575-g629387a6586a7531 |r10-3575-g629387a6586a7531
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10/11 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (10 preceding siblings ...)
2022-01-28 18:05 ` [Bug tree-optimization/104263] [10/11 " jakub at gcc dot gnu.org
@ 2022-02-19 8:02 ` cvs-commit at gcc dot gnu.org
2022-02-19 8:07 ` [Bug tree-optimization/104263] [10 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-19 8:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:73b30d18a04bd6efa7e25c28dac1c863dc1cb06e
commit r11-9595-g73b30d18a04bd6efa7e25c28dac1c863dc1cb06e
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jan 28 19:02:26 2022 +0100
store-merging: Fix up a -fcompare-debug bug in get_status_for_store_merging
[PR104263]
As mentioned in the PRthe following testcase fails, because the last
stmt of a bb with -g is a debug stmt and get_status_for_store_merging
uses gimple_seq_last_stmt (bb_seq (bb)) when testing if it is valid
for store merging. The debug stmt isn't valid, while a stmt at that
position with -g0 is valid and so the divergence.
As we walk the whole bb already, this patch just remembers the last
non-debug stmt, so that we don't need to skip backwards debug stmts at the
end of the bb to find last real stmt.
2022-01-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/104263
* gimple-ssa-store-merging.c (get_status_for_store_merging): For
cfun->can_throw_non_call_exceptions && cfun->eh test whether
last non-debug stmt in the bb is store_valid_for_store_merging_p
rather than last stmt.
* gcc.dg/pr104263.c: New test.
(cherry picked from commit a591c71b41e18e4ff86852a974592af4962aef57)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (11 preceding siblings ...)
2022-02-19 8:02 ` cvs-commit at gcc dot gnu.org
@ 2022-02-19 8:07 ` jakub at gcc dot gnu.org
2022-02-25 1:20 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-19 8:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11 Regression] |[10 Regression]
|'-fcompare-debug' failure |'-fcompare-debug' failure
|(length) w/ -O2 |(length) w/ -O2
|-fnon-call-exceptions |-fnon-call-exceptions
|-fno-inline-small-functions |-fno-inline-small-functions
|since |since
|r10-3575-g629387a6586a7531 |r10-3575-g629387a6586a7531
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.3+ too.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (12 preceding siblings ...)
2022-02-19 8:07 ` [Bug tree-optimization/104263] [10 " jakub at gcc dot gnu.org
@ 2022-02-25 1:20 ` cvs-commit at gcc dot gnu.org
2022-05-10 8:23 ` cvs-commit at gcc dot gnu.org
2022-05-10 10:19 ` jakub at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-25 1:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alexandre Oliva <aoliva@gcc.gnu.org>:
https://gcc.gnu.org/g:33c7df5854ecb31e2d645ab672ad3987b591ebfd
commit r12-7383-g33c7df5854ecb31e2d645ab672ad3987b591ebfd
Author: Alexandre Oliva <oliva@adacore.com>
Date: Thu Feb 24 22:03:38 2022 -0300
Add testcase from PR103845
This problem was already fixed as part of PR104263: the abnormal edge
that remained from before inlining didn't make sense after inlining.
So this patch adds only the testcase.
for gcc/testsuite/ChangeLog
PR tree-optimization/103845
PR tree-optimization/104263
* gcc.dg/pr103845.c: New.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (13 preceding siblings ...)
2022-02-25 1:20 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 8:23 ` cvs-commit at gcc dot gnu.org
2022-05-10 10:19 ` jakub at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 8:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:7bb29feb789dfa05297998e1c241d438307cc3d2
commit r10-10671-g7bb29feb789dfa05297998e1c241d438307cc3d2
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jan 28 19:02:26 2022 +0100
store-merging: Fix up a -fcompare-debug bug in get_status_for_store_merging
[PR104263]
As mentioned in the PRthe following testcase fails, because the last
stmt of a bb with -g is a debug stmt and get_status_for_store_merging
uses gimple_seq_last_stmt (bb_seq (bb)) when testing if it is valid
for store merging. The debug stmt isn't valid, while a stmt at that
position with -g0 is valid and so the divergence.
As we walk the whole bb already, this patch just remembers the last
non-debug stmt, so that we don't need to skip backwards debug stmts at the
end of the bb to find last real stmt.
2022-01-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/104263
* gimple-ssa-store-merging.c (get_status_for_store_merging): For
cfun->can_throw_non_call_exceptions && cfun->eh test whether
last non-debug stmt in the bb is store_valid_for_store_merging_p
rather than last stmt.
* gcc.dg/pr104263.c: New test.
(cherry picked from commit a591c71b41e18e4ff86852a974592af4962aef57)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/104263] [10 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
` (14 preceding siblings ...)
2022-05-10 8:23 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 10:19 ` jakub at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-10 10:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104263
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.4 too.
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2022-05-10 10:19 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28 2:51 [Bug debug/104263] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions asolokha at gmx dot com
2022-01-28 8:16 ` [Bug debug/104263] " rguenth at gcc dot gnu.org
2022-01-28 8:22 ` [Bug tree-optimization/104263] " rguenth at gcc dot gnu.org
2022-01-28 9:33 ` jakub at gcc dot gnu.org
2022-01-28 9:50 ` [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531 marxin at gcc dot gnu.org
2022-01-28 9:54 ` rguenth at gcc dot gnu.org
2022-01-28 9:54 ` rguenth at gcc dot gnu.org
2022-01-28 10:37 ` jakub at gcc dot gnu.org
2022-01-28 10:48 ` ebotcazou at gcc dot gnu.org
2022-01-28 12:30 ` cvs-commit at gcc dot gnu.org
2022-01-28 18:03 ` cvs-commit at gcc dot gnu.org
2022-01-28 18:05 ` [Bug tree-optimization/104263] [10/11 " jakub at gcc dot gnu.org
2022-02-19 8:02 ` cvs-commit at gcc dot gnu.org
2022-02-19 8:07 ` [Bug tree-optimization/104263] [10 " jakub at gcc dot gnu.org
2022-02-25 1:20 ` cvs-commit at gcc dot gnu.org
2022-05-10 8:23 ` cvs-commit at gcc dot gnu.org
2022-05-10 10:19 ` 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).