powerpc32: fix 64-bit comparison (#16465)
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 20 Mar 2019 22:40:28 +0000 (22:40 +0000)
committerBen Gamari <ben@smart-cactus.org>
Mon, 24 Jun 2019 22:35:12 +0000 (18:35 -0400)
On powerpc32 64-bit comparison code generated dangling
target labels. This caused ghc build failure as:

    $ ./configure --target=powerpc-unknown-linux-gnu && make
    ...
    SCCs aren't in reverse dependent order
    bad blockId n3U

This happened because condIntCode' in PPC codegen generated
label name but did not place the label into `cmp_lo` code block.

The change adds the `cmp_lo` label into the case of negative
comparison.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
(cherry picked from commit 973077ac63c79988f2d5f25d13b60dce82f9e8dd)

compiler/nativeGen/PPC/CodeGen.hs

index 516a49a..4835aca 100644 (file)
@@ -943,6 +943,7 @@ condIntCode' True cond W64 x y
                  , BCC LE cmp_lo Nothing
                  , CMPL II32 x_lo (RIReg y_lo)
                  , BCC ALWAYS end_lbl Nothing
+                 , NEWBLOCK cmp_lo
                  , CMPL II32 y_lo (RIReg x_lo)
                  , BCC ALWAYS end_lbl Nothing