re PR fortran/69834 ([OOP] Collision in derived type hashes)
authorPaul Thomas <pault@gcc.gnu.org>
Sun, 23 Oct 2016 18:09:14 +0000 (18:09 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sun, 23 Oct 2016 18:09:14 +0000 (18:09 +0000)
commitdfd6231ea3621d57a2bf75f675fc8931ce5dec28
treefbc0891231c59b5f11319981f233231b8a38dc77
parentfb4ab5f0057f3a43636956efb5304a4c030bc449
re PR fortran/69834 ([OOP] Collision in derived type hashes)

2016-10-23  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/69834
* class.c (gfc_find_derived_vtab): Obtain the gsymbol for the
derived type's module. If the gsymbol is present and the top
level namespace corresponds to a module, use the gsymbol name
space. In the search to see if the vtable exists, try the gsym
namespace first.
* dump-parse-tree (show_code_node): Modify select case dump to
show select type construct.
* resolve.c (build_loc_call): New function.
(resolve_select_type): Add check for repeated type is cases.
Retain selector expression and use it later instead of expr1.
Exclude deferred length TYPE IS cases and emit error message.
Store the address for the vtable in the 'low' expression and
the hash value in the 'high' expression, for each case. Do not
call resolve_select.
* trans.c(trans_code) : Call gfc_trans_select_type.
* trans-stmt.c (gfc_trans_select_type_cases): New function.
(gfc_trans_select_type): New function.
* trans-stmt.h : Add prototype for gfc_trans_select_type.

2016-10-23  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/69834
* gfortran.dg/select_type_1.f03: Change error for overlapping
TYPE IS cases.
* gfortran.dg/select_type_36.f03: New test.

From-SVN: r241450
gcc/fortran/ChangeLog
gcc/fortran/class.c
gcc/fortran/dump-parse-tree.c
gcc/fortran/resolve.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans-stmt.h
gcc/fortran/trans.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/select_type_1.f03
gcc/testsuite/gfortran.dg/select_type_36.f03 [new file with mode: 0644]