[patch, fortran] PR43217 Output of Hollerith constants which are not a multiple of 4 bytes

Jerry DeLisle jvdelisle@frontier.com
Fri Aug 27 01:17:00 GMT 2010


On 08/25/2010 08:32 PM, Jerry DeLisle wrote:
> On 08/25/2010 06:15 PM, Jerry DeLisle wrote:
>> Hi,
>>
>> The attached patch fixes this by padding the constant when it is created
>> to fit into a default integer size.
>>
I have updated the patch to include saving the pad size in the expressions type 
specification so that calculated lengths used later can be adjusted to avoid 
spurious warnings.

Test case attached.  I expect to revise this to handle platforms that may have 
different endian-ness.

Regression tested on i686-Gnu-linux.

OK for trunk.

2010-08-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/43217
	* primary.c (match_hollerith_constant): Calculate padding needed to
	fill default integer and allocate string for that size.  Set pad bytes
	to ' '.
	* gfortran.h: Add hollerith pad value to type spec union.
	* data.c (create_character_initializer): Fix spelling of function name.
	Use hollerith pad value to calculate length.
	* arith.c (hollerith2representation); Use hollerith pad value to
	calculate length.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr43217-2.diff
Type: text/x-patch
Size: 3814 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100827/41bf7d72/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hollerith8.f90
Type: text/x-fortran
Size: 495 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100827/41bf7d72/attachment-0001.bin>


More information about the Fortran mailing list