OSDN Git Service

gcc/fortran:
authordfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Jul 2007 16:57:02 +0000 (16:57 +0000)
committerdfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Jul 2007 16:57:02 +0000 (16:57 +0000)
2007-07-24  Daniel Franke  <franke.daniel@gmail.com>

PR fortran/32867
* expr.c (check_init_expr): Simplify matched functions.

gcc/testsuite:
2007-07-24  Daniel Franke  <franke.daniel@gmail.com>

PR fortran/32867
* fortran.dg/initialization_10.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126882 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/initialization_10.f90 [new file with mode: 0644]

index 6445cf1..62489c8 100644 (file)
@@ -1,5 +1,10 @@
 2007-07-24  Daniel Franke  <franke.daniel@gmail.com>
 
+       PR fortran/32867
+       * expr.c (check_init_expr): Simplify matched functions.
+
+2007-07-24  Daniel Franke  <franke.daniel@gmail.com>
+
        PR fortran/32778
        * intrinsic.c (add_sym): Do not exclude any symbols, even if not part
        of the selected standard.
index 0028724..8e608ed 100644 (file)
@@ -2132,7 +2132,7 @@ check_init_expr (gfc_expr *e)
        }
 
       if (m == MATCH_YES)
-       t = SUCCESS;
+       t = gfc_simplify_expr (e, 0);
 
       break;
 
index 1a75a1f..3b36d6a 100644 (file)
@@ -1,5 +1,10 @@
 2007-07-24  Daniel Franke  <franke.daniel@gmail.com>
 
+       PR fortran/32867
+       * fortran.dg/initialization_10.f90: New test.
+
+2007-07-24  Daniel Franke  <franke.daniel@gmail.com>
+
        PR fortran/32778
        * gfortran.dg/imag_2.f: Removed
        * gfortran.dg/warn_std_1.f90: New test.
diff --git a/gcc/testsuite/gfortran.dg/initialization_10.f90 b/gcc/testsuite/gfortran.dg/initialization_10.f90
new file mode 100644 (file)
index 0000000..92d9df5
--- /dev/null
@@ -0,0 +1,32 @@
+! { dg-do compile }
+!
+! PR fortran/32867 - nested initialization expression not simplified
+!
+! Testcase contributed by H. J. Lu <hjl AT lucon DOT org>
+!
+
+MODULE Readdata_mod
+IMPLICIT NONE
+Private
+Public Parser
+  integer, parameter :: nkeywords = 2
+character(80), PARAMETER, dimension(1:nkeywords) :: keywords = &
+(/'PROBLEMSIZE                                  ',             &
+  'NFTRANS_TD                                   '/)
+
+CONTAINS
+SUBROUTINE Parser(nx, ny, keyword)
+integer, intent(inout) :: nx, ny
+character(80), intent(inout) :: keyword
+
+select case (keyword)
+  case (trim(keywords(1))) ! PROBLEMSIZE
+    nx = 1
+  case (trim(keywords(2))) !'NFTRANS_TD'
+    ny = 1
+end select
+
+END SUBROUTINE Parser
+END MODULE Readdata_mod
+
+! { dg-final { cleanup-modules "Readdata_mod" } }