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] Fix tree-optimization/23853


This patch fixes the ICE in tree-vect-analyze that is caused by
a overflown misalignment value.  Blindly using tree_low_cst on
it causes an assert to trigger.  Solved by using host_integerp (, 1)
instead of tree_int_cst_sgn () < 0 in the sanity check above it.
We also can use TREE_INT_CST_LOW then.

Bootstrapped and regtested on x86_64-unknown-linux-gnu with
vectorization enabled.

Looks obvious, but - ok for mainline?

Thanks,
Richard.

:ADDPATCH vectorizer:


2005-09-15  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/23853
	* tree-vect-analyze.c (vect_compute_data_ref_alignment): Use
	host_integerp to verify misalignment value.


Index: tree-vect-analyze.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vect-analyze.c,v
retrieving revision 2.36
diff -c -3 -p -r2.36 tree-vect-analyze.c
*** tree-vect-analyze.c	6 Sep 2005 10:58:49 -0000	2.36
--- tree-vect-analyze.c	15 Sep 2005 09:03:11 -0000
*************** vect_compute_data_ref_alignment (struct 
*** 773,787 ****
    /* Modulo alignment.  */
    misalign = size_binop (TRUNC_MOD_EXPR, misalign, alignment);
  
!   if (tree_int_cst_sgn (misalign) < 0)
      {
!       /* Negative misalignment value.  */
        if (vect_print_dump_info (REPORT_DETAILS))
  	fprintf (vect_dump, "unexpected misalign value");
        return false;
      }
  
!   DR_MISALIGNMENT (dr) = tree_low_cst (misalign, 1);
  
    if (vect_print_dump_info (REPORT_DETAILS))
      {
--- 773,787 ----
    /* Modulo alignment.  */
    misalign = size_binop (TRUNC_MOD_EXPR, misalign, alignment);
  
!   if (!host_integerp (misalign, 1))
      {
!       /* Negative or overflown misalignment value.  */
        if (vect_print_dump_info (REPORT_DETAILS))
  	fprintf (vect_dump, "unexpected misalign value");
        return false;
      }
  
!   DR_MISALIGNMENT (dr) = TREE_INT_CST_LOW (misalign);
  
    if (vect_print_dump_info (REPORT_DETAILS))
      {


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