This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/29797] New: Miscompiles bit test / set in OpenOffice
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Nov 2006 12:59:36 -0000
- Subject: [Bug target/29797] New: Miscompiles bit test / set in OpenOffice
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
extern "C" void abort(void);
unsigned bar(void) { return 32768;}
void foobar (unsigned u) { if (u != (32768 | 65536)) abort (); }
const char *name (void) { return "QPopupMenu"; }
int main()
{
unsigned nStyle = bar ();
const char *pClassName = name ();
if (__builtin_strcmp ("QPopupMenu", pClassName) == 0)
{
bool is_enabled = bool (nStyle & 1);
if (nStyle & 32768)
nStyle |= 65536;
foobar(nStyle);
}
return 0;
}
is miscompiled at -O1 and -O2 on ppc32 (ppc64 is ok).
--
Summary: Miscompiles bit test / set in OpenOffice
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Keywords: wrong-code
Severity: blocker
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
GCC target triplet: powerpc32-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29797