public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97396] New: [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop)
@ 2020-10-13  3:36 asolokha at gmx dot com
  2020-10-13  6:25 ` [Bug tree-optimization/97396] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: asolokha at gmx dot com @ 2020-10-13  3:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97396
           Summary: [11 Regression] ICE: Segmentation fault (in
                    bounds_of_var_in_loop)
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.0-alpha20201011 snapshot (g:4eaf96c56c1c97b11af42a4caaa12b37870308d7)
ICEs when compiling the following testcase w/ -m32 -O1 -ftree-vrp:

unsigned int
po (char *os, unsigned int al)
{
  for (;;)
    {
      int qx = 0;

      while (al < 1)
        {
          char *cw;

          cw = os + qx;
          if (cw)
            return al + qx;

          qx += sizeof *cw;
        }
    }
}

% gcc-11.0.0 -m32 -O1 -ftree-vrp -c c5dvzahu.c
during GIMPLE pass: evrp
c5dvzahu.c: In function 'po':
c5dvzahu.c:19:1: internal compiler error: Segmentation fault
   19 | }
      | ^
0xdb3b3f crash_signal
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/toplev.c:330
0x10e73a3 bounds_of_var_in_loop(tree_node**, tree_node**, range_query*, loop*,
gimple*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/vr-values.c:1836
0x18aaa19 gimple_ranger::range_of_ssa_name_with_loop_info(irange&, tree_node*,
loop*, gphi*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/gimple-range.cc:1138
0x18aad73 gimple_ranger::range_of_phi(irange&, gphi*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/gimple-range.cc:495
0x18ab0fd gimple_ranger::calc_stmt(irange&, gimple*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/gimple-range.cc:371
0x18ab30f gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/gimple-range.cc:986
0x18a7918 gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/gimple-range.cc:877
0x109d6fd range_query::value_of_expr(tree_node*, gimple*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/value-query.cc:85
0x1740211 hybrid_folder::value_of_expr(tree_node*, gimple*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/gimple-ssa-evrp.c:235
0xf529a6 substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/tree-ssa-propagate.c:1072
0x1715ca7 dom_walker::walk(basic_block_def*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/domwalk.c:309
0xf51f77 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/tree-ssa-propagate.c:1283
0x173fe8e execute_early_vrp
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201011/work/gcc-11-20201011/gcc/gimple-ssa-evrp.c:340

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

* [Bug tree-optimization/97396] [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop)
  2020-10-13  3:36 [Bug tree-optimization/97396] New: [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop) asolokha at gmx dot com
@ 2020-10-13  6:25 ` rguenth at gcc dot gnu.org
  2020-10-13  7:05 ` aldyh at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-13  6:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org
   Target Milestone|---                         |11.0

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

* [Bug tree-optimization/97396] [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop)
  2020-10-13  3:36 [Bug tree-optimization/97396] New: [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop) asolokha at gmx dot com
  2020-10-13  6:25 ` [Bug tree-optimization/97396] " rguenth at gcc dot gnu.org
@ 2020-10-13  7:05 ` aldyh at gcc dot gnu.org
  2020-10-13  7:15 ` aldyh at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-10-13  7:05 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-10-13
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |aldyh at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
confirmed

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

* [Bug tree-optimization/97396] [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop)
  2020-10-13  3:36 [Bug tree-optimization/97396] New: [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop) asolokha at gmx dot com
  2020-10-13  6:25 ` [Bug tree-optimization/97396] " rguenth at gcc dot gnu.org
  2020-10-13  7:05 ` aldyh at gcc dot gnu.org
@ 2020-10-13  7:15 ` aldyh at gcc dot gnu.org
  2020-10-14 14:59 ` cvs-commit at gcc dot gnu.org
  2020-10-14 15:06 ` aldyh at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-10-13  7:15 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
In bounds_of_var_in_loop, evolution_part_in_loop_num is returning NULL:

   step = evolution_part_in_loop_num (chrec, loop->num);

and we ICE while trying to calculate the range for STEP.

This is for:

(gdb) dd stmt
qx.0_3 = PHI <qx.0_1(3)>
(gdb) dd var
qx.0_3

I'm not familiar with the SCEV code.  It looks like NULL is a perfectly valid
response from evolution_part_in_loop_num.  Should we just bail if NULL?

diff --git a/gcc/vr-values.c b/gcc/vr-values.c
index da0b249278b..16f6c629f29 100644
--- a/gcc/vr-values.c
+++ b/gcc/vr-values.c
@@ -1827,6 +1827,8 @@ bounds_of_var_in_loop (tree *min, tree *max, range_query
*query,

   init = initial_condition_in_loop_num (chrec, loop->num);
   step = evolution_part_in_loop_num (chrec, loop->num);
+  if (step == NULL_TREE)
+    return false;

   /* If INIT is an SSA with a singleton range, set INIT to said
      singleton, otherwise leave INIT alone.  */

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

* [Bug tree-optimization/97396] [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop)
  2020-10-13  3:36 [Bug tree-optimization/97396] New: [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop) asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-10-13  7:15 ` aldyh at gcc dot gnu.org
@ 2020-10-14 14:59 ` cvs-commit at gcc dot gnu.org
  2020-10-14 15:06 ` aldyh at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-14 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Aldy Hernandez <aldyh@gcc.gnu.org>:

https://gcc.gnu.org/g:a121715bcab6e8980768d142b9781c45821130ac

commit r11-3880-ga121715bcab6e8980768d142b9781c45821130ac
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Tue Oct 13 03:05:23 2020 -0400

    Do not call range_of_ssa_name_with_loop_info with the loop tree root.

    gcc/ChangeLog:

            PR tree-optimization/97396
            * gimple-range.cc (gimple_ranger::range_of_phi): Do not call
            range_of_ssa_name_with_loop_info with the loop tree root.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr97396.c: New test.

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

* [Bug tree-optimization/97396] [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop)
  2020-10-13  3:36 [Bug tree-optimization/97396] New: [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop) asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-10-14 14:59 ` cvs-commit at gcc dot gnu.org
@ 2020-10-14 15:06 ` aldyh at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-10-14 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

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

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
fixed

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

end of thread, other threads:[~2020-10-14 15:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13  3:36 [Bug tree-optimization/97396] New: [11 Regression] ICE: Segmentation fault (in bounds_of_var_in_loop) asolokha at gmx dot com
2020-10-13  6:25 ` [Bug tree-optimization/97396] " rguenth at gcc dot gnu.org
2020-10-13  7:05 ` aldyh at gcc dot gnu.org
2020-10-13  7:15 ` aldyh at gcc dot gnu.org
2020-10-14 14:59 ` cvs-commit at gcc dot gnu.org
2020-10-14 15:06 ` aldyh 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).