aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2012-08-28 20:18:11 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2012-08-28 20:18:11 +0200
commit033418dcdef2ee561dde2947ec43ee5591619806 (patch)
tree5be2f0ea12e7a10432b21d557c2aa0a43179bda2 /gcc/fortran
parenta21d0595b4604c2861401a24712fc802f9c6a003 (diff)
downloadgcc-033418dcdef2ee561dde2947ec43ee5591619806.zip
gcc-033418dcdef2ee561dde2947ec43ee5591619806.tar.gz
gcc-033418dcdef2ee561dde2947ec43ee5591619806.tar.bz2
re PR fortran/54389 ([F2003/F2008 difference] PURE functions and pointer dummy arguments / DECL_PURE_P issue)
2012-08-28 Tobias Burnus <burnus@net-b.de> PR fortran/54389 * trans-decl.c (gfc_get_extern_function_decl, build_function_decl): Don't mark impure elemental functions as DECL_PURE_P and honour implicit_pure. From-SVN: r190757
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/trans-decl.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3a6a23e..582eb26 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,12 @@
2012-08-28 Tobias Burnus <burnus@net-b.de>
+ PR fortran/54389
+ * trans-decl.c (gfc_get_extern_function_decl,
+ build_function_decl): Don't mark impure elemental
+ functions as DECL_PURE_P and honour implicit_pure.
+
+2012-08-28 Tobias Burnus <burnus@net-b.de>
+
PR fortran/54382
* error.c (show_locus): Avoid out of bound access.
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 35a859b..7e59cb6 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1783,7 +1783,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
/* Set attributes for PURE functions. A call to PURE function in the
Fortran 95 sense is both pure and without side effects in the C
sense. */
- if (sym->attr.pure || sym->attr.elemental)
+ if (sym->attr.pure || sym->attr.implicit_pure)
{
if (sym->attr.function && !gfc_return_by_reference (sym))
DECL_PURE_P (fndecl) = 1;
@@ -1912,7 +1912,7 @@ build_function_decl (gfc_symbol * sym, bool global)
/* Set attributes for PURE functions. A call to a PURE function in the
Fortran 95 sense is both pure and without side effects in the C
sense. */
- if (attr.pure || attr.elemental)
+ if (attr.pure || attr.implicit_pure)
{
/* TODO: check if a pure SUBROUTINE has no INTENT(OUT) arguments
including an alternate return. In that case it can also be