public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/36208] New: Boolean type discrepancy between gfortran and libgomp
@ 2008-05-11 10:57 rsandifo at gcc dot gnu dot org
2008-06-11 6:45 ` [Bug libgomp/36208] " jakub at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: rsandifo at gcc dot gnu dot org @ 2008-05-11 10:57 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug libgomp/36208] Boolean type discrepancy between gfortran and libgomp
2008-05-11 10:57 [Bug libgomp/36208] New: Boolean type discrepancy between gfortran and libgomp rsandifo at gcc dot gnu dot org
@ 2008-06-11 6:45 ` jakub at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-06-11 6:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jakub at gcc dot gnu dot org 2008-06-11 06:44 -------
This ought to be fixed on the trunk - BT_BOOL is the C _Bool type even in
Fortran.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36208
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-11 6:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-11 10:57 [Bug libgomp/36208] New: Boolean type discrepancy between gfortran and libgomp rsandifo at gcc dot gnu dot org
2008-06-11 6:45 ` [Bug libgomp/36208] " jakub at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).