From: Tomas Bily Date: Mon, 12 May 2008 14:20:35 +0000 (+0200) Subject: * utils2.c (known_alignment, contains_save_expr_p) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=751d1520c31199d7a67e8c3caaed4e4af90fcb75;p=gcc.git * utils2.c (known_alignment, contains_save_expr_p) (gnat_mark_addressable): Use CASE_CONVERT. * decl.c (annotate_value): Likewise. * trans.c (maybe_stabilize_reference): Likewise. * utils2.c (build_binary_op): Use CONVERT_EXPR_P. * utils.c (rest_of_record_type_compilation): Likewise. * trans.c (protect_multiple_eval, Attribute_to_gnu) (protect_multiple_eval): Likewise. From-SVN: r135215 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5da66e0c595..6431d93c4a8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2008-05-12 Tomas Bily + + * utils2.c (known_alignment, contains_save_expr_p) + (gnat_mark_addressable): Use CASE_CONVERT. + * decl.c (annotate_value): Likewise. + * trans.c (maybe_stabilize_reference): Likewise. + * utils2.c (build_binary_op): Use CONVERT_EXPR_P. + * utils.c (rest_of_record_type_compilation): Likewise. + * trans.c (protect_multiple_eval, Attribute_to_gnu) + (protect_multiple_eval): Likewise. + 2008-05-08 Andreas Schwab * utils.c (handle_pure_attribute, init_gigi_decls): Rename diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 6e144927ef8..8565305c2d5 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -6622,7 +6622,7 @@ annotate_value (tree gnu_size) else return No_Uint; - case NOP_EXPR: case CONVERT_EXPR: case NON_LVALUE_EXPR: + CASE_CONVERT: case NON_LVALUE_EXPR: return annotate_value (TREE_OPERAND (gnu_size, 0)); /* Now just list the operations we handle. */ diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 5ec3ecdd013..122857a9bbd 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -916,8 +916,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) if (attribute == Attr_Code_Address) { for (gnu_expr = gnu_result; - TREE_CODE (gnu_expr) == NOP_EXPR - || TREE_CODE (gnu_expr) == CONVERT_EXPR; + CONVERT_EXPR_P (gnu_expr); gnu_expr = TREE_OPERAND (gnu_expr, 0)) TREE_CONSTANT (gnu_expr) = 1; @@ -931,8 +930,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) else if (TREE_CODE (TREE_TYPE (gnu_prefix)) == FUNCTION_TYPE) { for (gnu_expr = gnu_result; - TREE_CODE (gnu_expr) == NOP_EXPR - || TREE_CODE (gnu_expr) == CONVERT_EXPR; + CONVERT_EXPR_P (gnu_expr); gnu_expr = TREE_OPERAND (gnu_expr, 0)) ; @@ -6567,7 +6565,7 @@ protect_multiple_eval (tree exp) actually need to protect the address since the data itself can't change in these situations. */ else if (TREE_CODE (exp) == NON_LVALUE_EXPR - || TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR + || CONVERT_EXPR_P (exp) || TREE_CODE (exp) == VIEW_CONVERT_EXPR || TREE_CODE (exp) == INDIRECT_REF || TREE_CODE (exp) == UNCONSTRAINED_ARRAY_REF) @@ -6613,8 +6611,7 @@ maybe_stabilize_reference (tree ref, bool force, bool *success) return ref; case ADDR_EXPR: - case NOP_EXPR: - case CONVERT_EXPR: + CASE_CONVERT: case FLOAT_EXPR: case FIX_TRUNC_EXPR: case VIEW_CONVERT_EXPR: diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 1cce8dae906..202818db345 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -1096,8 +1096,7 @@ rest_of_record_type_compilation (tree record_type) /* Strip off any conversions. */ while (TREE_CODE (offset) == NON_LVALUE_EXPR - || TREE_CODE (offset) == NOP_EXPR - || TREE_CODE (offset) == CONVERT_EXPR) + || CONVERT_EXPR_P (offset)) offset = TREE_OPERAND (offset, 0); /* An offset which is a bitwise AND with a negative power of 2 @@ -3788,7 +3787,7 @@ remove_conversions (tree exp, bool true_address) break; case VIEW_CONVERT_EXPR: case NON_LVALUE_EXPR: - case NOP_EXPR: case CONVERT_EXPR: + CASE_CONVERT: return remove_conversions (TREE_OPERAND (exp, 0), true_address); default: diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index b45c7aca107..891463ce49c 100644 --- a/gcc/ada/utils2.c +++ b/gcc/ada/utils2.c @@ -156,9 +156,8 @@ known_alignment (tree exp) switch (TREE_CODE (exp)) { - case CONVERT_EXPR: + CASE_CONVERT: case VIEW_CONVERT_EXPR: - case NOP_EXPR: case NON_LVALUE_EXPR: /* Conversions between pointers and integers don't change the alignment of the underlying object. */ @@ -293,7 +292,7 @@ contains_save_expr_p (tree exp) case ADDR_EXPR: case INDIRECT_REF: case COMPONENT_REF: - case NOP_EXPR: case CONVERT_EXPR: case VIEW_CONVERT_EXPR: + CASE_CONVERT: case VIEW_CONVERT_EXPR: return contains_save_expr_p (TREE_OPERAND (exp, 0)); case CONSTRUCTOR: @@ -659,8 +658,7 @@ build_binary_op (enum tree_code op_code, tree result_type, conversions between array and record types, except for justified modular types. But don't do this if the right operand is not BLKmode (for packed arrays) unless we are not changing the mode. */ - while ((TREE_CODE (left_operand) == CONVERT_EXPR - || TREE_CODE (left_operand) == NOP_EXPR + while ((CONVERT_EXPR_P (left_operand) || TREE_CODE (left_operand) == VIEW_CONVERT_EXPR) && (((INTEGRAL_TYPE_P (left_type) || POINTER_TYPE_P (left_type)) @@ -742,8 +740,7 @@ build_binary_op (enum tree_code op_code, tree result_type, result = TREE_OPERAND (result, 0); else if (TREE_CODE (result) == REALPART_EXPR || TREE_CODE (result) == IMAGPART_EXPR - || ((TREE_CODE (result) == NOP_EXPR - || TREE_CODE (result) == CONVERT_EXPR) + || (CONVERT_EXPR_P (result) && (((TREE_CODE (restype) == TREE_CODE (TREE_TYPE (TREE_OPERAND (result, 0)))) @@ -2190,9 +2187,8 @@ gnat_mark_addressable (tree expr_node) case REALPART_EXPR: case IMAGPART_EXPR: case VIEW_CONVERT_EXPR: - case CONVERT_EXPR: case NON_LVALUE_EXPR: - case NOP_EXPR: + CASE_CONVERT: expr_node = TREE_OPERAND (expr_node, 0); break;