[patch] Obvious fix ICE in vectorizer's pattern recognition

Ira Rosen IRAR@il.ibm.com
Mon Feb 5 07:13:00 GMT 2007


This patch adds a check for the value returned by
get_vectype_for_scalar_type(). Without such check we got ICE for the
attached testcase.

Bootstrapped and tested on ppc-linux. If no objections will commit tomorrow
as obvious.

Thanks to Revital for the reduced testcase.

Ira

ChangeLog:

      * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Check that
      vectype is not NULL.
      (vect_pattern_recog_1): Likewise.


Index: tree-vect-patterns.c
===================================================================
*** tree-vect-patterns.c        (revision 121569)
--- tree-vect-patterns.c        (working copy)
*************** vect_recog_widen_mult_pattern (tree last
*** 386,392 ****

    /* Check target support  */
    vectype = get_vectype_for_scalar_type (half_type0);
!   if (!supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt,
vectype,
                                         &dummy, &dummy, &dummy_code,
                                         &dummy_code))
      return NULL;
--- 386,393 ----

    /* Check target support  */
    vectype = get_vectype_for_scalar_type (half_type0);
!   if (!vectype
!       || !supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt,
vectype,
                                         &dummy, &dummy, &dummy_code,
                                         &dummy_code))
      return NULL;
*************** vect_pattern_recog_1 (
*** 647,652 ****
--- 648,656 ----

        /* Check target support  */
        pattern_vectype = get_vectype_for_scalar_type (type_in);
+       if (!pattern_vectype)
+         return;
+
        optab = optab_for_tree_code (TREE_CODE (pattern_expr),
pattern_vectype);
        vec_mode = TYPE_MODE (pattern_vectype);
        if (!optab

Testcase:

(See attached file: vect-117.c.txt)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vect-117.c.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070205/00635bc8/attachment.txt>


More information about the Gcc-patches mailing list