Doing parallel byte operations with and's, or's fails to run correctly when using --fugly-logint. The file below is good example of how a.and.b works differently from and(a,b) Please compile example with g77 -fugly-logint Release: gcc version 2.95.1 19990816 (release)/GNU Fortran 0.5.25 19990816 (release) Environment: Linux ibdu 2.2.12-20 #1 Fri Sep 29 07:29:24 EDT 2000 i686 unknown(RedHat 6.1) How-To-Repeat: Just compile file with -fugly-logint and run to see difference between 2 outputs.
Fix: I have no idea, except that .and. should behave as and(.,.) in my opinion. But I am no expert.
State-Changed-From-To: open->closed State-Changed-Why: Fixed by submitter for 3.2 See: http://gcc.gnu.org/ml/gcc-patches/2002-05/msg00826.html
I have to reopen this bug, because the proposed (and implemented) solution caused regression (cf. PR fortran/12633).
Created attachment 5211 [details] This is a modified expr.c that correctly immitates IBM's xlf -qintlog This should fix the mentionned problem. I had it for a while but forgot to submit it. Sorry
The Expr.zip attachement above contains a modified expr.c file replacing gcc/f/expr.c This should correctly handle all logical operations and still implements IBM's xlf -qintlog. It's not the best looking code but it works
Nope, this doesn't fix the test case of PR 12633.
I will look at this asap, and come back with a solution (hopefully).
Assigning who thought he assigned it to himself.
Mark it right as the patch which fixed this caused other problems so it was reverted for 3.3.3 and 3.4.
I posted a potential patch here: http://gcc.gnu.org/ml/fortran/2004-01/msg00080.html This needs to be examined by somebody more familiar with FORTRAN.
(In reply to comment #11) > I posted a potential patch here: > http://gcc.gnu.org/ml/fortran/2004-01/msg00080.html > > This needs to be examined by somebody more familiar with FORTRAN. I will compile this and test it and have a look. Thanks for the patch
Subject: Bug 6491 CVSROOT: /cvs/gcc Module name: gcc Changes by: ian@gcc.gnu.org 2004-01-14 02:32:50 Modified files: gcc/f : ChangeLog expr.c Log message: PR fortran/6491 * expr.c (ffeexpr_reduce_): When handling AND, OR, and XOR, and when using -fugly-logint, if both operands are logical, convert the result back to logical. (ffeexpr_reduced_ugly2log_): Add bothlogical parameter. Change all callers. Convert logical operands to integer. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/ChangeLog.diff?cvsroot=gcc&r1=1.620&r2=1.621 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/expr.c.diff?cvsroot=gcc&r1=1.30&r2=1.31
Fixed for 3.4.