From 88e09c797b51a5351ae3a7c599b530cfb2708be6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 14 May 2010 09:40:06 +0200 Subject: [PATCH] trans.c (trans_code): Set backend locus early. * trans.c (trans_code): Set backend locus early. * trans-decl.c (gfc_get_fake_result_decl): Use source location of the function instead of current input_location. * gfortran.dg/gomp/pr44036-1.f90: Adjust. From-SVN: r159388 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/trans-decl.c | 4 ++-- gcc/fortran/trans.c | 2 ++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ef1031a084e..c766d40a568 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-05-14 Jakub Jelinek + + * trans.c (trans_code): Set backend locus early. + * trans-decl.c (gfc_get_fake_result_decl): Use source location + of the function instead of current input_location. + 2010-05-13 Daniel Franke PR fortran/35779 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 64d87caa073..4f0256ae87b 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -2283,11 +2283,11 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag) IDENTIFIER_POINTER (DECL_NAME (this_function_decl))); if (!sym->attr.mixed_entry_master && sym->attr.function) - decl = build_decl (input_location, + decl = build_decl (DECL_SOURCE_LOCATION (this_function_decl), VAR_DECL, get_identifier (name), gfc_sym_type (sym)); else - decl = build_decl (input_location, + decl = build_decl (DECL_SOURCE_LOCATION (this_function_decl), VAR_DECL, get_identifier (name), TREE_TYPE (TREE_TYPE (this_function_decl))); DECL_ARTIFICIAL (decl) = 1; diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 21c56045a44..8acccf85027 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -1067,6 +1067,8 @@ trans_code (gfc_code * code, tree cond) gfc_add_expr_to_block (&block, res); } + gfc_set_backend_locus (&code->loc); + switch (code->op) { case EXEC_NOP: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6320390802f..6a9bec19603 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-05-14 Jakub Jelinek + + * gfortran.dg/gomp/pr44036-1.f90: Adjust. + 2010-05-14 Shujing Zhao PR c++/30566 diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 index e8565783a9e..a4633a3e9c0 100644 --- a/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 @@ -12,7 +12,7 @@ subroutine foo(a, b) x = a(4) !$omp end parallel !$omp parallel default(none) private (x) ! { dg-error "enclosing parallel" } - x = b(5) ! { dg-error "not specified in" "" { target *-*-* } 11 } + x = b(5) ! { dg-error "not specified in" } !$omp end parallel !$omp parallel default(none) private (x) x = c(6) -- 2.30.2