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: [tuples] gimple_assign_subcode for GIMPLE_SINGLE_RHS


On 3/9/08 11:31 AM, Richard Guenther wrote:
On Sun, Mar 9, 2008 at 3:46 PM, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
Hi,


> So, what about adding a GIMPLE_COPY code? The code would have 0 > operands and used only for its numeric value.

 another possibility would be to make GIMPLE_COPY an unary operator, and
 get rid of the SINGLE_RHS case altogether (of course, unlike any other
 unary operator, it would not require its operand to be gimple_val, so
 special handling might still be necessary at some places. but it might
 be less cumbersome),

I like that. Maybe I even suggested this some time ago after some beer in some IRC session. (I don't see how unary should be fundamentally different from single).

The major difference is that GIMPLE_COPY never exists as a GENERIC tree node. Unary operators do exist in GENERIC.


When converting to GIMPLE, a unary operator will be flattened by putting its tree code in gimple_subcode() and its TREE_OPERAND (t, 0) in the RHS.

Instead, a single operand will be put in its entirety in the RHS. The subcode in that case becomes GIMPLE_COPY. No need to build a one operand operator in order to flatten it immediately.


Diego.



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