aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2004-09-25 22:11:02 +0000
committerDale Johannesen <dalej@gcc.gnu.org>2004-09-25 22:11:02 +0000
commitbfe0d06bba399fa140d681ffb1b2f3e58d6a838c (patch)
treed3b5eef730c7e666e7f24cab9c6b4406cf88b636 /gcc/doc
parent45343b92cc40d960ca6b8a53e5805c97b795542b (diff)
downloadgcc-bfe0d06bba399fa140d681ffb1b2f3e58d6a838c.zip
gcc-bfe0d06bba399fa140d681ffb1b2f3e58d6a838c.tar.gz
gcc-bfe0d06bba399fa140d681ffb1b2f3e58d6a838c.tar.bz2
tree-gimple.c: Move GIMPLE definition...
2004-09-25 Dale Johannesen <dalej@apple.com> * tree-gimple.c: Move GIMPLE definition... * doc/tree-ssa.texi: here. From-SVN: r88111
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/tree-ssa.texi249
1 files changed, 149 insertions, 100 deletions
diff --git a/gcc/doc/tree-ssa.texi b/gcc/doc/tree-ssa.texi
index 311006d..b5b9ad9 100644
--- a/gcc/doc/tree-ssa.texi
+++ b/gcc/doc/tree-ssa.texi
@@ -83,7 +83,8 @@ perfectly happy to take it as input and spit out GIMPLE.
GIMPLE is a simplified subset of GENERIC for use in optimization. The
particular subset chosen (and the name) was heavily influenced by the
-SIMPLE IL used by the McCAT compiler project at McGill University,
+SIMPLE IL used by the McCAT compiler project at McGill University
+(@uref{http://www-acaps.cs.mcgill.ca/info/McCAT/McCAT.html}),
though we have made some different choices. For one thing, SIMPLE
doesn't support @code{goto}; a production compiler can't afford that
kind of restriction.
@@ -529,105 +530,153 @@ void f()
@cindex Rough GIMPLE Grammar
@smallexample
-function:
- FUNCTION_DECL
- DECL_SAVED_TREE -> block
-block:
- BIND_EXPR
- BIND_EXPR_VARS -> DECL chain
- BIND_EXPR_BLOCK -> BLOCK
- BIND_EXPR_BODY
- -> compound-stmt
-compound-stmt:
- COMPOUND_EXPR
- op0 -> non-compound-stmt
- op1 -> stmt
-stmt: compound-stmt
- | non-compound-stmt
-non-compound-stmt:
- block
- | if-stmt
- | switch-stmt
- | jump-stmt
- | label-stmt
- | try-stmt
- | modify-stmt
- | call-stmt
-if-stmt:
- COND_EXPR
- op0 -> condition
- op1 -> stmt
- op2 -> stmt
-switch-stmt:
- SWITCH_EXPR
- op0 -> val
- op1 -> NULL_TREE
- op2 -> TREE_VEC of CASE_LABEL_EXPRs
-jump-stmt:
- GOTO_EXPR
- op0 -> LABEL_DECL | '*' ID
- | RETURN_EXPR
- op0 -> modify-stmt
- | NULL_TREE
-label-stmt:
- LABEL_EXPR
- op0 -> LABEL_DECL
-try-stmt:
- TRY_CATCH_EXPR
- op0 -> stmt
- op1 -> handler
- | TRY_FINALLY_EXPR
- op0 -> stmt
- op1 -> stmt
-handler:
- catch-seq
- | EH_FILTER_EXPR
- | stmt
-catch-seq:
- CATCH_EXPR
- | COMPOUND_EXPR
- op0 -> CATCH_EXPR
- op1 -> catch-seq
-modify-stmt:
- MODIFY_EXPR
- op0 -> lhs
- op1 -> rhs
-call-stmt: CALL_EXPR
- op0 -> _DECL | '&' _DECL
- op1 -> arglist
-arglist:
- NULL_TREE
- | TREE_LIST
- op0 -> val
- op1 -> arglist
-
-varname : compref | _DECL
-lhs: varname | '*' _DECL
-pseudo-lval: _DECL | '*' _DECL
-compref :
- COMPONENT_REF
- op0 -> compref | pseudo-lval
- | ARRAY_REF
- op0 -> compref | pseudo-lval
- op1 -> val
-
-condition : val | val relop val
-val : _DECL | CONST
-
-rhs: varname | CONST
- | '*' _DECL
- | '&' varname
- | call_expr
- | unop val
- | val binop val
- | '(' cast ')' val
-
-unop: '+' | '-' | '!' | '~'
-
-binop: relop | '-' | '+' | '/' | '*'
- | '%' | '&' | '|' | '<<' | '>>' | '^'
-
-relop: All tree codes of class '<'
+ function : FUNCTION_DECL
+ DECL_SAVED_TREE -> compound-stmt
+
+ compound-stmt: STATEMENT_LIST
+ members -> stmt
+
+ stmt : block
+ | if-stmt
+ | switch-stmt
+ | goto-stmt
+ | return-stmt
+ | resx-stmt
+ | label-stmt
+ | try-stmt
+ | modify-stmt
+ | call-stmt
+
+ block : BIND_EXPR
+ BIND_EXPR_VARS -> chain of DECLs
+ BIND_EXPR_BLOCK -> BLOCK
+ BIND_EXPR_BODY -> compound-stmt
+
+ if-stmt : COND_EXPR
+ op0 -> condition
+ op1 -> compound-stmt
+ op2 -> compound-stmt
+
+ switch-stmt : SWITCH_EXPR
+ op0 -> val
+ op1 -> NULL
+ op2 -> TREE_VEC of CASE_LABEL_EXPRs
+ The CASE_LABEL_EXPRs are sorted by CASE_LOW,
+ and default is last.
+
+ goto-stmt : GOTO_EXPR
+ op0 -> LABEL_DECL | val
+
+ return-stmt : RETURN_EXPR
+ op0 -> return-value
+
+ return-value : NULL
+ | RESULT_DECL
+ | MODIFY_EXPR
+ op0 -> RESULT_DECL
+ op1 -> lhs
+
+ resx-stmt : RESX_EXPR
+
+ label-stmt : LABEL_EXPR
+ op0 -> LABEL_DECL
+
+ try-stmt : TRY_CATCH_EXPR
+ op0 -> compound-stmt
+ op1 -> handler
+ | TRY_FINALLY_EXPR
+ op0 -> compound-stmt
+ op1 -> compound-stmt
+
+ handler : catch-seq
+ | EH_FILTER_EXPR
+ | compound-stmt
+
+ catch-seq : STATEMENT_LIST
+ members -> CATCH_EXPR
+
+ modify-stmt : MODIFY_EXPR
+ op0 -> lhs
+ op1 -> rhs
+
+ call-stmt : CALL_EXPR
+ op0 -> val | OBJ_TYPE_REF
+ op1 -> call-arg-list
+
+ call-arg-list: TREE_LIST
+ members -> lhs | CONST
+
+ addr-expr-arg: ID
+ | compref
+
+ addressable : addr-expr-arg
+ | indirectref
+
+ with-size-arg: addressable
+ | call-stmt
+
+ indirectref : INDIRECT_REF
+ op0 -> val
+
+ lhs : addressable
+ | bitfieldref
+ | WITH_SIZE_EXPR
+ op0 -> with-size-arg
+ op1 -> val
+
+ min-lval : ID
+ | indirectref
+
+ bitfieldref : BIT_FIELD_REF
+ op0 -> inner-compref
+ op1 -> CONST
+ op2 -> var
+
+ compref : inner-compref
+ | REALPART_EXPR
+ op0 -> inner-compref
+ | IMAGPART_EXPR
+ op0 -> inner-compref
+
+ inner-compref: min-lval
+ | COMPONENT_REF
+ op0 -> inner-compref
+ op1 -> FIELD_DECL
+ op2 -> val
+ | ARRAY_REF
+ op0 -> inner-compref
+ op1 -> val
+ op2 -> val
+ op3 -> val
+ | ARRAY_RANGE_REF
+ op0 -> inner-compref
+ op1 -> val
+ op2 -> val
+ op3 -> val
+ | VIEW_CONVERT_EXPR
+ op0 -> inner-compref
+
+ condition : val
+ | RELOP
+ op0 -> val
+ op1 -> val
+
+ val : ID
+ | CONST
+
+ rhs : lhs
+ | CONST
+ | call-stmt
+ | ADDR_EXPR
+ op0 -> addr-expr-arg
+ | UNOP
+ op0 -> val
+ | BINOP
+ op0 -> val
+ op1 -> val
+ | RELOP
+ op0 -> val
+ op1 -> val
@end smallexample
@node Annotations