re PR fortran/46809 ([OOP] ICE with -fcheck=pointer for CLASS IS)
authorJanus Weil <janus@gcc.gnu.org>
Sun, 12 Dec 2010 21:14:13 +0000 (22:14 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Sun, 12 Dec 2010 21:14:13 +0000 (22:14 +0100)
2010-12-12  Janus Weil  <janus@gcc.gnu.org>

PR fortran/46809
* resolve.c (resolve_select_type): Set the location of the first
argument when generating the EXTENDS_TYPE_OF call.

2010-12-12  Janus Weil  <janus@gcc.gnu.org>

PR fortran/46809
* gfortran.dg/pointer_check_8.f90: New.

From-SVN: r167731

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

index 90337d27327d1708d740e98979b5e1e869c73f22..734b49367487eb6721df1f35554a579dadf69116 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-12  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/46809
+       * resolve.c (resolve_select_type): Set the location of the first
+       argument when generating the EXTENDS_TYPE_OF call.
+
 2010-12-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/46705
index ab49e93f8fe86302d74e4a59358d583b9f1ffdce..a27fe2d11b54661704ed3cab2f0342be43122ead 100644 (file)
@@ -7893,6 +7893,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
          /* Set up arguments.  */
          new_st->expr1->value.function.actual = gfc_get_actual_arglist ();
          new_st->expr1->value.function.actual->expr = gfc_get_variable_expr (code->expr1->symtree);
+         new_st->expr1->value.function.actual->expr->where = code->loc;
          gfc_add_vptr_component (new_st->expr1->value.function.actual->expr);
          vtab = gfc_find_derived_vtab (body->ext.case_list->ts.u.derived);
          st = gfc_find_symtree (vtab->ns->sym_root, vtab->name);
index ee46df3fd4a01f691221c643e402ccfedefe028d..5cf2c03fdeef6ab41376c7e15a540fa715ee1a8f 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-12  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/46809
+       * gfortran.dg/pointer_check_8.f90: New.
+
 2010-12-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/46705
diff --git a/gcc/testsuite/gfortran.dg/pointer_check_8.f90 b/gcc/testsuite/gfortran.dg/pointer_check_8.f90
new file mode 100644 (file)
index 0000000..b47aa97
--- /dev/null
@@ -0,0 +1,21 @@
+! { dg-do compile}
+! { dg-options "-fcheck=pointer" }
+!
+! PR 46809: [OOP] ICE with -fcheck=pointer for CLASS IS
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+  type t
+  end type t
+
+contains
+
+  subroutine sub(a)
+    class(t) :: a
+    select type (a)
+      class is (t)
+        print *, 'Hi there'
+    end select
+  end subroutine
+
+end