This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, Fortran] DEC Compatibility: Logical operations on integers become bitwise ops with -fdec
- From: Fritz Reese <fritzoreese at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: fortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jerry DeLisle <jvdelisle at charter dot net>, Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Date: Wed, 26 Oct 2016 09:50:16 -0400
- Subject: Re: [PATCH, Fortran] DEC Compatibility: Logical operations on integers become bitwise ops with -fdec
- Authentication-results: sourceware.org; auth=none
- References: <CAE4aFAnUnF_gZENxeUR-7Nfoc5bEu_zUts4C=VVdZt0+qMOOag@mail.gmail.com> <mvmy41bifex.fsf@hawking.suse.de>
On Wed, Oct 26, 2016 at 6:16 AM, Andreas Schwab <schwab@suse.de> wrote:
> On Okt 25 2016, Fritz Reese <fritzoreese@gmail.com> wrote:
>
>> * dec_bitwise_ops_1.f90, dec_bitwise_ops_2.f90: New testcases.
>
> I'm getting these errors on ia64:
>
> FAIL: gfortran.dg/dec_bitwise_ops_1.f90 -O0 (test for excess errors)
> Excess errors:
> /usr/local/gcc/gcc-20161026/gcc/testsuite/gfortran.dg/dec_bitwise_ops_1.f90:33:16: Error: Can't convert INTEGER(4) to INTEGER(4) at (1)
> /usr/local/gcc/gcc-20161026/gcc/testsuite/gfortran.dg/dec_bitwise_ops_1.f90:34:16: Error: Can't convert INTEGER(4) to INTEGER(4) at (1)
> /usr/local/gcc/gcc-20161026/gcc/testsuite/gfortran.dg/dec_bitwise_ops_1.f90:35:24: Error: Can't convert INTEGER(4) to INTEGER(4) at (1)
...
Andreas,
I can't seem to reproduce this on x86-64. Did you fully apply the
patch? I think this section of code in resolve.c should be guarding
against type to same-type conversions in this case:
>>> resolve.c:3719 (resolve_operator)
/* Logical ops on integers become bitwise ops with -fdec. */
else if (flag_dec
&& (op1->ts.type == BT_INTEGER || op2->ts.type == BT_INTEGER))
{
e->ts.type = BT_INTEGER;
e->ts.kind = gfc_kind_max (op1, op2);
if (op1->ts.type != e->ts.type || op1->ts.kind != e->ts.kind)
gfc_convert_type (op1, &e->ts, 1);
if (op2->ts.type != e->ts.type || op2->ts.kind != e->ts.kind)
gfc_convert_type (op2, &e->ts, 1);
e = logical_to_bitwise (e);
return resolve_function (e);
}
<<<
---
Fritz Reese