aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-stmt.c
diff options
context:
space:
mode:
authorFeng Wang <fengwang@nudt.edu.cn>2005-10-25 14:06:22 +0000
committerFeng Wang <fengwang@gcc.gnu.org>2005-10-25 14:06:22 +0000
commit910450c13f863770bb095264d2ad17b47befce48 (patch)
treee12dd319f2cc0587bce5949c803cad264e174183 /gcc/fortran/trans-stmt.c
parenta22056479c1ec82073209cb070e310f3bddc7a59 (diff)
downloadgcc-910450c13f863770bb095264d2ad17b47befce48.zip
gcc-910450c13f863770bb095264d2ad17b47befce48.tar.gz
gcc-910450c13f863770bb095264d2ad17b47befce48.tar.bz2
re PR fortran/22290 (Optimize Assigned GOTO to cause error with -O1 or higher)
2005-10-25 Feng Wang <fengwang@nudt.edu.cn> PR fortran/22290 * trans-decl.c (gfc_add_assign_aux_vars): New function. Add two auxiliary variables. (gfc_get_symbol_decl): Use it when a variable, including dummy argument, is assigned a label. (gfc_trans_assign_aux_var): New function. Set initial value of the auxiliary variable explicitly. (gfc_trans_deferred_vars): Use it. * trans-stmt.c (gfc_conv_label_variable): Handle dummy argument. 2005-10-25 Feng Wang <fengwang@nudt.edu.cn> PR fortran/22290 * gfortran.dg/assign_5.f90: New test. * gfortran.dg/assign_6.f: New test. From-SVN: r105887
Diffstat (limited to 'gcc/fortran/trans-stmt.c')
-rw-r--r--gcc/fortran/trans-stmt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 615d91d..f0fefdc 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -91,6 +91,9 @@ gfc_conv_label_variable (gfc_se * se, gfc_expr * expr)
/* Deals with variable in common block. Get the field declaration. */
if (TREE_CODE (se->expr) == COMPONENT_REF)
se->expr = TREE_OPERAND (se->expr, 1);
+ /* Deals with dummy argument. Get the parameter declaration. */
+ else if (TREE_CODE (se->expr) == INDIRECT_REF)
+ se->expr = TREE_OPERAND (se->expr, 0);
}
/* Translate a label assignment statement. */