tree.h (enum size_type_kind): Add stk_ prefix to constants, convert in lowercase.

2012-03-20  Tristan Gingold  <gingold@adacore.com>

	* tree.h (enum size_type_kind): Add stk_ prefix to constants,
	convert in lowercase.
	(sizetype_tab, sizetype, bitsizetype, ssizetype, sbitsizetype)
	(size_int, ssize_int, bitsize_int, sbitsize_int): Adjust.
	* stor-layout.c (sizetype_tab): Adjust.
	(initialize_sizetypes): Use SIZETYPE instead of SIZE_TYPE.
	* tree-streamer.c (preload_common_nodes): Use stk_type_kind_last
	instead of type_kind_last.
	* tree-scalar-evolution.c (interpret_rhs_expr): Use size_int
	instead of size_int_kind.
	* doc/tm.texi.in (Type Layout): Document SIZETYPE.
	* doc/tm.texi: Regenerate.
	* defaults.h (SIZETYPE): Provide a default value.
	* config/vms/vms.h (SIZE_TYPE): Define as "unsigned int".
	(SIZETYPE): Define.

From-SVN: r185561
This commit is contained in:
Tristan Gingold 2012-03-20 08:47:27 +00:00 committed by Tristan Gingold
parent d924186175
commit 18dae0162f
9 changed files with 74 additions and 24 deletions

View File

@ -1,3 +1,21 @@
2012-03-20 Tristan Gingold <gingold@adacore.com>
* tree.h (enum size_type_kind): Add stk_ prefix to constants,
convert in lowercase.
(sizetype_tab, sizetype, bitsizetype, ssizetype, sbitsizetype)
(size_int, ssize_int, bitsize_int, sbitsize_int): Adjust.
* stor-layout.c (sizetype_tab): Adjust.
(initialize_sizetypes): Use SIZETYPE instead of SIZE_TYPE.
* tree-streamer.c (preload_common_nodes): Use stk_type_kind_last
instead of type_kind_last.
* tree-scalar-evolution.c (interpret_rhs_expr): Use size_int
instead of size_int_kind.
* doc/tm.texi.in (Type Layout): Document SIZETYPE.
* doc/tm.texi: Regenerate.
* defaults.h (SIZETYPE): Provide a default value.
* config/vms/vms.h (SIZE_TYPE): Define as "unsigned int".
(SIZETYPE): Define.
2012-03-20 Oleg Endo <olegendo@gcc.gnu.org> 2012-03-20 Oleg Endo <olegendo@gcc.gnu.org>
* config/sh/sh.md: Use braced string notation where applicable. * config/sh/sh.md: Use braced string notation where applicable.

View File

@ -60,15 +60,18 @@ extern void vms_c_register_includes (const char *, const char *, int);
#define POINTER_SIZE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? 32 : 64) #define POINTER_SIZE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? 32 : 64)
#define POINTERS_EXTEND_UNSIGNED 0 #define POINTERS_EXTEND_UNSIGNED 0
/* FIXME: It should always be a 32 bit type. */ /* Always a 32 bit type. */
#undef SIZE_TYPE #undef SIZE_TYPE
#define SIZE_TYPE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? \ #define SIZE_TYPE "unsigned int"
"unsigned int" : "long long unsigned int")
/* ???: Defined as a 'int' by dec-c, but obstack.h doesn't like it. */ /* ???: Defined as a 'int' by dec-c, but obstack.h doesn't like it. */
#undef PTRDIFF_TYPE #undef PTRDIFF_TYPE
#define PTRDIFF_TYPE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? \ #define PTRDIFF_TYPE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? \
"int" : "long long int") "int" : "long long int")
#define SIZETYPE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? \
"unsigned int" : "long long unsigned int")
#define C_COMMON_OVERRIDE_OPTIONS vms_c_common_override_options () #define C_COMMON_OVERRIDE_OPTIONS vms_c_common_override_options ()
/* VMS doesn't support other sections than .text for code. */ /* VMS doesn't support other sections than .text for code. */

View File

@ -582,6 +582,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define SIZE_TYPE "long unsigned int" #define SIZE_TYPE "long unsigned int"
#endif #endif
#ifndef SIZETYPE
#define SIZETYPE SIZE_TYPE
#endif
#ifndef PID_TYPE #ifndef PID_TYPE
#define PID_TYPE "int" #define PID_TYPE "int"
#endif #endif

View File

@ -1642,6 +1642,18 @@ If you don't define this macro, the default is @code{"long unsigned
int"}. int"}.
@end defmac @end defmac
@defmac SIZETYPE
GCC defines internal types (@code{sizetype}, @code{ssizetype},
@code{bitsizetype} and @code{sbitsizetype}) for expressions
dealing with size. This macro is a C expression for a string describing
the name of the data type from which the precision of @code{sizetype}
is extracted.
The string has the same restrictions as @code{SIZE_TYPE} string.
If you don't define this macro, the default is @code{SIZE_TYPE}.
@end defmac
@defmac PTRDIFF_TYPE @defmac PTRDIFF_TYPE
A C expression for a string describing the name of the data type to use A C expression for a string describing the name of the data type to use
for the result of subtracting two pointers. The typedef name for the result of subtracting two pointers. The typedef name

View File

@ -1630,6 +1630,18 @@ If you don't define this macro, the default is @code{"long unsigned
int"}. int"}.
@end defmac @end defmac
@defmac SIZETYPE
GCC defines internal types (@code{sizetype}, @code{ssizetype},
@code{bitsizetype} and @code{sbitsizetype}) for expressions
dealing with size. This macro is a C expression for a string describing
the name of the data type from which the precision of @code{sizetype}
is extracted.
The string has the same restrictions as @code{SIZE_TYPE} string.
If you don't define this macro, the default is @code{SIZE_TYPE}.
@end defmac
@defmac PTRDIFF_TYPE @defmac PTRDIFF_TYPE
A C expression for a string describing the name of the data type to use A C expression for a string describing the name of the data type to use
for the result of subtracting two pointers. The typedef name for the result of subtracting two pointers. The typedef name

View File

@ -44,7 +44,7 @@ along with GCC; see the file COPYING3. If not see
/* Data type for the expressions representing sizes of data types. /* Data type for the expressions representing sizes of data types.
It is the first integer type laid out. */ It is the first integer type laid out. */
tree sizetype_tab[(int) TYPE_KIND_LAST]; tree sizetype_tab[(int) stk_type_kind_last];
/* If nonzero, this is an upper limit on alignment of structure fields. /* If nonzero, this is an upper limit on alignment of structure fields.
The value is measured in bits. */ The value is measured in bits. */
@ -2389,13 +2389,13 @@ initialize_sizetypes (void)
int precision, bprecision; int precision, bprecision;
/* Get sizetypes precision from the SIZE_TYPE target macro. */ /* Get sizetypes precision from the SIZE_TYPE target macro. */
if (strcmp (SIZE_TYPE, "unsigned int") == 0) if (strcmp (SIZETYPE, "unsigned int") == 0)
precision = INT_TYPE_SIZE; precision = INT_TYPE_SIZE;
else if (strcmp (SIZE_TYPE, "long unsigned int") == 0) else if (strcmp (SIZETYPE, "long unsigned int") == 0)
precision = LONG_TYPE_SIZE; precision = LONG_TYPE_SIZE;
else if (strcmp (SIZE_TYPE, "long long unsigned int") == 0) else if (strcmp (SIZETYPE, "long long unsigned int") == 0)
precision = LONG_LONG_TYPE_SIZE; precision = LONG_LONG_TYPE_SIZE;
else if (strcmp (SIZE_TYPE, "short unsigned int") == 0) else if (strcmp (SIZETYPE, "short unsigned int") == 0)
precision = SHORT_TYPE_SIZE; precision = SHORT_TYPE_SIZE;
else else
gcc_unreachable (); gcc_unreachable ();

View File

@ -1758,7 +1758,7 @@ interpret_rhs_expr (struct loop *loop, gimple at_stmt,
{ {
gcc_assert ((bitpos % BITS_PER_UNIT) == 0); gcc_assert ((bitpos % BITS_PER_UNIT) == 0);
unitpos = size_int_kind (bitpos / BITS_PER_UNIT, SIZETYPE); unitpos = size_int (bitpos / BITS_PER_UNIT);
chrec3 = analyze_scalar_evolution (loop, unitpos); chrec3 = analyze_scalar_evolution (loop, unitpos);
chrec3 = chrec_convert (TREE_TYPE (unitpos), chrec3, at_stmt); chrec3 = chrec_convert (TREE_TYPE (unitpos), chrec3, at_stmt);
res = chrec_fold_plus (type, res, chrec3); res = chrec_fold_plus (type, res, chrec3);

View File

@ -293,7 +293,7 @@ preload_common_nodes (struct streamer_tree_cache_d *cache)
if (i != itk_char) if (i != itk_char)
record_common_node (cache, integer_types[i]); record_common_node (cache, integer_types[i]);
for (i = 0; i < TYPE_KIND_LAST; i++) for (i = 0; i < stk_type_kind_last; i++)
record_common_node (cache, sizetype_tab[i]); record_common_node (cache, sizetype_tab[i]);
for (i = 0; i < TI_MAX; i++) for (i = 0; i < TI_MAX; i++)

View File

@ -4787,18 +4787,19 @@ extern HOST_WIDE_INT int_byte_position (const_tree);
enum size_type_kind enum size_type_kind
{ {
SIZETYPE, /* Normal representation of sizes in bytes. */ stk_sizetype, /* Normal representation of sizes in bytes. */
SSIZETYPE, /* Signed representation of sizes in bytes. */ stk_ssizetype, /* Signed representation of sizes in bytes. */
BITSIZETYPE, /* Normal representation of sizes in bits. */ stk_bitsizetype, /* Normal representation of sizes in bits. */
SBITSIZETYPE, /* Signed representation of sizes in bits. */ stk_sbitsizetype, /* Signed representation of sizes in bits. */
TYPE_KIND_LAST}; stk_type_kind_last
};
extern GTY(()) tree sizetype_tab[(int) TYPE_KIND_LAST]; extern GTY(()) tree sizetype_tab[(int) stk_type_kind_last];
#define sizetype sizetype_tab[(int) SIZETYPE] #define sizetype sizetype_tab[(int) stk_sizetype]
#define bitsizetype sizetype_tab[(int) BITSIZETYPE] #define bitsizetype sizetype_tab[(int) stk_bitsizetype]
#define ssizetype sizetype_tab[(int) SSIZETYPE] #define ssizetype sizetype_tab[(int) stk_ssizetype]
#define sbitsizetype sizetype_tab[(int) SBITSIZETYPE] #define sbitsizetype sizetype_tab[(int) stk_sbitsizetype]
extern tree size_int_kind (HOST_WIDE_INT, enum size_type_kind); extern tree size_int_kind (HOST_WIDE_INT, enum size_type_kind);
#define size_binop(CODE,T1,T2)\ #define size_binop(CODE,T1,T2)\
@ -4808,10 +4809,10 @@ extern tree size_binop_loc (location_t, enum tree_code, tree, tree);
size_diffop_loc (UNKNOWN_LOCATION, T1, T2) size_diffop_loc (UNKNOWN_LOCATION, T1, T2)
extern tree size_diffop_loc (location_t, tree, tree); extern tree size_diffop_loc (location_t, tree, tree);
#define size_int(L) size_int_kind (L, SIZETYPE) #define size_int(L) size_int_kind (L, stk_sizetype)
#define ssize_int(L) size_int_kind (L, SSIZETYPE) #define ssize_int(L) size_int_kind (L, stk_ssizetype)
#define bitsize_int(L) size_int_kind (L, BITSIZETYPE) #define bitsize_int(L) size_int_kind (L, stk_bitsizetype)
#define sbitsize_int(L) size_int_kind (L, SBITSIZETYPE) #define sbitsize_int(L) size_int_kind (L, stk_sbitsizetype)
#define round_up(T,N) round_up_loc (UNKNOWN_LOCATION, T, N) #define round_up(T,N) round_up_loc (UNKNOWN_LOCATION, T, N)
extern tree round_up_loc (location_t, tree, int); extern tree round_up_loc (location_t, tree, int);