This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, Fortran] DEC Compatibility: Logical operations on integers become bitwise ops with -fdec


On 10/25/2016 09:24 AM, Fritz Reese wrote:
All-

Proposed here is another compatibility extension to the GNU Fortran
frontend which allows logical operations on integer operands with the
-fdec flag. In this case the logical operator is replaced with its
bitwise equivalent.

For example, GNU Fortran by default (correctly) produces an error for
the expression "A .AND. B" when A and/or B are integers. With this
patch when the -fdec legacy compatibility flag is asserted, GNU
Fortran instead silently replaces the expression with "IAND(A, B)",
performing a bitwise-and on the integers A and B. This behavior is to
match the behavior of legacy compilers, and expectations of some
legacy code.

This extension was originally implemented under its own flag
"-fdec-bitwise-ops", but following the recent trend I have just rolled
it into "-fdec". I thought the behavior might be too drastic for
-std=legacy, but if anyone has a different opinion I can certainly do
this with -std=legacy instead of -fdec.

Bootstraps and regtests on x86_64-redhat-linux, OK for trunk?


I think this is OK. -fdec is sufficient

Jerry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]