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] for PR 27779


Hello,

we access CHREC_LEFT directly in analyze_siv_subscript_cst_affine; this
is wrong, as there is no guarantee that the result of
analyze_siv_subscript_cst_affine is a polynomial_chrec.  This patch
makes us use initial_condition instead.

Bootstrapped & regtested on x86_64 and ppc.

Zdenek

	PR tree-optimization/27779
	* tree-data-ref.c (analyze_siv_subscript_cst_affine): Use
	initial_condition instead of CHREC_LEFT.

Index: tree-data-ref.c
===================================================================
*** tree-data-ref.c	(revision 114194)
--- tree-data-ref.c	(working copy)
*************** analyze_siv_subscript_cst_affine (tree c
*** 2332,2338 ****
    chrec_a = chrec_convert (integer_type_node, chrec_a, NULL_TREE);
    chrec_b = chrec_convert (integer_type_node, chrec_b, NULL_TREE);
    difference = chrec_fold_minus 
!     (integer_type_node, CHREC_LEFT (chrec_b), chrec_a);
    
    if (!chrec_is_positive (initial_condition (difference), &value0))
      {
--- 2332,2338 ----
    chrec_a = chrec_convert (integer_type_node, chrec_a, NULL_TREE);
    chrec_b = chrec_convert (integer_type_node, chrec_b, NULL_TREE);
    difference = chrec_fold_minus 
!     (integer_type_node, initial_condition (chrec_b), chrec_a);
    
    if (!chrec_is_positive (initial_condition (difference), &value0))
      {


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