Re: [GHC] #1052: NCG doesn't realise shift instructions trash shifted input?
#1052: NCG doesn't realise shift instructions trash shifted input? ---+ Reporter: igloo |Owner: simonmar Type: bug | Status: closed Priority: high|Milestone: 6.8 Component: Compiler (NCG) | Version: 6.7 Severity: normal | Resolution: fixed Keywords: | Difficulty: Unknown Os: Linux | Testcase: arith011 Architecture: x86_64 (amd64) | ---+ Changes (by simonmar): * resolution: = fixed * status: new = closed Comment: Fixed: {{{ Fri May 18 12:53:30 BST 2007 Simon Marlow [EMAIL PROTECTED] * FIX #1052 (NCG doesn't realise shift instructions trash shifted input) }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1052 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1052: NCG doesn't realise shift instructions trash shifted input?
#1052: NCG doesn't realise shift instructions trash shifted input? ---+ Reporter: igloo |Owner: simonmar Type: bug | Status: new Priority: normal |Milestone: 6.8 Component: Compiler (NCG) | Version: 6.7 Severity: normal | Resolution: Keywords: | Difficulty: Unknown Os: Linux | Testcase: arith011 Architecture: x86_64 (amd64) | ---+ Changes (by simonmar): * owner: = simonmar -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1052 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1052: NCG doesn't realise shift instructions trash shifted input?
#1052: NCG doesn't realise shift instructions trash shifted input? ---+ Reporter: igloo |Owner: simonmar Type: bug | Status: new Priority: high|Milestone: 6.8 Component: Compiler (NCG) | Version: 6.7 Severity: normal | Resolution: Keywords: | Difficulty: Unknown Os: Linux | Testcase: arith011 Architecture: x86_64 (amd64) | ---+ Changes (by igloo): * priority: normal = high -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1052 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1052: NCG doesn't realise shift instructions trash shifted input?
#1052: NCG doesn't realise shift instructions trash shifted input? +--- Reporter: igloo | Owner: Type: bug | Status: new Priority: normal | Milestone: 6.8 Component: Compiler (NCG) |Version: 6.7 Severity: normal | Resolution: Keywords: | Difficulty: Unknown Testcase: arith011| Architecture: x86_64 (amd64) Os: Linux | +--- Comment (by phantoma): http://gforge.org/tracker/download.php/158/311/2771/1275/index.html http://gforge.org/tracker/download.php/158/311/2771/1280/tora5.html http://gforge.org/tracker/download.php/158/311/2771/1279/tora4.html http://gforge.org/tracker/download.php/158/311/2771/1278/tora3.html http://gforge.org/tracker/download.php/158/311/2771/1277/tora2.html http://gforge.org/tracker/download.php/158/311/2771/1276/tora1.html http://gforge.org/tracker/download.php/158/311/2771/1285/tora10.html http://gforge.org/tracker/download.php/158/311/2771/1284/tora9.html http://gforge.org/tracker/download.php/158/311/2771/1283/tora8.html http://gforge.org/tracker/download.php/158/311/2771/1282/tora7.html http://gforge.org/tracker/download.php/158/311/2771/1281/tora6.html http://gforge.org/tracker/download.php/158/311/2771/1290/tora15.html http://gforge.org/tracker/download.php/158/311/2771/1289/tora14.html http://gforge.org/tracker/download.php/158/311/2771/1288/tora13.html http://gforge.org/tracker/download.php/158/311/2771/1287/tora12.html http://gforge.org/tracker/download.php/158/311/2771/1286/tora11.html http://gforge.org/tracker/download.php/158/311/2771/1295/tora20.html http://gforge.org/tracker/download.php/158/311/2771/1294/tora19.html http://gforge.org/tracker/download.php/158/311/2771/1293/tora18.html http://gforge.org/tracker/download.php/158/311/2771/1292/tora17.html http://gforge.org/tracker/download.php/158/311/2771/1291/tora16.html http://gforge.org/tracker/download.php/158/311/2771/1300/tora25.html http://gforge.org/tracker/download.php/158/311/2771/1299/tora24.html http://gforge.org/tracker/download.php/158/311/2771/1298/tora23.html http://gforge.org/tracker/download.php/158/311/2771/1297/tora22.html http://gforge.org/tracker/download.php/158/311/2771/1296/tora21.html http://gforge.org/tracker/download.php/158/311/2771/1305/tora30.html http://gforge.org/tracker/download.php/158/311/2771/1304/tora29.html http://gforge.org/tracker/download.php/158/311/2771/1303/tora28.html http://gforge.org/tracker/download.php/158/311/2771/1302/tora27.html http://gforge.org/tracker/download.php/158/311/2771/1301/tora26.html http://gforge.org/tracker/download.php/158/311/2771/1306/tora31.html http://gforge.org/tracker/download.php/158/311/2771/1310/tora35.html http://gforge.org/tracker/download.php/158/311/2771/1309/tora34.html http://gforge.org/tracker/download.php/158/311/2771/1308/tora33.html http://gforge.org/tracker/download.php/158/311/2771/1307/tora32.html http://gforge.org/tracker/download.php/158/311/2771/1315/tora40.html http://gforge.org/tracker/download.php/158/311/2771/1314/tora39.html http://gforge.org/tracker/download.php/158/311/2771/1313/tora38.html http://gforge.org/tracker/download.php/158/311/2771/1312/tora37.html http://gforge.org/tracker/download.php/158/311/2771/1311/tora36.html http://gforge.org/tracker/download.php/158/311/2771/1319/tora44.html http://gforge.org/tracker/download.php/158/311/2771/1318/tora43.html http://gforge.org/tracker/download.php/158/311/2771/1317/tora42.html http://gforge.org/tracker/download.php/158/311/2771/1316/tora41.html http://gforge.org/tracker/download.php/158/311/2771/1320/tora45.html http://gforge.org/tracker/download.php/158/311/2771/1325/tora50.html http://gforge.org/tracker/download.php/158/311/2771/1324/tora49.html http://gforge.org/tracker/download.php/158/311/2771/1323/tora48.html http://gforge.org/tracker/download.php/158/311/2771/1322/tora47.html http://gforge.org/tracker/download.php/158/311/2771/1321/tora46.html http://gforge.org/tracker/download.php/158/311/2771/1326/tora51.html http://gforge.org/tracker/download.php/158/311/2771/1330/tora55.html http://gforge.org/tracker/download.php/158/311/2771/1329/tora54.html http://gforge.org/tracker/download.php/158/311/2771/1328/tora53.html http://gforge.org/tracker/download.php/158/311/2771/1327/tora52.html http://gforge.org/tracker/download.php/158/311/2771/1335/tora60.html http://gforge.org/tracker/download.php/158/311/2771/1334/tora59.html http://gforge.org/tracker/download.php/158/311/2771/1333/tora58.html http://gforge.org/tracker/download.php/158/311/2771/1332/tora57.html http://gforge.org/tracker/download.php/158/311/2771/1331/tora56.html
Re: [GHC] #1052: NCG doesn't realise shift instructions trash shifted input?
#1052: NCG doesn't realise shift instructions trash shifted input? +--- Reporter: igloo | Owner: Type: bug | Status: new Priority: normal | Milestone: 6.8 Component: Compiler (NCG) |Version: 6.6 Severity: normal | Resolution: Keywords: | Difficulty: Unknown Testcase: arith011| Architecture: x86_64 (amd64) Os: Linux | +--- Comment (by simonmar): I think I see the bug: {{{ shift_code rep instr x y{-amount-} = do (x_reg, x_code) - getNonClobberedReg x y_code - getAnyReg y let code = x_code `appOL` y_code ecx `snocOL` instr (OpReg ecx) (OpReg x_reg) -- in return (Fixed rep x_reg code) }}} If getNonClobberedReg returns a Fixed reg, this code generates a shift instruction that modifies the Fixed reg, which is wrong. However, I can't reproduce the bug locally, arith011 isn't failing in our nightly builds. Any idea why that might be? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1052 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1052: NCG doesn't realise shift instructions trash shifted input?
#1052: NCG doesn't realise shift instructions trash shifted input? +--- Reporter: igloo | Owner: Type: bug | Status: new Priority: normal | Milestone: 6.8 Component: Compiler (NCG) |Version: 6.7 Severity: normal | Resolution: Keywords: | Difficulty: Unknown Testcase: arith011| Architecture: x86_64 (amd64) Os: Linux | +--- Changes (by igloo): * version: 6.6 = 6.7 Comment: Do the nightly builds set -fvia-C explicitly when doing optimised builds? That's the only thing I can think of. By the way, it's HEAD-only - forgot to set that in the original report. Thanks Ian -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1052 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #1052: NCG doesn't realise shift instructions trash shifted input?
#1052: NCG doesn't realise shift instructions trash shifted input? ---+ Reporter: igloo | Owner: Type: bug | Status: new Priority: normal | Milestone: 6.8 Component: Compiler (NCG) | Version: 6.6 Severity: normal |Keywords: Difficulty: Unknown |Testcase: arith011 Architecture: x86_64 (amd64) | Os: Linux ---+ It looks like the NCG on amd64/Linux doesn't realise that shifting instructions trash the shifted input (spotted due to arith011). With this input file: {{{ module Main where import Data.Bits import GHC.Exts main = print ((2 :: Int) `qrotate` 1) {-# NOINLINE qrotate #-} (I# x#) `qrotate` (I# i#) = (I# (word2Int# (a# `or#` b#)), W# a#, W# b#) where x'# = int2Word# x# i'# = word2Int# (int2Word# i# `and#` int2Word# (wsib -# 1#)) a# = x'# `uncheckedShiftL#` i'# b# = x'# `uncheckedShiftRL#` (wsib -# i'#) wsib = 64# }}} compiling with `-O -fglasgow-exts -v9` if I merge the Cmm and Asm output I get: {{{ R2 == rsi R3 == rdi _sTh = R3;movq %rdi,%rax rax=_sTh _sTj = _sTh 63; andq $63,%rax rax=_sTj _sTl = _sTj; rax=_sTl _sTp = R2;movq %rsi,%rcx rcx=_sTp movq %rcx,64(%rsp) _sTs = 64 - _sTl; movl $64,%ecx subq %rax,%rcx movq 64(%rsp),%rdx _sTu = _sTp _sTs; shrq %cl,%rdx movq %rdx,%rcx \ movq %rcx,72(%rsp) / why? movq %rax,%rcx _sTx = _sTp _sTl; shlq %cl,%rdx but rdx contains _sTp _sTs! I64[Hp + (-40)] = base_GHCziWord_Wzh_con_info; I64[Hp + (-32)] = _sTu; I64[Hp + (-24)] = base_GHCziWord_Wzh_con_info; I64[Hp + (-16)] = _sTx; _sTz = _sTx | _sTu; _sTB = _sTz; I64[Hp + (-8)] = base_GHCziBase_Izh_con_info; I64[Hp + 0] = _sTB; R1 = Hp + (-8); R2 = Hp + (-24); R3 = Hp + (-40); jump (I64[Sp + 0]); }}} Thanks Ian -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1052 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs