While I'm waiting for legion to run make m5 compile with a few more compilers

SConstruct:
src/SConscript:
    Add flags for Intel CC while i'm at it
src/base/compiler.hh:
    the _Pragma stuff needst to be called this way unless someone happens to have a cleaner way
src/base/cprintf_formats.hh:
    add std:: where appropriate
src/base/statistics.hh:
    use this->map since icc was getting confused about std::map vs the locally defined map
src/cpu/static_inst.hh:
    Add some more dummy returns where needed
src/mem/packet.hh:
    add more dummy returns where needed
src/sim/host.hh:
    use limits to come up with max tick

--HG--
extra : convert_revision : 08e9f7898b29fb9d063136529afb9b6abceab60c
This commit is contained in:
Ali Saidi 2007-01-27 15:38:04 -05:00
parent 5c7bf74c07
commit 02bd40d552
8 changed files with 36 additions and 18 deletions

View file

@ -209,14 +209,18 @@ if False:
env.Append(ENV = { 'M5_PLY' : Dir('ext/ply') })
env['GCC'] = False
env['SUNCC'] = False
env['ICC'] = False
env['GCC'] = subprocess.Popen(env['CXX'] + ' --version', shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
close_fds=True).communicate()[0].find('GCC') >= 0
env['SUNCC'] = subprocess.Popen(env['CXX'] + ' -V', shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
close_fds=True).communicate()[0].find('Sun C++') >= 0
if (env['GCC'] and env['SUNCC']):
print 'Error: How can we have both g++ and Sun C++ at the same time?'
env['ICC'] = subprocess.Popen(env['CXX'] + ' -V', shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
close_fds=True).communicate()[0].find('Intel') >= 0
if env['GCC'] + env['SUNCC'] env['ICC'] > 1:
print 'Error: How can we have two at the same time?'
Exit(1)
@ -225,6 +229,8 @@ if env['GCC']:
env.Append(CCFLAGS='-pipe')
env.Append(CCFLAGS='-fno-strict-aliasing')
env.Append(CCFLAGS=Split('-Wall -Wno-sign-compare -Werror -Wundef'))
elif env['ICC']:
pass #Fix me... add warning flags once we clean up icc warnings
elif env['SUNCC']:
env.Append(CCFLAGS='-Qoption ccfe')
env.Append(CCFLAGS='-features=gcc')
@ -234,7 +240,7 @@ elif env['SUNCC']:
# env.Append(CCFLAGS='-instances=semiexplicit')
else:
print 'Error: Don\'t know what compiler options to use for your compiler.'
print ' Please fix SConstruct and try again.'
print ' Please fix SConstruct and src/SConscript and try again.'
Exit(1)
if sys.platform == 'cygwin':

View file

@ -325,6 +325,11 @@ elif env['SUNCC']:
ccflags['opt'] = '-g -O'
ccflags['fast'] = '-fast'
ccflags['prof'] = '-fast -g -pg'
elif env['ICC']:
ccflags['debug'] = '-g -O0'
ccflags['opt'] = '-g -O'
ccflags['fast'] = '-xW -O3 -ipo -no-prec-div -static'
ccflags['prof'] = '-fast -g -pg'
else:
print 'Unknown compiler, please fix compiler options'
Exit(1)

View file

@ -44,7 +44,8 @@
// this doesn't do anything with sun cc, but why not
#define M5_ATTR_NORETURN __sun_attr__((__noreturn__))
#define M5_DUMMY_RETURN return (0);
#define M5_PRAGMA_NORETURN(x) _Pragma("does_not_return(x)")
#define DO_PRAGMA(x) _Pragma(#x)
#define M5_PRAGMA_NORETURN(x) DO_PRAGMA(does_not_return(x))
#else
#error "Need to define compiler options in base/compiler.hh"
#endif

View file

@ -84,21 +84,21 @@ _format_integer(std::ostream &out, const T &data, Format &fmt)
switch (fmt.base) {
case Format::hex:
out.setf(ios::hex, ios::basefield);
out.setf(std::ios::hex, std::ios::basefield);
break;
case Format::oct:
out.setf(ios::oct, ios::basefield);
out.setf(std::ios::oct, std::ios::basefield);
break;
case Format::dec:
out.setf(ios::dec, ios::basefield);
out.setf(std::ios::dec, std::ios::basefield);
break;
}
if (fmt.alternate_form) {
if (!fmt.fill_zero)
out.setf(ios::showbase);
out.setf(std::ios::showbase);
else {
switch (fmt.base) {
case Format::hex:
@ -122,13 +122,13 @@ _format_integer(std::ostream &out, const T &data, Format &fmt)
out.width(fmt.width);
if (fmt.flush_left && !fmt.fill_zero)
out.setf(ios::left);
out.setf(std::ios::left);
if (fmt.print_sign)
out.setf(ios::showpos);
out.setf(std::ios::showpos);
if (fmt.uppercase)
out.setf(ios::uppercase);
out.setf(std::ios::uppercase);
out << data;
}
@ -148,7 +148,7 @@ _format_float(std::ostream &out, const T &data, Format &fmt)
if (fmt.precision == 0)
fmt.precision = 1;
else
out.setf(ios::scientific);
out.setf(std::ios::scientific);
out.precision(fmt.precision);
} else
@ -156,7 +156,7 @@ _format_float(std::ostream &out, const T &data, Format &fmt)
out.width(fmt.width);
if (fmt.uppercase)
out.setf(ios::uppercase);
out.setf(std::ios::uppercase);
break;
case Format::fixed:
@ -164,7 +164,7 @@ _format_float(std::ostream &out, const T &data, Format &fmt)
if (fmt.width > 0)
out.width(fmt.width);
out.setf(ios::fixed);
out.setf(std::ios::fixed);
out.precision(fmt.precision);
} else
if (fmt.width > 0)
@ -216,7 +216,7 @@ _format_string(std::ostream &out, const T &data, Format &fmt)
if (fmt.width > 0)
out.width(fmt.width);
if (fmt.flush_left)
out.setf(ios::left);
out.setf(std::ios::left);
out << data;
#endif

View file

@ -398,7 +398,7 @@ class Wrap : public Child
public:
Wrap()
{
map(new Data<Child>(*this));
this->map(new Data<Child>(*this));
}
/**

View file

@ -379,6 +379,7 @@ class StaticInst : public StaticInstBase
{
panic("StaticInst::branchTarget() called on instruction "
"that is not a PC-relative branch.");
M5_DUMMY_RETURN
}
/**
@ -393,6 +394,7 @@ class StaticInst : public StaticInstBase
panic("StaticInst::branchTarget() called on instruction "
"that is not an indirect branch.");
}
M5_DUMMY_RETURN
/**
* Return true if the instruction is a control transfer, and if so,

View file

@ -41,10 +41,12 @@
#include <cassert>
#include <list>
#include "base/misc.hh"
#include "mem/request.hh"
#include "sim/host.hh"
#include "sim/root.hh"
struct Packet;
typedef Packet *PacketPtr;
typedef uint8_t* PacketDataPtr;
@ -238,7 +240,7 @@ class Packet
bool isNoAllocate() const { return (flags & NO_ALLOCATE) != 0; }
bool isCompressed() const { return (flags & COMPRESSED) != 0; }
bool nic_pkt() { assert("Unimplemented\n" && 0); return false; }
bool nic_pkt() { panic("Unimplemented"); M5_DUMMY_RETURN }
/** Possible results of a packet's request. */
enum Result

View file

@ -38,6 +38,8 @@
#define __HOST_HH__
#include <inttypes.h>
#include <limits>
/** uint64_t constant */
#define ULL(N) ((uint64_t)N##ULL)
@ -56,7 +58,7 @@ typedef int64_t Counter;
*/
typedef int64_t Tick;
const Tick MaxTick = (1LL << 63) - 1;
const Tick MaxTick = std::numeric_limits<Tick>::max();
/**
* Address type