Commit dd25a747 by Alan Modra Committed by Alan Modra

Delete get_inner_array_type. Use strip_array_types instead.

From-SVN: r135858
parent bcfef99b
2008-05-25 Alan Modra <amodra@bigpond.net.au>
* c-common.c (strip_array_types): Move function to..
* tree.c: ..here.
(get_inner_array_type): Delete.
* c-common.h (strip_array_types): Move declaration to..
* tree.h: ..here.
(get_inner_array_type): Delete.
* config/i386/i386.c (x86_field_alignment): Use strip_array_types.
* config/rs6000/aix.h (ADJUST_FIELD_ALIGN): Likewise.
* config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
* config/pa/pa.c (emit_move_sequence): Likewise.
2008-05-24 H.J. Lu <hongjiu.lu@intel.com> 2008-05-24 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.md (*sse_prologue_save_insn): Set length * config/i386/i386.md (*sse_prologue_save_insn): Set length
......
...@@ -4173,18 +4173,6 @@ self_promoting_args_p (const_tree parms) ...@@ -4173,18 +4173,6 @@ self_promoting_args_p (const_tree parms)
return 1; return 1;
} }
/* Recursively examines the array elements of TYPE, until a non-array
element type is found. */
tree
strip_array_types (tree type)
{
while (TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type);
return type;
}
/* Recursively remove any '*' or '&' operator from TYPE. */ /* Recursively remove any '*' or '&' operator from TYPE. */
tree tree
strip_pointer_operator (tree t) strip_pointer_operator (tree t)
......
...@@ -738,7 +738,6 @@ extern alias_set_type c_common_get_alias_set (tree); ...@@ -738,7 +738,6 @@ extern alias_set_type c_common_get_alias_set (tree);
extern void c_register_builtin_type (tree, const char*); extern void c_register_builtin_type (tree, const char*);
extern bool c_promoting_integer_type_p (const_tree); extern bool c_promoting_integer_type_p (const_tree);
extern int self_promoting_args_p (const_tree); extern int self_promoting_args_p (const_tree);
extern tree strip_array_types (tree);
extern tree strip_pointer_operator (tree); extern tree strip_pointer_operator (tree);
extern tree strip_pointer_or_array_types (tree); extern tree strip_pointer_or_array_types (tree);
extern HOST_WIDE_INT c_common_to_target_charset (HOST_WIDE_INT); extern HOST_WIDE_INT c_common_to_target_charset (HOST_WIDE_INT);
......
...@@ -23225,8 +23225,7 @@ x86_field_alignment (tree field, int computed) ...@@ -23225,8 +23225,7 @@ x86_field_alignment (tree field, int computed)
if (TARGET_64BIT || TARGET_ALIGN_DOUBLE) if (TARGET_64BIT || TARGET_ALIGN_DOUBLE)
return computed; return computed;
mode = TYPE_MODE (TREE_CODE (type) == ARRAY_TYPE mode = TYPE_MODE (strip_array_types (type));
? get_inner_array_type (type) : type);
if (mode == DFmode || mode == DCmode if (mode == DFmode || mode == DCmode
|| GET_MODE_CLASS (mode) == MODE_INT || GET_MODE_CLASS (mode) == MODE_INT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_INT) || GET_MODE_CLASS (mode) == MODE_COMPLEX_INT)
......
...@@ -1712,8 +1712,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) ...@@ -1712,8 +1712,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
decl = TREE_OPERAND (decl, 1); decl = TREE_OPERAND (decl, 1);
type = TREE_TYPE (decl); type = TREE_TYPE (decl);
if (TREE_CODE (type) == ARRAY_TYPE) type = strip_array_types (type);
type = get_inner_array_type (type);
if (POINTER_TYPE_P (type)) if (POINTER_TYPE_P (type))
{ {
......
...@@ -158,11 +158,10 @@ ...@@ -158,11 +158,10 @@
/* This now supports a natural alignment mode. */ /* This now supports a natural alignment mode. */
/* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */ /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
(TARGET_ALIGN_NATURAL ? (COMPUTED) : \ ((TARGET_ALIGN_NATURAL == 0 \
(TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \ && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \
? get_inner_array_type (FIELD) \ ? MIN ((COMPUTED), 32) \
: TREE_TYPE (FIELD)) == DFmode \ : (COMPUTED))
? MIN ((COMPUTED), 32) : (COMPUTED)))
/* AIX increases natural record alignment to doubleword if the first /* AIX increases natural record alignment to doubleword if the first
field is an FP double while the FP fields remain word aligned. */ field is an FP double while the FP fields remain word aligned. */
......
...@@ -217,9 +217,7 @@ extern int dot_symbols; ...@@ -217,9 +217,7 @@ extern int dot_symbols;
? 128 \ ? 128 \
: (TARGET_64BIT \ : (TARGET_64BIT \
&& TARGET_ALIGN_NATURAL == 0 \ && TARGET_ALIGN_NATURAL == 0 \
&& TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \ && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \
? get_inner_array_type (FIELD) \
: TREE_TYPE (FIELD)) == DFmode) \
? MIN ((COMPUTED), 32) \ ? MIN ((COMPUTED), 32) \
: (COMPUTED)) : (COMPUTED))
......
...@@ -5682,14 +5682,12 @@ build_array_type (tree elt_type, tree index_type) ...@@ -5682,14 +5682,12 @@ build_array_type (tree elt_type, tree index_type)
return t; return t;
} }
/* Return the TYPE of the elements comprising /* Recursively examines the array elements of TYPE, until a non-array
the innermost dimension of ARRAY. */ element type is found. */
tree tree
get_inner_array_type (const_tree array) strip_array_types (tree type)
{ {
tree type = TREE_TYPE (array);
while (TREE_CODE (type) == ARRAY_TYPE) while (TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type); type = TREE_TYPE (type);
......
...@@ -4011,7 +4011,7 @@ extern int tree_int_cst_sign_bit (const_tree); ...@@ -4011,7 +4011,7 @@ extern int tree_int_cst_sign_bit (const_tree);
extern bool tree_expr_nonnegative_p (tree); extern bool tree_expr_nonnegative_p (tree);
extern bool tree_expr_nonnegative_warnv_p (tree, bool *); extern bool tree_expr_nonnegative_warnv_p (tree, bool *);
extern bool may_negate_without_overflow_p (const_tree); extern bool may_negate_without_overflow_p (const_tree);
extern tree get_inner_array_type (const_tree); extern tree strip_array_types (tree);
/* Construct various nodes representing fract or accum data types. */ /* Construct various nodes representing fract or accum data types. */
......
2008-05-25 Alan Modra <amodra@bigpond.net.au>
* encoding.c (strip_array_types): Rename from get_inner_array_type.
(rs6000_special_round_type_align): Update.
2008-05-09 Julian Brown <julian@codesourcery.com> 2008-05-09 Julian Brown <julian@codesourcery.com>
* Makefile.in (LTLDFLAGS): New. * Makefile.in (LTLDFLAGS): New.
......
...@@ -78,7 +78,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -78,7 +78,7 @@ Boston, MA 02110-1301, USA. */
#define DFmode _C_DBL #define DFmode _C_DBL
#define get_inner_array_type(TYPE) ({const char *_field = (TYPE); \ #define strip_array_types(TYPE) ({const char *_field = (TYPE); \
while (*_field == _C_ARY_B)\ while (*_field == _C_ARY_B)\
{\ {\
while (isdigit ((unsigned char)*++_field))\ while (isdigit ((unsigned char)*++_field))\
...@@ -115,9 +115,7 @@ static int __attribute__ ((__unused__)) not_target_flags = 0; ...@@ -115,9 +115,7 @@ static int __attribute__ ((__unused__)) not_target_flags = 0;
#define rs6000_special_round_type_align(STRUCT, COMPUTED, SPECIFIED) \ #define rs6000_special_round_type_align(STRUCT, COMPUTED, SPECIFIED) \
({ const char *_fields = TYPE_FIELDS (STRUCT); \ ({ const char *_fields = TYPE_FIELDS (STRUCT); \
((_fields != 0 \ ((_fields != 0 \
&& TYPE_MODE (TREE_CODE (TREE_TYPE (_fields)) == ARRAY_TYPE \ && TYPE_MODE (strip_array_types (TREE_TYPE (_fields))) == DFmode) \
? get_inner_array_type (_fields) \
: TREE_TYPE (_fields)) == DFmode) \
? MAX (MAX (COMPUTED, SPECIFIED), 64) \ ? MAX (MAX (COMPUTED, SPECIFIED), 64) \
: MAX (COMPUTED, SPECIFIED));}) : MAX (COMPUTED, SPECIFIED));})
/* FIXME: The word 'fixme' is insufficient to explain the wrong-ness /* FIXME: The word 'fixme' is insufficient to explain the wrong-ness
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment