[patch, fortran, committed] Fix PR 95366, wrong code and ABI breakage

Thomas Koenig tkoenig@netcologne.de
Tue Jun 30 11:11:00 GMT 2020


Hello world,

fortunately, upon inspection the fix for this PR turned out to be
obvious (and simple).  I have committed it as such.  Unless there
is unexpected fallout, I intend to backport it to gcc-10 over
the weekend so it can still be included into 10.2.

Regression-tested on x86_64 and on a big-endian POWER, to make
sure the hash values were the same.

Regards

	Thomas

Use CHARACTER(kind) string for calculating the type hash.

This regression came about because of a change in the way
types are displayed in error messages.  The character
representation is also used to calculate the hashes for
our types, so this patch restores the old behavior if
we are indeed calculating a hash.

The test case also checks for the specific hash value because
changing that would be an ABI change, which we should not
be doing unintentionally.

gcc/fortran/ChangeLog:


2020-06-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/95355
         * gfortran.h (gfc_typename): Add optional argument for_hash.
         * misc.c (gfc_typename): When for_hash is true, just return
	CHARACTER(kind).
         * class.c (gfc_intrinsic_hash_value): Call gfc_typename with
	for_hash = true.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p2.diff
Type: text/x-patch
Size: 3207 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200630/0110a895/attachment.bin>


More information about the Gcc-patches mailing list