aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2019-12-07 11:07:07 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2019-12-07 12:07:07 +0100
commit9c81750c5bedd7883182ee2684a012c6210ebe1d (patch)
treea3355f687262d05caae19a9ab28b2fba2c9745ac /gcc/fortran/trans-decl.c
parentb01d215df18ba753746a170125b883befe100d67 (diff)
downloadgcc-9c81750c5bedd7883182ee2684a012c6210ebe1d.zip
gcc-9c81750c5bedd7883182ee2684a012c6210ebe1d.tar.gz
gcc-9c81750c5bedd7883182ee2684a012c6210ebe1d.tar.bz2
Fortran] PR 92793 - fix column used for error diagnostic
PR fortran/92793 * trans.c (gfc_get_location): Declare. * trans.c (gfc_get_location): Define; returns column-corrected location. (trans_runtime_error_vararg, gfc_trans_runtime_check, gfc_generate_module_code): Use new function. * trans-array.c (gfc_trans_auto_array_allocation): Likewise. * trans-common.c (build_field, get_init_field, create_common): Likewise. * trans-decl.c (gfc_build_label_decl, gfc_get_symbol_decl): Likewise. * trans-openmp.c (gfc_trans_omp_reduction_list, gfc_trans_omp_clauses): Likewise. * trans-stmt.c (gfc_trans_if_1): Likewise. From-SVN: r279075
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index fb15396..d0fc5d3 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -307,7 +307,7 @@ gfc_build_label_decl (tree label_id)
void
gfc_set_decl_location (tree decl, locus * loc)
{
- DECL_SOURCE_LOCATION (decl) = loc->lb->location;
+ DECL_SOURCE_LOCATION (decl) = gfc_get_location (loc);
}
@@ -1760,7 +1760,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
}
/* Create the decl for the variable. */
- decl = build_decl (sym->declared_at.lb->location,
+ decl = build_decl (gfc_get_location (&sym->declared_at),
VAR_DECL, gfc_sym_identifier (sym), gfc_sym_type (sym));
/* Add attributes to variables. Functions are handled elsewhere. */