This is the mail archive of the gcc-patches@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]

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


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)

Attachment: vect-117.c.txt
Description: Text document


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