[Bug sanitizer/71872] New: ICE in inchash::add_expr, at tree.c:7782 - OEP_ADDRESS_OF asserted for ADDR_EXPR applied to constant

gary at intrepid dot com gcc-bugzilla@gcc.gnu.org
Thu Jul 14 04:17:00 GMT 2016


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

            Bug ID: 71872
           Summary: ICE in inchash::add_expr, at tree.c:7782 -
                    OEP_ADDRESS_OF asserted for ADDR_EXPR applied to
                    constant
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gary at intrepid dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Created attachment 38895
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38895&action=edit
Non-reduced, pre-processed, test case for ICE in inchash::add_expr

See also PR 70683.

When the attached test case is compiled with -O3 and gcc checks are enabled,
the following ICE is triggered.

It looks like this check was added by trunk revision r23546.

ice-hash-expr.i: In function ‘main’:
ice-hash-expr.i:300:1: internal compiler error: in add_expr, at tree.c:7782
 main ()
 ^~~~
0xde5865 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree.c:7782
0xde65d3 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree.c:7997
0xba4406 iterative_hash_expr
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree.h:4786
0xba4406 innermost_loop_behavior_hash::hash(innermost_loop_behavior* const&)
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree-if-conv.c:150
0xba4406
simple_hashmap_traits<default_hash_traits<innermost_loop_behavior_hash>,
data_reference*>::hash(innermost_loop_behavior* const&)
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/hash-map-traits.h:48
0xba4406 hash_map<innermost_loop_behavior_hash, data_reference*,
simple_hashmap_traits<default_hash_traits<innermost_loop_behavior_hash>,
data_reference*> >::get_or_insert(innermost_loop_behavior* const&, bool*)
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/hash-map.h:161
0xba4406 hash_memrefs_baserefs_and_store_DRs_read_written_info
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree-if-conv.c:693
0xba4406 if_convertible_loop_p_1
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree-if-conv.c:1410
0xba4406 if_convertible_loop_p
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree-if-conv.c:1490
0xba6e41 tree_if_conversion
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree-if-conv.c:2647
0xba6e41 execute
        /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/tree-if-conv.c:2749

The offending tree expression looks like this:

<addr_expr 0x7fffeff80200
    type <pointer_type 0x7fffefe2d930
        type <integer_type 0x7fffefe0c888 unsigned int sizes-gimplified public
unsigned SI
            size <integer_cst 0x7fffefe08ee8 constant 32>
            unit size <integer_cst 0x7fffefe08f00 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x7fffefe0c888
precision 32 min <integer_cst 0x7fffefe08f18 0> max <integer_cst 0x7fffefe08ed0
4294967295> context <translation_unit_decl 0x7fffeff47168 D.1906>
            pointer_to_this <pointer_type 0x7fffefe2d930>>
        public unsigned DI
        size <integer_cst 0x7fffefe08ca8 constant 64>
        unit size <integer_cst 0x7fffefe08cc0 constant 8>
        align 64 symtab 0 alias set -1 canonical type 0x7fffefe2d930>
    constant
    arg 0 <integer_cst 0x7fffeff43330 type <integer_type 0x7fffefe0c888
unsigned int> constant 1>>

The assertion check is at line 7782.

7777           identity.  */
7778        case VOID_CST:
7779          hstate.merge_hash (0);
7780          return;
7781        case INTEGER_CST:
7782          gcc_checking_assert (!(flags & OEP_ADDRESS_OF));
7783          for (i = 0; i < TREE_INT_CST_EXT_NUNITS (t); i++)
7784            hstate.add_wide_int (TREE_INT_CST_ELT (t, i));
7785          return;
7786        case REAL_CST:


More information about the Gcc-bugs mailing list