This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Remove loop.c compilation warnings
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch] Remove loop.c compilation warnings
- From: Michael Hayes <mhayes at redhat dot com>
- Date: Fri, 26 Jan 2001 21:16:35 +1300 (NZDT)
This patch should remove the remaining compilation warnings
from loop.c. It bootstraps OK.
2001-01-26 Michael Hayes <mhayes@redhat.com>
* loop.c (loop_giv_reduce_benefit): Copy mode size into
int variable.
(check_ext_dependant_givs): Initialise u_start_val and
u_end_val.
(load_mems): Make last_max_reg unsigned.
(try_swap_copy_prop): Use INSN_P and initialise set.
Index: loop.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/loop.c,v
retrieving revision 1.321
diff -c -3 -p -r1.321 loop.c
*** loop.c 2001/01/25 09:28:55 1.321
--- loop.c 2001/01/26 07:58:45
*************** loop_giv_reduce_benefit (loop, bl, v, te
*** 4135,4151 ****
&& benefit > 0
&& GET_CODE (v->mult_val) == CONST_INT)
{
if (HAVE_POST_INCREMENT
! && INTVAL (v->mult_val) == GET_MODE_SIZE (GET_MODE (v->mem)))
benefit += add_cost * bl->biv_count;
else if (HAVE_PRE_INCREMENT
! && INTVAL (v->mult_val) == GET_MODE_SIZE (GET_MODE (v->mem)))
benefit += add_cost * bl->biv_count;
else if (HAVE_POST_DECREMENT
! && -INTVAL (v->mult_val) == GET_MODE_SIZE (GET_MODE (v->mem)))
benefit += add_cost * bl->biv_count;
else if (HAVE_PRE_DECREMENT
! && -INTVAL (v->mult_val) == GET_MODE_SIZE (GET_MODE (v->mem)))
benefit += add_cost * bl->biv_count;
}
#endif
--- 4135,4153 ----
&& benefit > 0
&& GET_CODE (v->mult_val) == CONST_INT)
{
+ int size = GET_MODE_SIZE (GET_MODE (v->mem));
+
if (HAVE_POST_INCREMENT
! && INTVAL (v->mult_val) == size)
benefit += add_cost * bl->biv_count;
else if (HAVE_PRE_INCREMENT
! && INTVAL (v->mult_val) == size)
benefit += add_cost * bl->biv_count;
else if (HAVE_POST_DECREMENT
! && -INTVAL (v->mult_val) == size)
benefit += add_cost * bl->biv_count;
else if (HAVE_PRE_DECREMENT
! && -INTVAL (v->mult_val) == size)
benefit += add_cost * bl->biv_count;
}
#endif
*************** check_ext_dependant_givs (bl, loop_info)
*** 6482,6488 ****
int ze_ok = 0, se_ok = 0, info_ok = 0;
enum machine_mode biv_mode = GET_MODE (bl->biv->src_reg);
HOST_WIDE_INT start_val;
! unsigned HOST_WIDE_INT u_end_val, u_start_val;
rtx incr = pc_rtx;
struct induction *v;
--- 6484,6491 ----
int ze_ok = 0, se_ok = 0, info_ok = 0;
enum machine_mode biv_mode = GET_MODE (bl->biv->src_reg);
HOST_WIDE_INT start_val;
! unsigned HOST_WIDE_INT u_end_val = 0;
! unsigned HOST_WIDE_INT u_start_val = 0;
rtx incr = pc_rtx;
struct induction *v;
*************** load_mems (loop)
*** 8815,8821 ****
rtx end_label;
/* Nonzero if the next instruction may never be executed. */
int next_maybe_never = 0;
! int last_max_reg = max_reg_num ();
if (loop_info->mems_idx == 0)
return;
--- 8818,8824 ----
rtx end_label;
/* Nonzero if the next instruction may never be executed. */
int next_maybe_never = 0;
! unsigned int last_max_reg = max_reg_num ();
if (loop_info->mems_idx == 0)
return;
*************** try_swap_copy_prop (loop, replacement, r
*** 9247,9253 ****
unsigned int regno;
{
rtx insn;
! rtx set;
unsigned int new_regno;
new_regno = REGNO (replacement);
--- 9250,9256 ----
unsigned int regno;
{
rtx insn;
! rtx set = NULL_RTX;
unsigned int new_regno;
new_regno = REGNO (replacement);
*************** try_swap_copy_prop (loop, replacement, r
*** 9257,9263 ****
insn = next_insn_in_loop (loop, insn))
{
/* Search for the insn that copies REGNO to NEW_REGNO? */
! if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& (set = single_set (insn))
&& GET_CODE (SET_DEST (set)) == REG
&& REGNO (SET_DEST (set)) == new_regno
--- 9260,9266 ----
insn = next_insn_in_loop (loop, insn))
{
/* Search for the insn that copies REGNO to NEW_REGNO? */
! if (INSN_P (insn)
&& (set = single_set (insn))
&& GET_CODE (SET_DEST (set)) == REG
&& REGNO (SET_DEST (set)) == new_regno
*************** try_swap_copy_prop (loop, replacement, r
*** 9266,9272 ****
break;
}
! if (insn != NULL_RTX)
{
rtx prev_insn;
rtx prev_set;
--- 9269,9275 ----
break;
}
! if (set)
{
rtx prev_insn;
rtx prev_set;
*************** try_swap_copy_prop (loop, replacement, r
*** 9277,9283 ****
prev_insn = PREV_INSN (insn);
! if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& (prev_set = single_set (prev_insn))
&& GET_CODE (SET_DEST (prev_set)) == REG
&& REGNO (SET_DEST (prev_set)) == regno)
--- 9280,9286 ----
prev_insn = PREV_INSN (insn);
! if (INSN_P (insn)
&& (prev_set = single_set (prev_insn))
&& GET_CODE (SET_DEST (prev_set)) == REG
&& REGNO (SET_DEST (prev_set)) == regno)