This is the mail archive of the gcc@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: [tree-ssa] where to fix this?


On Tue, 6 Jan 2004, Jan Hubicka wrote:
> > The callback is set up by the front-end to call a front-end routine.
> Yes, but what is unclear to me is how the front-end routine would look
> like...

My vote for the reorganization of "fold", and the passing of additional
parameters, is to do something like the current implementation of
"fold_initializer" in fold-const.c.  The interface is simple to the
outside world, sets up the required behaviour of "fold" and then
invokes fold itself.

This idiom can be used to provide the functionality of "simplify_builtin"
and "nondestructive_fold_*" without the current code duplication.  The
addition of extra flags to prohibit SAVE_EXPRs and/or useless type
conversions makes this approach useful to tree-ssa and friends.

Front-ends already use this mechanism via various lang_hooks, and
flag_wrapv, flag_evaluation_order, flag_finite_math etc...  We just
need a few additional "knobs" to protect/disable the two or three
unsafe transformations that (via recursion) prevent us from reusing
the powerfull 10K lines of "fold" and "fold_builtin".


Perhaps a flag_type_safe could be used to tweak fold_convert?

Roger
--


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