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: Patch for bugs 772 and 17913


On Mon, 2 May 2005, [ISO-8859-2] Gábor Lóki wrote:
> -  if (TREE_CODE (ifexp) == INTEGER_CST)
> -    return non_lvalue (integer_zerop (ifexp) ? op2 : op1);
> -
>   return fold (build3 (COND_EXPR, result_type, ifexp, op1, op2));
> }

Could you take the opportunity to change the line following your
change to use "fold_build3 (COND_EXPR, ...".  This is a case where
in the past the C front-end duplicated some functionality from
fold to avoid creating COND_EXPR nodes when not needed.  With the
new API(s), letting fold-const.c handle this has a much smaller
overhead (in addition to improving correctness).

> +static tree contains_label_1 (tree*, int*, void*);
> +static bool contains_label_p (tree);

You only need to prototype the constains_label_p call, as it's
subroutine contains_label_1 is only used after it's defined.
If both these routines were moved earlier in fold-const.c, you
wouldn't need to prototype either.


With those tweaks, the middle-end changes (still) look good to me.
If you repost with those changes, a C front-end or global maintainer
should feel free to approve the lot.


Roger
--


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