[llvm-bugs] [Bug 42783] New: Add a way to avoid calls to noreturn functions from being merged

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 26 10:08:49 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42783

            Bug ID: 42783
           Summary: Add a way to avoid calls to noreturn functions from
                    being merged
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jmuizelaar at mozilla.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Given the following code it would be nice if there was a way to ensure that
each of the callsites to crash() remained unique so that it's possible to
distinguish which callsite is triggering a particular crash().

void crash() __attribute__((noreturn));


void f(int i) {
    if (i == 5) {
        crash();
    }
    else if (i == 7) {
        crash();
    }
    crash();
}

Today this just gets compiled to:

f(int):                                  # @f(int)
        pushq   %rax
        callq   crash()

-- 
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/20190726/3da35b04/attachment.html>


More information about the llvm-bugs mailing list