public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25014] New: seems to be a bug in optimization on sparc systems.
@ 2005-11-24 10:29 d dot obermann at callassoftware dot com
2005-11-25 20:23 ` [Bug c++/25014] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: d dot obermann at callassoftware dot com @ 2005-11-24 10:29 UTC (permalink / raw)
To: gcc-bugs
The following bug occurs only if -O (or higher optimization) is switched on.
I did not find out which of the single optimization switches is responsible for
it. The complete if statement is true, although none of each boolean value is
true. If I replace the enum variable "Type" by an int, the code works correct
even with optimization. Please let me know if this bug is already known or even
fixed.
Compiler:
../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.1
System (uname -a)
SunOS sun2 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Blade-1500
//gcc -O enumtest.cpp (has the bug)
//gcc -O enumtest.cpp -lsupc++ (has the bug)
//or: gcc enumtest.cpp -lsupc++ (is correct)
//output is(if used -O ):
//>inside
//>done
//output is(if not used -O ):
//>done
//(as I expect)
#include <stdio.h>
enum ETestType
{
e_Zero = 0
, e_One
, e_Two
, e_Three
, e_Four
};
int main () {
ETestType Type= e_Four;
if( ( Type == e_One )
|| ( Type == e_Two )
|| ( Type == e_Three ) )
{
printf("inside\n");
}
printf("done\n");
return 0;
}
David
--
Summary: seems to be a bug in optimization on sparc systems.
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: d dot obermann at callassoftware dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25014
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/25014] seems to be a bug in optimization on sparc systems.
2005-11-24 10:29 [Bug c++/25014] New: seems to be a bug in optimization on sparc systems d dot obermann at callassoftware dot com
@ 2005-11-25 20:23 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-25 20:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-11-25 20:23 -------
This is a dup of bug 16372 which was fixed in 3.4.2.
*** This bug has been marked as a duplicate of 16372 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25014
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-11-25 20:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-24 10:29 [Bug c++/25014] New: seems to be a bug in optimization on sparc systems d dot obermann at callassoftware dot com
2005-11-25 20:23 ` [Bug c++/25014] " pinskia 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).