From 717b1c973636333440d908fd6caa7111b8ccc285 Mon Sep 17 00:00:00 2001 From: Yang Chen Date: Wed, 4 May 2011 14:16:27 -0600 Subject: [PATCH] Fixed a bug related to --no-math64 and --no-longlong --- runtime/csmith.h | 2 +- src/OutputMgr.cpp | 6 +++--- src/Probabilities.cpp | 4 ++++ src/Type.cpp | 6 ++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/runtime/csmith.h b/runtime/csmith.h index 3ded75273..f1334a37b 100644 --- a/runtime/csmith.h +++ b/runtime/csmith.h @@ -87,7 +87,7 @@ transparent_crc (uint32_t val, char* vname, int flag) { crc32_8bytes(val); if (flag) { - printf("...checksum after hashing %s : %X\n", vname, crc32_context ^ 0xFFFFFFFFUL); + printf("...checksum after hashing %s : %X\n", vname, crc32_context ^ 0xFFFFFFFFU); } } #else diff --git a/src/OutputMgr.cpp b/src/OutputMgr.cpp index 05b7797ce..09c5b49ff 100644 --- a/src/OutputMgr.cpp +++ b/src/OutputMgr.cpp @@ -391,9 +391,9 @@ OutputMgr::OutputHeader(int argc, char *argv[], unsigned long seed) if (!CGOptions::longlong()) { out << endl; - out << "#ifndef __x86_64__" << std::endl; + //out << "#ifndef __x86_64__" << std::endl; out << "#define NO_LONGLONG" << std::endl; - out << "#endif" << std::endl; + //out << "#endif" << std::endl; out << endl; } @@ -417,7 +417,7 @@ OutputMgr::OutputHeader(int argc, char *argv[], unsigned long seed) } out << endl; - out << "long __undefined;" << endl; + out << "int32_t __undefined;" << endl; out << endl; if (CGOptions::depth_protect()) { diff --git a/src/Probabilities.cpp b/src/Probabilities.cpp index e346d92ff..3e877da85 100644 --- a/src/Probabilities.cpp +++ b/src/Probabilities.cpp @@ -650,6 +650,10 @@ Probabilities::set_default_simple_types_prob() else { SET_SINGLE_NAME("long_long_prob", LongLong, 0); SET_SINGLE_NAME("ulong_long_prob", ULongLong, 0); + if (CGOptions::x86_64()) { + SET_SINGLE_NAME("long_long_prob", Long, 0); + SET_SINGLE_NAME("ulong_long_prob", ULong, 0); + } } set_group_prob(true, pSimpleTypesProb, m); diff --git a/src/Type.cpp b/src/Type.cpp index 735254727..fc4945119 100644 --- a/src/Type.cpp +++ b/src/Type.cpp @@ -1043,9 +1043,11 @@ Type::GenerateSimpleTypes(void) unsigned int st; for (st=eChar; st