re PR middle-end/19543 ([4.1 only] fortran LOGICAL*8 not consistently distinguished from 32 bit integers)

PR middle-end/19543
	* varasm.c (compare_constant) <INTEGER_CST>: Integer constants are
	only equivalent if the have both the same mode and precision.

	* gfortran.dg/logical_1.f90: New test case.

From-SVN: r111294
This commit is contained in:
Roger Sayle 2006-02-20 00:34:12 +00:00 committed by Roger Sayle
parent 3cdab2662d
commit 6a34c78895
4 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2006-02-19 Roger Sayle <roger@eyesopen.com>
PR middle-end/19543
* varasm.c (compare_constant) <INTEGER_CST>: Integer constants are
only equivalent if the have both the same mode and precision.
2006-02-20 Ben Elliston <bje@au.ibm.com>
* doc/tree-ssa.texi (Interfaces): Describe low vs. high GIMPLE.

View File

@ -1,3 +1,8 @@
2006-02-19 Roger Sayle <roger@eyesopen.com>
PR middle-end/19543
* gfortran.dg/logical_1.f90: New test case.
2006-02-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/26334

View File

@ -0,0 +1,22 @@
! { dg-do run }
! PR middle-end/19543
program logical_1
implicit none
logical(1), parameter :: t1 = .TRUE., f1 = .FALSE.
logical(2), parameter :: t2 = .TRUE., f2 = .FALSE.
logical(4), parameter :: t4 = .TRUE., f4 = .FALSE.
logical(8), parameter :: t8 = .TRUE., f8 = .FALSE.
character*2 :: t(4), f(4)
write(t(1),*) t1
write(f(1),*) f1
write(t(2),*) t2
write(f(2),*) f2
write(t(3),*) t4
write(f(3),*) f4
write(t(4),*) t8
write(f(4),*) f8
if (any(t .ne. " T")) call abort
if (any(f .ne. " F")) call abort
end

View File

@ -2573,6 +2573,8 @@ compare_constant (const tree t1, const tree t2)
/* Integer constants are the same only if the same width of type. */
if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2)))
return 0;
if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2)))
return 0;
return tree_int_cst_equal (t1, t2);
case REAL_CST: