[llvm-bugs] [Bug 47387] New: libcall simplification invents calls to puts even under -fno-builtin-puts

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 1 11:46:31 PDT 2020


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

            Bug ID: 47387
           Summary: libcall simplification invents calls to puts even
                    under -fno-builtin-puts
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: llvm-bugs at lists.llvm.org

Testcase: https://godbolt.org/z/sTr3xa

#include <stdio.h>

int puts(const char *s) {
    printf("%s\n", s);
    return strlen(s);
}

With -fno-builtin-puts, the call to printf is replaced by a call to puts, which
seems incorrect. We shouldn't assume we know what 'puts' does under
-fno-builtin-puts.

-- 
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/20200901/4b20ff82/attachment.html>


More information about the llvm-bugs mailing list