This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Remaining generic bits from sparc64-linux merge
- To: egcs at cygnus dot com
- Subject: Remaining generic bits from sparc64-linux merge
- From: "David S. Miller" <davem at jenolan dot rutgers dot edu>
- Date: Thu, 2 Oct 1997 15:50:05 -0400
The following have still not been applied. This is fine, but I would
like some feedback on whether the maintainers have some reservations
about applying these changes, and if so what the specific problems
are.
Thu Oct 2 15:28:24 1997 David S. Miller <davem@tanya.rutgers.edu>
* varasm.c (immed_double_const): Add casts to HOST_WIDE_INT where
necessary.
(const_hash): Hash val is unsigned long.
(SYMHASH): Likewise.
* tree.c (TYPE_HASH): Type of hash val is unsigned long.
* rtl.c: Remove atol extern, include stdlib.h instead.
(read_rtx): Use atol/atoq based upon disposition of
HOST_WIDE_INT.
* genattrtab.c (write_test_expr): Use proper format string based
upon disposition of HOST_BITS_PER_WIDE_INT.
* genemit.c (gen_exp): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (write_tree_1): Likewise.
* print-tree.c (print_node_brief): HOST_PTR_PRINTF format wants a
char pointer, not HOST_WIDE_INT.
(print_node): Likewise. Also hash is unsigned long not
HOST_WIDE_INT.
* gbl-ctors.h: Do not declare extern for atexit if both WINNT and
NEED_ATEXIT are not defined.
* cse.c (canon_hash): Hash is unsigned long not HOST_WIDE_INT.
* c-lex.c (yyprint): Use proper format string based upon
disposition of HOST_BITS_PER_WIDE_INT.
(yylex): Put casts in right place for args to build_int_2.
--- ./c-lex.c.~1~ Fri Aug 15 01:32:53 1997
+++ ./c-lex.c Thu Oct 2 15:29:07 1997
@@ -305,10 +305,14 @@ yyprint (file, yychar, yylval)
if (TREE_CODE (t) == INTEGER_CST)
fprintf (file,
#if HOST_BITS_PER_WIDE_INT == 64
-#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
+ " 0x%x%016x",
+#else
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
" 0x%lx%016lx",
#else
- " 0x%x%016x",
+ " 0x%llx%016llx",
+#endif
#endif
#else
#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
@@ -1892,12 +1896,12 @@ yylex ()
else if (TREE_UNSIGNED (char_type_node)
|| ((result >> (num_bits - 1)) & 1) == 0)
yylval.ttype
- = build_int_2 (result & ((unsigned HOST_WIDE_INT) ~0
+ = build_int_2 (result & (~(unsigned HOST_WIDE_INT) 0
>> (HOST_BITS_PER_WIDE_INT - num_bits)),
0);
else
yylval.ttype
- = build_int_2 (result | ~((unsigned HOST_WIDE_INT) ~0
+ = build_int_2 (result | ~(~(unsigned HOST_WIDE_INT) 0
>> (HOST_BITS_PER_WIDE_INT - num_bits)),
-1);
TREE_TYPE (yylval.ttype) = integer_type_node;
--- ./cse.c.~1~ Mon Sep 22 13:41:19 1997
+++ ./cse.c Thu Oct 2 15:34:25 1997
@@ -1913,12 +1913,12 @@ canon_hash (x, mode)
/* Assume there is only one rtx object for any given label. */
case LABEL_REF:
hash
- += ((unsigned) LABEL_REF << 7) + (unsigned HOST_WIDE_INT) XEXP (x, 0);
+ += ((unsigned) LABEL_REF << 7) + (unsigned long) XEXP (x, 0);
return hash;
case SYMBOL_REF:
hash
- += ((unsigned) SYMBOL_REF << 7) + (unsigned HOST_WIDE_INT) XSTR (x, 0);
+ += ((unsigned) SYMBOL_REF << 7) + (unsigned long) XSTR (x, 0);
return hash;
case MEM:
--- ./gbl-ctors.h.~1~ Mon Aug 11 11:57:07 1997
+++ ./gbl-ctors.h Thu Oct 2 15:35:20 1997
@@ -39,8 +39,6 @@ Boston, MA 02111-1307, USA. */
#ifdef HAVE_ATEXIT
#if defined (WINNT) || defined (NEED_ATEXIT)
extern int atexit (void (*) (void));
-#else
-extern void atexit (void (*) (void));
#endif
#define ON_EXIT(FUNC,ARG) atexit ((FUNC))
#else
--- ./genattrtab.c.~1~ Sun Sep 21 20:49:30 1997
+++ ./genattrtab.c Thu Oct 2 15:36:36 1997
@@ -4482,7 +4482,11 @@ write_test_expr (exp, in_comparison)
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
printf ("%d", XWINT (exp, 0));
#else
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
printf ("%ld", XWINT (exp, 0));
+#else
+ printf ("%lld", XWINT (exp, 0));
+#endif
#endif
break;
--- ./genemit.c.~1~ Mon Aug 11 11:57:09 1997
+++ ./genemit.c Thu Oct 2 15:37:19 1997
@@ -216,7 +216,11 @@ gen_exp (x)
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
"GEN_INT (%d)",
#else
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
"GEN_INT (%ld)",
+#else
+ "GEN_INT (%lld)",
+#endif
#endif
INTVAL (x));
return;
--- ./genpeep.c.~1~ Mon Aug 11 11:57:10 1997
+++ ./genpeep.c Thu Oct 2 15:37:55 1997
@@ -327,8 +327,13 @@ match_rtx (x, path, fail_label)
printf (" if (XWINT (x, %d) != %d) goto L%d;\n",
i, XWINT (x, i), fail_label);
#else
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
printf (" if (XWINT (x, %d) != %ld) goto L%d;\n",
i, XWINT (x, i), fail_label);
+#else
+ printf (" if (XWINT (x, %d) != %lld) goto L%d;\n",
+ i, XWINT (x, i), fail_label);
+#endif
#endif
}
else if (fmt[i] == 's')
--- ./rtl.c.~1~ Tue Sep 23 03:14:06 1997
+++ ./rtl.c Thu Oct 2 15:42:17 1997
@@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include <ctype.h>
#include <stdio.h>
+#include <stdlib.h>
#include "rtl.h"
#include "real.h"
@@ -37,9 +38,6 @@ Boston, MA 02111-1307, USA. */
extern struct obstack *rtl_obstack;
-#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
-extern long atol();
-#endif
/* Indexed by rtx code, gives number of operands for an rtx with that code.
Does NOT include rtx header data (code and links).
@@ -753,7 +751,11 @@ read_rtx (infile)
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
tmp_wide = atoi (tmp_char);
#else
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
tmp_wide = atol (tmp_char);
+#else
+ tmp_wide = atoq (tmp_char);
+#endif
#endif
XWINT (return_rtx, i) = tmp_wide;
break;
--- ./genrecog.c.~1~ Mon Aug 11 11:57:10 1997
+++ ./genrecog.c Thu Oct 2 15:38:23 1997
@@ -1355,7 +1355,11 @@ write_tree_1 (tree, prevpos, afterward,
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
"XWINT (x%d, 0) == %d%s && ",
#else
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
"XWINT (x%d, 0) == %ld%s && ",
+#else
+ "XWINT (x%d, 0) == %lld%s && ",
+#endif
#endif
depth, p->elt_zero_wide + offset, offset ? "-1" : "");
}
--- ./print-tree.c.~1~ Mon Aug 11 11:57:12 1997
+++ ./print-tree.c Thu Oct 2 15:40:35 1997
@@ -82,7 +82,7 @@ print_node_brief (file, prefix, node, in
if (indent > 0)
fprintf (file, " ");
fprintf (file, "%s <%s ", prefix, tree_code_name[(int) TREE_CODE (node)]);
- fprintf (file, HOST_PTR_PRINTF, (HOST_WIDE_INT) node);
+ fprintf (file, HOST_PTR_PRINTF, (char *) node);
if (class == 'd')
{
@@ -218,7 +218,7 @@ print_node (file, prefix, node, indent)
return;
}
- hash = ((unsigned HOST_WIDE_INT) node) % HASH_SIZE;
+ hash = ((unsigned long) node) % HASH_SIZE;
/* If node is in the table, just mention its address. */
for (b = table[hash]; b; b = b->next)
@@ -239,7 +239,7 @@ print_node (file, prefix, node, indent)
/* Print the slot this node is in, and its code, and address. */
fprintf (file, "%s <%s ", prefix, tree_code_name[(int) TREE_CODE (node)]);
- fprintf (file, HOST_PTR_PRINTF, (HOST_WIDE_INT) node);
+ fprintf (file, HOST_PTR_PRINTF, (char *) node);
/* Print the name, if any. */
if (class == 'd')
@@ -435,7 +435,7 @@ print_node (file, prefix, node, indent)
{
fprintf (file, "saved-insns ");
fprintf (file, HOST_PTR_PRINTF,
- (HOST_WIDE_INT) DECL_SAVED_INSNS (node));
+ (char *) DECL_SAVED_INSNS (node));
}
}
--- ./tree.c.~1~ Thu Aug 28 09:08:52 1997
+++ ./tree.c Thu Oct 2 15:42:48 1997
@@ -280,7 +280,7 @@ static int next_type_uid = 1;
/* Here is how primitive or already-canonicalized types' hash
codes are made. */
-#define TYPE_HASH(TYPE) ((HOST_WIDE_INT) (TYPE) & 0777777)
+#define TYPE_HASH(TYPE) ((unsigned long) (TYPE) & 0777777)
extern char *mode_name[];
--- ./varasm.c.~1~ Mon Sep 22 13:41:48 1997
+++ ./varasm.c Thu Oct 2 15:44:55 1997
@@ -2163,7 +2163,7 @@ immed_double_const (i0, i1, mode)
is being broken. */
if (width <= HOST_BITS_PER_WIDE_INT)
- i1 = (i0 < 0) ? ~0 : 0;
+ i1 = (i0 < 0) ? ~(HOST_WIDE_INT) 0 : 0;
/* If this integer fits in one word, return a CONST_INT. */
if ((i1 == 0 && i0 >= 0)
@@ -2476,7 +2476,7 @@ const_hash (exp)
Instead, we include the array size because the constructor could
be shorter. */
if (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE)
- hi = ((HOST_WIDE_INT) TREE_TYPE (exp) & ((1 << HASHBITS) - 1))
+ hi = ((unsigned long) TREE_TYPE (exp) & ((1 << HASHBITS) - 1))
% MAX_HASH_TABLE;
else
hi = ((5 + int_size_in_bytes (TREE_TYPE (exp)))
@@ -3237,7 +3237,7 @@ static struct pool_sym **const_rtx_sym_h
The argument is XSTR (... , 0) */
#define SYMHASH(LABEL) \
- ((((HOST_WIDE_INT) (LABEL)) & ((1 << HASHBITS) - 1)) % MAX_RTX_HASH_TABLE)
+ ((((unsigned long) (LABEL)) & ((1 << HASHBITS) - 1)) % MAX_RTX_HASH_TABLE)
/* Initialize constant pool hashing for next function. */