This is the mail archive of the gcc-patches@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: [4.5] Doloop improvement patches, 2/7


Hi,

> @@ -1853,6 +1853,43 @@ simplify_using_initial_values (struct lo
>  		  SET_REGNO_REG_SET (this_altered, i);
>  	    }
>  
> +	  did_replace = simplify_using_assignment (insn, expr);
> +
> +	  if (did_replace)
> +	    {
> +	      rtx *pnote, *pnote_next;
> +	      for (pnote = &cond_list; *pnote; pnote = pnote_next)
> +		{
> +		  rtx note = *pnote;
> +
> +		  pnote_next = &XEXP (note, 1);
> +		  simplify_using_assignment (insn, &XEXP (note, 0));
> +		  /* We can no longer use a condition that has been simplified
> +		     to a constant, and simplify_using_condition will abort if
> +		     we try.  */
> +		  if (CONSTANT_P (XEXP (note, 0)))
> +		    {
> +		      *pnote = *pnote_next;
> +		      pnote_next = pnote;
> +		      free_EXPR_LIST_node (note);
> +		    }
> +		}
> +	    }

The block above should not be guarded by did_replace.   Also, it
seems that you should remove the conditions that are invalidated
according to this_altered from the list, unless you perform a
replacement in the condition.

> +	  if (old != *expr)

Why is this guarded by old != *expr, and not did_replace?

> +	    {
> +	      rtx note;
> +
> +	      if (CONSTANT_P (*expr))
> +		goto out;
> +	      for (note = cond_list; note; note = XEXP (note, 1))
> +		{
> +		  simplify_using_condition (XEXP (note, 0), expr, altered);
> +		  if (CONSTANT_P (*expr))
> +		    goto out;
> +		}
> +	    }

Zdenek


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