[Bug c++/25014] New: seems to be a bug in optimization on sparc systems.

2005-11-24 Thread d dot obermann at callassoftware dot com
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 -Oenumtest.cpp  -lsupc++ (has the bug) 
//or: gccenumtest.cpp  -lsupc++ (is correct)
//output is(if used -O ): 
//>inside 
//>done


//output is(if not used -O ): 
//>done 
//(as I expect) 

#include 

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



[Bug c++/2413] Under AIX 4.3.0: Global object constructors not executed

2006-09-19 Thread d dot obermann at callassoftware dot com


--- Comment #3 from d dot obermann at callassoftware dot com  2006-09-20 
06:38 ---
I have this problem on AIX 5.3 with gcc 4.1.1 (also with 4.0.2)
In a small program the code below works but when I add this to my application,
the code is never executed. (My application is about 440MB without
optimization). The problem is that no code is executed before main. const char
* const are initialized, but no ctors are called.


David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2413