mode-classes.def (MODE_POINTER_BOUNDS): New.
* mode-classes.def (MODE_POINTER_BOUNDS): New. * tree.def (POINTER_BOUNDS_TYPE): New. * genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS. (POINTER_BOUNDS_MODE): New. (make_pointer_bounds_mode): New. * machmode.h (POINTER_BOUNDS_MODE_P): New. * stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS. (layout_type): Support POINTER_BOUNDS_TYPE. * tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE. * tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE. (type_contains_placeholder_1): Likewise. * tree.h (POINTER_BOUNDS_TYPE_P): New. * varasm.c (output_constant): Support POINTER_BOUNDS_TYPE. * doc/rtl.texi (MODE_POINTER_BOUNDS): New. From-SVN: r204045
This commit is contained in:
parent
ca9f377992
commit
65f55baca4
|
@ -1,3 +1,20 @@
|
||||||
|
2013-10-24 Ilya Enkovich <ilya.enkovich@intel.com>
|
||||||
|
|
||||||
|
* mode-classes.def (MODE_POINTER_BOUNDS): New.
|
||||||
|
* tree.def (POINTER_BOUNDS_TYPE): New.
|
||||||
|
* genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS.
|
||||||
|
(POINTER_BOUNDS_MODE): New.
|
||||||
|
(make_pointer_bounds_mode): New.
|
||||||
|
* machmode.h (POINTER_BOUNDS_MODE_P): New.
|
||||||
|
* stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS.
|
||||||
|
(layout_type): Support POINTER_BOUNDS_TYPE.
|
||||||
|
* tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE.
|
||||||
|
* tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE.
|
||||||
|
(type_contains_placeholder_1): Likewise.
|
||||||
|
* tree.h (POINTER_BOUNDS_TYPE_P): New.
|
||||||
|
* varasm.c (output_constant): Support POINTER_BOUNDS_TYPE.
|
||||||
|
* doc/rtl.texi (MODE_POINTER_BOUNDS): New.
|
||||||
|
|
||||||
2013-10-24 Igor Shevlyakov <igor.shevlyakov@gmail.com>
|
2013-10-24 Igor Shevlyakov <igor.shevlyakov@gmail.com>
|
||||||
|
|
||||||
* expr.c (expand_expr_real_1): Use mode of memory reference rather
|
* expr.c (expand_expr_real_1): Use mode of memory reference rather
|
||||||
|
|
|
@ -1382,6 +1382,12 @@ any @code{CC_MODE} modes listed in the @file{@var{machine}-modes.def}.
|
||||||
@xref{Jump Patterns},
|
@xref{Jump Patterns},
|
||||||
also see @ref{Condition Code}.
|
also see @ref{Condition Code}.
|
||||||
|
|
||||||
|
@findex MODE_POINTER_BOUNDS
|
||||||
|
@item MODE_POINTER_BOUNDS
|
||||||
|
Pointer bounds modes. Used to represent values of pointer bounds type.
|
||||||
|
Operations in these modes may be executed as NOPs depending on hardware
|
||||||
|
features and environment setup.
|
||||||
|
|
||||||
@findex MODE_RANDOM
|
@findex MODE_RANDOM
|
||||||
@item MODE_RANDOM
|
@item MODE_RANDOM
|
||||||
This is a catchall mode class for modes which don't fit into the above
|
This is a catchall mode class for modes which don't fit into the above
|
||||||
|
|
|
@ -333,6 +333,7 @@ complete_mode (struct mode_data *m)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_INT:
|
case MODE_INT:
|
||||||
|
case MODE_POINTER_BOUNDS:
|
||||||
case MODE_FLOAT:
|
case MODE_FLOAT:
|
||||||
case MODE_DECIMAL_FLOAT:
|
case MODE_DECIMAL_FLOAT:
|
||||||
case MODE_FRACT:
|
case MODE_FRACT:
|
||||||
|
@ -534,6 +535,19 @@ make_special_mode (enum mode_class cl, const char *name,
|
||||||
new_mode (cl, name, file, line);
|
new_mode (cl, name, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define POINTER_BOUNDS_MODE(N, Y) \
|
||||||
|
make_pointer_bounds_mode (#N, Y, __FILE__, __LINE__)
|
||||||
|
|
||||||
|
static void ATTRIBUTE_UNUSED
|
||||||
|
make_pointer_bounds_mode (const char *name,
|
||||||
|
unsigned int bytesize,
|
||||||
|
const char *file, unsigned int line)
|
||||||
|
{
|
||||||
|
struct mode_data *m = new_mode (MODE_POINTER_BOUNDS, name, file, line);
|
||||||
|
m->bytesize = bytesize;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define INT_MODE(N, Y) FRACTIONAL_INT_MODE (N, -1U, Y)
|
#define INT_MODE(N, Y) FRACTIONAL_INT_MODE (N, -1U, Y)
|
||||||
#define FRACTIONAL_INT_MODE(N, B, Y) \
|
#define FRACTIONAL_INT_MODE(N, B, Y) \
|
||||||
make_int_mode (#N, B, Y, __FILE__, __LINE__)
|
make_int_mode (#N, B, Y, __FILE__, __LINE__)
|
||||||
|
|
|
@ -174,6 +174,9 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES];
|
||||||
|| CLASS == MODE_ACCUM \
|
|| CLASS == MODE_ACCUM \
|
||||||
|| CLASS == MODE_UACCUM)
|
|| CLASS == MODE_UACCUM)
|
||||||
|
|
||||||
|
#define POINTER_BOUNDS_MODE_P(MODE) \
|
||||||
|
(GET_MODE_CLASS (MODE) == MODE_POINTER_BOUNDS)
|
||||||
|
|
||||||
/* Get the size in bytes and bits of an object of mode MODE. */
|
/* Get the size in bytes and bits of an object of mode MODE. */
|
||||||
|
|
||||||
extern CONST_MODE_SIZE unsigned char mode_size[NUM_MACHINE_MODES];
|
extern CONST_MODE_SIZE unsigned char mode_size[NUM_MACHINE_MODES];
|
||||||
|
|
|
@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
|
||||||
DEF_MODE_CLASS (MODE_CC), /* condition code in a register */ \
|
DEF_MODE_CLASS (MODE_CC), /* condition code in a register */ \
|
||||||
DEF_MODE_CLASS (MODE_INT), /* integer */ \
|
DEF_MODE_CLASS (MODE_INT), /* integer */ \
|
||||||
DEF_MODE_CLASS (MODE_PARTIAL_INT), /* integer with padding bits */ \
|
DEF_MODE_CLASS (MODE_PARTIAL_INT), /* integer with padding bits */ \
|
||||||
|
DEF_MODE_CLASS (MODE_POINTER_BOUNDS), /* bounds */ \
|
||||||
DEF_MODE_CLASS (MODE_FRACT), /* signed fractional number */ \
|
DEF_MODE_CLASS (MODE_FRACT), /* signed fractional number */ \
|
||||||
DEF_MODE_CLASS (MODE_UFRACT), /* unsigned fractional number */ \
|
DEF_MODE_CLASS (MODE_UFRACT), /* unsigned fractional number */ \
|
||||||
DEF_MODE_CLASS (MODE_ACCUM), /* signed accumulator */ \
|
DEF_MODE_CLASS (MODE_ACCUM), /* signed accumulator */ \
|
||||||
|
|
|
@ -383,6 +383,7 @@ int_mode_for_mode (enum machine_mode mode)
|
||||||
case MODE_VECTOR_ACCUM:
|
case MODE_VECTOR_ACCUM:
|
||||||
case MODE_VECTOR_UFRACT:
|
case MODE_VECTOR_UFRACT:
|
||||||
case MODE_VECTOR_UACCUM:
|
case MODE_VECTOR_UACCUM:
|
||||||
|
case MODE_POINTER_BOUNDS:
|
||||||
mode = mode_for_size (GET_MODE_BITSIZE (mode), MODE_INT, 0);
|
mode = mode_for_size (GET_MODE_BITSIZE (mode), MODE_INT, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2122,6 +2123,14 @@ layout_type (tree type)
|
||||||
SET_TYPE_MODE (type, VOIDmode);
|
SET_TYPE_MODE (type, VOIDmode);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case POINTER_BOUNDS_TYPE:
|
||||||
|
SET_TYPE_MODE (type,
|
||||||
|
mode_for_size (TYPE_PRECISION (type),
|
||||||
|
MODE_POINTER_BOUNDS, 0));
|
||||||
|
TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
|
||||||
|
TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
|
||||||
|
break;
|
||||||
|
|
||||||
case OFFSET_TYPE:
|
case OFFSET_TYPE:
|
||||||
TYPE_SIZE (type) = bitsize_int (POINTER_SIZE);
|
TYPE_SIZE (type) = bitsize_int (POINTER_SIZE);
|
||||||
TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
|
TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
|
||||||
|
|
|
@ -866,6 +866,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VOID_TYPE:
|
case VOID_TYPE:
|
||||||
|
case POINTER_BOUNDS_TYPE:
|
||||||
case INTEGER_TYPE:
|
case INTEGER_TYPE:
|
||||||
case REAL_TYPE:
|
case REAL_TYPE:
|
||||||
case FIXED_POINT_TYPE:
|
case FIXED_POINT_TYPE:
|
||||||
|
|
|
@ -1221,7 +1221,8 @@ build_int_cst_wide (tree type, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi)
|
||||||
|
|
||||||
case POINTER_TYPE:
|
case POINTER_TYPE:
|
||||||
case REFERENCE_TYPE:
|
case REFERENCE_TYPE:
|
||||||
/* Cache NULL pointer. */
|
case POINTER_BOUNDS_TYPE:
|
||||||
|
/* Cache NULL pointer and zero bounds. */
|
||||||
if (!hi && !low)
|
if (!hi && !low)
|
||||||
{
|
{
|
||||||
limit = 1;
|
limit = 1;
|
||||||
|
@ -3273,6 +3274,7 @@ type_contains_placeholder_1 (const_tree type)
|
||||||
switch (TREE_CODE (type))
|
switch (TREE_CODE (type))
|
||||||
{
|
{
|
||||||
case VOID_TYPE:
|
case VOID_TYPE:
|
||||||
|
case POINTER_BOUNDS_TYPE:
|
||||||
case COMPLEX_TYPE:
|
case COMPLEX_TYPE:
|
||||||
case ENUMERAL_TYPE:
|
case ENUMERAL_TYPE:
|
||||||
case BOOLEAN_TYPE:
|
case BOOLEAN_TYPE:
|
||||||
|
|
|
@ -232,6 +232,11 @@ DEFTREECODE (QUAL_UNION_TYPE, "qual_union_type", tcc_type, 0)
|
||||||
/* The void type in C */
|
/* The void type in C */
|
||||||
DEFTREECODE (VOID_TYPE, "void_type", tcc_type, 0)
|
DEFTREECODE (VOID_TYPE, "void_type", tcc_type, 0)
|
||||||
|
|
||||||
|
/* Type to hold bounds for a pointer.
|
||||||
|
Has TYPE_PRECISION component to specify number of bits used
|
||||||
|
by this type. */
|
||||||
|
DEFTREECODE (POINTER_BOUNDS_TYPE, "pointer_bounds_type", tcc_type, 0)
|
||||||
|
|
||||||
/* Type of functions. Special fields:
|
/* Type of functions. Special fields:
|
||||||
TREE_TYPE type of value returned.
|
TREE_TYPE type of value returned.
|
||||||
TYPE_ARG_TYPES list of types of arguments expected.
|
TYPE_ARG_TYPES list of types of arguments expected.
|
||||||
|
|
|
@ -542,6 +542,10 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
|
||||||
/* Nonzero if this type is a complete type. */
|
/* Nonzero if this type is a complete type. */
|
||||||
#define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
|
#define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
|
||||||
|
|
||||||
|
/* Nonzero if this type is a pointer bounds type. */
|
||||||
|
#define POINTER_BOUNDS_TYPE_P(NODE) \
|
||||||
|
(TREE_CODE (NODE) == POINTER_BOUNDS_TYPE)
|
||||||
|
|
||||||
/* Nonzero if this type is the (possibly qualified) void type. */
|
/* Nonzero if this type is the (possibly qualified) void type. */
|
||||||
#define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE)
|
#define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE)
|
||||||
|
|
||||||
|
|
|
@ -4704,6 +4704,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
|
||||||
case REFERENCE_TYPE:
|
case REFERENCE_TYPE:
|
||||||
case OFFSET_TYPE:
|
case OFFSET_TYPE:
|
||||||
case FIXED_POINT_TYPE:
|
case FIXED_POINT_TYPE:
|
||||||
|
case POINTER_BOUNDS_TYPE:
|
||||||
if (! assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode,
|
if (! assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode,
|
||||||
EXPAND_INITIALIZER),
|
EXPAND_INITIALIZER),
|
||||||
MIN (size, thissize), align, 0))
|
MIN (size, thissize), align, 0))
|
||||||
|
|
Loading…
Reference in New Issue