This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: optimization/7120: Run once loop should *always* be unrolled


On Wed, Jun 26, 2002 at 06:02:10PM +0930, Alan Modra wrote:
> +      if (((INTVAL (initial_value) + INTVAL (increment))
> +	   & (((unsigned HOST_WIDE_INT) 1
> +	       << (GET_MODE_BITSIZE (GET_MODE (iteration_var)) - 1)
> +	       << 1) - 1)) == INTVAL (final_value))

Need to use gen_int_mode here and for the final_value calulation.
Suggest something like

  rtx incone = gen_int_mode (INTVAL (initial_value) + INTVAL (increment),
			     GET_MODE (iteration_var));

  if (incone == final_value)
    {
      ...
    }
  else
    {
      loop_info->n_iterations = 1;
      loop_info->final_value = incone;
      loop_info->final_equiv_value = incone;
      return 1;
    }


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]