summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-06-27 20:00:50 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-06-27 20:00:50 +0000
commite7041633a5b9ac8eb09b92de5321bf3184a7b98f (patch)
treefa9685b9314b38bc39469f771fb889342e130b2d /gcc/fortran
parentde8f4b07c03ffb0db0562f462be066684af2f0b7 (diff)
downloadgcc-e7041633a5b9ac8eb09b92de5321bf3184a7b98f.tar.gz
gfortran.h (gfc_code): Split backend_decl field into cycle_label and exit_label fields.
* gfortran.h (gfc_code): Split backend_decl field into cycle_label and exit_label fields. * trans-openmp.c (gfc_trans_omp_do): Assign to new fields individually. * trans-stmt.c (gfc_trans_simple_do): Likewise. (gfc_trans_do): Likewise. (gfc_trans_do_while): Likewise. (gfc_trans_cycle): Use cycle_label directly. (gfc_trans_exit): Use exit_label directly. From-SVN: r161473
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog12
-rw-r--r--gcc/fortran/gfortran.h6
-rw-r--r--gcc/fortran/trans-openmp.c8
-rw-r--r--gcc/fortran/trans-stmt.c18
4 files changed, 27 insertions, 17 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index b4997f628f0..d58299dc4d5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,15 @@
+2010-06-27 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gfortran.h (gfc_code): Split backend_decl field into cycle_label
+ and exit_label fields.
+ * trans-openmp.c (gfc_trans_omp_do): Assign to new fields
+ individually.
+ * trans-stmt.c (gfc_trans_simple_do): Likewise.
+ (gfc_trans_do): Likewise.
+ (gfc_trans_do_while): Likewise.
+ (gfc_trans_cycle): Use cycle_label directly.
+ (gfc_trans_exit): Use exit_label directly.
+
2010-06-27 Daniel Kraft <d@domob.eu>
* dump-parse-tree.c (show_symbol): Dump target-expression for
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 4a9b5f0226b..0c96bf40e6e 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2077,9 +2077,9 @@ typedef struct gfc_code
}
ext; /* Points to additional structures required by statement */
- /* Backend_decl is used for cycle and break labels in do loops, and
- probably for other constructs as well, once we translate them. */
- tree backend_decl;
+ /* Cycle and break labels in do loops. */
+ tree cycle_label;
+ tree exit_label;
}
gfc_code;
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 1be4b81c8e8..a5d5ba133e7 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -1357,12 +1357,10 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
present for this loop. */
cycle_label = gfc_build_label_decl (NULL_TREE);
- /* Put these labels where they can be found later. We put the
- labels in a TREE_LIST node (because TREE_CHAIN is already
- used). cycle_label goes in TREE_PURPOSE (backend_decl), exit
- label in TREE_VALUE (backend_decl). */
+ /* Put these labels where they can be found later. */
- code->block->backend_decl = tree_cons (cycle_label, NULL, NULL);
+ code->block->cycle_label = cycle_label;
+ code->block->exit_label = NULL_TREE;
/* Main loop body. */
tmp = gfc_trans_omp_code (code->block->next, true);
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index ad054261dad..6fa84b91694 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -928,7 +928,8 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar,
exit_label = gfc_build_label_decl (NULL_TREE);
/* Put the labels where they can be found later. See gfc_trans_do(). */
- code->block->backend_decl = tree_cons (cycle_label, exit_label, NULL);
+ code->block->cycle_label = cycle_label;
+ code->block->exit_label = exit_label;
/* Loop body. */
gfc_start_block (&body);
@@ -1196,12 +1197,10 @@ gfc_trans_do (gfc_code * code, tree exit_cond)
/* Loop body. */
gfc_start_block (&body);
- /* Put these labels where they can be found later. We put the
- labels in a TREE_LIST node (because TREE_CHAIN is already
- used). cycle_label goes in TREE_PURPOSE (backend_decl), exit
- label in TREE_VALUE (backend_decl). */
+ /* Put these labels where they can be found later. */
- code->block->backend_decl = tree_cons (cycle_label, exit_label, NULL);
+ code->block->cycle_label = cycle_label;
+ code->block->exit_label = exit_label;
/* Main loop body. */
tmp = gfc_trans_code_cond (code->block->next, exit_cond);
@@ -1305,7 +1304,8 @@ gfc_trans_do_while (gfc_code * code)
exit_label = gfc_build_label_decl (NULL_TREE);
/* Put the labels where they can be found later. See gfc_trans_do(). */
- code->block->backend_decl = tree_cons (cycle_label, exit_label, NULL);
+ code->block->cycle_label = cycle_label;
+ code->block->exit_label = exit_label;
/* Create a GIMPLE version of the exit condition. */
gfc_init_se (&cond, NULL);
@@ -4080,7 +4080,7 @@ gfc_trans_cycle (gfc_code * code)
{
tree cycle_label;
- cycle_label = TREE_PURPOSE (code->ext.whichloop->backend_decl);
+ cycle_label = code->ext.whichloop->cycle_label;
TREE_USED (cycle_label) = 1;
return build1_v (GOTO_EXPR, cycle_label);
}
@@ -4095,7 +4095,7 @@ gfc_trans_exit (gfc_code * code)
{
tree exit_label;
- exit_label = TREE_VALUE (code->ext.whichloop->backend_decl);
+ exit_label = code->ext.whichloop->exit_label;
TREE_USED (exit_label) = 1;
return build1_v (GOTO_EXPR, exit_label);
}