From 481eb6ae8018d0478c23fda7c5f9f3fa4db8de89 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 14 Nov 2014 03:53:51 -0500 Subject: arm: Fixes based on UBSan and static analysis Another churn to clean up undefined behaviour, mostly ARM, but some parts also touching the generic part of the code base. Most of the fixes are simply ensuring that proper intialisation. One of the more subtle changes is the return type of the sign-extension, which is changed to uint64_t. This is to avoid shifting negative values (undefined behaviour) in the ISA code. --- src/cpu/minor/decode.cc | 3 ++- src/cpu/minor/fetch1.hh | 6 ------ src/cpu/minor/fetch2.cc | 3 ++- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/cpu/minor') diff --git a/src/cpu/minor/decode.cc b/src/cpu/minor/decode.cc index e380f0d2d..533ebd7d3 100644 --- a/src/cpu/minor/decode.cc +++ b/src/cpu/minor/decode.cc @@ -60,7 +60,8 @@ Decode::Decode(const std::string &name, inputBuffer(name + ".inputBuffer", "insts", params.decodeInputBufferSize), inputIndex(0), inMacroop(false), - execSeqNum(InstId::firstExecSeqNum) + execSeqNum(InstId::firstExecSeqNum), + blocked(false) { if (outputWidth < 1) fatal("%s: executeInputWidth must be >= 1 (%d)\n", name, outputWidth); diff --git a/src/cpu/minor/fetch1.hh b/src/cpu/minor/fetch1.hh index 45977b310..29e10def5 100644 --- a/src/cpu/minor/fetch1.hh +++ b/src/cpu/minor/fetch1.hh @@ -251,12 +251,6 @@ class Fetch1 : public Named * prediction sequence numbers. */ InstSeqNum predictionSeqNum; - /** The sequence number expected for the next returned cache line. The - * responses queue should be ordered and so, if the front of that queue - * has a lower lineSeqNum than this, lines need to be discarded. If it - * has a higher lineSeqNum, our line hasn't appeared yet */ - InstSeqNum expectedLineSeqNum; - /** Blocked indication for report */ bool blocked; diff --git a/src/cpu/minor/fetch2.cc b/src/cpu/minor/fetch2.cc index 4827b75fc..cb45f16e3 100644 --- a/src/cpu/minor/fetch2.cc +++ b/src/cpu/minor/fetch2.cc @@ -76,7 +76,8 @@ Fetch2::Fetch2(const std::string &name, lastStreamSeqNum(InstId::firstStreamSeqNum), fetchSeqNum(InstId::firstFetchSeqNum), expectedStreamSeqNum(InstId::firstStreamSeqNum), - predictionSeqNum(InstId::firstPredictionSeqNum) + predictionSeqNum(InstId::firstPredictionSeqNum), + blocked(false) { if (outputWidth < 1) fatal("%s: decodeInputWidth must be >= 1 (%d)\n", name, outputWidth); -- cgit v1.2.3