This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH] PR fortran/77505 -- Treat negative character length as LEN=0
- From: "Punnoose, Elizebeth" <elizebeth dot punnoose at hpe dot com>
- To: "kargl at uw dot edu" <kargl at uw dot edu>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 2 Dec 2016 09:15:19 +0000
- Subject: RE: [PATCH] PR fortran/77505 -- Treat negative character length as LEN=0
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=elizebeth dot punnoose at hpe dot com;
- References: <CS1PR84MB00548EE8A08008205FE76A83918C0@CS1PR84MB0054.NAMPRD84.PROD.OUTLOOK.COM> <20161201232340.GA61471@troutmask.apl.washington.edu>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Thank you Steve.
Thanks,
Elizebeth
-----Original Message-----
From: Steve Kargl [mailto:sgk@troutmask.apl.washington.edu]
Sent: 02 December 2016 04:54
To: Punnoose, Elizebeth <elizebeth.punnoose@hpe.com>
Cc: fortran@gcc.gnu.org; gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] PR fortran/77505 -- Treat negative character length as LEN=0
On Wed, Nov 30, 2016 at 05:13:28AM +0000, Punnoose, Elizebeth wrote:
> Please excuse the messy formatting in my initial mail. Resending with
> proper formatting.
>
> This patch checks for negative character length in the array
> constructor, and treats it as LEN=0.
>
> A warning message is also printed if bounds checking is enabled.
>
> Bootstrapped and regression tested the patch on x86_64-linux-gnu and
> aarch64-linux-gnu.
>
Thanks. After regression testing on x86_64-*-freebsd, I committed the attached patch. Not sure if the whitespace got messed up by my email agent, but I needed to reformat your testcases. I took the opportunity to rename and improve the testcases. The improvements check that in fact len=0 and that a warning is issued.
Hopefully, you're inclined to submit additional patches in the future.
A few recommendations are to include the text of your ChangeLog entry in body of the email, for example,
2016-12-01 Elizebeth Punnoose <elizebeth.punnoose@hpe.com>
PR fortran/77505
* trans-array.c (trans_array_constructor): Treat negative character
length as LEN = 0.
2016-12-01 Elizebeth Punnoose <elizebeth.punnoose@hpe.com>
PR fortran/77505
* gfortran.dg/char_length_20.f90: New test.
* gfortran.dg/char_length_21.f90: Ditto.
(Note, 2 spaces before and after your name.) Then attach the patch to the email. This hopefully will prevent formatting issues with various email clients/servers.
--
Steve