public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96967] New: [11 Regression] ICE in decompose,  at wide-int.h:984
@ 2020-09-08  2:03 asolokha at gmx dot com
  2020-09-08  7:05 ` [Bug tree-optimization/96967] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2020-09-08  2:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96967
           Summary: [11 Regression] ICE in decompose, at wide-int.h:984
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-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-alpha20200906 snapshot (g:23f8b90c401842afcbaa50a7fd3c2f37818f4396)
ICEs when compiling the following testcase w/ -O2 -fshort-enums:

enum re {
  o3,
};

int
uj (int mq, enum re dn)
{
  enum re nr = mq;

  switch (nr)
    {
    case 4:
      if (dn == 0)
        goto wdev_inactive_unlock;
      break;

    default:
      break;
    }

  switch (nr)
    {
    case 0:
    case 4:
      return 0;

    default:
      break;
    }

 wdev_inactive_unlock:
  return 1;
}

% gcc-11.0.0 -O2 -fshort-enums -c cvihn9ij.c
during GIMPLE pass: vrp
cvihn9ij.c: In function 'uj':
cvihn9ij.c:6:1: internal compiler error: in decompose, at wide-int.h:984
    6 | uj (int mq, enum re dn)
      | ^~
0x70e4c0 wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> >
>::decompose(long*, unsigned int, generic_wide_int<wide_int_ref_storage<false,
false> > const&)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/wide-int.h:984
0x1070b85 wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> >
>::decompose(long*, unsigned int, generic_wide_int<wide_int_ref_storage<false,
false> > const&)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/wide-int.h:1931
0x1070b85 wide_int_ref_storage<false,
false>::wide_int_ref_storage<generic_wide_int<wide_int_ref_storage<false,
false> > >(generic_wide_int<wide_int_ref_storage<false, false> > const&,
unsigned int)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/wide-int.h:1034
0x1070b85 generic_wide_int<wide_int_ref_storage<false, false>
>::generic_wide_int<generic_wide_int<wide_int_ref_storage<false, false> >
>(generic_wide_int<wide_int_ref_storage<false, false> > const&, unsigned int)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/wide-int.h:790
0x1070b85 bool wi::ltu_p<generic_wide_int<wide_int_ref_storage<false, false> >,
generic_wide_int<wide_int_ref_storage<false, false> >
>(generic_wide_int<wide_int_ref_storage<false, false> > const&,
generic_wide_int<wide_int_ref_storage<false, false> > const&)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/wide-int.h:1935
0x106ed94 bool wi::lt_p<generic_wide_int<wide_int_ref_storage<false, false> >,
generic_wide_int<wide_int_ref_storage<false, false> >
>(generic_wide_int<wide_int_ref_storage<false, false> > const&,
generic_wide_int<wide_int_ref_storage<false, false> > const&, signop)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/wide-int.h:1961
0x106ed94 irange::irange_intersect(irange const&)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/value-range.cc:1701
0x106f049 irange::intersect(irange const*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/value-range.cc:1539
0x1029e02 find_case_label_range(gswitch*, irange const*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-vrp.c:3831
0xf88a63 simplify_control_stmt_condition
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-ssa-threadedge.c:554
0xf89840 thread_through_normal_block
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-ssa-threadedge.c:1101
0xf8b50d thread_through_normal_block
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-ssa-threadedge.c:1302
0xf8b50d thread_across_edge
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-ssa-threadedge.c:1259
0xf8b7cf thread_outgoing_edges(basic_block_def*, gcond*, const_and_copies*,
avail_exprs_stack*, evrp_range_analyzer*, tree_node* (*)(gimple*, gimple*,
avail_exprs_stack*, basic_block_def*))
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-ssa-threadedge.c:1463
0x1024748 vrp_dom_walker::after_dom_children(basic_block_def*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-vrp.c:4286
0x16d8687 dom_walker::walk(basic_block_def*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/domwalk.c:352
0x10337f1 identify_jump_threads
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-vrp.c:4341
0x10337f1 execute_vrp
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200906/work/gcc-11-20200906/gcc/tree-vrp.c:4480

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

* [Bug tree-optimization/96967] [11 Regression] ICE in decompose, at wide-int.h:984
  2020-09-08  2:03 [Bug tree-optimization/96967] New: [11 Regression] ICE in decompose, at wide-int.h:984 asolokha at gmx dot com
@ 2020-09-08  7:05 ` rguenth at gcc dot gnu.org
  2020-09-08  7:52 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-08  7:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug tree-optimization/96967] [11 Regression] ICE in decompose, at wide-int.h:984
  2020-09-08  2:03 [Bug tree-optimization/96967] New: [11 Regression] ICE in decompose, at wide-int.h:984 asolokha at gmx dot com
  2020-09-08  7:05 ` [Bug tree-optimization/96967] " rguenth at gcc dot gnu.org
@ 2020-09-08  7:52 ` aldyh at gcc dot gnu.org
  2020-09-08 11:44 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-09-08  7:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-09-08
     Ever confirmed|0                           |1

--- Comment #1 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Confirmed.

This is the same issue as PR96818.  It's another intersect that's missing a
cast.  Testing the following patch:

diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index f7b0692..b493e40 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -3828,6 +3828,8 @@ find_case_label_range (gswitch *switch_stmt, const irange
*range_of_op)
       tree case_high
        = CASE_HIGH (label) ? CASE_HIGH (label) : CASE_LOW (label);
       int_range_max label_range (CASE_LOW (label), case_high);
+      if (!types_compatible_p (label_range.type (), range_of_op->type ()))
+       range_cast (label_range, range_of_op->type ());
       label_range.intersect (range_of_op);
       if (label_range == *range_of_op)
        return label;

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

* [Bug tree-optimization/96967] [11 Regression] ICE in decompose, at wide-int.h:984
  2020-09-08  2:03 [Bug tree-optimization/96967] New: [11 Regression] ICE in decompose, at wide-int.h:984 asolokha at gmx dot com
  2020-09-08  7:05 ` [Bug tree-optimization/96967] " rguenth at gcc dot gnu.org
  2020-09-08  7:52 ` aldyh at gcc dot gnu.org
@ 2020-09-08 11:44 ` cvs-commit at gcc dot gnu.org
  2020-09-08 11:47 ` aldyh at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-08 11:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:19b0fed7c2d3663f0f144ca8557b6af29bafa4e3

commit r11-3049-g19b0fed7c2d3663f0f144ca8557b6af29bafa4e3
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Tue Sep 8 07:42:03 2020 +0000

    PR tree-optimization/96967 - cast label range to type of switch operand

            PR tree-optimization/96967
            * tree-vrp.c (find_case_label_range): Cast label range to
            type of switch operand.

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

* [Bug tree-optimization/96967] [11 Regression] ICE in decompose, at wide-int.h:984
  2020-09-08  2:03 [Bug tree-optimization/96967] New: [11 Regression] ICE in decompose, at wide-int.h:984 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-09-08 11:44 ` cvs-commit at gcc dot gnu.org
@ 2020-09-08 11:47 ` aldyh at gcc dot gnu.org
  2020-11-02  7:35 ` cvs-commit at gcc dot gnu.org
  2020-11-02  7:39 ` clyon at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-09-08 11:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug tree-optimization/96967] [11 Regression] ICE in decompose, at wide-int.h:984
  2020-09-08  2:03 [Bug tree-optimization/96967] New: [11 Regression] ICE in decompose, at wide-int.h:984 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-09-08 11:47 ` aldyh at gcc dot gnu.org
@ 2020-11-02  7:35 ` cvs-commit at gcc dot gnu.org
  2020-11-02  7:39 ` clyon at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-02  7:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Christophe Lyon <clyon@gcc.gnu.org>:

https://gcc.gnu.org/g:4d9af90d6a216822fe117337fb9836ba656dc3af

commit r11-4598-g4d9af90d6a216822fe117337fb9836ba656dc3af
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Mon Nov 2 07:31:22 2020 +0000

    arm: Avoid indirection with -mpure-code on v6m (PR96967)

    With -mpure-code on v6m (thumb-1), to avoid a useless indirection when
    building the address of a symbol, we want to consider SYMBOL_REF as a
    legitimate constant. This way, we build the address using a series of
    upper/lower relocations instead of loading the address from memory.

    This patch also fixes a missing "clob" conds attribute for
    thumb1_movsi_insn, needed because that alternative clobbers the flags.

    2020-11-02  Christophe Lyon  <christophe.lyon@linaro.org>

            gcc/
            PR target/96967
            * config/arm/arm.c (thumb_legitimate_constant_p): Add support for
            disabled literal pool in thumb-1.
            * config/arm/thumb1.md (thumb1_movsi_symbol_ref): Remove.
            (*thumb1_movsi_insn): Add support for SYMBOL_REF with -mpure-code.

            gcc/testsuite
            PR target/96967
            * gcc.target/arm/pure-code/pr96767.c: New test.

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

* [Bug tree-optimization/96967] [11 Regression] ICE in decompose, at wide-int.h:984
  2020-09-08  2:03 [Bug tree-optimization/96967] New: [11 Regression] ICE in decompose, at wide-int.h:984 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2020-11-02  7:35 ` cvs-commit at gcc dot gnu.org
@ 2020-11-02  7:39 ` clyon at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-11-02  7:39 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

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

--- Comment #5 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Sorry comment #4 is unrelated to this PR, I made a typo and meant PR96767.

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

end of thread, other threads:[~2020-11-02  7:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08  2:03 [Bug tree-optimization/96967] New: [11 Regression] ICE in decompose, at wide-int.h:984 asolokha at gmx dot com
2020-09-08  7:05 ` [Bug tree-optimization/96967] " rguenth at gcc dot gnu.org
2020-09-08  7:52 ` aldyh at gcc dot gnu.org
2020-09-08 11:44 ` cvs-commit at gcc dot gnu.org
2020-09-08 11:47 ` aldyh at gcc dot gnu.org
2020-11-02  7:35 ` cvs-commit at gcc dot gnu.org
2020-11-02  7:39 ` clyon 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).