2013-04-13 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Apr 2013 10:52:31 +0000 (10:52 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Apr 2013 10:52:31 +0000 (10:52 +0000)
PR fortran/55959
* expr.c (gfc_simplify_expr): Branch is not unreachable.

2013-04-13  Janus Weil  <janus@gcc.gnu.org>

PR fortran/55959
* gfortran.dg/typebound_proc_29.f03: New.

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

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

index ace16ad..8f88b0b 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-13  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/55959
+       * expr.c (gfc_simplify_expr): Branch is not unreachable.
+
 2013-04-12  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/56266
index 829b087..e4bcc79 100644 (file)
@@ -1916,7 +1916,6 @@ gfc_simplify_expr (gfc_expr *p, int type)
 
     case EXPR_COMPCALL:
     case EXPR_PPC:
-      gcc_unreachable ();
       break;
     }
 
index c99fee8..28b9b62 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-13  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/55959
+       * gfortran.dg/typebound_proc_29.f03: New.
+
 2013-04-12  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/56266
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_29.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_29.f90
new file mode 100644 (file)
index 0000000..2650d14
--- /dev/null
@@ -0,0 +1,26 @@
+! { dg-do compile }
+!
+! PR 55959: [OOP] ICE in in gfc_simplify_expr, at fortran/expr.c:1920
+!
+! Contributed by Tilo Schwarz <tilo@tilo-schwarz.de>
+
+module pdfs
+  type :: pdf
+  contains
+    procedure, nopass :: getx
+  end type
+
+contains
+
+  real function getx()
+  end function
+
+end module
+
+program abstract
+  use pdfs
+  type(pdf) pp
+  print pp%getx()  ! { dg-error "must be of type default-kind CHARACTER or of INTEGER" }
+end program
+
+! { dg-final { cleanup-modules "pdfs" } }