This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25542] New: Trivial code miscompilation on 32-bit Sparc
- From: "sabre at nondot dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Dec 2005 07:24:44 -0000
- Subject: [Bug c/25542] New: Trivial code miscompilation on 32-bit Sparc
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
extern int printf(const char *, ...);
void testL(long long Arg) {
printf("%lld\n", Arg / (1LL << 4));
}
int main() {
unsigned long B53 = - (1LL << 53);
testL(B53 + 65);
return 0;
}
GCC 3.4.2 miscompiles this when compiling with -m32 on Sparc. It should print
4, instead it prints -562949953421307. :(
-Chris
--
Summary: Trivial code miscompilation on 32-bit Sparc
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sabre at nondot dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25542