This is the mail archive of the
mailing list for the GCC project.
[PATCH] Document valid RHS for GIMPLE_ASSIGN if LHS isn't a gimple reg
- From: Adam Nemet <anemet at caviumnetworks dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 5 May 2009 12:49:57 -0700
- Subject: [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.)
* gimple.def (GIMPLE_ASSIGN): Document that if LHS is not a gimple
register, then RHS1 has to be a single object (GIMPLE_SINGLE_RHS).
--- 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
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