From: Jayneel Gandhi Date: Thu, 7 Jun 2012 13:11:00 +0000 (-0500) Subject: X86 TLB: Fix for gcc 4.4.3 X-Git-Tag: stable_2012_06_28~11 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7183c3fd56c4f0e8e4137795bb91dcaff312f591;p=gem5.git X86 TLB: Fix for gcc 4.4.3 Due to recent changes to X86 TLB, gem5 stopped compiling on gcc version 4.4.3. This patch provides the fix for that problem. The patch is tested on gcc 4.4.3. The change is not required for more recent versions of gcc (like on 4.6.3). --- diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc index 4923752ef..623e1871d 100644 --- a/src/arch/x86/tlb.cc +++ b/src/arch/x86/tlb.cc @@ -270,7 +270,8 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation, Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg)); Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg)); bool sizeOverride = (flags & (AddrSizeFlagBit << FlagShift)); - int logSize = sizeOverride ? m5Reg.altAddr : m5Reg.defAddr; + unsigned logSize = sizeOverride ? (unsigned)m5Reg.altAddr + : (unsigned)m5Reg.defAddr; int size = (1 << logSize) * 8; Addr offset = bits(vaddr - base, size - 1, 0); Addr endOffset = offset + req->getSize() - 1;