public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97737] New: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88
@ 2020-11-06  5:52 zhendong.su at inf dot ethz.ch
  2020-11-06  7:26 ` [Bug tree-optimization/97737] [11 Regression] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2020-11-06  5:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97737
           Summary: ICE at -Os and above: tree check: expected class
                    ‘type’, have ‘exceptional’ (error_mark) in
                    useless_type_conversion_p, at gimple-expr.c:88
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

Related to the fixed PR 97725. 

[521] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20201106 (experimental) [master revision
6483f05989e:058c571d79e:32ee472864ada44ef05b2a3b087b8ce413bee282] (GCC) 
[522] % 
[522] % gcctk -O1 -c small.c
[523] % 
[523] % gcctk -Os -c small.c
during GIMPLE pass: evrp
small.c: In function ‘d’:
small.c:13:1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88
   13 | }
      | ^
0x5fdd79 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc-trunk/gcc/tree.c:9802
0x9bbf87 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc-trunk/gcc/tree.h:3436
0x9bbf87 useless_type_conversion_p(tree_node*, tree_node*)
        ../../gcc-trunk/gcc/gimple-expr.c:88
0xd3b622 verify_gimple_comparison
        ../../gcc-trunk/gcc/tree-cfg.c:3477
0xd52240 verify_gimple_in_cfg(function*, bool)
        ../../gcc-trunk/gcc/tree-cfg.c:5397
0xc019ae execute_function_todo
        ../../gcc-trunk/gcc/passes.c:2039
0xc02892 execute_todo
        ../../gcc-trunk/gcc/passes.c:2093
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.
[524] % 
[524] % cat small.c
int a = 1, b, c;

void d() {
  int e = 1;
L1:
  b = e;
L2:
  e = e / a;
  if (!(e || c || e - 1))
    goto L1;
  if (!b)
    goto L2;
}

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

* [Bug tree-optimization/97737] [11 Regression] ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88
  2020-11-06  5:52 [Bug tree-optimization/97737] New: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 zhendong.su at inf dot ethz.ch
@ 2020-11-06  7:26 ` rguenth at gcc dot gnu.org
  2020-11-06  9:50 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-06  7:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org
            Summary|ICE at -Os and above: tree  |[11 Regression] ICE at -Os
                   |check: expected class       |and above: tree check:
                   |‘type’, have ‘exceptional’  |expected class ‘type’, have
                   |(error_mark) in             |‘exceptional’ (error_mark)
                   |useless_type_conversion_p,  |in
                   |at gimple-expr.c:88         |useless_type_conversion_p,
                   |                            |at gimple-expr.c:88
   Target Milestone|---                         |11.0
           Priority|P3                          |P1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
probably similar as that other bug

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

* [Bug tree-optimization/97737] [11 Regression] ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88
  2020-11-06  5:52 [Bug tree-optimization/97737] New: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 zhendong.su at inf dot ethz.ch
  2020-11-06  7:26 ` [Bug tree-optimization/97737] [11 Regression] " rguenth at gcc dot gnu.org
@ 2020-11-06  9:50 ` marxin at gcc dot gnu.org
  2020-11-06 16:09 ` amacleod at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-06  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |10.2.0
      Known to fail|                            |11.0
                 CC|                            |amacleod at redhat dot com,
                   |                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2020-11-06

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-4724-ge86fd6a17cdb2671.

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

* [Bug tree-optimization/97737] [11 Regression] ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88
  2020-11-06  5:52 [Bug tree-optimization/97737] New: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 zhendong.su at inf dot ethz.ch
  2020-11-06  7:26 ` [Bug tree-optimization/97737] [11 Regression] " rguenth at gcc dot gnu.org
  2020-11-06  9:50 ` marxin at gcc dot gnu.org
@ 2020-11-06 16:09 ` amacleod at redhat dot com
  2020-11-06 16:31 ` zhendong.su at inf dot ethz.ch
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: amacleod at redhat dot com @ 2020-11-06 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
This is actually the same issue as 97741.  The iL is being changed and we lose
info.  The first thing visited is:

e_4 = PHI <1(2), e_3(7)>

and the incoming edge from bb7 is determined to be undefined, so we fold e_4 to
1
but later on the undefined edge becomes defined due a "harmless" constant in
unreachable code being propagated.

The end result is now:

<bb 2> :
  b = 1;
  a.0_1 = a;
  e_10 = 1 / a.0_1;
  if (e_10 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  c.1_2 = c;

  <bb 4> :
  return;

*** This bug has been marked as a duplicate of bug 97741 ***

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

* [Bug tree-optimization/97737] [11 Regression] ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88
  2020-11-06  5:52 [Bug tree-optimization/97737] New: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 zhendong.su at inf dot ethz.ch
                   ` (2 preceding siblings ...)
  2020-11-06 16:09 ` amacleod at redhat dot com
@ 2020-11-06 16:31 ` zhendong.su at inf dot ethz.ch
  2020-11-06 19:27 ` cvs-commit at gcc dot gnu.org
  2020-11-06 19:30 ` amacleod at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2020-11-06 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
I would guess that it makes more sense to mark PR 97741 as a dup of this bug.

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

* [Bug tree-optimization/97737] [11 Regression] ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88
  2020-11-06  5:52 [Bug tree-optimization/97737] New: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 zhendong.su at inf dot ethz.ch
                   ` (3 preceding siblings ...)
  2020-11-06 16:31 ` zhendong.su at inf dot ethz.ch
@ 2020-11-06 19:27 ` cvs-commit at gcc dot gnu.org
  2020-11-06 19:30 ` amacleod at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-06 19:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:129e1a8a96d140150705fab30d25afb464eb1d99

commit r11-4795-g129e1a8a96d140150705fab30d25afb464eb1d99
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Fri Nov 6 14:14:46 2020 -0500

    Combine new calculated ranges with existing range.

    When a range is recalculated, retain what was previously known as IL
changes
    can produce different results from un-executed code.   This also paves
    the way for external injection of ranges.

            gcc/
            PR tree-optimization/97737
            PR tree-optimization/97741
            * gimple-range.cc: (gimple_ranger::range_of_stmt): Intersect newly
            calculated ranges with the existing known global range.
            gcc/testsuite/
            * gcc.dg/pr97737.c: New.
            * gcc.dg/pr97741.c: New.

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

* [Bug tree-optimization/97737] [11 Regression] ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88
  2020-11-06  5:52 [Bug tree-optimization/97737] New: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 zhendong.su at inf dot ethz.ch
                   ` (4 preceding siblings ...)
  2020-11-06 19:27 ` cvs-commit at gcc dot gnu.org
@ 2020-11-06 19:30 ` amacleod at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: amacleod at redhat dot com @ 2020-11-06 19:30 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|DUPLICATE                   |FIXED

--- Comment #6 from Andrew Macleod <amacleod at redhat dot com> ---
I also put this testcase into the suite since propagating undefined in
range-ops would also fix the Other PR, but not this one.   So although the
problem are similar and covered by the same patch, its possible to change the
fix for one and not fix the other.

Still, fixed.

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

end of thread, other threads:[~2020-11-06 19:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06  5:52 [Bug tree-optimization/97737] New: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 zhendong.su at inf dot ethz.ch
2020-11-06  7:26 ` [Bug tree-optimization/97737] [11 Regression] " rguenth at gcc dot gnu.org
2020-11-06  9:50 ` marxin at gcc dot gnu.org
2020-11-06 16:09 ` amacleod at redhat dot com
2020-11-06 16:31 ` zhendong.su at inf dot ethz.ch
2020-11-06 19:27 ` cvs-commit at gcc dot gnu.org
2020-11-06 19:30 ` 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).