public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101497] New: ice in type, at value-range.h:221
@ 2021-07-18  7:53 dcb314 at hotmail dot com
  2021-07-18  7:58 ` [Bug tree-optimization/101497] [12 Regression] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2021-07-18  7:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101497
           Summary: ice in type, at value-range.h:221
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C code:

char uc_1;
int i_4, func_12_uli_6;
void func_12() {
  int *ptr_8 = &func_12_uli_6;
  *ptr_8 = 0 >= 211 - uc_1 <= 0;
  i_4 %= 0;
  i_4 *= *ptr_8;
}

compiled by recent gcc trunk, does this:

$ /home/dcb/gcc/results/bin/gcc -c -O2 -w bug737.c 
during GIMPLE pass: evrp
bug737.c: In function ‘func_12’:
bug737.c:8:1: internal compiler error: in type, at value-range.h:221
    8 | }
      | ^
0x884da8 irange::type() const
        ../../trunk.git/gcc/value-range.h:221
0x884da8 fold_using_range::range_of_cond_expr(irange&, gassign*, fur_source&)
        ../../trunk.git/gcc/gimple-range-fold.cc:1114
0x1b0e0ac fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*
)
        ../../trunk.git/gcc/gimple-range-fold.cc:521
0x1b00091 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
        ../../trunk.git/gcc/gimple-range.cc:154

Bug first seems to occur sometime between git hash 7466a0a5d8d536ab
and 94ba897be8b59ef5

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
@ 2021-07-18  7:58 ` pinskia at gcc dot gnu.org
  2021-07-18  7:58 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-18  7:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
          Component|c                           |tree-optimization
           Keywords|                            |ice-on-valid-code
            Summary|ice in type, at             |[12 Regression] ice in
                   |value-range.h:221           |type, at value-range.h:221

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
  2021-07-18  7:58 ` [Bug tree-optimization/101497] [12 Regression] " pinskia at gcc dot gnu.org
@ 2021-07-18  7:58 ` pinskia at gcc dot gnu.org
  2021-07-18 16:38 ` dcb314 at hotmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-18  7:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to David Binderman from comment #0)
> Bug first seems to occur sometime between git hash 7466a0a5d8d536ab
> and 94ba897be8b59ef5

So between r12-2235 and r12-2372.

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
  2021-07-18  7:58 ` [Bug tree-optimization/101497] [12 Regression] " pinskia at gcc dot gnu.org
  2021-07-18  7:58 ` pinskia at gcc dot gnu.org
@ 2021-07-18 16:38 ` dcb314 at hotmail dot com
  2021-07-18 16:56 ` dcb314 at hotmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2021-07-18 16:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Andrew Pinski from comment #1)
> (In reply to David Binderman from comment #0)
> > Bug first seems to occur sometime between git hash 7466a0a5d8d536ab
> > and 94ba897be8b59ef5
> 
> So between r12-2235 and r12-2372.

About 68 revisions, so trying revision 269ca408e2839d7f.

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2021-07-18 16:38 ` dcb314 at hotmail dot com
@ 2021-07-18 16:56 ` dcb314 at hotmail dot com
  2021-07-18 17:58 ` dcb314 at hotmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2021-07-18 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #2)
> (In reply to Andrew Pinski from comment #1)
> > (In reply to David Binderman from comment #0)
> > > Bug first seems to occur sometime between git hash 7466a0a5d8d536ab
> > > and 94ba897be8b59ef5
> > 
> > So between r12-2235 and r12-2372.
> 
> About 68 revisions, so trying revision 269ca408e2839d7f.

Seems good, so trying 33255ad3ac14e395.

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2021-07-18 16:56 ` dcb314 at hotmail dot com
@ 2021-07-18 17:58 ` dcb314 at hotmail dot com
  2021-07-19  6:36 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2021-07-18 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

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

--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
Range seems to be [33255ad3ac14e395, c031ea2782a1873e],
so this looks like another one for Andrew Macleod.

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2021-07-18 17:58 ` dcb314 at hotmail dot com
@ 2021-07-19  6:36 ` rguenth at gcc dot gnu.org
  2021-07-19 19:11 ` amacleod at redhat dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-19  6:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2021-07-19  6:36 ` rguenth at gcc dot gnu.org
@ 2021-07-19 19:11 ` amacleod at redhat dot com
  2021-07-22 12:53 ` cvs-commit at gcc dot gnu.org
  2021-07-22 13:07 ` amacleod at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: amacleod at redhat dot com @ 2021-07-19 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Macleod <amacleod at redhat dot com> ---
  uc_1.0_1 = uc_1;
  _2 = (int) uc_1.0_1;    
  _3 = 211 - _2;

_3 evaluates as 211 - [-128, 127], or [84, 339]

  _4 = _3 > 0;
  _5 = (int) _4;
  func_12_uli_6 = _5;
  i_4.1_6 = i_4;
  _7 = i_4.1_6 % 0;

We changed it so that anything mod 0 was undefined.  so _7 is UNDEFINED.
  i_4 = _7;
  _11 = _3 > 0;

_3 i s[84, 339] meaning _11 always evaluates TRUE.

  _10 = _11 ? _7 : 0;

The code for COND_EXPR confirms the types match when it folds. In this case,
the result is UNDEFINED.. undefined has no type, so we need to add a check for
that.

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2021-07-19 19:11 ` amacleod at redhat dot com
@ 2021-07-22 12:53 ` cvs-commit at gcc dot gnu.org
  2021-07-22 13:07 ` amacleod at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-22 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

commit r12-2465-gea789238b2c24eedf70b56257235adf3d33c5a0a
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Mon Jul 19 15:16:25 2021 -0400

    Check for undefined on COND_EXPR before querying type.

            gcc/
            PR tree-optimization/101497
            * gimple-range-fold.cc (fold_using_range::range_of_cond_expr):
Check
            for undefined.

            gcc/testsuite
            * gcc.dg/pr101497.c: New.

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

* [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221
  2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2021-07-22 12:53 ` cvs-commit at gcc dot gnu.org
@ 2021-07-22 13:07 ` amacleod at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: amacleod at redhat dot com @ 2021-07-22 13:07 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

--- Comment #7 from Andrew Macleod <amacleod at redhat dot com> ---
fixed

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

end of thread, other threads:[~2021-07-22 13:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-18  7:53 [Bug c/101497] New: ice in type, at value-range.h:221 dcb314 at hotmail dot com
2021-07-18  7:58 ` [Bug tree-optimization/101497] [12 Regression] " pinskia at gcc dot gnu.org
2021-07-18  7:58 ` pinskia at gcc dot gnu.org
2021-07-18 16:38 ` dcb314 at hotmail dot com
2021-07-18 16:56 ` dcb314 at hotmail dot com
2021-07-18 17:58 ` dcb314 at hotmail dot com
2021-07-19  6:36 ` rguenth at gcc dot gnu.org
2021-07-19 19:11 ` amacleod at redhat dot com
2021-07-22 12:53 ` cvs-commit at gcc dot gnu.org
2021-07-22 13:07 ` 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).