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: Constant folding for builtins


On Sun, 29 Oct 2000, Richard Henderson wrote:

> On Sun, Oct 29, 2000 at 01:55:44PM +0000, Bernd Schmidt wrote:
> > cp/ChangeLog:
> > 	* call.c (build_over_call): Call fold on the CALL_EXPR.
> 
> You'll have to get someone else to approve this.

Mark Mitchell has approved it in an off-list mail.

> > 	* builtins.c (fold_builtin_constant_p, fold_builtin): New functions.
> > 	(expand_builtin_constant_p): Move parts of the code into
> > 	fold_builtin_constant_p.
> > 	(expand_builtin_strlen): Move parts of the code into fold_builtin.
> > 	* expr.h (fold_builtin): Declare.
> > 	* fold-const.c (fold): Handle builtin calls.
> > 
> > 	* c-typeck.c (build_function_call): Call fold on the CALL_EXPR.
> 
> Generally good.  I'd prefer that you choose a no-op
> return value for fold_builtin and stick to it.  You
> use both NULL and expr from fold_builtin_constant_p
> and fold_builtin respectively.

I've fixed fold_builtin to return 0 to indicate failure and checked the
patch in.


Bernd


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