summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-23 18:42:21 +0000
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-23 18:42:21 +0000
commit5309e73e08fdb9639efc4efe0fe6a0388f8c768d (patch)
tree6abc815a92bf4a3392ef93e9a3cf4337623d9d37 /gcc
parent3aee830bec8aae752d9f4010bf90fe58c4ebe022 (diff)
downloadgcc-5309e73e08fdb9639efc4efe0fe6a0388f8c768d.tar.gz
2010-08-23 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45380 * frontend-passes.c (optimize_equality): Don't optimize array equality git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163484 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/frontend-passes.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index eba7534df86..831c7796d82 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-23 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/45380
+ * frontend-passes.c (optimize_equality): Don't optimize array equality
+
2010-08-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/45366
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index ce3ee9a2720..27ff0feb9a3 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -399,6 +399,13 @@ optimize_equality (gfc_expr *e, bool equal)
return true;
}
+ /* An expression of type EXPR_CONSTANT is only valid for scalars. */
+ /* TODO: A scalar constant may be acceptable in some cases (the scalarizer
+ handles them well). However, there are also cases that need a non-scalar
+ argument. For example the any intrinsic. See PR 45380. */
+ if (e->rank > 0)
+ return false;
+
/* Check for direct comparison between identical variables. Don't compare
REAL or COMPLEX because of NaN checks. */
if (op1->expr_type == EXPR_VARIABLE