GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
/*@@ This file should be rewritten to use an arbitrary precision
@@ representation for "struct tree_int_cst" and "struct tree_real_cst".
overflow. */
bool
-may_negate_without_overflow_p (tree t)
+may_negate_without_overflow_p (const_tree t)
{
unsigned HOST_WIDE_INT val;
unsigned int prec;
{
tem = strip_float_extensions (t);
if (tem != t && negate_expr_p (tem))
- return negate_expr (tem);
+ return fold_convert (type, negate_expr (tem));
}
break;
If NOTRUNC is nonzero, do not truncate the result to fit the data type. */
tree
-int_const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
+int_const_binop (enum tree_code code, const_tree arg1, const_tree arg2, int notrunc)
{
unsigned HOST_WIDE_INT int1l, int2l;
HOST_WIDE_INT int1h, int2h;
/* Returns true, if ARG is convertible to TYPE using a NOP_EXPR. */
bool
-fold_convertible_p (tree type, tree arg)
+fold_convertible_p (const_tree type, const_tree arg)
{
tree orig = TREE_TYPE (arg);
to ensure that global memory is unchanged in between. */
int
-operand_equal_p (tree arg0, tree arg1, unsigned int flags)
+operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
{
/* If either is ERROR_MARK, they aren't equal. */
if (TREE_CODE (arg0) == ERROR_MARK || TREE_CODE (arg1) == ERROR_MARK)
/* Now see if all the arguments are the same. */
{
- call_expr_arg_iterator iter0, iter1;
- tree a0, a1;
- for (a0 = first_call_expr_arg (arg0, &iter0),
- a1 = first_call_expr_arg (arg1, &iter1);
+ const_call_expr_arg_iterator iter0, iter1;
+ const_tree a0, a1;
+ for (a0 = first_const_call_expr_arg (arg0, &iter0),
+ a1 = first_const_call_expr_arg (arg1, &iter1);
a0 && a1;
- a0 = next_call_expr_arg (&iter0),
- a1 = next_call_expr_arg (&iter1))
+ a0 = next_const_call_expr_arg (&iter0),
+ a1 = next_const_call_expr_arg (&iter1))
if (! operand_equal_p (a0, a1, flags))
return 0;
build_int_cst (type, 1), 0),
OEP_ONLY_CONST))
return pedantic_non_lvalue (fold_build2 (MIN_EXPR,
- type, arg1, arg2));
+ type,
+ fold_convert (type, arg1),
+ arg2));
break;
case LE_EXPR:
build_int_cst (type, 1), 0),
OEP_ONLY_CONST))
return pedantic_non_lvalue (fold_build2 (MIN_EXPR,
- type, arg1, arg2));
+ type,
+ fold_convert (type, arg1),
+ arg2));
break;
case GT_EXPR:
build_int_cst (type, 1), 0),
OEP_ONLY_CONST))
return pedantic_non_lvalue (fold_build2 (MAX_EXPR,
- type, arg1, arg2));
+ type,
+ fold_convert (type, arg1),
+ arg2));
break;
case GE_EXPR:
build_int_cst (type, 1), 0),
OEP_ONLY_CONST))
return pedantic_non_lvalue (fold_build2 (MAX_EXPR,
- type, arg1, arg2));
+ type,
+ fold_convert (type, arg1),
+ arg2));
break;
case NE_EXPR:
break;
evaluate the operands in reverse order. */
bool
-tree_swap_operands_p (tree arg0, tree arg1, bool reorder)
+tree_swap_operands_p (const_tree arg0, const_tree arg1, bool reorder)
{
STRIP_SIGN_NOPS (arg0);
STRIP_SIGN_NOPS (arg1);
upon failure. */
static int
-native_encode_int (tree expr, unsigned char *ptr, int len)
+native_encode_int (const_tree expr, unsigned char *ptr, int len)
{
tree type = TREE_TYPE (expr);
int total_bytes = GET_MODE_SIZE (TYPE_MODE (type));
upon failure. */
static int
-native_encode_real (tree expr, unsigned char *ptr, int len)
+native_encode_real (const_tree expr, unsigned char *ptr, int len)
{
tree type = TREE_TYPE (expr);
int total_bytes = GET_MODE_SIZE (TYPE_MODE (type));
upon failure. */
static int
-native_encode_complex (tree expr, unsigned char *ptr, int len)
+native_encode_complex (const_tree expr, unsigned char *ptr, int len)
{
int rsize, isize;
tree part;
upon failure. */
static int
-native_encode_vector (tree expr, unsigned char *ptr, int len)
+native_encode_vector (const_tree expr, unsigned char *ptr, int len)
{
int i, size, offset, count;
tree itype, elem, elements;
placed in the buffer, or zero upon failure. */
int
-native_encode_expr (tree expr, unsigned char *ptr, int len)
+native_encode_expr (const_tree expr, unsigned char *ptr, int len)
{
switch (TREE_CODE (expr))
{
If the buffer cannot be interpreted, return NULL_TREE. */
static tree
-native_interpret_int (tree type, unsigned char *ptr, int len)
+native_interpret_int (tree type, const unsigned char *ptr, int len)
{
int total_bytes = GET_MODE_SIZE (TYPE_MODE (type));
int byte, offset, word, words;
If the buffer cannot be interpreted, return NULL_TREE. */
static tree
-native_interpret_real (tree type, unsigned char *ptr, int len)
+native_interpret_real (tree type, const unsigned char *ptr, int len)
{
enum machine_mode mode = TYPE_MODE (type);
int total_bytes = GET_MODE_SIZE (mode);
If the buffer cannot be interpreted, return NULL_TREE. */
static tree
-native_interpret_complex (tree type, unsigned char *ptr, int len)
+native_interpret_complex (tree type, const unsigned char *ptr, int len)
{
tree etype, rpart, ipart;
int size;
If the buffer cannot be interpreted, return NULL_TREE. */
static tree
-native_interpret_vector (tree type, unsigned char *ptr, int len)
+native_interpret_vector (tree type, const unsigned char *ptr, int len)
{
tree etype, elem, elements;
int i, size, count;
return NULL_TREE. */
tree
-native_interpret_expr (tree type, unsigned char *ptr, int len)
+native_interpret_expr (tree type, const unsigned char *ptr, int len)
{
switch (TREE_CODE (type))
{
&& (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (TREE_TYPE (string))))
== MODE_INT)
&& (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (string)))) == 1))
- return fold_convert (TREE_TYPE (exp),
- build_int_cst (NULL_TREE,
- (TREE_STRING_POINTER (string)
- [TREE_INT_CST_LOW (index)])));
+ return build_int_cst_type (TREE_TYPE (exp),
+ (TREE_STRING_POINTER (string)
+ [TREE_INT_CST_LOW (index)]));
}
return NULL;
}