This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Fortran, OOP] PR 54881: [4.8 Regression] [OOP] ICE in fold_convert_loc, at fold-const.c:2016


Hi all,

here is an OOP patch for the above PR, which has two disconnected parts:

1) It fixes a problem with ASSOCIATED, when it is fed a CLASS-valued
function as argument (i.e. the ICE in the bug title). This is the
trans-intrinsic part of the patch. Instead of adding the _data
component to the expr first and translating then, we now translate
first and then add the _data component.

2) It fixes an error with SELECT TYPE (which is a 4.8 regression), by
respecting the POINTER argument of the selector when building the
temporaries for the select type branches. This is the match.c part of
the patch, which looks much more complicated than it is, because I
merged two functions into one, which do essentially the same. I think
they were at some point split up by Paul, but I see no advantage this,
to be honest.

Regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2012-10-11  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/54881
	* match.c (select_derived_set_tmp,select_class_set_tmp): Removed and
	unified into ...
	(select_type_set_tmp): ... this one. Set POINTER argument according to
	selector.
	* trans-intrinsic.c (gfc_conv_associated): Use 'gfc_class_data_get'
	instead of 'gfc_add_data_component'.

2012-10-11  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/54881
	* gfortran.dg/associated_6.f90: New.
	* gfortran.dg/select_type_30.f03: New.

Attachment: pr54881.diff
Description: Binary data

Attachment: associated_6.f90
Description: Binary data

Attachment: select_type_30.f03
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]