[LLVMbugs] [Bug 21903] New: Bad machine code: MBB exits via unconditional fall-through but its successor differs from its CFG successor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 12 17:43:43 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21903

            Bug ID: 21903
           Summary: Bad machine code: MBB exits via unconditional
                    fall-through but its successor differs from its CFG
                    successor
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dimitry at andric.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13534
  --> http://llvm.org/bugs/attachment.cgi?id=13534&action=edit
Test case, minimized from Inkscape's geom.cpp

I received a report from the maintainer of the FreeBSD inkscape port, about
clang giving a lot of "Bad machine code" messages when compiling a certain
source file in this program:

http://beefy1.isc.freebsd.org/data/head-i386-default/2014-12-12_10h09m09s/logs/inkscape-0.48.5_1.log

The errors are as follows:

*** Bad machine code: MBB exits via conditional branch/fall-through but the CFG
successors don't match the actual successors! ***
- function:    _ZN4Geom23line_segment_intersectpERKNS_5PointES2_S2_S2_
- basic block: BB#6 if.end3 (0x2d17a3f0)

*** Bad machine code: MBB exits via unconditional fall-through but its
successor differs from its CFG successor! ***
- function:    _ZN4Geom23line_segment_intersectpERKNS_5PointES2_S2_S2_
- basic block: BB#18 (null) (0x2d29287c)

*** Bad machine code: MBB exits via unconditional fall-through but its
successor differs from its CFG successor! ***
- function:    _ZN4Geom23line_segment_intersectpERKNS_5PointES2_S2_S2_
- basic block: BB#19 (null) (0x2d2928d8)

*** Bad machine code: MBB exits via conditional branch/fall-through but the CFG
successors don't match the actual successors! ***
- function:    _ZN4Geom23line_segment_intersectpERKNS_5PointES2_S2_S2_
- basic block: BB#9 if.end.i34 (0x2d1d3e38)

*** Bad machine code: Using an undefined physical register ***
- function:    _ZN4Geom23line_segment_intersectpERKNS_5PointES2_S2_S2_
- basic block: BB#10 if.else.i43 (0x2d17a4a8)
- instruction: FNSTSW16r %AX<imp-def>, %FPSW<imp-use,kill>
- operand 1:   %FPSW<imp-use,kill>

This crash occurs both with clang 3.4.1 (current in FreeBSD 9.x through 11.x),
and 3.5.0 (which is coming up in FreeBSD 11.x).  When I tried with clang trunk
r223525, it spun at 100% CPU, until I killed it after 10 minutes or so (but it
didn't use a lot of memory).

I have reduced the test case to the attached file, which can be compiled with:

clang -cc1 -triple i386-unknown-linux -S -mrelocation-model static -target-cpu
i486 -O2 inkscape-geom-reduced.cpp

resulting in:

*** Bad machine code: MBB exits via unconditional fall-through but its
successor differs from its CFG successor! ***
- function:    _ZN4Geom23line_segment_intersectpERKNS_5PointES2_S2_S2_
- basic block: BB#9 (null) (0x2add140c)

*** Bad machine code: MBB exits via conditional branch/fall-through but the CFG
successors don't match the actual successors! ***
- function:    _ZN4Geom23line_segment_intersectpERKNS_5PointES2_S2_S2_
- basic block: BB#2 if.end.i (0x2add7488)

*** Bad machine code: Using an undefined physical register ***
- function:    _ZN4Geom23line_segment_intersectpERKNS_5PointES2_S2_S2_
- basic block: BB#3 if.end10.i (0x2adb7334)
- instruction: FNSTSW16r %AX<imp-def>, %FPSW<imp-use>
- operand 1:   %FPSW<imp-use>
fatal error: error in backend: Found 3 machine code errors.

These errors show for -target-cpu values of i486, i586 and i686, but as far as
I can determine, they disappear when using pentium2 or 'higher'.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141213/73871244/attachment.html>


More information about the llvm-bugs mailing list