This fixes a fallout of the fix for PR58417 - the assert in
build_polynomial_chrec is too strict and I wonder why we haven't
been running into this before.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2013-09-20  Richard Biener  <rguent...@suse.de>

        PR middle-end/58473
        * tree-chrec.h (build_polynomial_chrec): Use gcc_checking_assert,
        make type comparison less strict.

Index: gcc/tree-chrec.h
===================================================================
*** gcc/tree-chrec.h    (revision 202766)
--- gcc/tree-chrec.h    (working copy)
*************** build_polynomial_chrec (unsigned loop_nu
*** 137,151 ****
        || !val)
      return chrec_dont_know;
  
!   /* Pointer types should occur only on the left hand side, i.e. in
!      the base of the chrec, and not in the step.  */
!   gcc_assert (!POINTER_TYPE_P (TREE_TYPE (right)));
! 
!   /* Types of left and right sides of a chrec should be compatible.  */
    if (POINTER_TYPE_P (TREE_TYPE (left)))
!     gcc_assert (ptrofftype_p (TREE_TYPE (right)));
    else
!     gcc_assert (TREE_TYPE (left) == TREE_TYPE (right));
  
    if (chrec_zerop (right))
      return left;
--- 137,154 ----
        || !val)
      return chrec_dont_know;
  
!   /* Types of left and right sides of a chrec should be compatible, but
!      pointer CHRECs are special in that the evolution is of ptroff type.  */
    if (POINTER_TYPE_P (TREE_TYPE (left)))
!     gcc_checking_assert (ptrofftype_p (TREE_TYPE (right)));
    else
!     {
!       /* Pointer types should occur only on the left hand side, i.e. in
!        the base of the chrec, and not in the step.  */
!       gcc_checking_assert (!POINTER_TYPE_P (TREE_TYPE (right))
!                          && types_compatible_p (TREE_TYPE (left),
!                                                 TREE_TYPE (right)));
!     }
  
    if (chrec_zerop (right))
      return left;

Reply via email to