aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/expr.h')
-rw-r--r--gcc/expr.h58
1 files changed, 38 insertions, 20 deletions
diff --git a/gcc/expr.h b/gcc/expr.h
index 17f09b19a81..fb7c61dcae3 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -75,23 +75,30 @@ struct args_size
/* Add the value of the tree INC to the `struct args_size' TO. */
-#define ADD_PARM_SIZE(TO, INC) \
-{ tree inc = (INC); \
- if (host_integerp (inc, 0)) \
- (TO).constant += tree_low_cst (inc, 0); \
- else if ((TO).var == 0) \
- (TO).var = inc; \
- else \
- (TO).var = size_binop (PLUS_EXPR, (TO).var, inc); }
-
-#define SUB_PARM_SIZE(TO, DEC) \
-{ tree dec = (DEC); \
- if (host_integerp (dec, 0)) \
- (TO).constant -= tree_low_cst (dec, 0); \
- else if ((TO).var == 0) \
- (TO).var = size_binop (MINUS_EXPR, ssize_int (0), dec); \
- else \
- (TO).var = size_binop (MINUS_EXPR, (TO).var, dec); }
+#define ADD_PARM_SIZE(TO, INC) \
+do { \
+ tree inc = (INC); \
+ if (host_integerp (inc, 0)) \
+ (TO).constant += tree_low_cst (inc, 0); \
+ else if ((TO).var == 0) \
+ (TO).var = convert (ssizetype, inc); \
+ else \
+ (TO).var = size_binop (PLUS_EXPR, (TO).var, \
+ convert (ssizetype, inc)); \
+} while (0)
+
+#define SUB_PARM_SIZE(TO, DEC) \
+do { \
+ tree dec = (DEC); \
+ if (host_integerp (dec, 0)) \
+ (TO).constant -= tree_low_cst (dec, 0); \
+ else if ((TO).var == 0) \
+ (TO).var = size_binop (MINUS_EXPR, ssize_int (0), \
+ convert (ssizetype, dec)); \
+ else \
+ (TO).var = size_binop (MINUS_EXPR, (TO).var, \
+ convert (ssizetype, dec)); \
+} while (0)
/* Convert the implicit sum in a `struct args_size' into a tree
of type ssizetype. */
@@ -333,7 +340,6 @@ extern rtx get_condition PARAMS ((rtx, rtx *));
extern rtx gen_cond_trap PARAMS ((enum rtx_code, rtx, rtx, rtx));
/* Functions from builtins.c: */
-#ifdef TREE_CODE
extern rtx expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
extern void std_expand_builtin_va_start PARAMS ((int, tree, rtx));
extern rtx std_expand_builtin_va_arg PARAMS ((tree, tree));
@@ -341,12 +347,11 @@ extern rtx expand_builtin_va_arg PARAMS ((tree, tree));
extern void default_init_builtins PARAMS ((void));
extern rtx default_expand_builtin PARAMS ((tree, rtx, rtx,
enum machine_mode, int));
-#endif
-
extern void expand_builtin_setjmp_setup PARAMS ((rtx, rtx));
extern void expand_builtin_setjmp_receiver PARAMS ((rtx));
extern void expand_builtin_longjmp PARAMS ((rtx, rtx));
extern rtx expand_builtin_saveregs PARAMS ((void));
+extern void expand_builtin_trap PARAMS ((void));
extern HOST_WIDE_INT get_varargs_alias_set PARAMS ((void));
extern HOST_WIDE_INT get_frame_alias_set PARAMS ((void));
extern void record_base_value PARAMS ((unsigned int, rtx, int));
@@ -543,6 +548,10 @@ extern unsigned int case_values_threshold PARAMS ((void));
/* Return an rtx for the size in bytes of the value of an expr. */
extern rtx expr_size PARAMS ((tree));
+/* Return a wide integer for the size in bytes of the value of EXP, or -1
+ if the size can vary or is larger than an integer. */
+extern HOST_WIDE_INT int_expr_size PARAMS ((tree));
+
extern rtx lookup_static_chain PARAMS ((tree));
/* Convert a stack slot address ADDR valid in function FNDECL
@@ -603,6 +612,9 @@ extern void set_mem_expr PARAMS ((rtx, tree));
/* Set the offset for MEM to OFFSET. */
extern void set_mem_offset PARAMS ((rtx, rtx));
+/* Set the size for MEM to SIZE. */
+extern void set_mem_size PARAMS ((rtx, rtx));
+
/* Return a memory reference like MEMREF, but with its mode changed
to MODE and its address changed to ADDR.
(VOIDmode means don't change the mode.
@@ -665,6 +677,12 @@ extern void maybe_set_unchanging PARAMS ((rtx, tree));
corresponding to REF, set the memory attributes. OBJECTP is nonzero
if we are making a new object of this type. */
extern void set_mem_attributes PARAMS ((rtx, tree, int));
+
+/* Similar, except that BITPOS has not yet been applied to REF, so if
+ we alter MEM_OFFSET according to T then we should subtract BITPOS
+ expecting that it'll be added back in later. */
+extern void set_mem_attributes_minus_bitpos PARAMS ((rtx, tree, int,
+ HOST_WIDE_INT));
#endif
/* Assemble the static constant template for function entry trampolines. */