aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorCharles Hannum <mycroft@gnu.org>1992-07-06 20:15:06 +0000
committerCharles Hannum <mycroft@gnu.org>1992-07-06 20:15:06 +0000
commitc166a31116c7a33593aa2c54b0763d70c7dd4391 (patch)
tree4ab72bd153a36b9459a8c41247387a25bab2d88d /gcc
parent373666321abc0c92b292160fbb328a991d205940 (diff)
downloadgcc-c166a31116c7a33593aa2c54b0763d70c7dd4391.zip
gcc-c166a31116c7a33593aa2c54b0763d70c7dd4391.tar.gz
gcc-c166a31116c7a33593aa2c54b0763d70c7dd4391.tar.bz2
entered into RCS
From-SVN: r1476
Diffstat (limited to 'gcc')
-rw-r--r--gcc/reg-stack.c9
-rw-r--r--gcc/rtl.c53
-rw-r--r--gcc/rtlanal.c13
-rw-r--r--gcc/stor-layout.c34
-rw-r--r--gcc/unroll.c48
-rw-r--r--gcc/xcoffout.c2
6 files changed, 106 insertions, 53 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 8b15005..839a155 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -655,7 +655,7 @@ constrain_asm_operands (n_operands, operands, operand_constraints,
/* Match any CONST_DOUBLE, but only if
we can examine the bits of it reliably. */
if ((HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT
- || HOST_BITS_PER_INT != BITS_PER_WORD)
+ || HOST_BITS_PER_WIDE_INT != BITS_PER_WORD)
&& GET_CODE (op) != VOIDmode && ! flag_pretend_float)
break;
if (GET_CODE (op) == CONST_DOUBLE)
@@ -1160,7 +1160,7 @@ record_reg_life (insn, block, regstack)
int n_inputs, n_outputs;
char **constraints = (char **) alloca (n_operands * sizeof (char *));
- decode_asm_operands (body, operands, 0, constraints, 0);
+ decode_asm_operands (body, operands, NULL_PTR, constraints, NULL_PTR);
get_asm_operand_lengths (body, n_operands, &n_inputs, &n_outputs);
record_asm_reg_life (insn, regstack, operands, constraints,
n_inputs, n_outputs);
@@ -2383,7 +2383,8 @@ subst_stack_regs (insn, regstack)
char **constraints
= (char **) alloca (n_operands * sizeof (char *));
- decode_asm_operands (body, operands, operands_loc, constraints, 0);
+ decode_asm_operands (body, operands, operands_loc,
+ constraints, NULL_PTR);
get_asm_operand_lengths (body, n_operands, &n_inputs, &n_outputs);
subst_asm_stack_regs (insn, regstack, operands, operands_loc,
constraints, n_inputs, n_outputs);
@@ -2391,7 +2392,7 @@ subst_stack_regs (insn, regstack)
}
if (GET_CODE (PATTERN (insn)) == PARALLEL)
- for (i = 0; i < XVECLEN (PATTERN (insn) , 0); i++)
+ for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
if (stack_regs_mentioned_p (XVECEXP (PATTERN (insn), 0, i)))
subst_stack_regs_pat (insn, regstack,
diff --git a/gcc/rtl.c b/gcc/rtl.c
index a145e54..7b646c3 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -36,6 +36,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
extern struct obstack *rtl_obstack;
extern long ftell();
+
+#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).
@@ -136,6 +140,8 @@ char *rtx_format[] = {
"i" an integer
prints the integer
"n" like "i", but prints entries from `note_insn_name'
+ "w" an integer of width HOST_BITS_PER_WIDE_INT
+ prints the integer
"s" a pointer to a string
prints the string
"S" like "s", but optional:
@@ -282,6 +288,7 @@ copy_rtx (orig)
XEXP (copy, i) = copy_rtx (XEXP (orig, i));
break;
+ case '0':
case 'u':
XEXP (copy, i) = XEXP (orig, i);
break;
@@ -297,9 +304,21 @@ copy_rtx (orig)
}
break;
- default:
+ case 'w':
+ XWINT (copy, i) = XWINT (orig, i);
+ break;
+
+ case 'i':
XINT (copy, i) = XINT (orig, i);
break;
+
+ case 's':
+ case 'S':
+ XSTR (copy, i) = XSTR (orig, i);
+ break;
+
+ default:
+ abort ();
}
}
return copy;
@@ -355,6 +374,7 @@ copy_most_rtx (orig, may_share)
XEXP (copy, i) = copy_most_rtx (XEXP (orig, i), may_share);
break;
+ case '0':
case 'u':
XEXP (copy, i) = XEXP (orig, i);
break;
@@ -371,9 +391,22 @@ copy_most_rtx (orig, may_share)
}
break;
- default:
+ case 'w':
+ XWINT (copy, i) = XWINT (orig, i);
+ break;
+
+ case 'n':
+ case 'i':
XINT (copy, i) = XINT (orig, i);
break;
+
+ case 's':
+ case 'S':
+ XSTR (copy, i) = XSTR (orig, i);
+ break;
+
+ default:
+ abort ();
}
}
return copy;
@@ -500,6 +533,7 @@ read_rtx (infile)
rtx return_rtx;
register int c;
int tmp_int;
+ HOST_WIDE_INT tmp_wide;
/* Linked list structure for making RTXs: */
struct rtx_list
@@ -612,8 +646,7 @@ read_rtx (infile)
}
/* get vector length and allocate it */
XVEC (return_rtx, i) = (list_counter
- ? rtvec_alloc (list_counter)
- : (struct rtvec_def *) NULL);
+ ? rtvec_alloc (list_counter) : NULL_RTVEC);
if (list_counter > 0)
{
next_rtx = list_rtx;
@@ -684,6 +717,16 @@ read_rtx (infile)
}
break;
+ case 'w':
+ read_name (tmp_char, infile);
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
+ tmp_wide = atoi (tmp_char);
+#else
+ tmp_wide = atol (tmp_char);
+#endif
+ XWINT (return_rtx, i) = tmp_wide;
+ break;
+
case 'i':
case 'n':
read_name (tmp_char, infile);
@@ -737,7 +780,7 @@ init_rtl ()
/* Set the GET_RTX_FORMAT of CONST_DOUBLE to a string
of as many `i's as we now have elements. */
for (i = 0; i < rtx_length[(int) CONST_DOUBLE]; i++)
- *s++ = 'i';
+ *s++ = 'w';
*s++ = 0;
}
#endif
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 8ca23e3..8ccae19 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1,5 +1,5 @@
/* Analyze RTL for C-Compiler
- Copyright (C) 1987, 1988, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1991, 1992 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -184,7 +184,7 @@ rtx_addr_varies_p (x)
Only obvious integer terms are detected.
This is used in cse.c with the `related_value' field.*/
-int
+HOST_WIDE_INT
get_integer_term (x)
rtx x;
{
@@ -561,7 +561,7 @@ find_last_value (x, pinsn, valid_to)
if (GET_RTX_CLASS (GET_CODE (p)) == 'i')
{
rtx set = single_set (p);
- rtx note = find_reg_note (p, REG_EQUAL, 0);
+ rtx note = find_reg_note (p, REG_EQUAL, NULL_RTX);
if (set && rtx_equal_p (x, SET_DEST (set)))
{
@@ -735,7 +735,7 @@ reg_overlap_mentioned_p (x, in)
endregno = regno + (regno < FIRST_PSEUDO_REGISTER
? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1);
- return refers_to_regno_p (regno, endregno, in, 0);
+ return refers_to_regno_p (regno, endregno, in, NULL_PTR);
}
/* Used for communications between the next few functions. */
@@ -886,6 +886,11 @@ rtx_equal_p (x, y)
{
switch (fmt[i])
{
+ case 'w':
+ if (XWINT (x, i) != XWINT (y, i))
+ return 0;
+ break;
+
case 'n':
case 'i':
if (XINT (x, i) != XINT (y, i))
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index abf8638..7c4ef96 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -86,9 +86,9 @@ variable_size (size)
}
if (immediate_size_expand)
- expand_expr (size, 0, VOIDmode, 0);
+ expand_expr (size, NULL_PTR, VOIDmode, 0);
else
- pending_sizes = tree_cons (0, size, pending_sizes);
+ pending_sizes = tree_cons (NULL_TREE, size, pending_sizes);
return size;
}
@@ -280,7 +280,7 @@ layout_record (rec)
if (TREE_STATIC (field))
{
- pending_statics = tree_cons (NULL, field, pending_statics);
+ pending_statics = tree_cons (NULL_TREE, field, pending_statics);
continue;
}
/* Enumerators and enum types which are local to this class need not
@@ -873,14 +873,18 @@ make_signed_type (precision)
/* Create the extreme values based on the number of bits. */
TYPE_MIN_VALUE (type)
- = build_int_2 ((precision-HOST_BITS_PER_INT > 0 ? 0 : (-1)<<(precision-1)),
- (-1)<<(precision-HOST_BITS_PER_INT-1 > 0
- ? precision-HOST_BITS_PER_INT-1
- : 0));
+ = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
+ ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
+ (((HOST_WIDE_INT) (-1)
+ << (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
+ ? precision-HOST_BITS_PER_WIDE_INT - 1
+ : 0))));
TYPE_MAX_VALUE (type)
- = build_int_2 ((precision-HOST_BITS_PER_INT > 0 ? -1 : (1<<(precision-1))-1),
- (precision-HOST_BITS_PER_INT-1 > 0
- ? (1<<(precision-HOST_BITS_PER_INT-1))-1
+ = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
+ ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
+ (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
+ ? (((HOST_WIDE_INT) 1
+ << (precision - HOST_BITS_PER_INT - 1)))-1
: 0));
/* Give this type's extreme values this type as their type. */
@@ -937,10 +941,12 @@ fixup_unsigned_type (type)
TYPE_MIN_VALUE (type) = build_int_2 (0, 0);
TYPE_MAX_VALUE (type)
- = build_int_2 (precision-HOST_BITS_PER_INT >= 0 ? -1 : (1<<precision)-1,
- precision-HOST_BITS_PER_INT > 0
- ? ((unsigned) ~0
- >> (HOST_BITS_PER_INT - (precision - HOST_BITS_PER_INT)))
+ = build_int_2 (precision - HOST_BITS_PER_WIDE_INT >= 0
+ ? -1 : ((HOST_WIDE_INT) 1<< precision) - 1,
+ precision - HOST_BITS_PER_WIDE_INT > 0
+ ? ((unsigned HOST_WIDE_INT) ~0
+ >> (HOST_BITS_PER_WIDE_INT
+ - (precision - HOST_BITS_PER_WIDE_INT)))
: 0);
TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
diff --git a/gcc/unroll.c b/gcc/unroll.c
index f285e24..f8c2fca 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -783,15 +783,14 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
improperly shared rtl. */
diff = expand_binop (mode, sub_optab, copy_rtx (final_value),
- copy_rtx (initial_value), 0, 0,
+ copy_rtx (initial_value), NULL_RTX, 0,
OPTAB_LIB_WIDEN);
/* Now calculate (diff % (unroll * abs (increment))) by using an
and instruction. */
diff = expand_binop (GET_MODE (diff), and_optab, diff,
- gen_rtx (CONST_INT, VOIDmode,
- unroll_number * abs_inc - 1),
- 0, 0, OPTAB_LIB_WIDEN);
+ GEN_INT (unroll_number * abs_inc - 1),
+ NULL_RTX, 0, OPTAB_LIB_WIDEN);
/* Now emit a sequence of branches to jump to the proper precond
loop entry point. */
@@ -826,9 +825,8 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
else
cmp_const = i;
- emit_cmp_insn (diff, gen_rtx (CONST_INT, VOIDmode,
- abs_inc * cmp_const),
- EQ, 0, mode, 0, 0);
+ emit_cmp_insn (diff, GEN_INT (abs_inc * cmp_const),
+ EQ, NULL_RTX, mode, 0, 0);
if (i == 0)
emit_jump_insn (gen_beq (labels[i]));
@@ -858,8 +856,8 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
else
cmp_const = abs_inc * (unroll_number - 1) + 1;
- emit_cmp_insn (diff, gen_rtx (CONST_INT, VOIDmode, cmp_const),
- EQ, 0, mode, 0, 0);
+ emit_cmp_insn (diff, GEN_INT (cmp_const), EQ, NULL_RTX,
+ mode, 0, 0);
if (neg_inc)
emit_jump_insn (gen_ble (labels[0]));
@@ -1178,7 +1176,7 @@ precondition_loop_p (initial_value, final_value, increment, loop_start,
{
*initial_value = const0_rtx;
*increment = const1_rtx;
- *final_value = gen_rtx (CONST_INT, VOIDmode, loop_n_iterations);
+ *final_value = GEN_INT (loop_n_iterations);
if (loop_dump_stream)
fprintf (loop_dump_stream,
@@ -1583,8 +1581,7 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
#endif
splittable_regs[regno]
- = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (giv_inc)
+ = GEN_INT (INTVAL (giv_inc)
+ INTVAL (splittable_regs[regno]));
giv_inc = splittable_regs[regno];
@@ -2391,7 +2388,7 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
/* Check for the case where the pseudo is set by a shift/add
sequence, in which case the first insn setting the pseudo
is the first insn of the shift/add sequence. */
- && (! (tem = find_reg_note (v->insn, REG_RETVAL, 0))
+ && (! (tem = find_reg_note (v->insn, REG_RETVAL, NULL_RTX))
|| (regno_first_uid[REGNO (v->dest_reg)]
!= INSN_UID (XEXP (tem, 0)))))
/* Line above always fails if INSN was moved by loop opt. */
@@ -2785,8 +2782,7 @@ final_biv_value (bl, loop_start, loop_end)
case it is needed later. */
tem = gen_reg_rtx (bl->biv->mode);
- emit_iv_add_mult (increment,
- gen_rtx (CONST_INT, VOIDmode, loop_n_iterations),
+ emit_iv_add_mult (increment, GEN_INT (loop_n_iterations),
bl->initial_value, tem, NEXT_INSN (loop_end));
if (loop_dump_stream)
@@ -2877,8 +2873,7 @@ final_giv_value (v, loop_start, loop_end)
/* Put the final biv value in tem. */
tem = gen_reg_rtx (bl->biv->mode);
- emit_iv_add_mult (increment,
- gen_rtx (CONST_INT, VOIDmode, loop_n_iterations),
+ emit_iv_add_mult (increment, GEN_INT (loop_n_iterations),
bl->initial_value, tem, insert_before);
/* Subtract off extra increments as we find them. */
@@ -2904,7 +2899,7 @@ final_giv_value (v, loop_start, loop_end)
start_sequence ();
tem = expand_binop (GET_MODE (tem), sub_optab, tem,
- XEXP (SET_SRC (pattern), 1), 0, 0,
+ XEXP (SET_SRC (pattern), 1), NULL_RTX, 0,
OPTAB_LIB_WIDEN);
seq = gen_sequence ();
end_sequence ();
@@ -2947,14 +2942,15 @@ final_giv_value (v, loop_start, loop_end)
/* Calculate the number of loop iterations. Returns the exact number of loop
iterations if it can be calculated, otherwise returns zero. */
-unsigned long
+unsigned HOST_WIDE_INT
loop_iterations (loop_start, loop_end)
rtx loop_start, loop_end;
{
rtx comparison, comparison_value;
rtx iteration_var, initial_value, increment, final_value;
enum rtx_code comparison_code;
- int i, increment_dir;
+ HOST_WIDE_INT i;
+ int increment_dir;
int unsigned_compare, compare_dir, final_larger;
unsigned long tempu;
rtx last_loop_insn;
@@ -3044,7 +3040,7 @@ loop_iterations (loop_start, loop_end)
&& (set = single_set (insn))
&& (SET_DEST (set) == comparison_value))
{
- rtx note = find_reg_note (insn, REG_EQUAL, 0);
+ rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST)
comparison_value = XEXP (note, 0);
@@ -3094,11 +3090,13 @@ loop_iterations (loop_start, loop_end)
/* Final_larger is 1 if final larger, 0 if they are equal, otherwise -1. */
if (unsigned_compare)
final_larger
- = ((unsigned) INTVAL (final_value) > (unsigned) INTVAL (initial_value)) -
- ((unsigned) INTVAL (final_value) < (unsigned) INTVAL (initial_value));
+ = ((unsigned HOST_WIDE_INT) INTVAL (final_value)
+ > (unsigned HOST_WIDE_INT) INTVAL (initial_value))
+ - ((unsigned HOST_WIDE_INT) INTVAL (final_value)
+ < (unsigned HOST_WIDE_INT) INTVAL (initial_value));
else
- final_larger = (INTVAL (final_value) > INTVAL (initial_value)) -
- (INTVAL (final_value) < INTVAL (initial_value));
+ final_larger = (INTVAL (final_value) > INTVAL (initial_value))
+ - (INTVAL (final_value) < INTVAL (initial_value));
if (INTVAL (increment) > 0)
increment_dir = 1;
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index 1b3c4e3..a7875eb 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -359,7 +359,7 @@ xcoffout_block (block, depth, args)
next_block_number++;
/* Output the subblocks. */
- xcoffout_block (BLOCK_SUBBLOCKS (block), depth + 1, 0);
+ xcoffout_block (BLOCK_SUBBLOCKS (block), depth + 1, NULL_TREE);
}
block = BLOCK_CHAIN (block);
}