aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2006-12-04 21:02:43 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2006-12-04 21:02:43 +0100
commita74897c141f39c4400f0569839befffe4dc6aa41 (patch)
treec340a0d95065e76783fb2fd0a7e0fa944b3eefeb
parentdd5ecf415546bfcd359c5f6dc7500fe7cc319593 (diff)
downloadgcc-a74897c141f39c4400f0569839befffe4dc6aa41.zip
gcc-a74897c141f39c4400f0569839befffe4dc6aa41.tar.gz
gcc-a74897c141f39c4400f0569839befffe4dc6aa41.tar.bz2
re PR fortran/29962 (Initialization expressions)
fortran/ 2006-12-04 Tobias Burnus <burnus@net-b.de> PR fortran/29962 * expr.c (check_intrinsic_op): Allow noninteger exponents for F2003. testsuite/ 2006-12-04 Tobias Burnus <burnus@net-b.de> PR fortran/29962 * initialization_4.f90: Test noninteger exponents (-std=f95). * initialization_5.f90: New test for noninteger exponents with -std=f2003 From-SVN: r119505
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/expr.c8
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.dg/initialization_4.f901
-rw-r--r--gcc/testsuite/gfortran.dg/initialization_5.f907
5 files changed, 25 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 2ce1ec6..eeaaa48 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/29962
+ * expr.c (check_intrinsic_op): Allow noninteger exponents for F2003.
+
2006-12-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29821
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 16e89f8..f806497 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1622,9 +1622,11 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
if (e->value.op.operator == INTRINSIC_POWER
&& check_function == check_init_expr && et0 (op2) != BT_INTEGER)
{
- gfc_error ("Exponent at %L must be INTEGER for an initialization "
- "expression", &op2->where);
- return FAILURE;
+ if (gfc_notify_std (GFC_STD_F2003,"Fortran 2003: Noninteger "
+ "exponent in an initialization "
+ "expression at %L", &op2->where)
+ == FAILURE)
+ return FAILURE;
}
break;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a0c4f78..4ed0ce6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-12-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/29962
+ * initialization_4.f90: Test noninteger exponents (-std=f95).
+ * initialization_5.f90: New test for noninteger exponents
+ with -std=f2003.
+
2006-12-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29821
diff --git a/gcc/testsuite/gfortran.dg/initialization_4.f90 b/gcc/testsuite/gfortran.dg/initialization_4.f90
index b0f2431..552a01f 100644
--- a/gcc/testsuite/gfortran.dg/initialization_4.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_4.f90
@@ -3,4 +3,5 @@
! { dg-do compile }
! { dg-options "-std=f95" }
real, parameter :: pi = 4.0*Atan(1.0) ! { dg-error "Evaluation of nonstandard initialization expression" }
+real, parameter :: three = 27.0**(1.0/3.0) ! { dg-error "Noninteger exponent in an initialization expression" }
end
diff --git a/gcc/testsuite/gfortran.dg/initialization_5.f90 b/gcc/testsuite/gfortran.dg/initialization_5.f90
new file mode 100644
index 0000000..b5cfe0f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/initialization_5.f90
@@ -0,0 +1,7 @@
+! initialization expression, now allowed in Fortran 2003
+! PR fortran/29962
+! { dg-do run }
+! { dg-options "-std=f2003 -fall-intrinsics" }
+ real, parameter :: three = 27.0**(1.0/3.0)
+ if(abs(three-3.0)>epsilon(three)) call abort()
+end