Skip to content

instcombine miscompilation #3967

@edwintorok

Description

@edwintorok
Bugzilla Link 3595
Resolution FIXED
Resolved on Nov 07, 2018 00:22
Version unspecified
OS Linux
Blocks llvm/llvm-bugzilla-archive#3596
Attachments bugpoint-passinput.bc, Testcase to reproduce problem, preprocessed testcase, bugpoint-tonotoptimize.bc, bugpoint-tooptimize.bc
CC @efriedma-quic,@nlewycky

Extended Description

Using SVN r64664 of clang to compile ClamAV, I get 1 error in 'make check' of ClamAV:

99%: Checks: 235, Failures: 1, Errors: 0
../../../clamav-devel/unit_tests/check_str.c:61:F:cli_unescape:test_unescape_hex:0: cli_unescape truncated
FAIL: check_clamav

Bugpoint has reduced this to be an instcombine bug.

Here's bugpoint's output:
*** Found miscompiling pass: -instcombine
Emitted bitcode to 'bugpoint-passinput.bc'

*** You can reproduce the problem with: opt bugpoint-passinput.bc -instcombine
Checking to see if the program is misoptimized when these functions are run through the pass: cli_unescape cli_hex2int output_utf8 main
Optimizing functions being tested: done.
Checking to see if the merged program executes correctly: yup.

*** The following functions are being miscompiled: cli_unescape cli_hex2int output_utf8 main
Extracted a loop from the breaking portion of the program.
Testing after loop extraction:
Optimizing functions being tested: done.
Checking to see if the merged program executes correctly: yup.
*** Loop extraction masked the problem. Undoing.
Checking to see if the program is misoptimized when all blocks are extracted.
Optimizing functions being tested: done.
Checking to see if the merged program executes correctly: yup.
Checking to see if the program is misoptimized when all but these 29 blocks are extracted: entry for.cond for.body if.then15 lor.lhs.false lor.lhs.false29 lor.lhs.false38 lor.lhs.false47 lor.lhs.false56 if.then65 ...
Optimizing functions being tested: done.
Checking to see if the merged program executes correctly: yup.
Outputting reduced bitcode files which expose the problem:
Non-optimized portion: Emitted bitcode to 'bugpoint-tonotoptimize.bc'
Portion that is input to optimizer: Emitted bitcode to 'bugpoint-tooptimize.bc'

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzilla

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions