re PR c++/54538 (Getting assembler messages when compiling)
[gcc.git] / gcc / tree-chrec.h
index b9bf71e9d08ed747e0838b25c9eda864680866c5..836780267524ce59bf3c5988fc905235d8338421 100644 (file)
@@ -77,7 +77,6 @@ extern void for_each_scev_op (tree *, bool (*) (tree *, void *), void *);
 /* Observers.  */
 extern bool eq_evolutions_p (const_tree, const_tree);
 extern bool is_multivariate_chrec (const_tree);
-extern bool chrec_is_positive (tree, bool *);
 extern bool chrec_contains_symbols (const_tree);
 extern bool chrec_contains_symbols_defined_in_loop (const_tree, unsigned);
 extern bool chrec_contains_undetermined (const_tree);
@@ -145,7 +144,7 @@ build_polynomial_chrec (unsigned loop_num,
 
   /* Types of left and right sides of a chrec should be compatible.  */
   if (POINTER_TYPE_P (TREE_TYPE (left)))
-    gcc_assert (sizetype == TREE_TYPE (right));
+    gcc_assert (ptrofftype_p (TREE_TYPE (right)));
   else
     gcc_assert (TREE_TYPE (left) == TREE_TYPE (right));
 
@@ -205,7 +204,9 @@ evolution_function_is_affine_p (const_tree chrec)
   return chrec
     && TREE_CODE (chrec) == POLYNOMIAL_CHREC
     && evolution_function_is_invariant_p (CHREC_RIGHT (chrec),
-                                         CHREC_VARIABLE (chrec));
+                                         CHREC_VARIABLE (chrec))
+    && (TREE_CODE (CHREC_RIGHT (chrec)) != POLYNOMIAL_CHREC
+       || evolution_function_is_affine_p (CHREC_RIGHT (chrec)));
 }
 
 /* Determines whether EXPR does not contains chrec expressions.  */