[LLVMbugs] Miscompilation of 2003-05-26-Shorts.c on Sparc

Vikram S. Adve vadve at cs.uiuc.edu
Wed Oct 22 12:50:04 PDT 2003


Ok, I think all of our systems are fine.  Lli and llc produce identical
(and correct) outputs.  CBE produces a different output but that was
also compiled with the same native compiler (gcc).

--Vikram
http://www.cs.uiuc.edu/~vadve


> -----Original Message-----
> From: llvmbugs-admin at cs.uiuc.edu 
> [mailto:llvmbugs-admin at cs.uiuc.edu] On Behalf Of Chris Lattner
> Sent: Wednesday, October 22, 2003 1:26 PM
> To: Vikram S. Adve
> Cc: LLVMbugs list
> Subject: RE: [LLVMbugs] Miscompilation of 2003-05-26-Shorts.c on Sparc
> 
> 
> On Wed, 22 Oct 2003, Vikram S. Adve wrote:
> 
> > Here are the outputs that get generated.  As I said I 
> assumed bugpoint
> > wouldn't help so I didn't investigate beyond that:
> > 
> tank:/localhome/vadve/llvm/test/Programs/SingleSource/UnitTest
> s/2003-05-
> > 26-Shorts.out-*
> 
> It looks like a bug in the native compiler.  This appears to 
> be completely
> portable:
> unsigned long long getL() {
>   return 0xafafafafc5c5b8a3ull;
> }
> ...
>   unsigned long long  UL = getL();
>   unsigned short us = (unsigned short) UL;
>   printf("UL-us = %lld (0x%llx)\n", UL-us, UL-us);
> ...
> 
> The native compiler you are using prints zero for the result of the
> subtraction, instead of 0xafafafafc5c50000, like it should.
> 
> -Chris
> 
> -- 
> http://llvm.cs.uiuc.edu/
> http://www.nondot.org/~sabre/Projects/
> 
> _______________________________________________
> LLVMbugs mailing list
> LLVMbugs at cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmbugs
> 




More information about the llvm-bugs mailing list