public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
@ 2020-10-08  9:27 vries at gcc dot gnu.org
  2020-10-08  9:36 ` [Bug tree-optimization/97333] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2020-10-08  9:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97333
           Summary: [gimple_can_duplicate_bb_p == false,
                    tree-ssa-threadupdate] ICE in duplicate_block, at
                    cfghooks.c:1093
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

With this patch:
...
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 406441751a9..b9168755155 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -6213,7 +6213,7 @@ gimple_split_block_before_cond_jump (basic_block bb)
 static bool
 gimple_can_duplicate_bb_p (const_basic_block bb ATTRIBUTE_UNUSED)
 {
-  return true;
+  return false;
 }

 /* Create a duplicate of the basic block BB.  NOTE: This does not
...
we run into:
...
spawn -ignore SIGHUP
/dev/shm/tdevries/data/master/2020-10-07T08-04-46-02-00-c475cfa435b/build/gcc/xgcc
-B/dev/shm/tdevries/data/master/2020-10-07T08-04-46-02-00-c475cfa435b/build/gcc/
-fdiagnostics-plain-output -O1 -w -c -o 20041018-1.o
/labs/tdevries/gcc/src/gcc/testsuite/gcc.c-torture/compile/20041018-1.c^M
during GIMPLE pass: dom^M
/labs/tdevries/gcc/src/gcc/testsuite/gcc.c-torture/compile/20041018-1.c: In
function 'foo':^M
/labs/tdevries/gcc/src/gcc/testsuite/gcc.c-torture/compile/20041018-1.c:2:1:
internal compiler error: in duplicate_block, at cfghooks.c:1093^M
0xbfebaf duplicate_block(basic_block_def*, edge_def*, basic_block_def*,
copy_bb_data*)^M
        /labs/tdevries/gcc/src/gcc/cfghooks.c:1093^M
0x16d794b create_block_for_threading^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:342^M
0x16d90e7 ssa_create_duplicates(redirection_data**, ssa_local_info_t*)^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:1130^M
0x16dfe86 void hash_table<redirection_data, false,
xcallocator>::traverse_noresize<ssa_local_info_t*,
&(ssa_create_duplicates(redirection_data**,
ssa_local_info_t*))>(ssa_local_info_t*)^M
        /labs/tdevries/gcc/src/gcc/hash-table.h:1081^M
0x16df31a void hash_table<redirection_data, false,
xcallocator>::traverse<ssa_local_info_t*,
&(ssa_create_duplicates(redirection_data**,
ssa_local_info_t*))>(ssa_local_info_t*)^M
        /labs/tdevries/gcc/src/gcc/hash-table.h:1102^M
0x16d9dff thread_block_1^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:1495^M
0x16d9ee5 thread_block^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:1539^M
0x16da3d7 thread_through_loop_header^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:1781^M
0x16dc767 thread_through_all_blocks(bool)^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:2667^M
0x15522d2 execute^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-dom.c:776^M
...

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

* [Bug tree-optimization/97333] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
@ 2020-10-08  9:36 ` rguenth at gcc dot gnu.org
  2020-10-09 13:38 ` vries at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-08  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks like the jump threading code fails to check can_duplicate_block_p ()
(because well, on GIMPLE we can duplicate all blocks).

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

* [Bug tree-optimization/97333] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
  2020-10-08  9:36 ` [Bug tree-optimization/97333] " rguenth at gcc dot gnu.org
@ 2020-10-09 13:38 ` vries at gcc dot gnu.org
  2020-10-15  8:51 ` vries at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2020-10-09 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> (because well, on GIMPLE we can duplicate all blocks).

I'm not sure I understand why, given that tracer.c has a can_duplicate_bb_p
that sometimes returns false.  Sent an RFC patch to ask for clarification:
https://gcc.gnu.org/pipermail/gcc-patches/2020-October/555890.html .

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

* [Bug tree-optimization/97333] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
  2020-10-08  9:36 ` [Bug tree-optimization/97333] " rguenth at gcc dot gnu.org
  2020-10-09 13:38 ` vries at gcc dot gnu.org
@ 2020-10-15  8:51 ` vries at gcc dot gnu.org
  2022-08-01 18:33 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2020-10-15  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #2)
> (In reply to Richard Biener from comment #1)
> > (because well, on GIMPLE we can duplicate all blocks).
> 
> I'm not sure I understand why, given that tracer.c has a can_duplicate_bb_p
> that sometimes returns false.  Sent an RFC patch to ask for clarification:
> https://gcc.gnu.org/pipermail/gcc-patches/2020-October/555890.html .

Committed as "[gimple] Move can_duplicate_bb_p to gimple_can_duplicate_bb_p" (
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=17d5739a6b103cdd3315f5d0e09fe8faa6620a03
).

Now gimple_can_duplicate_bb_p can return false.

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

* [Bug tree-optimization/97333] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-10-15  8:51 ` vries at gcc dot gnu.org
@ 2022-08-01 18:33 ` pinskia at gcc dot gnu.org
  2022-08-01 18:35 ` [Bug tree-optimization/97333] [13 Regression] " pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-01 18:33 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asolokha at gmx dot com

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 106497 has been marked as a duplicate of this bug. ***

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

* [Bug tree-optimization/97333] [13 Regression] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-08-01 18:33 ` pinskia at gcc dot gnu.org
@ 2022-08-01 18:35 ` pinskia at gcc dot gnu.org
  2022-08-01 18:46 ` [Bug tree-optimization/97333] [meta-bug] " pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-01 18:35 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
            Summary|[gimple_can_duplicate_bb_p  |[13 Regression]
                   |== false,                   |[gimple_can_duplicate_bb_p
                   |tree-ssa-threadupdate] ICE  |== false,
                   |in duplicate_block, at      |tree-ssa-threadupdate] ICE
                   |cfghooks.c:1093             |in duplicate_block, at
                   |                            |cfghooks.c:1093
     Ever confirmed|0                           |1
           Keywords|internal-improvement        |
   Last reconfirmed|                            |2022-08-01
   Target Milestone|---                         |13.0

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is now a regression after r13-1753-g26cea5f108e0facd.

testcase:
int n;

__attribute__ ((pure,returns_twice)) int
bar (void);

int
foo (int x)
{
  n = 0;

  bar ();

  if (x && n)
    return 0;

  foo (x);
}

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

* [Bug tree-optimization/97333] [meta-bug] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-08-01 18:35 ` [Bug tree-optimization/97333] [13 Regression] " pinskia at gcc dot gnu.org
@ 2022-08-01 18:46 ` pinskia at gcc dot gnu.org
  2022-08-01 18:47 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-01 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13 Regression]             |[meta-bug]
                   |[gimple_can_duplicate_bb_p  |[gimple_can_duplicate_bb_p
                   |== false,                   |== false,
                   |tree-ssa-threadupdate] ICE  |tree-ssa-threadupdate] ICE
                   |in duplicate_block, at      |in duplicate_block, at
                   |cfghooks.c:1093             |cfghooks.c:1093
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot gnu.org
         Depends on|                            |106422
   Target Milestone|13.0                        |---
           Keywords|                            |meta-bug


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106422
[Bug 106422] [13 Regression] ice in duplicate_block, at cfghooks.cc:1115

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

* [Bug tree-optimization/97333] [meta-bug] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-08-01 18:46 ` [Bug tree-optimization/97333] [meta-bug] " pinskia at gcc dot gnu.org
@ 2022-08-01 18:47 ` pinskia at gcc dot gnu.org
  2022-08-01 18:50 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-01 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since gimple_can_duplicate_bb_p can now return false for returns_twice, there
might be other regressions

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

* [Bug tree-optimization/97333] [meta-bug] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-08-01 18:47 ` pinskia at gcc dot gnu.org
@ 2022-08-01 18:50 ` pinskia at gcc dot gnu.org
  2022-08-02 11:31 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-01 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It might be useful do a test of having gimple_can_duplicate_bb_p return true
for all basic block again. as shown by PR 106497 and PR 106422 there definitely
is some in jump threading. And it might be able to flush out more of the issues
now that gimple_can_duplicate_bb_p will return false for returns_twice without
getting other bug reports ...

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

* [Bug tree-optimization/97333] [meta-bug] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-08-01 18:50 ` pinskia at gcc dot gnu.org
@ 2022-08-02 11:31 ` rguenth at gcc dot gnu.org
  2024-03-10  7:30 ` pinskia at gcc dot gnu.org
  2024-03-10 22:23 ` pinskia at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-02 11:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97333
Bug 97333 depends on bug 106497, which changed state.

Bug 106497 Summary: [13 Regression] ICE in duplicate_block, at cfghooks.cc:1115 since r13-1753-g26cea5f108e0facd
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106497

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

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

* [Bug tree-optimization/97333] [meta-bug] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2022-08-02 11:31 ` rguenth at gcc dot gnu.org
@ 2024-03-10  7:30 ` pinskia at gcc dot gnu.org
  2024-03-10 22:23 ` pinskia at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-10  7:30 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note if you have gimple_can_duplicate_bb_p return false always, you need to
disable -Werror as GCC's (target library) sources depend on some jump threading
so some warnings don't show up.

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

* [Bug tree-optimization/97333] [meta-bug] [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093
  2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2024-03-10  7:30 ` pinskia at gcc dot gnu.org
@ 2024-03-10 22:23 ` pinskia at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-10 22:23 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.0
             Status|NEW                         |RESOLVED

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I ran a bootstrap and test with gimple_can_duplicate_bb_p returning false
always. The only ICE was in the vectorizer while vectorizing OpenMP reduction
code. I tried to reproduce that ICE without the patch and could not get the
vectorizer to fail so closing as fixed.

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

end of thread, other threads:[~2024-03-10 22:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08  9:27 [Bug tree-optimization/97333] New: [gimple_can_duplicate_bb_p == false, tree-ssa-threadupdate] ICE in duplicate_block, at cfghooks.c:1093 vries at gcc dot gnu.org
2020-10-08  9:36 ` [Bug tree-optimization/97333] " rguenth at gcc dot gnu.org
2020-10-09 13:38 ` vries at gcc dot gnu.org
2020-10-15  8:51 ` vries at gcc dot gnu.org
2022-08-01 18:33 ` pinskia at gcc dot gnu.org
2022-08-01 18:35 ` [Bug tree-optimization/97333] [13 Regression] " pinskia at gcc dot gnu.org
2022-08-01 18:46 ` [Bug tree-optimization/97333] [meta-bug] " pinskia at gcc dot gnu.org
2022-08-01 18:47 ` pinskia at gcc dot gnu.org
2022-08-01 18:50 ` pinskia at gcc dot gnu.org
2022-08-02 11:31 ` rguenth at gcc dot gnu.org
2024-03-10  7:30 ` pinskia at gcc dot gnu.org
2024-03-10 22:23 ` pinskia 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).