OK, so I agree that the else clause is looking superfluous and with
the comment "probably written by ..." then it definitely has no place.

So if the compiler warning is caused by writing past the out of bounds
value then the fix would be to just delete the else clause since
inside of the original if condition it seems that shadow sets have
been taken care of.

As for MIPS regressions, I am wondering about those myself since no
doubt this has been tested with more than a "hello world" app and the
work left off with MIPS close to booting Linux.

On Wed, Sep 24, 2008 at 9:35 AM, nathan binkert <[EMAIL PROTECTED]> wrote:
> I'm trying to get rid of lots of compiler warnings so that things work
> properly with gcc 4.3 and I encountered something that's a bug.
>
> In src/arch/mips/int_regfile.cc
>
> The functions readReg and setReg both check to make sure that "intReg
> < NumIntRegs" and do something special if it is.  The confusion I have
> comes from the fact that there is an else clause at all.  The else
> clause in the setReg case goes ahead and writes a value beyond the end
> of the array if the condition is false.
>
> So, either the code is just totally extra and can be deleted, or the
> size of the reg array is wrong and it needs to be fixed.  I'm
> wondering if it's the latter case, because there's a comment in
> readReg that says
> "        // Read from shadow GPR .. probably called by RDPGPR"
>
> Looking in decoder.isa for that instruction seems to indicate that the
> system can indeed access registers > NumIntRegs.
>
> Is it possible that we're multiplying by the wrong number in rdpgpr
> and wrpgpr? Should we be multiplying by NumIntArchRegs, not
> NumIntRegs?
>
> So, the question is, what's the right fix?  If we don't arrive at a
> solution, I guess I could just remove the code and add an assertion if
> the condition is false.
>
>  Nate
> _______________________________________________
> m5-dev mailing list
> m5-dev@m5sim.org
> http://m5sim.org/mailman/listinfo/m5-dev
>



-- 
----------
Korey L Sewell
Graduate Student - PhD Candidate
Computer Science & Engineering
University of Michigan
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to