This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran]
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 25 Jun 2006 06:31:46 +0200
- Subject: Re: [Patch, fortran]
- References: <449C20DA.1060503@wanadoo.fr> <20060624153211.GA58005@troutmask.apl.washington.edu>
Steve Kargl wrote:
+ if (type == BT_LOGICAL && cp->low->expr_type == EXPR_CONSTANT)
+ {
+ if (cp->low->value.logical & seen_logical)
Do you want & or && here?
The arithmetic and was intentional. However, I realised in replying to
you that the first operand is incorrect; the patch only fixes repeated
.TRUE.!
This is what I will submit:
if (type == BT_LOGICAL && cp->low->expr_type == EXPR_CONSTANT)
{
int value;
value = cp->low->value.logical == 0 ? 2 : 1;
if (value & seen_logical)
{
gfc_error ("constant logical value in CASE statement "
"is repeated at %L",
&cp->low->where);
t = FAILURE;
break;
}
seen_logical |= value;
}
Otherwise, the patch is OK.
Many thanks for this and the review of the FORALL patch.
Paul