diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-10 04:58:16 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-10 04:58:16 +0000 |
commit | b9973141d81fea74a52c4ba9cbbcdac33879f269 (patch) | |
tree | 458b3e129494260814423b1b3a4a1eea07056ac5 /gcc/fortran/intrinsic.c | |
parent | 77580f206811d903762f23f278bc12896ec6d653 (diff) | |
download | gcc-b9973141d81fea74a52c4ba9cbbcdac33879f269.tar.gz |
2010-11-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Mikael Morin <mikael@gcc.gnu.org>
PR fortran/46331
* intrinsic.c: Correctly set the pure attributes for intrinsic
functions.
* expr.c (check_specification_function): Remove this function and move
its code into gfc_is_constant_expr. (gfc_is_constant_expr): Change the
order of checks by checking for non-constant arguments first. Then,
check for initialization functions, followed by intrinsics.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166520 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/intrinsic.c')
-rw-r--r-- | gcc/fortran/intrinsic.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index 84547973d8c..f7f0e0506ae 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -274,10 +274,7 @@ add_sym (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type strcat (buf, name); next_sym->lib_name = gfc_get_string (buf); - /* There are no IMPURE ELEMENTAL intrinsics, thus the ELEMENTAL class - also implies PURE. Additionally, there's the PURE class itself. */ - next_sym->pure = (cl == CLASS_ELEMENTAL || cl == CLASS_PURE); - + next_sym->pure = (cl != CLASS_IMPURE); next_sym->elemental = (cl == CLASS_ELEMENTAL); next_sym->inquiry = (cl == CLASS_INQUIRY); next_sym->transformational = (cl == CLASS_TRANSFORMATIONAL); @@ -3370,8 +3367,6 @@ add_char_conversions (void) void gfc_intrinsic_init_1 (void) { - int i; - nargs = nfunc = nsub = nconv = 0; /* Create a namespace to hold the resolved intrinsic symbols. */ @@ -3404,15 +3399,6 @@ gfc_intrinsic_init_1 (void) /* Character conversion intrinsics need to be treated separately. */ add_char_conversions (); - - /* Set the pure flag. All intrinsic functions are pure, and - intrinsic subroutines are pure if they are elemental. */ - - for (i = 0; i < nfunc; i++) - functions[i].pure = 1; - - for (i = 0; i < nsub; i++) - subroutines[i].pure = subroutines[i].elemental; } |