summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/explow.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-05-09 20:02:13 +0000
committerobrien <obrien@FreeBSD.org>2002-05-09 20:02:13 +0000
commitc8f5fc7032940ad6633f932ac40cade82ec4d0cc (patch)
tree29a0f0a6c79a69ecc64f612947a0fe5904311713 /contrib/gcc/explow.c
parentc9ab9ae440a8066b2c2b85b157b1fdadcf09916a (diff)
downloadFreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.zip
FreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.tar.gz
Gcc 3.1.0 pre-release from the FSF anoncvs repo on 9-May-2002 15:57:15 EDT.
Diffstat (limited to 'contrib/gcc/explow.c')
-rw-r--r--contrib/gcc/explow.c74
1 files changed, 45 insertions, 29 deletions
diff --git a/contrib/gcc/explow.c b/contrib/gcc/explow.c
index 8f9e0bf..7a770ee 100644
--- a/contrib/gcc/explow.c
+++ b/contrib/gcc/explow.c
@@ -142,7 +142,7 @@ plus_constant_wide (x, c)
Look for constant term in the sum and combine
with C. For an integer constant term, we make a combined
integer. For a constant term that is not an explicit integer,
- we cannot really combine, but group them together anyway.
+ we cannot really combine, but group them together anyway.
Restart or use a recursive call in case the remaining operand is
something that we handle specially, such as a SYMBOL_REF.
@@ -391,7 +391,7 @@ convert_memory_address (to_mode, x)
case CONST:
if (POINTERS_EXTEND_UNSIGNED >= 0)
- return gen_rtx_CONST (to_mode,
+ return gen_rtx_CONST (to_mode,
convert_memory_address (to_mode, XEXP (x, 0)));
break;
@@ -406,11 +406,11 @@ convert_memory_address (to_mode, x)
|| (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT
&& (INTVAL (XEXP (x, 1)) + 20000 < 40000
|| CONSTANT_P (XEXP (x, 0))))))
- return gen_rtx_fmt_ee (GET_CODE (x), to_mode,
+ return gen_rtx_fmt_ee (GET_CODE (x), to_mode,
convert_memory_address (to_mode, XEXP (x, 0)),
convert_memory_address (to_mode, XEXP (x, 1)));
break;
-
+
default:
break;
}
@@ -670,12 +670,12 @@ copy_to_reg (x)
rtx x;
{
rtx temp = gen_reg_rtx (GET_MODE (x));
-
+
/* If not an operand, must be an address with PLUS and MULT so
- do the computation. */
+ do the computation. */
if (! general_operand (x, VOIDmode))
x = force_operand (x, temp);
-
+
if (x != temp)
emit_move_insn (temp, x);
@@ -701,9 +701,9 @@ copy_to_mode_reg (mode, x)
rtx x;
{
rtx temp = gen_reg_rtx (mode);
-
+
/* If not an operand, must be an address with PLUS and MULT so
- do the computation. */
+ do the computation. */
if (! general_operand (x, VOIDmode))
x = force_operand (x, temp);
@@ -731,13 +731,24 @@ force_reg (mode, x)
if (GET_CODE (x) == REG)
return x;
-
- temp = gen_reg_rtx (mode);
-
- if (! general_operand (x, mode))
- x = force_operand (x, NULL_RTX);
-
- insn = emit_move_insn (temp, x);
+
+ if (general_operand (x, mode))
+ {
+ temp = gen_reg_rtx (mode);
+ insn = emit_move_insn (temp, x);
+ }
+ else
+ {
+ temp = force_operand (x, NULL_RTX);
+ if (GET_CODE (temp) == REG)
+ insn = get_last_insn ();
+ else
+ {
+ rtx temp2 = gen_reg_rtx (mode);
+ insn = emit_move_insn (temp2, temp);
+ temp = temp2;
+ }
+ }
/* Let optimizers know that TEMP's value never changes
and that X can be substituted for it. Don't get confused
@@ -746,6 +757,7 @@ force_reg (mode, x)
&& (set = single_set (insn)) != 0
&& SET_DEST (set) == temp)
set_unique_reg_note (insn, REG_EQUAL, x);
+
return temp;
}
@@ -823,7 +835,7 @@ promote_mode (type, mode, punsignedp, for_call)
unsignedp = POINTERS_EXTEND_UNSIGNED;
break;
#endif
-
+
default:
break;
}
@@ -1010,9 +1022,9 @@ emit_stack_save (save_level, psave, after)
}
/* Restore the stack pointer for the purpose in SAVE_LEVEL. SA is the save
- area made by emit_stack_save. If it is zero, we have nothing to do.
+ area made by emit_stack_save. If it is zero, we have nothing to do.
- Put any emitted insns after insn AFTER, if nonzero, otherwise at
+ Put any emitted insns after insn AFTER, if nonzero, otherwise at
current position. */
void
@@ -1096,7 +1108,7 @@ optimize_save_area_alloca (insns)
/* If we do not see the note in a pattern matching
these precise characteristics, we did something
- entirely wrong in allocate_dynamic_stack_space.
+ entirely wrong in allocate_dynamic_stack_space.
Note, one way this could happen is if SETJMP_VIA_SAVE_AREA
was defined on a machine where stacks grow towards higher
@@ -1187,7 +1199,7 @@ allocate_dynamic_stack_space (size, target, known_align)
/* We will need to ensure that the address we return is aligned to
BIGGEST_ALIGNMENT. If STACK_DYNAMIC_OFFSET is defined, we don't
- always know its final value at this point in the compilation (it
+ always know its final value at this point in the compilation (it
might depend on the size of the outgoing parameter lists, for
example), so we must align the value to be returned in that case.
(Note that STACK_DYNAMIC_OFFSET will have a default non-zero value if
@@ -1206,7 +1218,7 @@ allocate_dynamic_stack_space (size, target, known_align)
if (MUST_ALIGN)
size
- = force_operand (plus_constant (size,
+ = force_operand (plus_constant (size,
BIGGEST_ALIGNMENT / BITS_PER_UNIT - 1),
NULL_RTX);
@@ -1339,11 +1351,11 @@ allocate_dynamic_stack_space (size, target, known_align)
rtx available;
rtx space_available = gen_label_rtx ();
#ifdef STACK_GROWS_DOWNWARD
- available = expand_binop (Pmode, sub_optab,
+ available = expand_binop (Pmode, sub_optab,
stack_pointer_rtx, stack_limit_rtx,
NULL_RTX, 1, OPTAB_WIDEN);
#else
- available = expand_binop (Pmode, sub_optab,
+ available = expand_binop (Pmode, sub_optab,
stack_limit_rtx, stack_pointer_rtx,
NULL_RTX, 1, OPTAB_WIDEN);
#endif
@@ -1372,7 +1384,7 @@ allocate_dynamic_stack_space (size, target, known_align)
#endif /* SETJMP_VIA_SAVE_AREA */
#ifdef STACK_GROWS_DOWNWARD
- emit_move_insn (target, virtual_stack_dynamic_rtx);
+ emit_move_insn (target, virtual_stack_dynamic_rtx);
#endif
}
@@ -1391,7 +1403,7 @@ allocate_dynamic_stack_space (size, target, known_align)
GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT),
NULL_RTX, 1);
}
-
+
/* Some systems require a particular insn to refer to the stack
to make the pages exist. */
#ifdef HAVE_probe
@@ -1406,7 +1418,7 @@ allocate_dynamic_stack_space (size, target, known_align)
return target;
}
-/* A front end may want to override GCC's stack checking by providing a
+/* A front end may want to override GCC's stack checking by providing a
run-time routine to call to check the stack, so provide a mechanism for
calling that routine. */
@@ -1436,7 +1448,7 @@ emit_stack_probe (address)
emit_move_insn (memref, const0_rtx);
}
-/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
+/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
FIRST is a constant and size is a Pmode RTX. These are offsets from the
current stack pointer. STACK_GROWS_DOWNWARD says whether to add or
subtract from the stack. If SIZE is constant, this is done
@@ -1603,6 +1615,10 @@ hard_function_value (valtype, func, outgoing)
unsigned HOST_WIDE_INT bytes = int_size_in_bytes (valtype);
enum machine_mode tmpmode;
+ /* int_size_in_bytes can return -1. We don't need a check here
+ since the value of bytes will be large enough that no mode
+ will match and we will abort later in this function. */
+
for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
tmpmode != VOIDmode;
tmpmode = GET_MODE_WIDER_MODE (tmpmode))
@@ -1617,7 +1633,7 @@ hard_function_value (valtype, func, outgoing)
abort ();
PUT_MODE (val, tmpmode);
- }
+ }
return val;
}
OpenPOWER on IntegriCloud