[Bug c++/83902] [8 Regression] ice in decompose, at wide-int.h:932

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 17 08:50:00 GMT 2018


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-01-17
   Target Milestone|---                         |8.0
            Summary|ice in decompose, at        |[8 Regression] ice in
                   |wide-int.h:932              |decompose, at
                   |                            |wide-int.h:932
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

> ./cc1plus  -quiet t.ii
t.ii: In member function ‘void b<a>::c()’:
t.ii:3:48: internal compiler error: in decompose, at wide-int.h:933
   void c() { memset(4, 0, 4 * a * sizeof(float)); }
                                                ^
0x8e2e36 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&)
        /space/rguenther/src/svn/early-lto-debug/gcc/wide-int.h:933
0x939858 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)
        /space/rguenther/src/svn/early-lto-debug/gcc/wide-int.h:983
0x939166 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)
        /space/rguenther/src/svn/early-lto-debug/gcc/wide-int.h:758
0xe51776 wi::binary_traits<generic_wide_int<wide_int_ref_storage<false, false>
>, generic_wide_int<wide_int_ref_storage<false, false> >,
wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> >
>::precision_type, wi::int_traits<generic_wide_int<wide_int_ref_storage<false,
false> > >::precision_type>::result_type
wi::mul<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, bool*)
        /space/rguenther/src/svn/early-lto-debug/gcc/wide-int.h:2538
0x18e271d generic_simplify_MULT_EXPR
        /abuild/rguenther/obj-early-lto-debug-g/gcc/generic-match.c:22503
0x192dba7 generic_simplify(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)

this is

/* #line 301 "/space/rguenther/src/svn/early-lto-debug/gcc/match.pd" */
 bool overflow_p;
 wide_int mul = wi::mul (wi::to_wide (captures[1]), wi::to_wide (captures[2]),
TYPE_SIGN (type), &overflow_p);

/* Combine successive multiplications.  Similar to above, but handling
   overflow is different.  */
(simplify
 (mult (mult @0 INTEGER_CST@1) INTEGER_CST@2)
 (with {
   bool overflow_p;
   wide_int mul = wi::mul (wi::to_wide (@1), wi::to_wide (@2),
                           TYPE_SIGN (type), &overflow_p);
  }

(gdb) p debug_tree (captures[1])
 <integer_cst 0x7ffff68b25a0 type <integer_type 0x7ffff68af5e8 int> constant 4>
$1 = void
(gdb) p debug_tree (captures[2])
 <integer_cst 0x7ffff6a00240 type <integer_type 0x7ffff68af7e0 long unsigned
int> constant 4>
$2 = void

so somehow bougs GENERIC is folded.

#9  0x00000000008d2920 in cp_fold (x=<mult_expr 0x7ffff69ff4d8>)
    at /space/rguenther/src/svn/early-lto-debug/gcc/cp/cp-gimplify.c:2276
2276                x = fold_build2_loc (loc, code, TREE_TYPE (x), op0, op1);
(gdb) p debug_generic_expr (x)
(4 * <<< Unknown tree: template_parm_index >>>) * <<< Unknown tree: sizeof_expr
  float >>>

(gdb) p debug_tree (x)
 <mult_expr 0x7ffff69ff4d8
    type <integer_type 0x7ffff68af7e0 long unsigned int public unsigned type_6
DI
        size <integer_cst 0x7ffff6892e70 constant 64>
        unit-size <integer_cst 0x7ffff6892e88 constant 8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff68af7e0 precision:64 min <integer_cst 0x7ffff68b2150 0> max <integer_cst
0x7ffff68935c0 18446744073709551615>
        pointer_to_this <pointer_type 0x7ffff68bf540>>

    arg:0 <mult_expr 0x7ffff69ff488
        type <integer_type 0x7ffff68af5e8 int public type_6 SI

kaboom.  C++ FE issue (or bogus folding elsewhere - didn't track down further).


More information about the Gcc-bugs mailing list