Commit 2afaa41c by Greg McGary Committed by Greg McGary

tree.h (struct tree_int_cst): Wrap low and high in a sub-struct.

	* tree.h (struct tree_int_cst): Wrap low and high in a sub-struct.
	(TREE_INT_CST_LOW, TREE_INT_CST_HIGH): Access through sub-struct.
	(TREE_INT_CST): New macro.
	* varasm.c (const_hash, compare_constant_1, record_constant_1):
	Use new macro TREE_INT_CST.

From-SVN: r36076
parent 1d92b3e1
2000-08-30 Greg McGary <greg@mcgary.org>
* tree.h (struct tree_int_cst): Wrap low and high in a sub-struct.
(TREE_INT_CST_LOW, TREE_INT_CST_HIGH): Access through sub-struct.
(TREE_INT_CST): New macro.
* varasm.c (const_hash, compare_constant_1, record_constant_1):
Use new macro TREE_INT_CST.
Wed 30-Aug-2000 23:18:59 BST Neil Booth <NeilB@earthling.net> Wed 30-Aug-2000 23:18:59 BST Neil Booth <NeilB@earthling.net>
* contrib.texi: Add self. * contrib.texi: Add self.
......
...@@ -655,8 +655,9 @@ extern void tree_class_check_failed PARAMS ((const tree, int, ...@@ -655,8 +655,9 @@ extern void tree_class_check_failed PARAMS ((const tree, int,
If the data type is signed, the value is sign-extended to 2 words If the data type is signed, the value is sign-extended to 2 words
even though not all of them may really be in use. even though not all of them may really be in use.
In an unsigned constant shorter than 2 words, the extra bits are 0. */ In an unsigned constant shorter than 2 words, the extra bits are 0. */
#define TREE_INT_CST_LOW(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst_low) #define TREE_INT_CST(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst)
#define TREE_INT_CST_HIGH(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst_high) #define TREE_INT_CST_LOW(NODE) (TREE_INT_CST (NODE).low)
#define TREE_INT_CST_HIGH(NODE) (TREE_INT_CST (NODE).high)
#define INT_CST_LT(A, B) \ #define INT_CST_LT(A, B) \
(TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B) \ (TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B) \
...@@ -675,8 +676,13 @@ struct tree_int_cst ...@@ -675,8 +676,13 @@ struct tree_int_cst
struct tree_common common; struct tree_common common;
struct rtx_def *rtl; /* acts as link to register transfer language struct rtx_def *rtl; /* acts as link to register transfer language
(rtl) info */ (rtl) info */
unsigned HOST_WIDE_INT int_cst_low; /* A sub-struct is necessary here because the function `const_hash'
HOST_WIDE_INT int_cst_high; wants to scan both words as a unit and taking the address of the
sub-struct yields the properly inclusive bounded pointer. */
struct {
unsigned HOST_WIDE_INT low;
HOST_WIDE_INT high;
} int_cst;
}; };
/* In REAL_CST, STRING_CST, COMPLEX_CST nodes, and CONSTRUCTOR nodes, /* In REAL_CST, STRING_CST, COMPLEX_CST nodes, and CONSTRUCTOR nodes,
......
...@@ -2361,8 +2361,8 @@ const_hash (exp) ...@@ -2361,8 +2361,8 @@ const_hash (exp)
switch (code) switch (code)
{ {
case INTEGER_CST: case INTEGER_CST:
p = (char *) &TREE_INT_CST_LOW (exp); p = (char *) &TREE_INT_CST (exp);
len = 2 * sizeof TREE_INT_CST_LOW (exp); len = sizeof TREE_INT_CST (exp);
break; break;
case REAL_CST: case REAL_CST:
...@@ -2506,8 +2506,8 @@ compare_constant_1 (exp, p) ...@@ -2506,8 +2506,8 @@ compare_constant_1 (exp, p)
if (*p++ != TYPE_PRECISION (TREE_TYPE (exp))) if (*p++ != TYPE_PRECISION (TREE_TYPE (exp)))
return 0; return 0;
strp = (unsigned char *) &TREE_INT_CST_LOW (exp); strp = (unsigned char *) &TREE_INT_CST (exp);
len = 2 * sizeof TREE_INT_CST_LOW (exp); len = sizeof TREE_INT_CST (exp);
break; break;
case REAL_CST: case REAL_CST:
...@@ -2745,8 +2745,8 @@ record_constant_1 (exp) ...@@ -2745,8 +2745,8 @@ record_constant_1 (exp)
{ {
case INTEGER_CST: case INTEGER_CST:
obstack_1grow (&permanent_obstack, TYPE_PRECISION (TREE_TYPE (exp))); obstack_1grow (&permanent_obstack, TYPE_PRECISION (TREE_TYPE (exp)));
strp = (unsigned char *) &TREE_INT_CST_LOW (exp); strp = (unsigned char *) &TREE_INT_CST (exp);
len = 2 * sizeof TREE_INT_CST_LOW (exp); len = sizeof TREE_INT_CST (exp);
break; break;
case REAL_CST: case REAL_CST:
......
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