This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/20066] New: Ordering of clogical onstants determines if they're correctly emitted
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Feb 2005 22:28:10 -0000
- Subject: [Bug rtl-optimization/20066] New: Ordering of clogical onstants determines if they're correctly emitted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
There's a difference between the assembly emitted for the following two Fortran
tests:
PRINT *, .TRUE., .TRUE_8 ; END
and
PRINT *, .TRUE._8, .TRUE ; END
Where for the former we get
.align 4
.LC1:
.long 1
the latter gives:
.align 8
.LC1:
.long 1
.long 0
.text
and in both cases the constants are referenced by pointing to .LC1, i.e. the
code for the PRINT-statements looks like:
pushl $8 ;; or $4 for the 4-byte true
pushl $.LC1
call _gfortran_transfer_logical
In other words, the code is correct for the former program, but not for the
latter, as here both alignment may be wrong and memory beyond the correctly
initialized space will be read.
Andrew Pinski confirmed that the same difference also exists on powerpc, I
assume that this will make 4-byte .TRUE. to always be evaluated to .FALSE. on
that platform. On ix86 on the other hand an .FALSE._8 will be evaluating to
true if subsequent memory is non-zero.
NB I mark this as blocking PR19543, I don't know if this is the only issue
remaining with that PR. Also, I made the component rtl-optimization, as the
tree dumps look correct.
--
Summary: Ordering of clogical onstants determines if they're
correctly emitted
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P2
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tobi at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 19543
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20066