This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: builtin_constant_p
- To: Jim Wilson <wilson at cygnus dot com>, Richard Henderson <rth at cygnus dot com>
- Subject: Re: builtin_constant_p
- From: Richard Henderson <rth at cygnus dot com>
- Date: Wed, 24 Jun 1998 13:39:05 -0700
- Cc: law at cygnus dot com, egcs-patches at cygnus dot com
- References: <19980623205704.A18836@dot.cygnus.com> <199806241939.MAA14463@rtl.cygnus.com>
- Reply-To: Richard Henderson <rth at cygnus dot com>
On Wed, Jun 24, 1998 at 12:39:08PM -0700, Jim Wilson wrote:
> So you are saying that side-effects should not be performed? Why?
I consider __builtin_constant_p to be a function in the same vein
as sizeof. In the places I want to use __builtin_constant_p, I
want to be assured that I can safely evaluate the expression
multiple times. And changing this behaviour would break existing
code.
> Incidentally, you don't need a function to test whether a tree has side
> effects. All you need to do is check the TREE_SIDE_EFFECTS bit. This bit is
> valid for all trees.
Doh!
> So given the above expectation, do we still need to modify ports? Or
> is updating CONSTANT_P sufficient?
>
> I'd suggest we try it, and see what kinds of problems show up, keeping in
> mind that we may need to make further changes. I suspect that fixing
> CONSTANT_P will handle the vast majority of the cases, and that the rest
> won't be important enough to worry about.
Ok, I'll get a new patch out this evening.
r~