This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgomp/36208] New: Boolean type discrepancy between gfortran and libgomp
- From: "rsandifo at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 May 2008 10:56:47 -0000
- Subject: [Bug libgomp/36208] New: Boolean type discrepancy between gfortran and libgomp
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Sorry in advance if this is a dup or known issue. While writing
a patch for IRA, I came across a hang in libgomp.fortran/do2.f90.
The problem is that gomp_loop_ordered_static_next & friends
return a C _Bool, which on i686-pc-linux-gnu is a single byte
(i.e. it has QImode). But omp-builtins.def says that the function
returns a BT_BOOL, which means boolean_type_node. boolean_type_node
is logical(kind=4) for Fortran (i.e. it maps to SImode), so the
upper 24 bits of the return value can be tested uninitialised.
We get lucky on trunk because %eax happens to be zero before
the "sete %al" instruction in gomp_loop_ordered_static_next.
This is not deliberate; it just so happens that the locking
code always leaves it that way. The patch I'm working on
swaps the allocation of %eax and %edx for two allocnos,
such that %edx is accidentally zero instead.
Richard
--
Summary: Boolean type discrepancy between gfortran and libgomp
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: libgomp
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rsandifo at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36208