builtin_constant_p

Richard Henderson rth@cygnus.com
Wed Jun 24 13:36:00 GMT 1998


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~



More information about the Gcc-patches mailing list