[patch, PR 32731] fix pack and unpack for kind=1 and kind=2 mask
Thomas Koenig
tkoenig@alice-dsl.net
Fri Jul 13 19:39:00 GMT 2007
Hello world,
this patch fixes PR 32731 (wrong-code for kind=1 and kind=2 mask).
It should be mostly self-explanatory.
The reason why I hard-coded the magic number 4 in a few places is
because we only have kind=4 masks for scalar masks, and the GFC_LOGICAL
conversion trick is also hardcoded in the library. I also would have
felt silly defining a GFC_DEFAULT_DEFAULT_LOGICAL_KIND, but I'm open
to suggestions.
Currently regression-testing on i686-pc-linux-gnu. OK for trunk if this
passes?
Thomas
2007-07-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/32731
* iresolve.c(gfc_resolve_pack): A scalar mask has
to be kind=4, an array mask with kind<4 is converted
to gfc_default_logical_kind automatically.
(gfc_resolve_unpack): Convert mask to gfc_default_lotical_kind
if it has a kind<4.
2007-07-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/32731
* gfortran.dg/pack_mask_1.f90: New test.
* gfortran.dg/unpack_mask_1.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pack+unpack.diff
Type: text/x-patch
Size: 2302 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070713/3681f7dd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pack_mask_1.f90
Type: text/x-fortran
Size: 261 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070713/3681f7dd/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unpack_mask_1.f90
Type: text/x-fortran
Size: 387 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070713/3681f7dd/attachment-0002.bin>
More information about the Fortran
mailing list