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]

Re: [RFA] Two small tree optimizations


Neil Booth <neil@daikokuya.demon.co.uk> writes:
[snip]
>    switch (code)
>      {
> @@ -2491,9 +2485,17 @@ build1 (code, type, node)
>        break;
>
>      default:
> -      if (TREE_CODE_CLASS (code) == '1' && node && TREE_CONSTANT (node))
> -	TREE_CONSTANT (t) = 1;
> -      break;
> +      if (node)
> +	{
> +	  if (first_rtl_op (code) != 0)
> +	    {
> +	      TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (node);
> +	      TREE_READONLY (t) = TREE_READONLY (node);
> +	    }
> +	  if (TREE_CODE_CLASS (code) == '1' && TREE_CONSTANT (node))
> +	    TREE_CONSTANT (t) = 1;
> +	  break;
> +	} ^^^^^^
>      }

Stylistically, wouldn't it be better to put the break outside the if.

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash


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