public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108825] New: error during GIMPLE pass: unrolljam
@ 2023-02-16 17:34 dcb314 at hotmail dot com
  2023-02-16 17:50 ` [Bug tree-optimization/108825] [13 Regression] " pinskia at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-16 17:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108825
           Summary: error during GIMPLE pass: unrolljam
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C code: 

safe_mul_func_uint8_t_u_u_ui2, g_231, g_277_1, g_568, func_35___trans_tmp_10;
g_81[7];
g_96[];
char func_35___trans_tmp_11;
safe_add_func_int32_t_s_s(si1, si2) { return si1 > 647 - si2 ?: si1; }
func_35() {
  for (; g_277_1; g_277_1 += 1) {
    g_231 = 0;
    for (; g_231 <= 6; g_231 += 1) {
      func_35___trans_tmp_10 =
          safe_add_func_int32_t_s_s(g_81[g_231], g_568 || g_96[1]);
      func_35___trans_tmp_11 =
          func_35___trans_tmp_10 * safe_mul_func_uint8_t_u_u_ui2;
      g_81[g_231] = func_35___trans_tmp_11;
    }
  }
}

compiled by recent gcc, does this:

$ ~/gcc/results/bin/gcc -c -O3 -w bug885.c
bug885.c: In function ‘func_35’:
bug885.c:6:1: error: definition in block 43 does not dominate use in block 44
    6 | func_35() {
      | ^~~~~~~
for SSA_NAME: _96 in statement:
_99 = (char) _96;
during GIMPLE pass: unrolljam
bug885.c:6:1: internal compiler error: verify_ssa failed
0x1027185 verify_ssa(bool, bool)
        ../../trunk.d1/gcc/tree-ssa.cc:1211

The bug first seems to occur sometime between g:4acc4c2be84d6607,
dated 20221101 and g:d0a3d55ae4a2656f, dated 20221130.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
@ 2023-02-16 17:50 ` pinskia at gcc dot gnu.org
  2023-02-16 18:37 ` dcb314 at hotmail dot com
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-16 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Keywords|                            |ice-checking
            Summary|error during GIMPLE pass:   |[13 Regression] error
                   |unrolljam                   |during GIMPLE pass:
                   |                            |unrolljam
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-02-16
   Target Milestone|---                         |13.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Slightly better testcase:
```

int safe_mul_func_uint8_t_u_u_ui2, g_231, g_277_1, g_568,
func_35___trans_tmp_10;
int g_81[7];
extern int g_96[];
char func_35___trans_tmp_11;
static inline int safe_add_func_int32_t_s_s(int si1, int si2) { return si1 >
647 - si2 ?: si1; }
void func_35() {
  for (; g_277_1; g_277_1 += 1) {
    g_231 = 0;
    for (; g_231 <= 6; g_231 += 1) {
      func_35___trans_tmp_10 =
          safe_add_func_int32_t_s_s(g_81[g_231], g_568 || g_96[1]);
      func_35___trans_tmp_11 =
          func_35___trans_tmp_10 * safe_mul_func_uint8_t_u_u_ui2;
      g_81[g_231] = func_35___trans_tmp_11;
    }
  }
}
```

Confirmed:
  <bb 42> [local count: 47303694]:
  if (0 != 0)
    goto <bb 44>; [50.00%]
  else
    goto <bb 43>; [50.00%]

  <bb 43> [local count: 23651847]:
  _94 = _7 * prephitmp_71;

  <bb 44> [local count: 47303694]:
  _97 = (int) _94;

Obvious the cfgcleanup will remove the branch and it will become valid but I
have no idea if it is latent otherwise.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
  2023-02-16 17:50 ` [Bug tree-optimization/108825] [13 Regression] " pinskia at gcc dot gnu.org
@ 2023-02-16 18:37 ` dcb314 at hotmail dot com
  2023-02-16 18:54 ` dcb314 at hotmail dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-16 18:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
Trying revision 1191a412bb17a734.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
  2023-02-16 17:50 ` [Bug tree-optimization/108825] [13 Regression] " pinskia at gcc dot gnu.org
  2023-02-16 18:37 ` dcb314 at hotmail dot com
@ 2023-02-16 18:54 ` dcb314 at hotmail dot com
  2023-02-16 19:43 ` dcb314 at hotmail dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-16 18:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #2)
> Trying revision 1191a412bb17a734.

Seems bad. Trying 59ad8b684dd67e17.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2023-02-16 18:54 ` dcb314 at hotmail dot com
@ 2023-02-16 19:43 ` dcb314 at hotmail dot com
  2023-02-16 20:10 ` dcb314 at hotmail dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-16 19:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
git range now seems to be g:59ad8b684dd67e17 .. g:3b54cc9d04c2efb2,
which is 103 commits.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2023-02-16 19:43 ` dcb314 at hotmail dot com
@ 2023-02-16 20:10 ` dcb314 at hotmail dot com
  2023-02-16 20:44 ` dcb314 at hotmail dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-16 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #4)
> git range now seems to be g:59ad8b684dd67e17 .. g:3b54cc9d04c2efb2,
> which is 103 commits.

git range now seems to be g:0cbb756fe9c8e13a .. g:3b54cc9d04c2efb2,
which is 26 commits.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2023-02-16 20:10 ` dcb314 at hotmail dot com
@ 2023-02-16 20:44 ` dcb314 at hotmail dot com
  2023-02-16 20:48 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-16 20:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
git range now seems to be g:0cbb756fe9c8e13a .. g:bd044dae51caea3c,
which is 6 commits.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2023-02-16 20:44 ` dcb314 at hotmail dot com
@ 2023-02-16 20:48 ` pinskia at gcc dot gnu.org
  2023-02-16 21:01 ` dcb314 at hotmail dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-16 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to David Binderman from comment #6)
> git range now seems to be g:0cbb756fe9c8e13a .. g:bd044dae51caea3c,
> which is 6 commits.

Most likely r13-3875-g9e11ceef165bc0 .

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2023-02-16 20:48 ` pinskia at gcc dot gnu.org
@ 2023-02-16 21:01 ` dcb314 at hotmail dot com
  2023-02-16 21:40 ` dcb314 at hotmail dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-16 21:01 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenther at suse dot de

--- Comment #8 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Andrew Pinski from comment #7)
> (In reply to David Binderman from comment #6)
> > git range now seems to be g:0cbb756fe9c8e13a .. g:bd044dae51caea3c,
> > which is 6 commits.
> 
> Most likely r13-3875-g9e11ceef165bc0 .

Agreed. Over to Richard for their best advice.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2023-02-16 21:01 ` dcb314 at hotmail dot com
@ 2023-02-16 21:40 ` dcb314 at hotmail dot com
  2023-02-17  8:01 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-16 21:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #8)
> (In reply to Andrew Pinski from comment #7)
> > (In reply to David Binderman from comment #6)
> > > git range now seems to be g:0cbb756fe9c8e13a .. g:bd044dae51caea3c,
> > > which is 6 commits.
> > 
> > Most likely r13-3875-g9e11ceef165bc0 .
> 
> Agreed. Over to Richard for their best advice.

Bisection finished. It does appear to be this revision.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2023-02-16 21:40 ` dcb314 at hotmail dot com
@ 2023-02-17  8:01 ` rguenth at gcc dot gnu.org
  2023-02-20  8:53 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-02-17  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (9 preceding siblings ...)
  2023-02-17  8:01 ` rguenth at gcc dot gnu.org
@ 2023-02-20  8:53 ` rguenth at gcc dot gnu.org
  2023-02-20 10:04 ` cvs-commit at gcc dot gnu.org
  2023-02-20 10:32 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-02-20  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-bisection             |

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is that unroll-and-jam applies RPO VN on the transformed body but
that leaves the IL in "indetermined" state (it returns a TODO to make it valid
again).  But unroll-and-jam then continues to transform another loop and
in using the tree_unroll_loop helper runs into tree_transform_and_unroll_loop
performing IL checking

  checking_verify_flow_info ();
  checking_verify_loop_structure ();
  checking_verify_loop_closed_ssa (true, loop);
  if (new_loop)
    checking_verify_loop_closed_ssa (true, new_loop);

in particular the loop-specific LC SSA verifiers run function-wide SSA
verification.

In generally IL verification in these kind of helpers is frowned upon since
it easily results in quadraticness when checking is enabled.

I'm "fixing" the loop-local LC SSA verifier to not perform function-wide
SSA verification but the real fix would be to delete all of the above
(and rely on after-pass IL verification).

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (10 preceding siblings ...)
  2023-02-20  8:53 ` rguenth at gcc dot gnu.org
@ 2023-02-20 10:04 ` cvs-commit at gcc dot gnu.org
  2023-02-20 10:32 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-20 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 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:ae113080a9f98e807db239f3ad2157c64324542f

commit r13-6138-gae113080a9f98e807db239f3ad2157c64324542f
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Feb 20 09:54:37 2023 +0100

    tree-optimization/108825 - checking ICE with unroll-and-jam

    The issue is that unroll-and-jam applies RPO VN on the transformed body but
    that leaves the IL in "indetermined" state (it returns a TODO to make it
    valid again).  But unroll-and-jam then continues to transform another loop
and
    in using the tree_unroll_loop helper runs into
tree_transform_and_unroll_loop
    performing IL checking on the whole function.

    While the real fix is to elide all such checking I'm only making the
    loop-local LC SSA verifier not perform function-wide SSA verification
    at this point.

            PR tree-optimization/108825
            * tree-ssa-loop-manip.cc (verify_loop_closed_ssa): For
            loop-local verfication only verify there's no pending SSA
            update.

            * gcc.dg/torture/pr108825.c: New testcase.

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

* [Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam
  2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
                   ` (11 preceding siblings ...)
  2023-02-20 10:04 ` cvs-commit at gcc dot gnu.org
@ 2023-02-20 10:32 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-02-20 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-02-20 10:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16 17:34 [Bug c/108825] New: error during GIMPLE pass: unrolljam dcb314 at hotmail dot com
2023-02-16 17:50 ` [Bug tree-optimization/108825] [13 Regression] " pinskia at gcc dot gnu.org
2023-02-16 18:37 ` dcb314 at hotmail dot com
2023-02-16 18:54 ` dcb314 at hotmail dot com
2023-02-16 19:43 ` dcb314 at hotmail dot com
2023-02-16 20:10 ` dcb314 at hotmail dot com
2023-02-16 20:44 ` dcb314 at hotmail dot com
2023-02-16 20:48 ` pinskia at gcc dot gnu.org
2023-02-16 21:01 ` dcb314 at hotmail dot com
2023-02-16 21:40 ` dcb314 at hotmail dot com
2023-02-17  8:01 ` rguenth at gcc dot gnu.org
2023-02-20  8:53 ` rguenth at gcc dot gnu.org
2023-02-20 10:04 ` cvs-commit at gcc dot gnu.org
2023-02-20 10:32 ` 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).