[PATCH] improve C++ code by changing fold-const.c

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Sun May 23 14:34:00 GMT 2004


    > Oh by the way I notice that C++ front-end uses CONVERT_EXPR instead of 
    > NOP_EXPR
    > when converting between pointer and reference types anyways which is 
    > wrong as
    > CONVERT_EXPR is defined as creating code which this conversion does 
    > not.  There
    > are most likely more like this. 

    Yes, that certainly sounds like a bug.

I would take the opposite view and ask why we have both NOP_EXPR and
CONVERT_EXPR.  Why is a front end supposed to be in the business of
guessing whether or not code will be generated for a conversion?  And
who cares one way or the other?  How can we state the semantic difference
between these two nodes in a useful manner?

My choice would be to eliminate NOP_EXPR.



More information about the Gcc mailing list