public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103122] New: [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2
@ 2021-11-08  1:02 vsevolod.livinskij at frtk dot ru
  2021-11-08  2:36 ` [Bug tree-optimization/103122] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vsevolod.livinskij at frtk dot ru @ 2021-11-08  1:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103122
           Summary: [12 Regression] ICE in fill_block_cache, at
                    gimple-range-cache.cc:1277 with -O2
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vsevolod.livinskij at frtk dot ru
  Target Milestone: ---

Link to the Compiler Explorer: https://godbolt.org/z/GWbbq3sKK
Reproducer:
unsigned a;
int b;
short c;
void d(long) {
  for (bool e = (bool)c - 1; e < (bool)b - 1; e += 0)
    ;
  if (a) {
    for (char f = 0; f < 7; f = 7)
      for (int g = 0; g < c; g += 10)
        ;
    d(-!c);
  }
}

Error:
>$ g++ -O2 -c func.cpp
during GIMPLE pass: evrp
func.cpp: In function 'void d(long int)':
func.cpp:13:1: internal compiler error: in fill_block_cache, at
gimple-range-cache.cc:1277
   13 | }
      | ^
0x9e79d7 ranger_cache::fill_block_cache(tree_node*, basic_block_def*,
basic_block_def*)
        /testing/gcc/gcc_src_master/gcc/gimple-range-cache.cc:1277
0x1ed1ecd ranger_cache::block_range(irange&, basic_block_def*, tree_node*,
bool)
        /testing/gcc/gcc_src_master/gcc/gimple-range-cache.cc:1107
0x1ecc4f8 gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
        /testing/gcc/gcc_src_master/gcc/gimple-range.cc:92
0xee7dff expr_not_equal_to(tree_node*, generic_wide_int<wide_int_storage>
const&)
        /testing/gcc/gcc_src_master/gcc/fold-const.c:10733
0xeec8e3 tree_single_nonzero_warnv_p(tree_node*, bool*)
        /testing/gcc/gcc_src_master/gcc/fold-const.c:15244
0xeed076 tree_expr_nonzero_p(tree_node*)
        /testing/gcc/gcc_src_master/gcc/fold-const.c:10706
0xefe7a8 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        /testing/gcc/gcc_src_master/gcc/fold-const.c:12284
0xf0254d fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        /testing/gcc/gcc_src_master/gcc/fold-const.c:13774
0x13fe25c simplify_using_initial_conditions(loop*, tree_node*)
        /testing/gcc/gcc_src_master/gcc/tree-ssa-loop-niter.c:2353
0x1404cd7 simplify_using_initial_conditions(loop*, tree_node*)
        /testing/gcc/gcc_src_master/gcc/tree-ssa-loop-niter.c:2333
0x1404cd7 number_of_iterations_exit_assumptions(loop*, edge_def*,
tree_niter_desc*, gcond**, bool, basic_block_def**)
        /testing/gcc/gcc_src_master/gcc/tree-ssa-loop-niter.c:2590
0x1405be2 number_of_iterations_exit_assumptions(loop*, edge_def*,
tree_niter_desc*, gcond**, bool, basic_block_def**)
        /testing/gcc/gcc_src_master/gcc/tree-ssa-loop-niter.c:2825
0x1405be2 number_of_iterations_exit(loop*, edge_def*, tree_niter_desc*, bool,
bool, basic_block_def**)
        /testing/gcc/gcc_src_master/gcc/tree-ssa-loop-niter.c:2812
0x135f6f0 number_of_latch_executions(loop*)
        /testing/gcc/gcc_src_master/gcc/tree-scalar-evolution.c:2813
0x1405ef5 estimate_numbers_of_iterations(loop*)
        /testing/gcc/gcc_src_master/gcc/tree-ssa-loop-niter.c:4356
0x1408c87 max_loop_iterations(loop*,
generic_wide_int<fixed_wide_int_storage<576> >*)
        /testing/gcc/gcc_src_master/gcc/tree-ssa-loop-niter.c:4462
0x15d2f6f bounds_of_var_in_loop(tree_node**, tree_node**, range_query*, loop*,
gimple*, tree_node*)
        /testing/gcc/gcc_src_master/gcc/vr-values.c:1708
0x1ed6641 fold_using_range::range_of_ssa_name_with_loop_info(irange&,
tree_node*, loop*, gphi*, fur_source&)
        /testing/gcc/gcc_src_master/gcc/gimple-range-fold.cc:1282
0x1ed6e1e fold_using_range::range_of_phi(irange&, gphi*, fur_source&)
        /testing/gcc/gcc_src_master/gcc/gimple-range-fold.cc:837
0x1ed8e50 fold_using_range::fold_stmt(irange&, gimple*, fur_source&,
tree_node*)
        /testing/gcc/gcc_src_master/gcc/gimple-range-fold.cc:554
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

GCC version:
gcc version 12.0.0 20211107 (9defce622893f87d954e0089e0ea79e1e388a480) (GCC)

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

* [Bug tree-optimization/103122] [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2
  2021-11-08  1:02 [Bug tree-optimization/103122] New: [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 vsevolod.livinskij at frtk dot ru
@ 2021-11-08  2:36 ` pinskia at gcc dot gnu.org
  2021-11-08  8:20 ` [Bug tree-optimization/103122] [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 since r12-4866-gfc4076752067fb40 marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-08  2:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug tree-optimization/103122] [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 since r12-4866-gfc4076752067fb40
  2021-11-08  1:02 [Bug tree-optimization/103122] New: [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 vsevolod.livinskij at frtk dot ru
  2021-11-08  2:36 ` [Bug tree-optimization/103122] " pinskia at gcc dot gnu.org
@ 2021-11-08  8:20 ` marxin at gcc dot gnu.org
  2021-11-08  9:25 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-08  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|[12 Regression] ICE in      |[12 Regression] ICE in
                   |fill_block_cache, at        |fill_block_cache, at
                   |gimple-range-cache.cc:1277  |gimple-range-cache.cc:1277
                   |with -O2                    |with -O2 since
                   |                            |r12-4866-gfc4076752067fb40
                 CC|                            |aldyh at gcc dot gnu.org,
                   |                            |amacleod at redhat dot com,
                   |                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2021-11-08
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-4866-gfc4076752067fb40.

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

* [Bug tree-optimization/103122] [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 since r12-4866-gfc4076752067fb40
  2021-11-08  1:02 [Bug tree-optimization/103122] New: [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 vsevolod.livinskij at frtk dot ru
  2021-11-08  2:36 ` [Bug tree-optimization/103122] " pinskia at gcc dot gnu.org
  2021-11-08  8:20 ` [Bug tree-optimization/103122] [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 since r12-4866-gfc4076752067fb40 marxin at gcc dot gnu.org
@ 2021-11-08  9:25 ` rguenth at gcc dot gnu.org
  2021-11-08 17:49 ` cvs-commit at gcc dot gnu.org
  2021-11-08 17:50 ` amacleod at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-08  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug tree-optimization/103122] [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 since r12-4866-gfc4076752067fb40
  2021-11-08  1:02 [Bug tree-optimization/103122] New: [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 vsevolod.livinskij at frtk dot ru
                   ` (2 preceding siblings ...)
  2021-11-08  9:25 ` rguenth at gcc dot gnu.org
@ 2021-11-08 17:49 ` cvs-commit at gcc dot gnu.org
  2021-11-08 17:50 ` amacleod at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-08 17:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

https://gcc.gnu.org/g:0cd653bd2559701da9cc4c9bf51f22bdd68623b5

commit r12-5006-g0cd653bd2559701da9cc4c9bf51f22bdd68623b5
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Mon Nov 8 09:32:42 2021 -0500

    Don't calculate new values when using the private context callback.

    When using rangers private callback mechanism to provide context
    to fold_stmt calls, we are only suppose to be using the cache in read
    only mode, never calculate new values.

            gcc/
            PR tree-optimization/103122
            * gimple-range.cc (gimple_ranger::range_of_expr): Request the cache
            entry with "calulate new values" set to false.

            gcc/testsuite/
            * g++.dg/pr103122.C: New.

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

* [Bug tree-optimization/103122] [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 since r12-4866-gfc4076752067fb40
  2021-11-08  1:02 [Bug tree-optimization/103122] New: [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 vsevolod.livinskij at frtk dot ru
                   ` (3 preceding siblings ...)
  2021-11-08 17:49 ` cvs-commit at gcc dot gnu.org
@ 2021-11-08 17:50 ` amacleod at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: amacleod at redhat dot com @ 2021-11-08 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
Fixed.

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

end of thread, other threads:[~2021-11-08 17:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  1:02 [Bug tree-optimization/103122] New: [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 vsevolod.livinskij at frtk dot ru
2021-11-08  2:36 ` [Bug tree-optimization/103122] " pinskia at gcc dot gnu.org
2021-11-08  8:20 ` [Bug tree-optimization/103122] [12 Regression] ICE in fill_block_cache, at gimple-range-cache.cc:1277 with -O2 since r12-4866-gfc4076752067fb40 marxin at gcc dot gnu.org
2021-11-08  9:25 ` rguenth at gcc dot gnu.org
2021-11-08 17:49 ` cvs-commit at gcc dot gnu.org
2021-11-08 17:50 ` amacleod at redhat dot com

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).