Bug 19589 - Regression: Error on Data assignment with LOGICAL*1
Summary: Regression: Error on Data assignment with LOGICAL*1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: patch
Depends on:
Blocks: 19292
  Show dependency treegraph
 
Reported: 2005-01-23 14:55 UTC by Manfred Schwarb
Modified: 2005-01-29 15:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-01-23 16:48:19


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manfred Schwarb 2005-01-23 14:55:17 UTC
PROGRAM logical_data
      LOGICAL*1 GRD
      DATA  GRD /.TRUE./
      END

gives:
> gfc -v logical_data.f
Driving: /usr/local/gfortran/irun/bin/gfortran -static -v logical_data.f -lgfortranbegin -lgfortran -lm
Using built-in specs.
Configured with: ../gcc/configure --enable-languages=c,f95 --prefix=/usr/work/2005023/irun
Thread model: posix
gcc version 4.0.0 20050123 (experimental)
 /usr/local/gfortran/irun/bin/../libexec/gcc/i686-pc-linux-gnu/4.0.0/f951 logical_data.f -ffixed-form -quiet -dumpbase logical_data.f -mtune=pentiumpro -auxbase logical_data -version -o /tmp/cc2uDAa6.s
GNU F95 version 4.0.0 20050123 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.0 20050117 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 In file logical_data.f:3

      DATA  GRD /.TRUE./
                      1
Error: Incompatible types in assignment at (1), LOGICAL(4) to LOGICAL(1)


which is a clear regression, g77 supports this.
Of course this error happens also with LOGICAL*2, LOGICAL*8, ...
Comment 1 Andrew Pinski 2005-01-23 16:48:19 UTC
Confirmed.
Comment 2 Steve Kargl 2005-01-26 20:37:29 UTC
Here's a patch and testsuite program

http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01924.html
Comment 3 Andrew Pinski 2005-01-26 20:56:35 UTC
Patch posted here: <http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01924.html>.
Comment 4 GCC Commits 2005-01-29 15:36:06 UTC
Subject: Bug 19589

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pbrook@gcc.gnu.org	2005-01-29 15:35:51

Modified files:
	gcc/fortran    : ChangeLog expr.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: logical_data_1.f90 

Log message:
	2005-01-29  Steven G. Kargl  <kargls@comcast.net>
	
	PR fortran/19589
	* expr.c (gfc_check_assign):  Check for conformance of logical operands
	testsuite/
	* gfortran.dg/logical_data_1.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.314&r2=1.315
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/expr.c.diff?cvsroot=gcc&r1=1.19&r2=1.20
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4953&r2=1.4954
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/logical_data_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 5 Andrew Pinski 2005-01-29 15:39:07 UTC
Fixed.