This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC 2.95.3 for PS2 Multiplication Issue


Hi, 
? 
I am seeing this issue when using the 2.95.3 compiler for EE processor.? 
? 
When compiling the following code: 
? 
?unsigned int a,b; 

??? a = ((unsigned int)4294967295 * b);? 
?
the 2.95.3 compiler generates the following assembly:
????? 
?? 8fc30014? lw $v1,20($s8) 
???0060102d? move $v0,$v1? 
???431823 subu $v1,$v0,$v1 
???afc30024? sw $v1,36($s8) 
?
Of course, the result is always 0.? Is this a bug or done by design because the compiler knows that the result should be stored in a 64-bit data type?? For the latter case I would expect an error message to be displayed instead.? Note that if I declare a as an unsigned long (64-bit) the compiler generates the correct multiplication instruction.
?
Is there a compiler option for 2.95.3 that can work around this issue?
?
Thanks.
?
Charlotte


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]