public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
@ 2020-06-15 10:30 asolokha at gmx dot com
  2020-07-15  7:07 ` [Bug tree-optimization/95679] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2020-06-15 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95679
           Summary: [11 Regression] ICE: tree check: expected class
                    'type', have 'exceptional' (error_mark) in
                    type_has_mode_precision_p, at tree.h:6231
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-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-alpha20200614 snapshot (g:3de12cc548c7a37bb68ea10937709dc6385a3b2b)
ICEs when compiling the following testcase w/ -Os --param
scev-max-expr-size=15:

int ex;

void
u1 (int hu, int nd)
{
  while (hu != 0)
    if (nd == hu || nd == ex)
      while (hu < u1)
        ++hu;
}

% gcc-11.0.0 -Os --param scev-max-expr-size=15 -w -c nnbsry0z.c
during GIMPLE pass: cunroll
nnbsry0z.c: In function 'u1':
nnbsry0z.c:4:1: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
    4 | u1 (int hu, int nd)
      | ^~
0x70460e tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree.c:9735
0x754802 tree_class_check(tree_node const*, tree_code_class, char const*, int,
char const*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree.h:3675
0x754802 type_has_mode_precision_p(tree_node const*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree.h:6231
0x754802 generic_simplify_218
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/build/gcc/generic-match.c:10515
0x134447e generic_simplify_CONVERT_EXPR
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/build/gcc/generic-match.c:19701
0xa65d30 fold_unary_loc(unsigned int, tree_code, tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/fold-const.c:8612
0xa67418 fold_build1_loc(unsigned int, tree_code, tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/fold-const.c:13067
0xa65ecb fold_unary_loc(unsigned int, tree_code, tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/fold-const.c:8628
0xa67418 fold_build1_loc(unsigned int, tree_code, tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/fold-const.c:13067
0x17bc40d chrec_convert_1
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-chrec.c:1482
0x17bf9e1 chrec_convert(tree_node*, tree_node*, gimple*, bool, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-chrec.c:1536
0x17bf9e1 chrec_convert_rhs(tree_node*, tree_node*, gimple*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-chrec.c:1406
0x17bf9e1 chrec_apply(unsigned int, tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-chrec.c:622
0xe8552a compute_overall_effect_of_inner_loop(loop*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-scalar-evolution.c:471
0xe8552a compute_overall_effect_of_inner_loop(loop*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-scalar-evolution.c:447
0xe85b16 follow_ssa_edge_inner_loop_phi
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-scalar-evolution.c:1114
0xe85b16 follow_ssa_edge_expr
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-scalar-evolution.c:1183
0xe85c2e follow_ssa_edge_in_condition_phi_branch
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-scalar-evolution.c:1011
0xe85c2e follow_ssa_edge_in_condition_phi
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-scalar-evolution.c:1037
0xe85c2e follow_ssa_edge_expr
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200614/work/gcc-11-20200614/gcc/tree-scalar-evolution.c:1165

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

* [Bug tree-optimization/95679] [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
  2020-06-15 10:30 [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231 asolokha at gmx dot com
@ 2020-07-15  7:07 ` rguenth at gcc dot gnu.org
  2020-07-29  7:55 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-15  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-07-15
   Target Milestone|---                         |11.0
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
           Keywords|                            |needs-bisection

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Whoops, this fell through the cracks - I can't reproduce with
g:7a4770f0394751860ee54520b23007938907ac33 though.  Confirmed with your
cited rev. where we see

 <minus_expr 0x7ffff6977960
    type <integer_type 0x7ffff682d1f8 public unsigned DI
        size <integer_cst 0x7ffff680ccd8 constant 64>
        unit-size <integer_cst 0x7ffff680ccf0 constant 8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff682d1f8 precision:64 min <integer_cst 0x7ffff682a108 0> max <integer_cst
0x7ffff680d5c0 18446744073709551615>>

    arg:0 <nop_expr 0x7ffff6976e80 type <integer_type 0x7ffff682d1f8>
        constant
        arg:0 <addr_expr 0x7ffff694b140 type <pointer_type 0x7ffff6945348>
            constant arg:0 <function_decl 0x7ffff693d600 u1>
            t.c:8:17 start: t.c:8:17 finish: t.c:8:17>>
    arg:1 <nop_expr 0x7ffff6976e60 type <integer_type 0x7ffff682d1f8>

        arg:0 <ssa_name 0x7ffff6968090 type <error_mark 0x7ffff680ccc0>
            nothrow
            def_stmt 
            version:10 in-free-list>>>

and thus a released SSA name.  That's probably inconsistent SCEV cache
not reset before cunroll and the issue is probably still latent.

For curiosity I wonder what "fixed" it.

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

* [Bug tree-optimization/95679] [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
  2020-06-15 10:30 [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231 asolokha at gmx dot com
  2020-07-15  7:07 ` [Bug tree-optimization/95679] " rguenth at gcc dot gnu.org
@ 2020-07-29  7:55 ` rguenth at gcc dot gnu.org
  2020-07-29  7:57 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-29  7:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
SCEV info is wrecked by copyprop in this case which does

 u1 (int hu, int nd)
 {
   int ex.0_1;
@@ -36,10 +41,9 @@
   <bb 11> [local count: 64191087]:

   <bb 6> [local count: 118111600]:
-  # hu_10 = PHI <hu_5(11), hu_5(12)>

   <bb 7> [local count: 1073741824]:
-  # hu_4 = PHI <hu_10(6), hu_9(5)>
+  # hu_4 = PHI <hu_5(6), hu_9(5)>
   _2 = (long int) hu_4;
   _3 = (void (*<T321>) (int, int)) _2;
   if (_3 < u1)

caused by Aldys refactoring which lost a "changed" setting by too much
C++-ification.  Also looks like propagating into PHI args is now done twice?!

Testing patch.

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

* [Bug tree-optimization/95679] [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
  2020-06-15 10:30 [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231 asolokha at gmx dot com
  2020-07-15  7:07 ` [Bug tree-optimization/95679] " rguenth at gcc dot gnu.org
  2020-07-29  7:55 ` rguenth at gcc dot gnu.org
@ 2020-07-29  7:57 ` rguenth at gcc dot gnu.org
  2020-07-29  9:11 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-29  7:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
And the ICE was mitigated by g:8fb4d1d58362b77da78c09740c6b5562124a369e but
the 'changed' flag still is missing.

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

* [Bug tree-optimization/95679] [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
  2020-06-15 10:30 [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-07-29  7:57 ` rguenth at gcc dot gnu.org
@ 2020-07-29  9:11 ` marxin at gcc dot gnu.org
  2020-07-29  9:11 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-29  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-bisection             |
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Just for the record, it started with .

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

* [Bug tree-optimization/95679] [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
  2020-06-15 10:30 [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-07-29  9:11 ` marxin at gcc dot gnu.org
@ 2020-07-29  9:11 ` marxin at gcc dot gnu.org
  2020-07-29 10:34 ` cvs-commit at gcc dot gnu.org
  2020-07-29 10:34 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-29  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
r11-1146-g1396fa5b91cfa0b3

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

* [Bug tree-optimization/95679] [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
  2020-06-15 10:30 [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2020-07-29  9:11 ` marxin at gcc dot gnu.org
@ 2020-07-29 10:34 ` cvs-commit at gcc dot gnu.org
  2020-07-29 10:34 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-29 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 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:8e8792a347c87dbb82b4cf75ec3452bc5cd1d3db

commit r11-2400-g8e8792a347c87dbb82b4cf75ec3452bc5cd1d3db
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jul 29 09:59:01 2020 +0200

    tree-optimization/95679 - properly signal changes from
propagate_into_phi_args

    This restores a lost setting of something_changed with the
    recent refactoring of the substitute and fold engine.  The
    reported ICE in the PR was meanwhile mitigated in other ways
    but the issue can still result in missed optimizations via
    failed runs of CFG cleanup.

    2020-07-29  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/95679
            * tree-ssa-propagate.h
            (substitute_and_fold_engine::propagate_into_phi_args): Return
            whether anything changed.
            * tree-ssa-propagate.c
            (substitute_and_fold_engine::propagate_into_phi_args): Likewise.
            (substitute_and_fold_dom_walker::before_dom_children): Update
            something_changed.

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

* [Bug tree-optimization/95679] [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231
  2020-06-15 10:30 [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2020-07-29 10:34 ` cvs-commit at gcc dot gnu.org
@ 2020-07-29 10:34 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-29 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2020-07-29 10:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 10:30 [Bug tree-optimization/95679] New: [11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in type_has_mode_precision_p, at tree.h:6231 asolokha at gmx dot com
2020-07-15  7:07 ` [Bug tree-optimization/95679] " rguenth at gcc dot gnu.org
2020-07-29  7:55 ` rguenth at gcc dot gnu.org
2020-07-29  7:57 ` rguenth at gcc dot gnu.org
2020-07-29  9:11 ` marxin at gcc dot gnu.org
2020-07-29  9:11 ` marxin at gcc dot gnu.org
2020-07-29 10:34 ` cvs-commit at gcc dot gnu.org
2020-07-29 10:34 ` 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).