This is the mail archive of the gcc-patches@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]

[PATCH] Document valid RHS for GIMPLE_ASSIGN if LHS isn't a gimple reg


For the store_field patch I had a hard time asserting that

  s.a = (<unnamed-signed:3>) D.1218_2

was in fact invalid gimple.  I knew it was true but couldn't find it in the
documention.  (I actually ended up modifying forwprop to do the propagation
hoping to find proof through the gimple verifier.  Luckily, it did fail with
"non-register as LHS of unary operation".)

The patch below fixes this omission in the documention.  (It seems that the
semantics of the different statements are documented in gimple.def itself
rather than in gimple.texi.)

OK?

Adam


	* gimple.def (GIMPLE_ASSIGN): Document that if LHS is not a gimple
	register, then RHS1 has to be a single object (GIMPLE_SINGLE_RHS).

Index: gimple.def
===================================================================
--- gimple.def	(revision 147033)
+++ gimple.def	(working copy)
@@ -108,7 +108,9 @@ DEFGSCODE(GIMPLE_CHANGE_DYNAMIC_TYPE, "g
    accepted by is_gimple_operand.
 
    RHS1 is the first operand on the RHS of the assignment. It must be a tree
-   node accepted by is_gimple_operand.
+   node accepted by is_gimple_operand.  Note that if LHS is not a gimple
+   register according to is_gimple_reg, the RHS1 can only be a single object
+   (GIMPLE_SINGLE_RHS).
 
    RHS2 is the second operand on the RHS of the assignemnt. It must be a tree
    node accepted by is_gimple_operand.  This argument exists only if SUBCODE is


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