public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107170] New: ICE on valid code: in as_a, at value-range.h:381
@ 2022-10-06 15:59 k.even-mendoza at imperial dot ac.uk
  2022-10-06 16:55 ` [Bug c/107170] " aldyh at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: k.even-mendoza at imperial dot ac.uk @ 2022-10-06 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107170
           Summary: ICE on valid code: in as_a, at value-range.h:381
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: k.even-mendoza at imperial dot ac.uk
  Target Milestone: ---

The following code crashed GCC-13 when compiling with -O2, -O3 or -Os in Ubuntu
18, x-86_64; GCC-12, from April, seems to work fine.

===
#include <stdlib.h>
int main() {
  double a;
  if (__builtin_signbit(a))
    abort();
}
===
The trace:

during GIMPLE pass: vrp
fuzzer-file-12773.c: In function 'main':
fuzzer-file-12773.c:2:5: internal compiler error: in as_a, at value-range.h:381
    2 | int main() {
      |     ^~~~
0x80bc97 irange& as_a<irange>(vrange&)
        .././../gcc-source/gcc/value-range.h:381
0x80bc97 irange& as_a<irange>(vrange&)
        .././../gcc-source/gcc/value-range.h:379
0x80bc97 vrange::operator=(vrange const&)
        .././../gcc-source/gcc/value-range.cc:202
0x80bc97 vrange::operator=(vrange const&)
        .././../gcc-source/gcc/value-range.cc:199
0x12c61f2 vr_values::range_of_expr(vrange&, tree_node*, gimple*)
        .././../gcc-source/gcc/vr-values.cc:188
0x1cf1f17 fold_using_range::range_of_range_op(vrange&,
gimple_range_op_handler&, fur_source&)
        .././../gcc-source/gcc/gimple-range-fold.cc:550
0x1cf3c10 fold_using_range::fold_stmt(vrange&, gimple*, fur_source&,
tree_node*)
        .././../gcc-source/gcc/gimple-range-fold.cc:489
0x1cf402b fold_range(vrange&, gimple*, range_query*)
        .././../gcc-source/gcc/gimple-range-fold.cc:316
0x12c9e9f vr_values::extract_range_basic(value_range_equiv*, gimple*)
        .././../gcc-source/gcc/vr-values.cc:1245
0x12269fd vrp_prop::visit_stmt(gimple*, edge_def**, tree_node**)
        .././../gcc-source/gcc/tree-vrp.cc:3865
0x111c5a6 ssa_propagation_engine::simulate_stmt(gimple*)
        .././../gcc-source/gcc/tree-ssa-propagate.cc:230
0x111c892 ssa_propagation_engine::simulate_block(basic_block_def*)
        .././../gcc-source/gcc/tree-ssa-propagate.cc:337
0x111ccc3 ssa_propagation_engine::ssa_propagate()
        .././../gcc-source/gcc/tree-ssa-propagate.cc:504
0x12331f5 execute_vrp
        .././../gcc-source/gcc/tree-vrp.cc:4215

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

* [Bug c/107170] ICE on valid code: in as_a, at value-range.h:381
  2022-10-06 15:59 [Bug c/107170] New: ICE on valid code: in as_a, at value-range.h:381 k.even-mendoza at imperial dot ac.uk
@ 2022-10-06 16:55 ` aldyh at gcc dot gnu.org
  2022-10-06 17:31 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-10-06 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |aldyh at gcc dot gnu.org
   Last reconfirmed|                            |2022-10-06
     Ever confirmed|0                           |1
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |aldyh at gcc dot gnu.org

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

* [Bug c/107170] ICE on valid code: in as_a, at value-range.h:381
  2022-10-06 15:59 [Bug c/107170] New: ICE on valid code: in as_a, at value-range.h:381 k.even-mendoza at imperial dot ac.uk
  2022-10-06 16:55 ` [Bug c/107170] " aldyh at gcc dot gnu.org
@ 2022-10-06 17:31 ` aldyh at gcc dot gnu.org
  2022-10-06 17:37 ` [Bug tree-optimization/107170] [13 Regression] " pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-10-06 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Created attachment 53672
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53672&action=edit
untested patch

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

* [Bug tree-optimization/107170] [13 Regression] ICE on valid code: in as_a, at value-range.h:381
  2022-10-06 15:59 [Bug c/107170] New: ICE on valid code: in as_a, at value-range.h:381 k.even-mendoza at imperial dot ac.uk
  2022-10-06 16:55 ` [Bug c/107170] " aldyh at gcc dot gnu.org
  2022-10-06 17:31 ` aldyh at gcc dot gnu.org
@ 2022-10-06 17:37 ` pinskia at gcc dot gnu.org
  2022-10-06 18:44 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-06 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |tree-optimization
   Target Milestone|---                         |13.0
            Summary|ICE on valid code: in as_a, |[13 Regression] ICE on
                   |at value-range.h:381        |valid code: in as_a, at
                   |                            |value-range.h:381

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

* [Bug tree-optimization/107170] [13 Regression] ICE on valid code: in as_a, at value-range.h:381
  2022-10-06 15:59 [Bug c/107170] New: ICE on valid code: in as_a, at value-range.h:381 k.even-mendoza at imperial dot ac.uk
                   ` (2 preceding siblings ...)
  2022-10-06 17:37 ` [Bug tree-optimization/107170] [13 Regression] " pinskia at gcc dot gnu.org
@ 2022-10-06 18:44 ` marxin at gcc dot gnu.org
  2022-10-06 20:41 ` cvs-commit at gcc dot gnu.org
  2022-10-06 20:42 ` aldyh at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-06 18:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |marxin at gcc dot gnu.org

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

* [Bug tree-optimization/107170] [13 Regression] ICE on valid code: in as_a, at value-range.h:381
  2022-10-06 15:59 [Bug c/107170] New: ICE on valid code: in as_a, at value-range.h:381 k.even-mendoza at imperial dot ac.uk
                   ` (3 preceding siblings ...)
  2022-10-06 18:44 ` marxin at gcc dot gnu.org
@ 2022-10-06 20:41 ` cvs-commit at gcc dot gnu.org
  2022-10-06 20:42 ` aldyh at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-06 20:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:49b9a8c8cc498b1ed2f566bee858e651e14ba37b

commit r13-3139-g49b9a8c8cc498b1ed2f566bee858e651e14ba37b
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Thu Oct 6 19:11:08 2022 +0200

    [PR107170] Avoid copying incompatible types in legacy VRP.

    Legacy VRP is calling ranger deep inside the bowels, and then trying to
    copy an incompatible type.  My previous patch in this area assumed that
    the only possibility out of vr_values::get_value_range for an
    unsupported type was VARYING, but UNDEFINED can also be returned.

            PR tree-optimization/107170

    gcc/ChangeLog:

            * vr-values.cc (vr_values::range_of_expr):  Do not die on
            unsupported types.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/pr107170.c: New test.

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

* [Bug tree-optimization/107170] [13 Regression] ICE on valid code: in as_a, at value-range.h:381
  2022-10-06 15:59 [Bug c/107170] New: ICE on valid code: in as_a, at value-range.h:381 k.even-mendoza at imperial dot ac.uk
                   ` (4 preceding siblings ...)
  2022-10-06 20:41 ` cvs-commit at gcc dot gnu.org
@ 2022-10-06 20:42 ` aldyh at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-10-06 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 15:59 [Bug c/107170] New: ICE on valid code: in as_a, at value-range.h:381 k.even-mendoza at imperial dot ac.uk
2022-10-06 16:55 ` [Bug c/107170] " aldyh at gcc dot gnu.org
2022-10-06 17:31 ` aldyh at gcc dot gnu.org
2022-10-06 17:37 ` [Bug tree-optimization/107170] [13 Regression] " pinskia at gcc dot gnu.org
2022-10-06 18:44 ` marxin at gcc dot gnu.org
2022-10-06 20:41 ` cvs-commit at gcc dot gnu.org
2022-10-06 20:42 ` 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).