Commit d88bbbb9 by Eric Botcazou Committed by Eric Botcazou

ada-tree.def (LOOP_STMT): Change to 4-operand nodes.

	* gcc-interface/ada-tree.def (LOOP_STMT): Change to 4-operand nodes.
	* gcc-interface/ada-tree.h (LOOP_STMT_TOP_COND, LOOP_STMT_BOT_COND):
	Merge into...
	(LOOP_STMT_COND): ...this.
	(LOOP_STMT_BOTTOM_COND_P): New flag.
	(LOOP_STMT_TOP_UPDATE_P): Likewise.
	* gcc-interface/trans.c (can_equal_min_or_max_val_p): New function.
	(can_equal_min_val_p): New static inline function.
	(can_equal_max_val_p): Likewise.
	(Loop_Statement_to_gnu): Use build4 in lieu of build5 and adjust to
	new LOOP_STMT semantics.  Use two different strategies depending on
	whether optimization is enabled to translate the loop.
	(gnat_gimplify_stmt) <LOOP_STMT>: Adjust to new LOOP_STMT semantics.

From-SVN: r158410
parent 586388fd
2010-04-16 Eric Botcazou <ebotcazou@adacore.com> 2010-04-16 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.def (LOOP_STMT): Change to 4-operand nodes.
* gcc-interface/ada-tree.h (LOOP_STMT_TOP_COND, LOOP_STMT_BOT_COND):
Merge into...
(LOOP_STMT_COND): ...this.
(LOOP_STMT_BOTTOM_COND_P): New flag.
(LOOP_STMT_TOP_UPDATE_P): Likewise.
* gcc-interface/trans.c (can_equal_min_or_max_val_p): New function.
(can_equal_min_val_p): New static inline function.
(can_equal_max_val_p): Likewise.
(Loop_Statement_to_gnu): Use build4 in lieu of build5 and adjust to
new LOOP_STMT semantics. Use two different strategies depending on
whether optimization is enabled to translate the loop.
(gnat_gimplify_stmt) <LOOP_STMT>: Adjust to new LOOP_STMT semantics.
2010-04-16 Eric Botcazou <ebotcazou@adacore.com>
* uintp.adb (UI_From_Dint): Remove useless code. * uintp.adb (UI_From_Dint): Remove useless code.
(UI_From_Int): Likewise. (UI_From_Int): Likewise.
* uintp.h: Reorder declarations. * uintp.h: Reorder declarations.
......
...@@ -61,12 +61,11 @@ DEFTREECODE (ATTR_ADDR_EXPR, "attr_addr_expr", tcc_reference, 1) ...@@ -61,12 +61,11 @@ DEFTREECODE (ATTR_ADDR_EXPR, "attr_addr_expr", tcc_reference, 1)
just returning the inner statement. */ just returning the inner statement. */
DEFTREECODE (STMT_STMT, "stmt_stmt", tcc_statement, 1) DEFTREECODE (STMT_STMT, "stmt_stmt", tcc_statement, 1)
/* A loop. LOOP_STMT_TOP_COND and LOOP_STMT_BOT_COND are the tests to exit a /* A loop. LOOP_STMT_COND is the test to exit the loop. LOOP_STMT_UPDATE
loop at the top and bottom respectively. LOOP_STMT_UPDATE is the statement is the statement to update the loop iteration variable at the continue
to update the loop iterator at the continue point. LOOP_STMT_BODY are the point. LOOP_STMT_BODY are the statements in the body of the loop. And
statements in the body of the loop. LOOP_STMT_LABEL points to the LOOP_STMT_LABEL points to the LABEL_DECL of the end label of the loop. */
LABEL_DECL of the end label of the loop. */ DEFTREECODE (LOOP_STMT, "loop_stmt", tcc_statement, 4)
DEFTREECODE (LOOP_STMT, "loop_stmt", tcc_statement, 5)
/* Conditionally exit a loop. EXIT_STMT_COND is the condition, which, if /* Conditionally exit a loop. EXIT_STMT_COND is the condition, which, if
true, will cause the loop to be exited. If no condition is specified, true, will cause the loop to be exited. If no condition is specified,
......
...@@ -417,10 +417,28 @@ do { \ ...@@ -417,10 +417,28 @@ do { \
(STATEMENT_CLASS_P (NODE) && TREE_CODE (NODE) >= STMT_STMT) (STATEMENT_CLASS_P (NODE) && TREE_CODE (NODE) >= STMT_STMT)
#define STMT_STMT_STMT(NODE) TREE_OPERAND_CHECK_CODE (NODE, STMT_STMT, 0) #define STMT_STMT_STMT(NODE) TREE_OPERAND_CHECK_CODE (NODE, STMT_STMT, 0)
#define LOOP_STMT_TOP_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 0)
#define LOOP_STMT_BOT_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 1) #define LOOP_STMT_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 0)
#define LOOP_STMT_UPDATE(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 2) #define LOOP_STMT_UPDATE(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 1)
#define LOOP_STMT_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 3) #define LOOP_STMT_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 2)
#define LOOP_STMT_LABEL(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 4) #define LOOP_STMT_LABEL(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 3)
/* A loop statement is conceptually made up of 6 sub-statements:
loop:
TOP_CONDITION
TOP_UPDATE
BODY
BOTTOM_CONDITION
BOTTOM_UPDATE
GOTO loop
However, only 4 of them can exist for a given loop, the pair of conditions
and the pair of updates being mutually exclusive. The default setting is
TOP_CONDITION and BOTTOM_UPDATE and the following couple of flags are used
to toggle the individual settings. */
#define LOOP_STMT_BOTTOM_COND_P(NODE) TREE_LANG_FLAG_0 (LOOP_STMT_CHECK (NODE))
#define LOOP_STMT_TOP_UPDATE_P(NODE) TREE_LANG_FLAG_1 (LOOP_STMT_CHECK (NODE))
#define EXIT_STMT_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXIT_STMT, 0) #define EXIT_STMT_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXIT_STMT, 0)
#define EXIT_STMT_LABEL(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXIT_STMT, 1) #define EXIT_STMT_LABEL(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXIT_STMT, 1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment