summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorJason Lowe-Power <jason@lowepower.com>2018-08-02 18:07:51 -0700
committerJason Lowe-Power <jason@lowepower.com>2018-08-21 14:41:29 +0000
commit4fdfd98230e780aeb068e3740742c7bff28fb859 (patch)
tree0018e9ab0ecdaccd83a9e9acf3cfe70b275578c6 /src/arch/x86
parent05f92d9760f21ace8c6635d95f7c8f5e5078eb2d (diff)
downloadgem5-4fdfd98230e780aeb068e3740742c7bff28fb859.tar.xz
misc: Appease GCC 8
GCC 8 adds a number of new warnings to -Wall which generate errors. - Fix memset to 0 for structs by adding casts. - Fix cast with const when the const was ignored. - Fix catch a polymorphic type by value We now compile with GCC 8! Change-Id: Iab70ce11190eee67608fc25c0bedff170152b153 Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/11949 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/decoder.hh2
-rw-r--r--src/arch/x86/types.hh4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/arch/x86/decoder.hh b/src/arch/x86/decoder.hh
index 3630ea8c8..c0b30b5e8 100644
--- a/src/arch/x86/decoder.hh
+++ b/src/arch/x86/decoder.hh
@@ -239,7 +239,7 @@ class Decoder
outOfBytes(true), instDone(false),
state(ResetState)
{
- memset(&emi, 0, sizeof(emi));
+ emi.reset();
mode = LongMode;
submode = SixtyFourBitMode;
emi.mode.mode = mode;
diff --git a/src/arch/x86/types.hh b/src/arch/x86/types.hh
index 6e1b1cf2f..f2b064650 100644
--- a/src/arch/x86/types.hh
+++ b/src/arch/x86/types.hh
@@ -199,6 +199,10 @@ namespace X86ISA
//The intermediate structure used by the x86 decoder.
struct ExtMachInst
{
+ void reset() {
+ memset(static_cast<void *>(this), 0, sizeof(*this));
+ }
+
//Prefixes
LegacyPrefixVector legacy;
Rex rex;