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: PR java/18931: jar -> .so optimization problem


On Mon, 20 Dec 2004, Andrew Haley wrote:
>    if (code == VOID_TYPE)
>      return build1 (CONVERT_EXPR, type, expr);
>    if (code == BOOLEAN_TYPE || code ==  CHAR_TYPE)
> -    return fold (build1 (CONVERT_EXPR, type, expr));
> +    return fold_convert (type, expr);
>    if (code == INTEGER_TYPE)
>      {
>        if ((really_constant_p (expr)
>

I only mention this because of the patch's context, but you should
also be able to use fold_convert for VOID_TYPE.  In addition to
creating the necessary conversion, fold_ignored_result will also
strip off tree nodes without side-effects.

Roger
--


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