public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111846] New: ice in exact_div, at poly-int.h:2156
@ 2023-10-17  8:28 dcb314 at hotmail dot com
  2023-10-17 10:19 ` [Bug c++/111846] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dcb314 at hotmail dot com @ 2023-10-17  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111846
           Summary: ice in exact_div, at poly-int.h:2156
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 56130
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56130&action=edit
gzipped C++ source code

For the attached C++ source code, recent gcc trunk does this:

$ ../results/bin/gcc -c -O3 -march=znver2 -ffast-math bug966.cc
during GIMPLE pass: slp
equalizer.cc: In function ‘void eq_update(void*, void*)’:
equalizer.cc:147:13: internal compiler error: in exact_div, at poly-int.h:2156
0x20fe038 vectorizable_simd_clone_call(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, gimple**, _slp_tree*, vec<stmt_info_for_cost, va_heap,
vl_ptr>*)
        ../../trunk.year/gcc/tree-vect-stmts.cc:0
0x20d4756 vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        ../../trunk.year/gcc/tree-vect-stmts.cc:12789

The bug first seems to occur sometime between g:530babc2058be5f2
and g:78dd49f387c515a6

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

* [Bug c++/111846] ice in exact_div, at poly-int.h:2156
  2023-10-17  8:28 [Bug c++/111846] New: ice in exact_div, at poly-int.h:2156 dcb314 at hotmail dot com
@ 2023-10-17 10:19 ` rguenth at gcc dot gnu.org
  2023-10-17 11:09 ` [Bug tree-optimization/111846] [14 Regression] " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-10-17 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
            Version|unknown                     |14.0
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2023-10-17
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Probably mine, reducing.

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

* [Bug tree-optimization/111846] [14 Regression] ice in exact_div, at poly-int.h:2156
  2023-10-17  8:28 [Bug c++/111846] New: ice in exact_div, at poly-int.h:2156 dcb314 at hotmail dot com
  2023-10-17 10:19 ` [Bug c++/111846] " rguenth at gcc dot gnu.org
@ 2023-10-17 11:09 ` rguenth at gcc dot gnu.org
  2023-10-17 11:31 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-10-17 11:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
          Component|c++                         |tree-optimization
   Target Milestone|---                         |14.0
            Summary|ice in exact_div, at        |[14 Regression] ice in
                   |poly-int.h:2156             |exact_div, at
                   |                            |poly-int.h:2156

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
extern "C" __attribute__((__simd__)) float powf(float, float);
float gv[0][10];
float eq_set_bands_real_adj[0];
void eq_set_bands_real() {
  for (int c = 0; c < 10; c++)
    for (int i = 0; i < 10; i++)
      gv[c][i] = powf(0, eq_set_bands_real_adj[i]) - 1;
}

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

* [Bug tree-optimization/111846] [14 Regression] ice in exact_div, at poly-int.h:2156
  2023-10-17  8:28 [Bug c++/111846] New: ice in exact_div, at poly-int.h:2156 dcb314 at hotmail dot com
  2023-10-17 10:19 ` [Bug c++/111846] " rguenth at gcc dot gnu.org
  2023-10-17 11:09 ` [Bug tree-optimization/111846] [14 Regression] " rguenth at gcc dot gnu.org
@ 2023-10-17 11:31 ` rguenth at gcc dot gnu.org
  2023-10-17 12:27 ` cvs-commit at gcc dot gnu.org
  2023-10-17 12:27 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-10-17 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
We are dividing 4 by 8.  We get here with basic-block vectorization and
a group size of 4 but we let vectorizable_simd_clone_call choose its
own vector type (it chooses 8 lanes).

While we properly constrain with

        if (!constant_multiple_p (vf * group_size,
                                  n->simdclone->simdlen, &num_calls)
            || n->simdclone->nargs != nargs)
          continue;

we seem to cache things in STMT_VINFO_SIMD_CLONE_INFO and this info gets
re-used across a group_size 8 -> 4 transition here.  This is because
we have multiple SLP instances each sharing some of the calls (in the end
costs would make vectorization not profitable), vectorizing the CTORs in

  <bb 2> [local count: 9759239]:
  _14 = eq_set_bands_real_adj[0];
  _15 = powf (0.0, _14);
  _16 = _15 - 1.0e+0;
  _21 = eq_set_bands_real_adj[1];
  _22 = powf (0.0, _21);
  _23 = _22 - 1.0e+0;
  _28 = eq_set_bands_real_adj[2];
  _29 = powf (0.0, _28);
  _30 = _29 - 1.0e+0;
  _35 = eq_set_bands_real_adj[3];
  _36 = powf (0.0, _35);
  _37 = _36 - 1.0e+0;
  _42 = eq_set_bands_real_adj[4];
  _43 = powf (0.0, _42);
  _44 = _43 - 1.0e+0;
  _49 = eq_set_bands_real_adj[5];
  _50 = powf (0.0, _49);
  _51 = _50 - 1.0e+0;
  _56 = eq_set_bands_real_adj[6];
  _57 = powf (0.0, _56);
  _58 = _57 - 1.0e+0;
  _63 = eq_set_bands_real_adj[7];
  _64 = powf (0.0, _63);
  _65 = _64 - 1.0e+0;
  _70 = eq_set_bands_real_adj[8];
  _71 = powf (0.0, _70);
  _72 = _71 - 1.0e+0;
  _77 = eq_set_bands_real_adj[9];
  _78 = powf (0.0, _77);
  _79 = _78 - 1.0e+0;
  _19 = {_30, _37, _44, _51, _58, _65, _72, _79};
  _25 = {_44, _51, _58, _65, _72, _79, _16, _23};
  _26 = {_58, _65, _72, _79, _16, _23, _30, _37};
  _32 = {_72, _79, _16, _23, _30, _37, _44, _51};
  _33 = {_16, _23, _30, _37, _44, _51, _58, _65};
  MEM <vector(8) float> [(float *)&gv] = _33;
  MEM <vector(8) float> [(float *)&gv + 32B] = _32;
  MEM <vector(8) float> [(float *)&gv + 64B] = _26;
  MEM <vector(8) float> [(float *)&gv + 96B] = _25;
  MEM <vector(8) float> [(float *)&gv + 128B] = _19;
  MEM <vector(8) float> [(float *)&gv + 160B] = _33;
  MEM <vector(8) float> [(float *)&gv + 192B] = _32;
  MEM <vector(8) float> [(float *)&gv + 224B] = _26;
  MEM <vector(8) float> [(float *)&gv + 256B] = _25;
  MEM <vector(8) float> [(float *)&gv + 288B] = _19;
  _82 = {_58, _65, _72, _79};
  _83 = {_30, _37, _44, _51};
  _84 = {_72, _79, _16, _23};
  _85 = {_44, _51, _58, _65};
  _86 = {_16, _23, _30, _37};
  MEM <vector(4) float> [(float *)&gv + 320B] = _86;
  MEM <vector(4) float> [(float *)&gv + 336B] = _85;
  MEM <vector(4) float> [(float *)&gv + 352B] = _84;
  MEM <vector(4) float> [(float *)&gv + 368B] = _83;
  MEM <vector(4) float> [(float *)&gv + 384B] = _82;
  return;

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

* [Bug tree-optimization/111846] [14 Regression] ice in exact_div, at poly-int.h:2156
  2023-10-17  8:28 [Bug c++/111846] New: ice in exact_div, at poly-int.h:2156 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2023-10-17 11:31 ` rguenth at gcc dot gnu.org
@ 2023-10-17 12:27 ` cvs-commit at gcc dot gnu.org
  2023-10-17 12:27 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-17 12:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:323209cd73bf1d81d91637677db5883afc8ae5f6

commit r14-4682-g323209cd73bf1d81d91637677db5883afc8ae5f6
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Oct 17 13:42:59 2023 +0200

    tree-optimization/111846 - put simd-clone-info into SLP tree

    The following avoids bogously re-using the simd-clone-info we
    currently hang off stmt_info from two different SLP contexts where
    a different number of lanes should have chosen a different best
    simdclone.

            PR tree-optimization/111846
            * tree-vectorizer.h (_slp_tree::simd_clone_info): Add.
            (SLP_TREE_SIMD_CLONE_INFO): New.
            * tree-vect-slp.cc (_slp_tree::_slp_tree): Initialize
            SLP_TREE_SIMD_CLONE_INFO.
            (_slp_tree::~_slp_tree): Release it.
            * tree-vect-stmts.cc (vectorizable_simd_clone_call): Use
            SLP_TREE_SIMD_CLONE_INFO or STMT_VINFO_SIMD_CLONE_INFO
            dependent on if we're doing SLP.

            * gcc.dg/vect/pr111846.c: New testcase.

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

* [Bug tree-optimization/111846] [14 Regression] ice in exact_div, at poly-int.h:2156
  2023-10-17  8:28 [Bug c++/111846] New: ice in exact_div, at poly-int.h:2156 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2023-10-17 12:27 ` cvs-commit at gcc dot gnu.org
@ 2023-10-17 12:27 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-10-17 12:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2023-10-17 12:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-17  8:28 [Bug c++/111846] New: ice in exact_div, at poly-int.h:2156 dcb314 at hotmail dot com
2023-10-17 10:19 ` [Bug c++/111846] " rguenth at gcc dot gnu.org
2023-10-17 11:09 ` [Bug tree-optimization/111846] [14 Regression] " rguenth at gcc dot gnu.org
2023-10-17 11:31 ` rguenth at gcc dot gnu.org
2023-10-17 12:27 ` cvs-commit at gcc dot gnu.org
2023-10-17 12:27 ` 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).