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: General question about types of tree expressions


On Wed, 2005-02-09 at 12:43 -0500, Paul Schlie wrote:
> > Daniel Berlin writes:
> > The document i've been working on defining the semantics of gimple
> > operations specifically states that all binary and unary operators
> > must have operands of the same type.
> 
> Out of curiosity, wouldn't it be both simpler and more efficient to
> define the semantics such that operands are "implied" to have the same
> type as the node itself, thereby eliminate the otherwise necessity to
> literally insert cast operators into the tree, which are already implied
> by the semantics of the operation itself (except as may otherwise be
> required to denote that sign extension for promoted signed integers, but
> not otherwise required for unsigned, down-cast, or other type conversions)?

You don't insert cast operators into the operator tree, you insert them
in the statements before the operation.
If we need casts to make the operands the same, they should be there
anyway (they are implicitly when they are expanded).
--Dan



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