public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105597] New: ice in type, at value-range.h:223
@ 2022-05-13 17:03 dcb314 at hotmail dot com
  2022-05-13 17:07 ` [Bug c/105597] " dcb314 at hotmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dcb314 at hotmail dot com @ 2022-05-13 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105597
           Summary: ice in type, at value-range.h:223
           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: ---

Created attachment 52972
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52972&action=edit
C source code

For the attached C code, recent gcc trunk with flag -O2 does this:

during GIMPLE pass: vrp
mgpswindows.c: In function 'mgps_initpsdevice':
mgpswindows.c:48:5: internal compiler error: in type, at value-range.h:223
   48 | int mgps_initpsdevice()
      |     ^~~~~~~~~~~~~~~~~
0x1c9b178 irange::type() const
    ../../trunk.git/gcc/value-range.h:223
0x1c9b178 operator_minus::lhs_op1_relation(irange const&, irange const&, irange
const&, tree_code) const
    /home/dcb/gcc/working/gcc/../../trunk.git/gcc/range-op.cc:1349

I will have my usual go at reducing the code and finding a range of git
hashes where the problem starts.

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

* [Bug c/105597] ice in type, at value-range.h:223
  2022-05-13 17:03 [Bug c/105597] New: ice in type, at value-range.h:223 dcb314 at hotmail dot com
@ 2022-05-13 17:07 ` dcb314 at hotmail dot com
  2022-05-13 17:14 ` amacleod at redhat dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dcb314 at hotmail dot com @ 2022-05-13 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
The bug seems to have started recently, between git hash 5b2a24ebfc0b2b4c
and 98e475a8f58ca3ba, a distance of 111 commits.

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

* [Bug c/105597] ice in type, at value-range.h:223
  2022-05-13 17:03 [Bug c/105597] New: ice in type, at value-range.h:223 dcb314 at hotmail dot com
  2022-05-13 17:07 ` [Bug c/105597] " dcb314 at hotmail dot com
@ 2022-05-13 17:14 ` amacleod at redhat dot com
  2022-05-13 17:21 ` dcb314 at hotmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2022-05-13 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

--- Comment #2 from Andrew Macleod <amacleod at redhat dot com> ---
Created attachment 52973
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52973&action=edit
proposed patch

Fix is here.  Testing in progress.

A reduced testcase would be helpful for the testsuite when I check it in.

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

* [Bug c/105597] ice in type, at value-range.h:223
  2022-05-13 17:03 [Bug c/105597] New: ice in type, at value-range.h:223 dcb314 at hotmail dot com
  2022-05-13 17:07 ` [Bug c/105597] " dcb314 at hotmail dot com
  2022-05-13 17:14 ` amacleod at redhat dot com
@ 2022-05-13 17:21 ` dcb314 at hotmail dot com
  2022-05-13 17:21 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dcb314 at hotmail dot com @ 2022-05-13 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
Reduced C code seems to be:

typedef struct {
  int allocated;
} vvec;
int vvneeds_want, mgpssort;
void vvinit(vvec *v, int minelems) { v->allocated = -minelems; }
void vvneeds(vvec *v, int needed) {
  if (needed > v->allocated)
    if (v->allocated < 0)
      ;
    else {
      int next = v->allocated + (v->allocated >> 1);
      vvneeds_want = next;
    }
}
void mgpssort_1() {
  vvinit(&mgpssort, mgpssort_1);
  vvneeds(&mgpssort, mgpssort_1);
}

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

* [Bug c/105597] ice in type, at value-range.h:223
  2022-05-13 17:03 [Bug c/105597] New: ice in type, at value-range.h:223 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2022-05-13 17:21 ` dcb314 at hotmail dot com
@ 2022-05-13 17:21 ` mpolacek at gcc dot gnu.org
  2022-05-13 18:41 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-13 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-05-13
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed then.

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

* [Bug c/105597] ice in type, at value-range.h:223
  2022-05-13 17:03 [Bug c/105597] New: ice in type, at value-range.h:223 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2022-05-13 17:21 ` mpolacek at gcc dot gnu.org
@ 2022-05-13 18:41 ` cvs-commit at gcc dot gnu.org
  2022-05-13 18:42 ` amacleod at redhat dot com
  2022-10-28 20:19 ` [Bug tree-optimization/105597] [13 Regression] " pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-13 18:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:e97e99296505e6015bc9e281364818bb89ca8a49

commit r13-449-ge97e99296505e6015bc9e281364818bb89ca8a49
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Fri May 13 13:11:18 2022 -0400

    Check operand for type, not LHS.

    When folding, the LHS has not been set, so we should be checking the type
of
    op1.  We should also make sure op1 is not undefined.

            PR tree-optimization/105597
            gcc/
            * range-op.cc (operator_minus::lhs_op1_relation): Use op1 instead
            of the lhs and make sure it is not undefined.
            gcc/testsuite/
            * gcc.dg/pr105597.c: New.

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

* [Bug c/105597] ice in type, at value-range.h:223
  2022-05-13 17:03 [Bug c/105597] New: ice in type, at value-range.h:223 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2022-05-13 18:41 ` cvs-commit at gcc dot gnu.org
@ 2022-05-13 18:42 ` amacleod at redhat dot com
  2022-10-28 20:19 ` [Bug tree-optimization/105597] [13 Regression] " pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2022-05-13 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

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

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

* [Bug tree-optimization/105597] [13 Regression] ice in type, at value-range.h:223
  2022-05-13 17:03 [Bug c/105597] New: ice in type, at value-range.h:223 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2022-05-13 18:42 ` amacleod at redhat dot com
@ 2022-10-28 20:19 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-28 20:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

end of thread, other threads:[~2022-10-28 20:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 17:03 [Bug c/105597] New: ice in type, at value-range.h:223 dcb314 at hotmail dot com
2022-05-13 17:07 ` [Bug c/105597] " dcb314 at hotmail dot com
2022-05-13 17:14 ` amacleod at redhat dot com
2022-05-13 17:21 ` dcb314 at hotmail dot com
2022-05-13 17:21 ` mpolacek at gcc dot gnu.org
2022-05-13 18:41 ` cvs-commit at gcc dot gnu.org
2022-05-13 18:42 ` amacleod at redhat dot com
2022-10-28 20:19 ` [Bug tree-optimization/105597] [13 Regression] " pinskia 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).