[COMMITTED] algol68: use a68_*_type rather than CTYPE (M_*) whenever possible
Jose E. Marchesi
jemarch@gnu.org
Sat Mar 15 17:10:24 GMT 2025
This saves an indirection.
---
gcc/algol68/a68-lang.cc | 8 +-
gcc/algol68/a68-low-bits.cc | 10 +-
gcc/algol68/a68-low-bools.cc | 2 +-
gcc/algol68/a68-low-chars.cc | 4 +-
gcc/algol68/a68-low-clauses.cc | 28 ++---
gcc/algol68/a68-low-coercions.cc | 20 ++--
gcc/algol68/a68-low-complex.cc | 6 +-
gcc/algol68/a68-low-generator.cc | 6 +-
gcc/algol68/a68-low-ints.cc | 28 ++---
gcc/algol68/a68-low-misc.cc | 8 +-
gcc/algol68/a68-low-moids.cc | 28 +----
gcc/algol68/a68-low-multiples.cc | 2 +-
gcc/algol68/a68-low-posix.cc | 82 +++++++-------
gcc/algol68/a68-low-prelude.cc | 188 +++++++++++++++----------------
gcc/algol68/a68-low-ranges.cc | 4 +-
gcc/algol68/a68-low-reals.cc | 18 +--
gcc/algol68/a68-low-runtime.cc | 4 +-
gcc/algol68/a68-low-strings.cc | 30 ++---
gcc/algol68/a68-low-units.cc | 10 +-
gcc/algol68/a68-low.cc | 40 +++----
20 files changed, 256 insertions(+), 270 deletions(-)
diff --git a/gcc/algol68/a68-lang.cc b/gcc/algol68/a68-lang.cc
index 5e8fdc491ba..854d01db342 100644
--- a/gcc/algol68/a68-lang.cc
+++ b/gcc/algol68/a68-lang.cc
@@ -30,6 +30,7 @@
#include "diagnostic.h"
#include "opts.h"
#include "machmode.h"
+#include "stor-layout.h" /* For layout_type */
#include "a68.h"
@@ -138,7 +139,12 @@ static void
a68_build_a68_type_nodes (void)
{
/* VOID */
- a68_void_type = void_type_node;
+ a68_void_type = make_node (RECORD_TYPE);
+ TYPE_NAME (a68_void_type) = get_identifier ("void%");
+ TYPE_FIELDS (a68_void_type) = NULL_TREE;
+ TYPE_READONLY (a68_void_type) = 1;
+ TYPE_CXX_ODR_P (a68_void_type) = 1;
+ layout_type (a68_void_type);
/* BOOL */
a68_bool_type = boolean_type_node;
diff --git a/gcc/algol68/a68-low-bits.cc b/gcc/algol68/a68-low-bits.cc
index 2beba19edf7..afbcbe370a9 100644
--- a/gcc/algol68/a68-low-bits.cc
+++ b/gcc/algol68/a68-low-bits.cc
@@ -48,7 +48,7 @@
tree
a68_bits_width (tree type)
{
- return fold_convert (CTYPE (M_INT), TYPE_SIZE (type));
+ return fold_convert (a68_int_type, TYPE_SIZE (type));
}
/* Given a BITS type, compute the maximum value that can be expressed with that
@@ -177,7 +177,7 @@ a68_bits_elem (NODE_T *p, tree pos, tree bits)
TYPE_SIZE (TREE_TYPE (bits)),
fold_convert (bitsizetype, pos));
tree elem = fold_build2 (EQ_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
fold_build2 (BIT_AND_EXPR,
TREE_TYPE (bits),
fold_build2 (RSHIFT_EXPR,
@@ -209,9 +209,9 @@ a68_bits_elem (NODE_T *p, tree pos, tree bits)
TRUTH_ORIF_EXPR,
ssizetype,
check,
- fold_build2 (COMPOUND_EXPR, CTYPE (M_BOOL),
+ fold_build2 (COMPOUND_EXPR, a68_bool_type,
call, boolean_false_node));
- elem = fold_build2 (COMPOUND_EXPR, CTYPE (M_BOOL),
+ elem = fold_build2 (COMPOUND_EXPR, a68_bool_type,
check, elem);
}
@@ -226,7 +226,7 @@ a68_bits_subset (tree bits1, tree bits2)
{
/* We compute this operation with `A | B == B' as specified by the Report */
bits2 = save_expr (bits2);
- return fold_build2 (EQ_EXPR, CTYPE (M_BOOL),
+ return fold_build2 (EQ_EXPR, a68_bool_type,
fold_build2 (BIT_IOR_EXPR, TREE_TYPE (bits1), bits1, bits2),
bits2);
}
diff --git a/gcc/algol68/a68-low-bools.cc b/gcc/algol68/a68-low-bools.cc
index b3fac2aeb39..01f0db17b71 100644
--- a/gcc/algol68/a68-low-bools.cc
+++ b/gcc/algol68/a68-low-bools.cc
@@ -48,5 +48,5 @@
tree
a68_bool_abs (tree val)
{
- return fold_convert (CTYPE (M_INT), val);
+ return fold_convert (a68_int_type, val);
}
diff --git a/gcc/algol68/a68-low-chars.cc b/gcc/algol68/a68-low-chars.cc
index e95f221f1b1..0fce0ba3883 100644
--- a/gcc/algol68/a68-low-chars.cc
+++ b/gcc/algol68/a68-low-chars.cc
@@ -50,7 +50,7 @@ a68_char_repr (tree val)
{
/* XXX check that the given value is within the CHAR range, i.e. the 21 bits
of UCS-4 or a single byte. If not raise run-time error. */
- return fold_convert (CTYPE (M_INT), val);
+ return fold_convert (a68_int_type, val);
}
/* the ABS of a CHAR is an INT containing an unique value for each permissable
@@ -59,5 +59,5 @@ a68_char_repr (tree val)
tree
a68_char_abs (tree val)
{
- return fold_convert (CTYPE (M_INT), val);
+ return fold_convert (a68_int_type, val);
}
diff --git a/gcc/algol68/a68-low-clauses.cc b/gcc/algol68/a68-low-clauses.cc
index 14741a77f16..8d75d06850f 100644
--- a/gcc/algol68/a68-low-clauses.cc
+++ b/gcc/algol68/a68-low-clauses.cc
@@ -329,7 +329,7 @@ a68_lower_loop_clause (NODE_T *p ATTRIBUTE_UNUSED,
const char *iterator_name = (iterator_defining_identifier == NO_NODE
? "iterator%"
: NSYMBOL (iterator_defining_identifier));
- iterator = a68_lower_tmpvar (iterator_name, CTYPE (M_INT), from_part);
+ iterator = a68_lower_tmpvar (iterator_name, a68_int_type, from_part);
if (iterator_defining_identifier != NO_NODE)
TAX_TREE_DECL (TAX (iterator_defining_identifier)) = iterator;
@@ -366,19 +366,19 @@ a68_lower_loop_clause (NODE_T *p ATTRIBUTE_UNUSED,
/* IF by_part < 0 THEN iterator < to_part ELSE iterator > to_part FI */
if (has_iterator && to_part != NULL_TREE)
exit_condition = fold_build3 (COND_EXPR,
- CTYPE (M_BOOL),
- fold_build2 (LT_EXPR, CTYPE (M_INT), by_part,
- build_int_cst (CTYPE (M_INT), 0)),
- fold_build2 (LT_EXPR, CTYPE (M_INT), iterator, to_part),
- fold_build2 (GT_EXPR, CTYPE (M_INT), iterator, to_part));
+ a68_bool_type,
+ fold_build2 (LT_EXPR, a68_int_type, by_part,
+ build_int_cst (a68_int_type, 0)),
+ fold_build2 (LT_EXPR, a68_int_type, iterator, to_part),
+ fold_build2 (GT_EXPR, a68_int_type, iterator, to_part));
/* NOT while_condition */
if (while_part)
{
tree while_exit_condition = fold_build1 (TRUTH_NOT_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
while_condition);
if (has_iterator && to_part != NULL_TREE)
- exit_condition = fold_build2 (TRUTH_ORIF_EXPR, CTYPE (M_BOOL),
+ exit_condition = fold_build2 (TRUTH_ORIF_EXPR, a68_bool_type,
exit_condition, while_exit_condition);
else
exit_condition = while_exit_condition;
@@ -408,7 +408,7 @@ a68_lower_loop_clause (NODE_T *p ATTRIBUTE_UNUSED,
/* Finally build the LOOP_EXPR and exit the introduced ranges. */
tree loop_clause = fold_build1_loc (a68_get_node_location (p),
- LOOP_EXPR, CTYPE (M_VOID), loop_body);
+ LOOP_EXPR, a68_void_type, loop_body);
if (while_part)
{
a68_add_stmt (loop_clause);
@@ -499,7 +499,7 @@ lower_unite_case_unit (NODE_T *p,
/* IF index = overhead THEN process entry FI */
a68_add_stmt (fold_build3 (COND_EXPR,
- CTYPE (M_VOID),
+ a68_void_type,
fold_build2 (EQ_EXPR,
TREE_TYPE (overhead),
overhead,
@@ -635,7 +635,7 @@ lower_int_case_unit (NODE_T *p,
/* IF count = enquiry THEN process entry FI */
a68_add_stmt (fold_build3 (COND_EXPR,
- CTYPE (M_VOID),
+ a68_void_type,
fold_build2 (EQ_EXPR,
TREE_TYPE (enquiry),
enquiry,
@@ -840,7 +840,7 @@ a68_lower_conditional_clause (NODE_T *p, LOW_CTX_T ctx)
tree enquiry_decl = build_decl (UNKNOWN_LOCATION,
VAR_DECL,
NULL, /* Set below. */
- CTYPE (M_BOOL));
+ a68_bool_type);
char *enquiry_name = xasprintf ("enquiry%d%%", DECL_UID(enquiry_decl));
DECL_NAME (enquiry_decl) = get_identifier (enquiry_name);
free (enquiry_name);
@@ -848,7 +848,7 @@ a68_lower_conditional_clause (NODE_T *p, LOW_CTX_T ctx)
a68_add_decl (enquiry_decl);
/* Add a DECL_EXPR for enquiry_decl% */
- a68_add_stmt (fold_build1 (DECL_EXPR, CTYPE (M_BOOL), enquiry_decl));
+ a68_add_stmt (fold_build1 (DECL_EXPR, a68_bool_type, enquiry_decl));
/* IF or ELIF part. */
NODE_T *s = SUB (p);
@@ -862,7 +862,7 @@ a68_lower_conditional_clause (NODE_T *p, LOW_CTX_T ctx)
yielding the boolean value. */
tree_stmt_iterator si = tsi_last (a68_range_stmt_list ());
gcc_assert (TREE_TYPE (tsi_stmt (si)) != void_type_node);
- a68_add_stmt (fold_build2 (MODIFY_EXPR, CTYPE (M_BOOL), enquiry_decl, tsi_stmt (si)));
+ a68_add_stmt (fold_build2 (MODIFY_EXPR, a68_bool_type, enquiry_decl, tsi_stmt (si)));
tsi_delink (&si);
/* THEN part. */
diff --git a/gcc/algol68/a68-low-coercions.cc b/gcc/algol68/a68-low-coercions.cc
index b750e3152ab..4464397784c 100644
--- a/gcc/algol68/a68-low-coercions.cc
+++ b/gcc/algol68/a68-low-coercions.cc
@@ -105,7 +105,7 @@ a68_lower_uniting (NODE_T *p, LOW_CTX_T ctx)
/* IF overhead = field_index THEN rows% = rows_from_multiple FI */
a68_add_stmt (fold_build3 (COND_EXPR,
- CTYPE (M_VOID),
+ a68_void_type,
fold_build2 (EQ_EXPR,
TREE_TYPE (overhead),
overhead,
@@ -333,16 +333,16 @@ a68_lower_widening (NODE_T *p, LOW_CTX_T ctx)
gcc_assert (bits_size != -1);
bits_size = bits_size * 8;
- tree pointer_to_bool_type = build_pointer_type (CTYPE (M_BOOL));
+ tree pointer_to_bool_type = build_pointer_type (a68_bool_type);
a68_push_range (M_ROW_BOOL);
/* First allocate space for the elements. */
tree elements = a68_lower_tmpvar ("elements%",
pointer_to_bool_type,
- a68_lower_alloca (CTYPE (M_BOOL),
+ a68_lower_alloca (a68_bool_type,
fold_build2 (MULT_EXPR,
sizetype,
size_int (bits_size),
- size_in_bytes (CTYPE (M_BOOL)))));
+ size_in_bytes (a68_bool_type))));
/* Set the elements, each element is a BOOL which is TRUE if the
corresponding bit in the coercend is set, FALSE otherwise. */
@@ -351,8 +351,8 @@ a68_lower_widening (NODE_T *p, LOW_CTX_T ctx)
for (HOST_WIDE_INT bit = 0; bit < bits_size; ++bit)
{
tree offset = fold_build2 (MULT_EXPR, sizetype,
- size_int (bit), size_in_bytes (CTYPE (M_BOOL)));
- tree bit_set = fold_convert (CTYPE (M_BOOL),
+ size_int (bit), size_in_bytes (a68_bool_type));
+ tree bit_set = fold_convert (a68_bool_type,
fold_build2 (BIT_AND_EXPR, coercend_type,
fold_build2 (RSHIFT_EXPR, coercend_type,
coercend,
@@ -361,9 +361,9 @@ a68_lower_widening (NODE_T *p, LOW_CTX_T ctx)
coercend_one_node));
a68_add_stmt (fold_build2 (MODIFY_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
fold_build2 (MEM_REF,
- CTYPE (M_BOOL),
+ a68_bool_type,
fold_build2 (POINTER_PLUS_EXPR,
pointer_to_bool_type,
elements,
@@ -378,7 +378,7 @@ a68_lower_widening (NODE_T *p, LOW_CTX_T ctx)
tree upper_bound = ssize_int (bits_size);
tree elements_size = fold_build2 (MULT_EXPR, sizetype,
size_int (bits_size),
- size_in_bytes (CTYPE (M_BOOL)));
+ size_in_bytes (a68_bool_type));
tree multiple = a68_row_value (CTYPE (M_ROW_BOOL), 1 /* dim */,
elements, elements_size,
&lower_bound, &upper_bound);
@@ -405,7 +405,7 @@ a68_lower_voiding (NODE_T *p, LOW_CTX_T ctx)
{
return fold_build2_loc (a68_get_node_location (p),
COMPOUND_EXPR,
- CTYPE (M_VOID),
+ a68_void_type,
a68_lower_tree (SUB (p), ctx),
a68_get_empty ());
}
diff --git a/gcc/algol68/a68-low-complex.cc b/gcc/algol68/a68-low-complex.cc
index ba1a55b9a53..aed1c3c3dab 100644
--- a/gcc/algol68/a68-low-complex.cc
+++ b/gcc/algol68/a68-low-complex.cc
@@ -103,11 +103,11 @@ a68_complex_widen_from_real (MOID_T *mode, tree r)
/* Sanity check. */
if (mode == M_COMPLEX)
- gcc_assert (TREE_TYPE (r) == CTYPE (M_REAL));
+ gcc_assert (TREE_TYPE (r) == a68_real_type);
else if (mode == M_LONG_COMPLEX)
- gcc_assert (TREE_TYPE (r) == CTYPE (M_LONG_REAL));
+ gcc_assert (TREE_TYPE (r) == a68_long_real_type);
else if (mode == M_LONG_LONG_COMPLEX)
- gcc_assert (TREE_TYPE (r) == CTYPE (M_LONG_LONG_REAL));
+ gcc_assert (TREE_TYPE (r) == a68_long_long_real_type);
else
gcc_unreachable ();
diff --git a/gcc/algol68/a68-low-generator.cc b/gcc/algol68/a68-low-generator.cc
index e6b708a95c1..007aa2dfd48 100644
--- a/gcc/algol68/a68-low-generator.cc
+++ b/gcc/algol68/a68-low-generator.cc
@@ -106,15 +106,15 @@ fill_in_buffer (tree buffer, tree offset, tree_stmt_iterator bounds, MOID_T *m,
offset = fold_build2 (PLUS_EXPR, sizetype, offset, pointer_byte_size);
tree elems_address = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (buffer), buffer, offset);
a68_add_stmt (fold_build2 (MODIFY_EXPR, void_type_node,
- fold_build1 (INDIRECT_REF, build_pointer_type (CTYPE (M_CHAR)),
+ fold_build1 (INDIRECT_REF, build_pointer_type (a68_char_type),
elems_address),
- build_int_cst (build_pointer_type (CTYPE (M_CHAR)), 0)));
+ build_int_cst (build_pointer_type (a68_char_type), 0)));
/* The size of the elements is zero. */
offset = fold_build2 (PLUS_EXPR, sizetype, offset, pointer_byte_size);
tree elems_size_address = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (buffer), buffer, offset);
a68_add_stmt (fold_build2 (MODIFY_EXPR, void_type_node,
- fold_build1 (INDIRECT_REF, build_pointer_type (CTYPE (M_CHAR)),
+ fold_build1 (INDIRECT_REF, build_pointer_type (a68_char_type),
elems_size_address),
size_zero_node));
}
diff --git a/gcc/algol68/a68-low-ints.cc b/gcc/algol68/a68-low-ints.cc
index 57735a571d3..d23ff5e730f 100644
--- a/gcc/algol68/a68-low-ints.cc
+++ b/gcc/algol68/a68-low-ints.cc
@@ -68,14 +68,14 @@ a68_int_width (tree type)
{
/* Note that log10 (2) is ~ 0.3.
Thanks to Andrew Pinski for suggesting using this expression. */
- return fold_build2 (PLUS_EXPR, CTYPE (M_INT),
- build_int_cst (CTYPE (M_INT), 1),
+ return fold_build2 (PLUS_EXPR, a68_int_type,
+ build_int_cst (a68_int_type, 1),
fold_build2 (TRUNC_DIV_EXPR,
- CTYPE (M_INT),
- fold_build2 (MULT_EXPR, CTYPE (M_INT),
- build_int_cst (CTYPE (M_INT), TYPE_PRECISION (type)),
- build_int_cst (CTYPE (M_INT), 3)),
- build_int_cst (CTYPE (M_INT), 10)));
+ a68_int_type,
+ fold_build2 (MULT_EXPR, a68_int_type,
+ build_int_cst (a68_int_type, TYPE_PRECISION (type)),
+ build_int_cst (a68_int_type, 3)),
+ build_int_cst (a68_int_type, 10)));
}
/* Given an integer value VAL, return -1 if it is less than zero, 0 if it is
@@ -87,14 +87,14 @@ a68_int_sign (tree val)
{
tree zero = build_int_cst (TREE_TYPE (val), 0);
return fold_build3 (COND_EXPR,
- CTYPE (M_INT),
+ a68_int_type,
fold_build2 (EQ_EXPR, integer_type_node, val, zero),
- build_int_cst (CTYPE (M_INT), 0),
+ build_int_cst (a68_int_type, 0),
fold_build3 (COND_EXPR,
- CTYPE (M_INT),
+ a68_int_type,
fold_build2 (GT_EXPR, integer_type_node, val, zero),
- build_int_cst (CTYPE (M_INT), 1),
- build_int_cst (CTYPE (M_INT), -1)));
+ build_int_cst (a68_int_type, 1),
+ build_int_cst (a68_int_type, -1)));
}
/* Absolute value of an integer. */
@@ -137,10 +137,10 @@ a68_int_shorten (MOID_T *to_mode, MOID_T *from_mode ATTRIBUTE_UNUSED, tree val)
most_positive_value = save_expr (most_positive_value);
most_negative_value = save_expr (most_negative_value);
return fold_build3 (COND_EXPR, CTYPE (to_mode),
- fold_build2 (GT_EXPR, CTYPE (M_BOOL), val, most_positive_value),
+ fold_build2 (GT_EXPR, a68_bool_type, val, most_positive_value),
fold_convert (CTYPE (to_mode), most_positive_value),
fold_build3 (COND_EXPR, CTYPE (to_mode),
- fold_build2 (LT_EXPR, CTYPE (M_BOOL), val, most_negative_value),
+ fold_build2 (LT_EXPR, a68_bool_type, val, most_negative_value),
fold_convert (CTYPE (to_mode), most_negative_value),
fold_convert (CTYPE (to_mode), val)));
}
diff --git a/gcc/algol68/a68-low-misc.cc b/gcc/algol68/a68-low-misc.cc
index 5de314a5c6c..fa805a3b441 100644
--- a/gcc/algol68/a68-low-misc.cc
+++ b/gcc/algol68/a68-low-misc.cc
@@ -65,15 +65,15 @@ a68_lower_assertion (NODE_T *p, LOW_CTX_T ctx)
/* Check condition and call assert if required. */
tree assertion = fold_build2_loc (a68_get_node_location (p),
COMPOUND_EXPR,
- CTYPE (M_VOID),
+ a68_void_type,
build2_loc (a68_get_node_location (p),
TRUTH_ORIF_EXPR,
- CTYPE (M_INT),
+ a68_int_type,
a68_lower_tree (NEXT (SUB (p)), ctx),
fold_build2 (COMPOUND_EXPR,
- CTYPE (M_INT),
+ a68_int_type,
call,
- build_int_cst (CTYPE (M_INT), 0))),
+ build_int_cst (a68_int_type, 0))),
a68_get_empty ());
TREE_SIDE_EFFECTS (assertion) = 1;
return assertion;
diff --git a/gcc/algol68/a68-low-moids.cc b/gcc/algol68/a68-low-moids.cc
index 25528ae482e..c730ca8db4c 100644
--- a/gcc/algol68/a68-low-moids.cc
+++ b/gcc/algol68/a68-low-moids.cc
@@ -186,26 +186,6 @@ finish_incomplete_fields (tree type)
* Mode lowering routines.
*/
-/* Lower a VOID mode to a GENERIC tree.
- The mode is of size zero and is implemented using an empty record type. */
-
-static tree
-lower_void_mode ()
-{
- static tree empty_rec_type;
-
- if (empty_rec_type == NULL_TREE)
- {
- empty_rec_type = make_node (RECORD_TYPE);
- TYPE_NAME (empty_rec_type) = get_identifier ("void%");
- TYPE_FIELDS (empty_rec_type) = NULL_TREE;
- TYPE_READONLY (empty_rec_type) = 1;
- TYPE_CXX_ODR_P (empty_rec_type) = 1;
- layout_type (empty_rec_type);
- }
- return empty_rec_type;
-}
-
/* Lower a HIP mode to a GENERIC tree.
HIP is the mode of NIL. */
@@ -216,7 +196,7 @@ lower_hip_mode (MOID_T *m)
if (hip_type == NULL)
{
- hip_type = build_pointer_type (lower_void_mode ());
+ hip_type = build_pointer_type (a68_void_type);
TYPE_LANG_SPECIFIC (hip_type) = a68_build_lang_type (m);
CTYPE (m) = hip_type;
}
@@ -626,7 +606,7 @@ a68_lower_mode (MOID_T *m)
/* This covers INDICANTs and standard MOIDS having an equivalent mode. */
type = a68_lower_mode (EQUIVALENT (m));
else if (m == M_VOID)
- type = lower_void_mode ();
+ type = a68_void_type;
else if (m == M_HIP)
type = lower_hip_mode (m);
else if (IS (m, STANDARD))
@@ -645,14 +625,14 @@ a68_lower_mode (MOID_T *m)
type = lower_union_mode (m);
else if (m == M_SIMPLOUT || m == M_SIMPLIN)
/* XXX void type for now */
- type = lower_void_mode ();
+ type = a68_void_type;
else if (IS (m, ROWS_SYMBOL))
/* ROWS is a mode that means "any row mode". */
type = lower_rows_mode (m);
else if (m == M_VACUUM)
/* This is a mode that should not survive the parser.
XXX void type for now. */
- type = lower_void_mode ();
+ type = a68_void_type;
else if (IS (m, SERIES_MODE) || IS (m, STOWED_MODE))
{
/* When dealing with operators the parser creates some modes that leak
diff --git a/gcc/algol68/a68-low-multiples.cc b/gcc/algol68/a68-low-multiples.cc
index c95b172fbec..0432bf56516 100644
--- a/gcc/algol68/a68-low-multiples.cc
+++ b/gcc/algol68/a68-low-multiples.cc
@@ -569,7 +569,7 @@ a68_multiple_slice (NODE_T *p,
fold_convert (ssizetype, index_expr),
fold_convert (ssizetype, lower_bound),
fold_convert (ssizetype, upper_bound));
- call = fold_build2 (COMPOUND_EXPR, CTYPE (M_BOOL), call, boolean_false_node);
+ call = fold_build2 (COMPOUND_EXPR, a68_bool_type, call, boolean_false_node);
/* If LB > UB, the dimension contains no elements.
Otherwise, it must hold IDX >= LB && IDX <= UB */
diff --git a/gcc/algol68/a68-low-posix.cc b/gcc/algol68/a68-low-posix.cc
index 9eb7e44a823..a22cb45cc02 100644
--- a/gcc/algol68/a68-low-posix.cc
+++ b/gcc/algol68/a68-low-posix.cc
@@ -63,11 +63,11 @@ a68_posix_argv (void)
argv_fndecl
= a68_low_toplevel_func_decl ("argv",
build_function_type_list (CTYPE (M_STRING),
- CTYPE (M_INT),
+ a68_int_type,
NULL_TREE));
announce_function (argv_fndecl);
- tree param = a68_low_func_param (argv_fndecl, "n", CTYPE (M_INT));
+ tree param = a68_low_func_param (argv_fndecl, "n", a68_int_type);
DECL_ARGUMENTS (argv_fndecl) = param;
a68_push_function_range (argv_fndecl, CTYPE (M_STRING),
@@ -77,7 +77,7 @@ a68_posix_argv (void)
tree len = a68_lower_tmpvar ("len%", sizetype, size_int (0));
TREE_ADDRESSABLE (len) = 1;
- tree ptrtochar_type = build_pointer_type (CTYPE (M_CHAR));
+ tree ptrtochar_type = build_pointer_type (a68_char_type);
tree elems = a68_lower_tmpvar ("elems%", ptrtochar_type,
a68_build_libcall (A68_LIBCALL_POSIX_ARGV,
ptrtochar_type, 2,
@@ -88,7 +88,7 @@ a68_posix_argv (void)
tree upper_bound = fold_convert (ssizetype, len);
tree elems_size = fold_build2 (MULT_EXPR, sizetype,
len,
- size_in_bytes (CTYPE (M_CHAR)));
+ size_in_bytes (a68_char_type));
a68_add_stmt (a68_row_value (CTYPE (M_STRING), 1 /* dim */,
elems, elems_size,
&lower_bound, &upper_bound));
@@ -128,7 +128,7 @@ a68_posix_getenv (void)
tree varname = a68_lower_tmpvar ("varname%", CTYPE (M_STRING),
param);
- tree ptrtochar_type = build_pointer_type (CTYPE (M_CHAR));
+ tree ptrtochar_type = build_pointer_type (a68_char_type);
tree convelems = a68_lower_tmpvar ("convelems%", ptrtochar_type,
build_int_cst (ptrtochar_type, 0));
TREE_ADDRESSABLE (convelems) = 1;
@@ -150,7 +150,7 @@ a68_posix_getenv (void)
tree upper_bound = fold_convert (ssizetype, convelemslen);
tree convelems_size = fold_build2 (MULT_EXPR, sizetype,
convelemslen,
- size_in_bytes (CTYPE (M_CHAR)));
+ size_in_bytes (a68_char_type));
a68_add_stmt (a68_row_value (CTYPE (M_STRING), 1 /* dim */,
convelems, convelems_size,
&lower_bound, &upper_bound));
@@ -209,22 +209,22 @@ a68_posix_fconnect (void)
{
fconnect_fndecl
= a68_low_toplevel_func_decl ("fconnect",
- build_function_type_list (CTYPE (M_INT),
+ build_function_type_list (a68_int_type,
CTYPE (M_STRING),
- CTYPE (M_BITS),
+ a68_bits_type,
NULL_TREE));
announce_function (fconnect_fndecl);
tree host = a68_low_func_param (fconnect_fndecl, "host", CTYPE (M_STRING));
- tree port = a68_low_func_param (fconnect_fndecl, "port", CTYPE (M_INT));
+ tree port = a68_low_func_param (fconnect_fndecl, "port", a68_int_type);
DECL_ARGUMENTS (fconnect_fndecl) = chainon (host, port);
- a68_push_function_range (fconnect_fndecl, CTYPE (M_INT),
+ a68_push_function_range (fconnect_fndecl, a68_int_type,
true /* top_level */);
tree body = a68_build_libcall (A68_LIBCALL_POSIX_FCONNECT,
- CTYPE (M_INT), 4,
+ a68_int_type, 4,
a68_multiple_elements (host),
a68_multiple_num_elems (host),
a68_multiple_stride (host, size_zero_node),
@@ -245,22 +245,22 @@ a68_posix_fcreate (void)
{
fcreate_fndecl
= a68_low_toplevel_func_decl ("fcreate",
- build_function_type_list (CTYPE (M_INT),
+ build_function_type_list (a68_int_type,
CTYPE (M_STRING),
- CTYPE (M_BITS),
+ a68_bits_type,
NULL_TREE));
announce_function (fcreate_fndecl);
tree pathname = a68_low_func_param (fcreate_fndecl, "pathname", CTYPE (M_STRING));
- tree mode = a68_low_func_param (fcreate_fndecl, "mode", CTYPE (M_INT));
+ tree mode = a68_low_func_param (fcreate_fndecl, "mode", a68_int_type);
DECL_ARGUMENTS (fcreate_fndecl) = chainon (pathname, mode);
- a68_push_function_range (fcreate_fndecl, CTYPE (M_INT),
+ a68_push_function_range (fcreate_fndecl, a68_int_type,
true /* top_level */);
tree body = a68_build_libcall (A68_LIBCALL_POSIX_FCREATE,
- CTYPE (M_INT), 4,
+ a68_int_type, 4,
a68_multiple_elements (pathname),
a68_multiple_num_elems (pathname),
a68_multiple_stride (pathname, size_zero_node),
@@ -281,22 +281,22 @@ a68_posix_fopen (void)
{
fopen_fndecl
= a68_low_toplevel_func_decl ("fopen",
- build_function_type_list (CTYPE (M_INT),
+ build_function_type_list (a68_int_type,
CTYPE (M_STRING),
- CTYPE (M_BITS),
+ a68_bits_type,
NULL_TREE));
announce_function (fopen_fndecl);
tree pathname = a68_low_func_param (fopen_fndecl, "pathname", CTYPE (M_STRING));
- tree flags = a68_low_func_param (fopen_fndecl, "flags", CTYPE (M_INT));
+ tree flags = a68_low_func_param (fopen_fndecl, "flags", a68_int_type);
DECL_ARGUMENTS (fopen_fndecl) = chainon (pathname, flags);
- a68_push_function_range (fopen_fndecl, CTYPE (M_INT),
+ a68_push_function_range (fopen_fndecl, a68_int_type,
true /* top_level */);
tree body = a68_build_libcall (A68_LIBCALL_POSIX_FOPEN,
- CTYPE (M_INT), 4,
+ a68_int_type, 4,
a68_multiple_elements (pathname),
a68_multiple_num_elems (pathname),
a68_multiple_stride (pathname, size_zero_node),
@@ -341,7 +341,7 @@ a68_posix_perror (void)
true /* top_level */);
tree body = a68_build_libcall (A68_LIBCALL_POSIX_PERROR,
- CTYPE (M_INT), 3,
+ a68_int_type, 3,
a68_multiple_elements (str),
a68_multiple_num_elems (str),
a68_multiple_stride (str, size_zero_node));
@@ -362,11 +362,11 @@ a68_posix_strerror (void)
strerror_fndecl
= a68_low_toplevel_func_decl ("strerror",
build_function_type_list (CTYPE (M_STRING),
- CTYPE (M_INT),
+ a68_int_type,
NULL_TREE));
announce_function (strerror_fndecl);
- tree errnum = a68_low_func_param (strerror_fndecl, "errnum", CTYPE (M_INT));
+ tree errnum = a68_low_func_param (strerror_fndecl, "errnum", a68_int_type);
DECL_ARGUMENTS (strerror_fndecl) = errnum;
a68_push_function_range (strerror_fndecl, CTYPE (M_STRING),
@@ -379,12 +379,12 @@ a68_posix_strerror (void)
void_type_node, 2,
errnum,
fold_build1 (ADDR_EXPR, build_pointer_type (sizetype), len));
- tree elems = a68_lower_tmpvar ("elems%", build_pointer_type (CTYPE (M_CHAR)), call);
+ tree elems = a68_lower_tmpvar ("elems%", build_pointer_type (a68_char_type), call);
tree lower_bound = ssize_int (1);
tree upper_bound = fold_convert (ssizetype, len);
tree elems_size = fold_build2 (MULT_EXPR, sizetype,
- len, size_in_bytes (CTYPE (M_CHAR)));
+ len, size_in_bytes (a68_char_type));
tree body = a68_row_value (CTYPE (M_STRING), 1 /* dim */,
elems, elems_size,
@@ -423,22 +423,22 @@ a68_posix_fputs (void)
{
fputs_fndecl
= a68_low_toplevel_func_decl ("fputs",
- build_function_type_list (CTYPE (M_INT),
- CTYPE (M_INT),
+ build_function_type_list (a68_int_type,
+ a68_int_type,
CTYPE (M_STRING),
NULL_TREE));
announce_function (fputs_fndecl);
- tree fd = a68_low_func_param (fputs_fndecl, "fd", CTYPE (M_INT));
+ tree fd = a68_low_func_param (fputs_fndecl, "fd", a68_int_type);
tree str = a68_low_func_param (fputs_fndecl, "str", CTYPE (M_STRING));
DECL_ARGUMENTS (fputs_fndecl) = chainon (fd, str);
- a68_push_function_range (fputs_fndecl, CTYPE (M_INT),
+ a68_push_function_range (fputs_fndecl, a68_int_type,
true /* top_level */);
tree body = a68_build_libcall (A68_LIBCALL_POSIX_FPUTS,
- CTYPE (M_INT), 4,
+ a68_int_type, 4,
fd,
a68_multiple_elements (str),
a68_multiple_num_elems (str),
@@ -460,13 +460,13 @@ a68_posix_fgets (void)
fgets_fndecl
= a68_low_toplevel_func_decl ("fgets",
build_function_type_list (CTYPE (M_STRING),
- CTYPE (M_INT),
- CTYPE (M_INT),
+ a68_int_type,
+ a68_int_type,
NULL_TREE));
announce_function (fgets_fndecl);
- tree fd = a68_low_func_param (fgets_fndecl, "fd", CTYPE (M_INT));
- tree n = a68_low_func_param (fgets_fndecl, "n", CTYPE (M_INT));
+ tree fd = a68_low_func_param (fgets_fndecl, "fd", a68_int_type);
+ tree n = a68_low_func_param (fgets_fndecl, "n", a68_int_type);
DECL_ARGUMENTS (fgets_fndecl) = chainon (fd, n);
a68_push_function_range (fgets_fndecl, CTYPE (M_STRING),
@@ -479,12 +479,12 @@ a68_posix_fgets (void)
CTYPE (M_STRING), 3,
fd, n,
fold_build1 (ADDR_EXPR, build_pointer_type (sizetype), len));
- tree elems = a68_lower_tmpvar ("elems%", build_pointer_type (CTYPE (M_CHAR)), call);
+ tree elems = a68_lower_tmpvar ("elems%", build_pointer_type (a68_char_type), call);
tree lower_bound = ssize_int (1);
tree upper_bound = fold_convert (ssizetype, len);
tree elems_size = fold_build2 (MULT_EXPR, sizetype,
- len, size_in_bytes (CTYPE (M_CHAR)));
+ len, size_in_bytes (a68_char_type));
tree body = a68_row_value (CTYPE (M_STRING), 1 /* dim */,
elems, elems_size,
&lower_bound, &upper_bound);
@@ -505,11 +505,11 @@ a68_posix_gets (void)
gets_fndecl
= a68_low_toplevel_func_decl ("gets",
build_function_type_list (CTYPE (M_STRING),
- CTYPE (M_INT),
+ a68_int_type,
NULL_TREE));
announce_function (gets_fndecl);
- tree n = a68_low_func_param (gets_fndecl, "n", CTYPE (M_INT));
+ tree n = a68_low_func_param (gets_fndecl, "n", a68_int_type);
DECL_ARGUMENTS (gets_fndecl) = n;
a68_push_function_range (gets_fndecl, CTYPE (M_STRING),
@@ -521,12 +521,12 @@ a68_posix_gets (void)
tree call = a68_build_libcall (A68_LIBCALL_POSIX_GETS,
CTYPE (M_STRING), 2,
n, fold_build1 (ADDR_EXPR, build_pointer_type (sizetype), len));
- tree elems = a68_lower_tmpvar ("elems%", build_pointer_type (CTYPE (M_CHAR)), call);
+ tree elems = a68_lower_tmpvar ("elems%", build_pointer_type (a68_char_type), call);
tree lower_bound = ssize_int (1);
tree upper_bound = fold_convert (ssizetype, len);
tree elems_size = fold_build2 (MULT_EXPR, sizetype,
- len, size_in_bytes (CTYPE (M_CHAR)));
+ len, size_in_bytes (a68_char_type));
tree body = a68_row_value (CTYPE (M_STRING), 1 /* dim */,
elems, elems_size,
&lower_bound, &upper_bound);
diff --git a/gcc/algol68/a68-low-prelude.cc b/gcc/algol68/a68-low-prelude.cc
index 4ed93aed2e0..c7874e6135e 100644
--- a/gcc/algol68/a68-low-prelude.cc
+++ b/gcc/algol68/a68-low-prelude.cc
@@ -686,7 +686,7 @@ a68_lower_odd2 (NODE_T *p, LOW_CTX_T ctx)
return fold_build2_loc (a68_get_node_location (p),
EQ_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
fold_build2 (BIT_AND_EXPR,
CTYPE (MOID (op)),
a68_lower_tree (op, ctx),
@@ -704,9 +704,9 @@ a68_lower_string_eq3 (NODE_T *p, LOW_CTX_T ctx)
return fold_build2_loc (a68_get_node_location (p),
EQ_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
cmp,
- build_int_cst (CTYPE (M_INT), 0));
+ build_int_cst (a68_int_type, 0));
}
tree
@@ -719,9 +719,9 @@ a68_lower_string_ne3 (NODE_T *p, LOW_CTX_T ctx)
return fold_build2_loc (a68_get_node_location (p),
NE_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
cmp,
- build_int_cst (CTYPE (M_INT), 0));
+ build_int_cst (a68_int_type, 0));
}
tree
@@ -734,9 +734,9 @@ a68_lower_string_lt3 (NODE_T *p, LOW_CTX_T ctx)
return fold_build2_loc (a68_get_node_location (p),
LT_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
cmp,
- build_int_cst (CTYPE (M_INT), 0));
+ build_int_cst (a68_int_type, 0));
}
tree
@@ -749,9 +749,9 @@ a68_lower_string_le3 (NODE_T *p, LOW_CTX_T ctx)
return fold_build2_loc (a68_get_node_location (p),
LE_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
cmp,
- build_int_cst (CTYPE (M_INT), 0));
+ build_int_cst (a68_int_type, 0));
}
tree
@@ -764,9 +764,9 @@ a68_lower_string_gt3 (NODE_T *p, LOW_CTX_T ctx)
return fold_build2_loc (a68_get_node_location (p),
GT_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
cmp,
- build_int_cst (CTYPE (M_INT), 0));
+ build_int_cst (a68_int_type, 0));
}
tree
@@ -779,9 +779,9 @@ a68_lower_string_ge3 (NODE_T *p, LOW_CTX_T ctx)
return fold_build2_loc (a68_get_node_location (p),
GE_EXPR,
- CTYPE (M_BOOL),
+ a68_bool_type,
cmp,
- build_int_cst (CTYPE (M_INT), 0));
+ build_int_cst (a68_int_type, 0));
}
tree
@@ -1048,97 +1048,97 @@ a68_lower_smallreal (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
tree
a68_lower_bitswidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_bits_width (CTYPE (M_BITS));
+ return a68_bits_width (a68_bits_type);
}
tree
a68_lower_longbitswidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_bits_width (CTYPE (M_LONG_BITS));
+ return a68_bits_width (a68_long_bits_type);
}
tree
a68_lower_longlongbitswidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_bits_width (CTYPE (M_LONG_LONG_BITS));
+ return a68_bits_width (a68_long_long_bits_type);
}
tree
a68_lower_shortbitswidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_bits_width (CTYPE (M_SHORT_BITS));
+ return a68_bits_width (a68_short_bits_type);
}
tree
a68_lower_shortshortbitswidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_bits_width (CTYPE (M_SHORT_SHORT_BITS));
+ return a68_bits_width (a68_short_short_bits_type);
}
tree
a68_lower_intwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_int_width (CTYPE (M_INT));
+ return a68_int_width (a68_int_type);
}
tree
a68_lower_longintwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_int_width (CTYPE (M_LONG_INT));
+ return a68_int_width (a68_long_int_type);
}
tree
a68_lower_longlongintwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_int_width (CTYPE (M_LONG_LONG_INT));
+ return a68_int_width (a68_long_long_int_type);
}
tree
a68_lower_shortintwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_int_width (CTYPE (M_SHORT_INT));
+ return a68_int_width (a68_short_int_type);
}
tree
a68_lower_shortshortintwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_int_width (CTYPE (M_SHORT_SHORT_INT));
+ return a68_int_width (a68_short_short_int_type);
}
tree
a68_lower_realwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_real_width (CTYPE (M_REAL));
+ return a68_real_width (a68_real_type);
}
tree
a68_lower_longrealwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_real_width (CTYPE (M_LONG_REAL));
+ return a68_real_width (a68_long_real_type);
}
tree
a68_lower_longlongrealwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_real_width (CTYPE (M_LONG_LONG_REAL));
+ return a68_real_width (a68_long_long_real_type);
}
tree
a68_lower_expwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_real_exp_width (CTYPE (M_REAL));
+ return a68_real_exp_width (a68_real_type);
}
tree
a68_lower_longexpwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_real_exp_width (CTYPE (M_LONG_REAL));
+ return a68_real_exp_width (a68_long_real_type);
}
tree
a68_lower_longlongexpwidth (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return a68_real_exp_width (CTYPE (M_LONG_LONG_REAL));
+ return a68_real_exp_width (a68_long_long_real_type);
}
tree
@@ -1153,7 +1153,7 @@ a68_lower_nullcharacter (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNU
static tree null_character = NULL_TREE;
if (null_character == NULL_TREE)
- null_character = build_int_cst (CTYPE (M_CHAR), 0);
+ null_character = build_int_cst (a68_char_type, 0);
return null_character;
}
@@ -1164,7 +1164,7 @@ a68_lower_flip (NODE_T *p ATTRIBUTE_UNUSED,
static tree flip = NULL_TREE;
if (flip == NULL_TREE)
- flip = build_int_cst (CTYPE (M_CHAR), 84); /* T */
+ flip = build_int_cst (a68_char_type, 84); /* T */
return flip;
}
@@ -1175,7 +1175,7 @@ a68_lower_invalidchar (NODE_T *p ATTRIBUTE_UNUSED,
static tree invalidchar = NULL_TREE;
if (invalidchar == NULL_TREE)
- invalidchar = build_int_cst (CTYPE (M_CHAR), 0xfffd);
+ invalidchar = build_int_cst (a68_char_type, 0xfffd);
return invalidchar;
}
@@ -1186,7 +1186,7 @@ a68_lower_flop (NODE_T *p ATTRIBUTE_UNUSED,
static tree flop = NULL_TREE;
if (flop == NULL_TREE)
- flop = build_int_cst (CTYPE (M_CHAR), 70); /* F */
+ flop = build_int_cst (a68_char_type, 70); /* F */
return flop;
}
@@ -1196,7 +1196,7 @@ a68_lower_errorchar (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
static tree errorchar = NULL_TREE;
if (errorchar == NULL_TREE)
- errorchar = build_int_cst (CTYPE (M_CHAR), 42); /* * */
+ errorchar = build_int_cst (a68_char_type, 42); /* * */
return errorchar;
}
@@ -1206,16 +1206,16 @@ a68_lower_blank (NODE_T *p ATTRIBUTE_UNUSED, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
static tree blank = NULL_TREE;
if (blank == NULL_TREE)
- blank = build_int_cst (CTYPE (M_CHAR), 32);
+ blank = build_int_cst (a68_char_type, 32);
return blank;
}
tree
a68_lower_intlengths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- HOST_WIDE_INT int_size = int_size_in_bytes (CTYPE (M_INT));
- HOST_WIDE_INT long_int_size = int_size_in_bytes (CTYPE (M_LONG_INT));
- HOST_WIDE_INT long_long_int_size = int_size_in_bytes (CTYPE (M_LONG_LONG_INT));
+ HOST_WIDE_INT int_size = int_size_in_bytes (a68_int_type);
+ HOST_WIDE_INT long_int_size = int_size_in_bytes (a68_long_int_type);
+ HOST_WIDE_INT long_long_int_size = int_size_in_bytes (a68_long_long_int_type);
gcc_assert (int_size != -1);
gcc_assert (long_int_size != -1);
@@ -1233,9 +1233,9 @@ a68_lower_intlengths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
tree
a68_lower_intshorths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- HOST_WIDE_INT int_size = int_size_in_bytes (CTYPE (M_INT));
- HOST_WIDE_INT short_int_size = int_size_in_bytes (CTYPE (M_SHORT_INT));
- HOST_WIDE_INT short_short_int_size = int_size_in_bytes (CTYPE (M_SHORT_SHORT_INT));
+ HOST_WIDE_INT int_size = int_size_in_bytes (a68_int_type);
+ HOST_WIDE_INT short_int_size = int_size_in_bytes (a68_short_int_type);
+ HOST_WIDE_INT short_short_int_size = int_size_in_bytes (a68_short_short_int_type);
gcc_assert (int_size != -1);
gcc_assert (short_int_size != -1);
@@ -1253,9 +1253,9 @@ a68_lower_intshorths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
tree
a68_lower_bitslengths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- HOST_WIDE_INT bits_size = int_size_in_bytes (CTYPE (M_BITS));
- HOST_WIDE_INT long_bits_size = int_size_in_bytes (CTYPE (M_LONG_BITS));
- HOST_WIDE_INT long_long_bits_size = int_size_in_bytes (CTYPE (M_LONG_LONG_BITS));
+ HOST_WIDE_INT bits_size = int_size_in_bytes (a68_bits_type);
+ HOST_WIDE_INT long_bits_size = int_size_in_bytes (a68_long_bits_type);
+ HOST_WIDE_INT long_long_bits_size = int_size_in_bytes (a68_long_long_bits_type);
gcc_assert (bits_size != -1);
gcc_assert (long_bits_size != -1);
@@ -1273,9 +1273,9 @@ a68_lower_bitslengths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
tree
a68_lower_bitsshorths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- HOST_WIDE_INT bits_size = int_size_in_bytes (CTYPE (M_BITS));
- HOST_WIDE_INT short_bits_size = int_size_in_bytes (CTYPE (M_SHORT_BITS));
- HOST_WIDE_INT short_short_bits_size = int_size_in_bytes (CTYPE (M_SHORT_SHORT_BITS));
+ HOST_WIDE_INT bits_size = int_size_in_bytes (a68_bits_type);
+ HOST_WIDE_INT short_bits_size = int_size_in_bytes (a68_short_bits_type);
+ HOST_WIDE_INT short_short_bits_size = int_size_in_bytes (a68_short_short_bits_type);
gcc_assert (bits_size != -1);
gcc_assert (short_bits_size != -1);
@@ -1293,9 +1293,9 @@ a68_lower_bitsshorths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
tree
a68_lower_reallengths (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- HOST_WIDE_INT real_size = int_size_in_bytes (CTYPE (M_REAL));
- HOST_WIDE_INT long_real_size = int_size_in_bytes (CTYPE (M_LONG_REAL));
- HOST_WIDE_INT long_long_real_size = int_size_in_bytes (CTYPE (M_LONG_LONG_REAL));
+ HOST_WIDE_INT real_size = int_size_in_bytes (a68_real_type);
+ HOST_WIDE_INT long_real_size = int_size_in_bytes (a68_long_real_type);
+ HOST_WIDE_INT long_long_real_size = int_size_in_bytes (a68_long_long_real_type);
gcc_assert (real_size != -1);
gcc_assert (long_real_size != -1);
@@ -1340,7 +1340,7 @@ tree
a68_lower_sqrt (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_sqrt (CTYPE (M_REAL));
+ tree t = a68_real_sqrt (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1350,7 +1350,7 @@ tree
a68_lower_long_sqrt (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_sqrt (CTYPE (M_LONG_REAL));
+ tree t = a68_real_sqrt (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1360,7 +1360,7 @@ tree
a68_lower_long_long_sqrt (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_sqrt (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_sqrt (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1370,7 +1370,7 @@ tree
a68_lower_tan (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_tan (CTYPE (M_REAL));
+ tree t = a68_real_tan (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1380,7 +1380,7 @@ tree
a68_lower_long_tan (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_tan (CTYPE (M_LONG_REAL));
+ tree t = a68_real_tan (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1390,7 +1390,7 @@ tree
a68_lower_long_long_tan (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_tan (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_tan (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1400,7 +1400,7 @@ tree
a68_lower_sin (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_sin (CTYPE (M_REAL));
+ tree t = a68_real_sin (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1410,7 +1410,7 @@ tree
a68_lower_long_sin (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_sin (CTYPE (M_LONG_REAL));
+ tree t = a68_real_sin (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1420,7 +1420,7 @@ tree
a68_lower_long_long_sin (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_sin (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_sin (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1430,7 +1430,7 @@ tree
a68_lower_cos (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_cos (CTYPE (M_REAL));
+ tree t = a68_real_cos (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1440,7 +1440,7 @@ tree
a68_lower_long_cos (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_cos (CTYPE (M_LONG_REAL));
+ tree t = a68_real_cos (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1450,7 +1450,7 @@ tree
a68_lower_long_long_cos (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_cos (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_cos (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1460,7 +1460,7 @@ tree
a68_lower_acos (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_acos (CTYPE (M_REAL));
+ tree t = a68_real_acos (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1470,7 +1470,7 @@ tree
a68_lower_long_acos (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_acos (CTYPE (M_LONG_REAL));
+ tree t = a68_real_acos (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1480,7 +1480,7 @@ tree
a68_lower_long_long_acos (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_acos (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_acos (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1490,7 +1490,7 @@ tree
a68_lower_asin (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_asin (CTYPE (M_REAL));
+ tree t = a68_real_asin (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1500,7 +1500,7 @@ tree
a68_lower_long_asin (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_asin (CTYPE (M_LONG_REAL));
+ tree t = a68_real_asin (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1510,7 +1510,7 @@ tree
a68_lower_long_long_asin (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_asin (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_asin (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1520,7 +1520,7 @@ tree
a68_lower_atan (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_atan (CTYPE (M_REAL));
+ tree t = a68_real_atan (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1530,7 +1530,7 @@ tree
a68_lower_long_atan (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_atan (CTYPE (M_LONG_REAL));
+ tree t = a68_real_atan (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1540,7 +1540,7 @@ tree
a68_lower_long_long_atan (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_atan (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_atan (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1550,7 +1550,7 @@ tree
a68_lower_ln (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_ln (CTYPE (M_REAL));
+ tree t = a68_real_ln (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1560,7 +1560,7 @@ tree
a68_lower_long_ln (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_ln (CTYPE (M_LONG_REAL));
+ tree t = a68_real_ln (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1570,7 +1570,7 @@ tree
a68_lower_long_long_ln (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_ln (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_ln (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1580,7 +1580,7 @@ tree
a68_lower_log (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_log (CTYPE (M_REAL));
+ tree t = a68_real_log (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1590,7 +1590,7 @@ tree
a68_lower_long_log (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_log (CTYPE (M_LONG_REAL));
+ tree t = a68_real_log (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1600,7 +1600,7 @@ tree
a68_lower_long_long_log (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_log (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_log (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1610,7 +1610,7 @@ tree
a68_lower_exp (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_exp (CTYPE (M_REAL));
+ tree t = a68_real_exp (a68_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1620,7 +1620,7 @@ tree
a68_lower_long_exp (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_exp (CTYPE (M_LONG_REAL));
+ tree t = a68_real_exp (a68_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1630,7 +1630,7 @@ tree
a68_lower_long_long_exp (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- tree t = a68_real_exp (CTYPE (M_LONG_LONG_REAL));
+ tree t = a68_real_exp (a68_long_long_real_type);
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1675,8 +1675,8 @@ a68_lower_inti (NODE_T *p, LOW_CTX_T ctx)
tree op1 = a68_lower_tree (SUB (p), ctx);
tree op2 = a68_lower_tree (NEXT (NEXT (SUB (p))), ctx);
tree t = a68_complex_i (M_COMPLEX,
- convert_to_real (CTYPE (M_REAL), op1),
- convert_to_real (CTYPE (M_REAL), op2));
+ convert_to_real (a68_real_type, op1),
+ convert_to_real (a68_real_type, op2));
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1688,8 +1688,8 @@ a68_lower_longinti (NODE_T *p, LOW_CTX_T ctx)
tree op1 = a68_lower_tree (SUB (p), ctx);
tree op2 = a68_lower_tree (NEXT (NEXT (SUB (p))), ctx);
tree t= a68_complex_i (M_LONG_COMPLEX,
- convert_to_real (CTYPE (M_LONG_REAL), op1),
- convert_to_real (CTYPE (M_LONG_REAL), op2));
+ convert_to_real (a68_long_real_type, op1),
+ convert_to_real (a68_long_real_type, op2));
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1701,8 +1701,8 @@ a68_lower_longlonginti (NODE_T *p, LOW_CTX_T ctx)
tree op1 = a68_lower_tree (SUB (p), ctx);
tree op2 = a68_lower_tree (NEXT (NEXT (SUB (p))), ctx);
tree t = a68_complex_i (M_LONG_LONG_COMPLEX,
- convert_to_real (CTYPE (M_LONG_LONG_REAL), op1),
- convert_to_real (CTYPE (M_LONG_LONG_REAL), op2));
+ convert_to_real (a68_long_long_real_type, op1),
+ convert_to_real (a68_long_long_real_type, op2));
if (CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, a68_get_node_location (p));
return t;
@@ -1878,21 +1878,21 @@ tree
a68_lower_posixstdinfiledes (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return build_int_cst (CTYPE (M_INT), 0);
+ return build_int_cst (a68_int_type, 0);
}
tree
a68_lower_posixstdoutfiledes (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return build_int_cst (CTYPE (M_INT), 1);
+ return build_int_cst (a68_int_type, 1);
}
tree
a68_lower_posixstderrfiledes (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
- return build_int_cst (CTYPE (M_INT), 2);
+ return build_int_cst (a68_int_type, 2);
}
tree
@@ -1900,7 +1900,7 @@ a68_lower_posixfileodefault (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
/* Please keep in sync with libga68/ga68-posix.c */
- return build_int_cst (CTYPE (M_BITS), 0x0);
+ return build_int_cst (a68_bits_type, 0x0);
}
tree
@@ -1908,7 +1908,7 @@ a68_lower_posixfileordwr (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
/* Please keep in sync with libga68/ga68-posix.c */
- return build_int_cst (CTYPE (M_BITS), 0x3);
+ return build_int_cst (a68_bits_type, 0x3);
}
tree
@@ -1916,7 +1916,7 @@ a68_lower_posixfileordonly (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
/* Please keep in sync with libga68/ga68-posix.c */
- return build_int_cst (CTYPE (M_BITS), 0x1);
+ return build_int_cst (a68_bits_type, 0x1);
}
tree
@@ -1924,7 +1924,7 @@ a68_lower_posixfileowronly (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
/* Please keep in sync with libga68/ga68-posix.c */
- return build_int_cst (CTYPE (M_BITS), 0x2);
+ return build_int_cst (a68_bits_type, 0x2);
}
tree
@@ -1932,7 +1932,7 @@ a68_lower_posixfileotrunc (NODE_T *p ATTRIBUTE_UNUSED,
LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
/* Please keep in sync with libga68/ga68-posix.c */
- return build_int_cst (CTYPE (M_BITS), 0x4);
+ return build_int_cst (a68_bits_type, 0x4);
}
tree
diff --git a/gcc/algol68/a68-low-ranges.cc b/gcc/algol68/a68-low-ranges.cc
index 13987792d35..41ad4c599f2 100644
--- a/gcc/algol68/a68-low-ranges.cc
+++ b/gcc/algol68/a68-low-ranges.cc
@@ -545,7 +545,7 @@ a68_pop_serial_clause_range (void)
/* Then turn the last expression in stmt_list to an assignment to
clause_result_decl%, but don't bother if it has been voided. */
- if (clause_type != CTYPE (M_VOID))
+ if (clause_type != a68_void_type)
{
tree_stmt_iterator si = tsi_last (range->stmt_list);
tree last_expr = tsi_stmt (si);
@@ -572,7 +572,7 @@ a68_pop_serial_clause_range (void)
tree_stmt_iterator si = tsi_last (range->stmt_list);
if (TREE_TYPE (tsi_stmt (si)) != clause_type
/* But NIL can appear in a context expecting VOID with no widening. */
- && !(clause_type == CTYPE (M_VOID)
+ && !(clause_type == a68_void_type
&& POINTER_TYPE_P (TREE_TYPE (tsi_stmt (si)))
&& TREE_CODE (tsi_stmt (si)) == INTEGER_CST
&& tree_to_shwi (tsi_stmt (si)) == 0)
diff --git a/gcc/algol68/a68-low-reals.cc b/gcc/algol68/a68-low-reals.cc
index 87a1bf9ad1a..05bb2e96355 100644
--- a/gcc/algol68/a68-low-reals.cc
+++ b/gcc/algol68/a68-low-reals.cc
@@ -109,7 +109,7 @@ a68_real_width (tree type)
{
const machine_mode mode = TYPE_MODE (type);
const struct real_format *fmt = REAL_MODE_FORMAT (mode);
- return build_int_cst (CTYPE (M_INT), fmt->p);
+ return build_int_cst (a68_int_type, fmt->p);
}
/* Given a real type, build an INT with the number of decimal digits required
@@ -120,7 +120,7 @@ tree
a68_real_exp_width (tree type ATTRIBUTE_UNUSED)
{
/* XXX */
- return build_int_cst (CTYPE (M_INT), 0);
+ return build_int_cst (a68_int_type, 0);
}
/* Given a real value VAL, return -1 if it is less than zero, 0 if it is zero
@@ -132,14 +132,14 @@ a68_real_sign (tree val)
{
tree zero = build_real (TREE_TYPE (val), dconst0);
return fold_build3 (COND_EXPR,
- CTYPE (M_INT),
+ a68_int_type,
build2 (EQ_EXPR, integer_type_node, val, zero),
- build_int_cst (CTYPE (M_INT), 0),
+ build_int_cst (a68_int_type, 0),
fold_build3 (COND_EXPR,
- CTYPE (M_INT),
+ a68_int_type,
fold_build2 (GT_EXPR, integer_type_node, val, zero),
- build_int_cst (CTYPE (M_INT), 1),
- build_int_cst (CTYPE (M_INT), -1)));
+ build_int_cst (a68_int_type, 1),
+ build_int_cst (a68_int_type, -1)));
}
/* Absolute value of a real value. */
@@ -352,10 +352,10 @@ a68_real_shorten (MOID_T *to_mode, MOID_T *from_mode ATTRIBUTE_UNUSED, tree val)
most_positive_value = save_expr (most_positive_value);
most_negative_value = save_expr (most_negative_value);
return fold_build3 (COND_EXPR, CTYPE (to_mode),
- fold_build2 (GT_EXPR, CTYPE (M_BOOL), val, most_positive_value),
+ fold_build2 (GT_EXPR, a68_bool_type, val, most_positive_value),
fold_convert (CTYPE (to_mode), most_positive_value),
fold_build3 (COND_EXPR, CTYPE (to_mode),
- fold_build2 (LT_EXPR, CTYPE (M_BOOL), val, most_negative_value),
+ fold_build2 (LT_EXPR, a68_bool_type, val, most_negative_value),
fold_convert (CTYPE (to_mode), most_negative_value),
fold_convert (CTYPE (to_mode), val)));
}
diff --git a/gcc/algol68/a68-low-runtime.cc b/gcc/algol68/a68-low-runtime.cc
index 3e9177dbc9a..277802f21e8 100644
--- a/gcc/algol68/a68-low-runtime.cc
+++ b/gcc/algol68/a68-low-runtime.cc
@@ -92,9 +92,9 @@ get_libcall_type (a68_libcall_type type)
else if (type == LCT_VOIDPTR)
libcall_types[type] = ptr_type_node;
else if (type == LCT_UNISTR)
- libcall_types[type] = build_pointer_type (CTYPE (M_CHAR));
+ libcall_types[type] = build_pointer_type (a68_char_type);
else if (type == LCT_UNISTRPTR)
- libcall_types[type] = build_pointer_type (build_pointer_type (CTYPE (M_CHAR)));
+ libcall_types[type] = build_pointer_type (build_pointer_type (a68_char_type));
else if (type == LCT_SIZE)
libcall_types[type] = sizetype;
else if (type == LCT_SIZEPTR)
diff --git a/gcc/algol68/a68-low-strings.cc b/gcc/algol68/a68-low-strings.cc
index eae2767ec3e..20a9186267c 100644
--- a/gcc/algol68/a68-low-strings.cc
+++ b/gcc/algol68/a68-low-strings.cc
@@ -47,7 +47,7 @@
static void
copy_string (tree elements, tree to_index, tree str)
{
- tree char_pointer_type = build_pointer_type (CTYPE (M_CHAR));
+ tree char_pointer_type = build_pointer_type (a68_char_type);
tree num_elems
= a68_lower_tmpvar ("num_elems%", sizetype, a68_multiple_num_elems (str));
@@ -66,16 +66,16 @@ copy_string (tree elements, tree to_index, tree str)
/* *(elements + to_index) = *(elements + from_index) */
tree to_offset = fold_build2 (MULT_EXPR, sizetype,
- to_index, size_in_bytes (CTYPE (M_CHAR)));
+ to_index, size_in_bytes (a68_char_type));
a68_add_stmt (fold_build2 (MODIFY_EXPR,
void_type_node,
- fold_build2 (MEM_REF, CTYPE (M_CHAR),
+ fold_build2 (MEM_REF, a68_char_type,
fold_build2 (POINTER_PLUS_EXPR,
char_pointer_type,
elements, to_offset),
fold_convert (char_pointer_type,
integer_zero_node)),
- fold_build2 (MEM_REF, CTYPE (M_CHAR),
+ fold_build2 (MEM_REF, a68_char_type,
fold_build2 (POINTER_PLUS_EXPR,
char_pointer_type,
a68_multiple_elements (str),
@@ -90,7 +90,7 @@ copy_string (tree elements, tree to_index, tree str)
from_offset,
fold_build2 (MULT_EXPR, sizetype,
a68_multiple_stride (str, size_zero_node),
- size_in_bytes (CTYPE (M_CHAR))))));
+ size_in_bytes (a68_char_type)))));
/* to_index = to_index + 1 */
a68_add_stmt (fold_build2 (POSTINCREMENT_EXPR, sizetype, to_index, size_one_node));
@@ -111,7 +111,7 @@ copy_string (tree elements, tree to_index, tree str)
tree
a68_string_concat (tree str1, tree str2)
{
- tree char_pointer_type = build_pointer_type (CTYPE (M_CHAR));
+ tree char_pointer_type = build_pointer_type (a68_char_type);
static tree string_concat_fndecl;
if (string_concat_fndecl == NULL_TREE)
@@ -138,12 +138,12 @@ a68_string_concat (tree str1, tree str2)
/* First allocate memory for the result string. We need enough space to
hold the elements of both strings with a stride of one. */
- tree char_pointer_type = build_pointer_type (CTYPE (M_CHAR));
+ tree char_pointer_type = build_pointer_type (a68_char_type);
tree elements_size = fold_build2 (MULT_EXPR, sizetype,
- size_in_bytes (CTYPE (M_CHAR)),
+ size_in_bytes (a68_char_type),
num_elems);
tree elements = a68_lower_tmpvar ("elements%", char_pointer_type,
- a68_lower_malloc (CTYPE (M_CHAR), elements_size));
+ a68_lower_malloc (a68_char_type, elements_size));
/* Copy elements. */
tree to_index = a68_lower_tmpvar ("to_index%", sizetype, size_zero_node);
@@ -160,7 +160,7 @@ a68_string_concat (tree str1, tree str2)
tree num_elems = a68_lower_tmpvar ("num_elems%", sizetype,
fold_build2 (PLUS_EXPR, sizetype, n1, n2));
tree elements_size = fold_build2 (MULT_EXPR, sizetype,
- size_in_bytes (CTYPE (M_CHAR)),
+ size_in_bytes (a68_char_type),
num_elems);
tree lower_bound = ssize_int (1);
tree upper_bound = fold_convert (ssizetype, num_elems);
@@ -224,20 +224,20 @@ a68_string_from_char (tree c)
{
tree lower_bound = ssize_int (1);
tree upper_bound = lower_bound;
- tree char_pointer_type = build_pointer_type (CTYPE (M_CHAR));
+ tree char_pointer_type = build_pointer_type (a68_char_type);
a68_push_range (M_STRING);
tree elements = a68_lower_tmpvar ("elements%", char_pointer_type,
- a68_lower_malloc (CTYPE (M_CHAR),
+ a68_lower_malloc (a68_char_type,
size_one_node));
a68_add_stmt (fold_build2 (MODIFY_EXPR,
void_type_node,
- fold_build1 (INDIRECT_REF, CTYPE (M_CHAR), elements),
+ fold_build1 (INDIRECT_REF, a68_char_type, elements),
c));
a68_add_stmt (a68_row_value (CTYPE (M_STRING), 1 /* dim */,
elements,
- size_in_bytes (CTYPE (M_CHAR)),
+ size_in_bytes (a68_char_type),
&lower_bound, &upper_bound));
return a68_pop_range ();
}
@@ -259,7 +259,7 @@ a68_string_cmp (tree s1, tree s2)
tree s2_stride = a68_multiple_stride (s2, size_zero_node);
return a68_build_libcall (A68_LIBCALL_U32_CMP2,
- CTYPE (M_INT), 6,
+ a68_int_type, 6,
s1_elems, s1_len, s1_stride,
s2_elems, s2_len, s2_stride);
}
diff --git a/gcc/algol68/a68-low-units.cc b/gcc/algol68/a68-low-units.cc
index 8ecafcf182f..1c0381843fa 100644
--- a/gcc/algol68/a68-low-units.cc
+++ b/gcc/algol68/a68-low-units.cc
@@ -130,13 +130,13 @@ a68_lower_string_denotation (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
NULL, &ucslen);
free (str);
tree string_literal = build_string_literal (ucslen * sizeof (uint32_t),
- (char *) ucsbuf, CTYPE (M_CHAR));
+ (char *) ucsbuf, a68_char_type);
tree elements = string_literal;
tree lower_bound = fold_convert (ssizetype, size_one_node);
tree upper_bound = ssize_int (ucslen);
tree elements_size = fold_build2 (MULT_EXPR, sizetype,
size_int (ucslen),
- size_in_bytes (CTYPE (M_CHAR)));
+ size_in_bytes (a68_char_type));
tree multiple = a68_row_value (CTYPE (M_ROW_CHAR), 1,
elements, elements_size,
&lower_bound, &upper_bound);
@@ -176,7 +176,7 @@ a68_lower_denotation (NODE_T *p, LOW_CTX_T ctx)
uint32_t ucs;
int length = a68_u8_mbtouc (&ucs, (const uint8_t *) NSYMBOL (p), 1);
gcc_assert (ucs != 0xfffd && length == 1);
- return build_int_cst (CTYPE (M_CHAR), ucs);
+ return build_int_cst (a68_char_type, ucs);
}
else if (moid == M_ROW_CHAR)
return a68_lower_string_denotation (p, ctx);
@@ -281,8 +281,8 @@ a68_lower_nihil (NODE_T *p, LOW_CTX_T ctx ATTRIBUTE_UNUSED)
{
tree type = CTYPE (MOID (p));
- gcc_assert (type == CTYPE (M_VOID) || POINTER_TYPE_P (type));
- if (type == CTYPE (M_VOID))
+ gcc_assert (type == a68_void_type || POINTER_TYPE_P (type));
+ if (type == a68_void_type)
return a68_lower_empty (p, ctx);
else
return build_int_cst (type, 0);
diff --git a/gcc/algol68/a68-low.cc b/gcc/algol68/a68-low.cc
index c4d8172543b..df2951d2fd2 100644
--- a/gcc/algol68/a68-low.cc
+++ b/gcc/algol68/a68-low.cc
@@ -72,7 +72,7 @@ a68_get_mangled_identifier (const char *name)
tree
a68_get_empty (void)
{
- return build_constructor (CTYPE (M_VOID), NULL);
+ return build_constructor (a68_void_type, NULL);
}
/* Return a tree with the yielding of SKIP for a given integral type. */
@@ -175,38 +175,38 @@ a68_get_skip_tree (MOID_T *m)
/* This is EMPTY. */
expr = a68_get_empty ();
else if (m == M_BOOL)
- expr = build_int_cst (CTYPE (M_BOOL), 0);
+ expr = build_int_cst (a68_bool_type, 0);
else if (m == M_CHAR)
- expr = build_int_cst (CTYPE (M_CHAR), ' ');
+ expr = build_int_cst (a68_char_type, ' ');
else if (m == M_SHORT_SHORT_INT)
- expr = a68_get_int_skip_tree (CTYPE (M_SHORT_SHORT_INT));
+ expr = a68_get_int_skip_tree (a68_short_short_int_type);
else if (m == M_SHORT_INT)
- expr = a68_get_int_skip_tree (CTYPE (M_SHORT_INT));
+ expr = a68_get_int_skip_tree (a68_short_int_type);
else if (m == M_INT)
- expr = a68_get_int_skip_tree (CTYPE (M_INT));
+ expr = a68_get_int_skip_tree (a68_int_type);
else if (m == M_LONG_INT)
- expr = a68_get_int_skip_tree (CTYPE (M_LONG_INT));
+ expr = a68_get_int_skip_tree (a68_long_int_type);
else if (m == M_LONG_LONG_INT)
- expr = a68_get_int_skip_tree (CTYPE (M_LONG_LONG_INT));
+ expr = a68_get_int_skip_tree (a68_long_long_int_type);
else if (m == M_SHORT_SHORT_BITS)
- expr = a68_get_int_skip_tree (CTYPE (M_SHORT_SHORT_BITS));
+ expr = a68_get_int_skip_tree (a68_short_short_bits_type);
else if (m == M_SHORT_BITS)
- expr = a68_get_int_skip_tree (CTYPE (M_SHORT_BITS));
+ expr = a68_get_int_skip_tree (a68_short_bits_type);
else if (m == M_BITS)
- expr = a68_get_int_skip_tree (CTYPE (M_BITS));
+ expr = a68_get_int_skip_tree (a68_bits_type);
else if (m == M_LONG_BITS)
- expr = a68_get_int_skip_tree (CTYPE (M_LONG_BITS));
+ expr = a68_get_int_skip_tree (a68_long_bits_type);
else if (m == M_LONG_LONG_BITS)
- expr = a68_get_int_skip_tree (CTYPE (M_LONG_LONG_BITS));
+ expr = a68_get_int_skip_tree (a68_long_long_bits_type);
else if (m == M_REAL)
- expr = build_real_from_int_cst (CTYPE (M_REAL),
- build_int_cst (CTYPE (M_INT), 0));
+ expr = build_real_from_int_cst (a68_real_type,
+ build_int_cst (a68_int_type, 0));
else if (m == M_LONG_REAL)
- expr = build_real_from_int_cst (CTYPE (M_LONG_REAL),
- build_int_cst (CTYPE (M_LONG_INT), 0));
+ expr = build_real_from_int_cst (a68_long_real_type,
+ build_int_cst (a68_long_int_type, 0));
else if (m == M_LONG_LONG_REAL)
- expr = build_real_from_int_cst (CTYPE (M_LONG_LONG_REAL),
- build_int_cst (CTYPE (M_LONG_LONG_INT), 0));
+ expr = build_real_from_int_cst (a68_long_long_real_type,
+ build_int_cst (a68_long_long_int_type, 0));
else
{
fatal_error (UNKNOWN_LOCATION,
@@ -467,7 +467,7 @@ a68_low_deref (tree exp, NODE_T *p)
void_type_node, 2,
filename,
build_int_cst (unsigned_type_node, lineno));
- call = fold_build2 (COMPOUND_EXPR, CTYPE (M_BOOL), call, boolean_false_node);
+ call = fold_build2 (COMPOUND_EXPR, a68_bool_type, call, boolean_false_node);
nil_check = fold_build2 (NE_EXPR, exp_type,
consolidated_exp,
build_int_cst (exp_type, 0));
--
2.30.2
More information about the Algol68
mailing list