#3182: Bad code generated with -fregs-graph
---------------------------------+------------------------------------------
Reporter: igloo | Owner: nobody
Type: bug | Status: new
Priority: normal | Milestone: 6.12.1
Component: Compiler (NCG) | Version: 6.11
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Changes (by benl):
* status: assigned => new
* owner: benl => nobody
Comment:
This is actually a bug in the x86_64 native code generator:
Compiling libraries/base/GHC/Float.lhs..
-ddump-opt-cmm
{{{
GHC.Float.$wlogBase_entry()
...
(_s4aK::F64,) = foreign "ccall"
MO_F64_Log((_c74u::F64,))[_unsafe_call_];
D1 = %MO_F_Quot_W64(_s4aJ::F64, _s4aK::F64);
jump I64[Sp] ();
}}}
-ddump-asm-liveness
{{{
GHC.Float.$wlogBase_entry()
...
call log
...
movss %xmm0,%vD_s4aK
# born: %vD_s4aK
# r_dying: %r16
movsd %vD_s4aJ,%xmm5
# r_dying: %vD_s4aJ
divsd %vD_s4aK,%xmm5
# r_dying: %vD_s4aK
jmp *(%rbp)
}}}
The result of the divsd instruction, %vD_s4aK hasn't been assigned
anywhere particular. The linear allocator happens to put it in %xmm0, so
it works. The graph allocator happens to put it in %xmm7, so it doesn't.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3182#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs