This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/51990] ICE in copy_reference_ops_from_ref


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51990

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-25
     Ever Confirmed|0                           |1

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-25 10:39:12 UTC ---
(In reply to comment #1)
> tentative fix:
> 
> Index: gcc/tree-ssa-sccvn.c
> ===================================================================
> --- gcc/tree-ssa-sccvn.c (revision 183325)
> +++ gcc/tree-ssa-sccvn.c (working copy)
> @@ -624,6 +624,10 @@ copy_reference_ops_from_ref (tree ref, V
> 
>        switch (temp.opcode)
>      {
> +    case WITH_SIZE_EXPR:
> +      temp.op0 = TREE_OPERAND (ref, 1);
> +      temp.off = 0;
> +      break;
>      case MEM_REF:
>        /* The base address gets its own vn_reference_op_s structure.  */
>        temp.op0 = TREE_OPERAND (ref, 1);
> @@ -740,6 +744,7 @@ copy_reference_ops_from_ref (tree ref, V
>        VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
> 
>        if (REFERENCE_CLASS_P (ref)
> +      || TREE_CODE (ref) == WITH_SIZE_EXPR
>        || (TREE_CODE (ref) == ADDR_EXPR
>            && !is_gimple_min_invariant (ref)))
>      ref = TREE_OPERAND (ref, 0);

I think there are a lot of bugs lurking in the compiler with respect to
not handling WITH_SIZE_EXPR (which incidentially isn't a handled-component,
nor tcc_reference ...).  You btw. also need to handle re-materializing
them in create_component_ref_by_pieces_1.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]