[llvm-bugs] [Bug 42955] New: Miscompilation when using -g, -fmodules and non-module headers

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Aug 10 09:08:15 PDT 2019


            Bug ID: 42955
           Summary: Miscompilation when using -g, -fmodules and non-module
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yshuiv7 at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

I have not idea what is causing this, but here is the code that triggers the


The clang command is in test.sh.

The miscompiled function is __list_insert_between, 

    new_->prev = prev;

is somehow compiled as

    new_->next = prev;

Doing either of these fixes the problem:

* Remove -g from clang command line
* Include "list.h" directly in x.c
* Remove the "triggers_the_bug" function

Tested on 8.0.1 and 9.0.0 r366556 (or git commit

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/20190810/5589e70d/attachment.html>

More information about the llvm-bugs mailing list