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

            Bug ID: 40063
           Summary: memcmp with constant string arguments produces wrong
                    result
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: br...@clisp.org
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

Created attachment 21244
  --> https://bugs.llvm.org/attachment.cgi?id=21244&action=edit
Test case

A memcmp() call with constant arguments is apparently inlined by clang and
produces a wrong result.

How to reproduce:
$ cc foo.c
$ nm a.out | grep memcmp
$ ./a.out
Expected output: A negative number.
Actual output: 1

OS: FreeBSD 12.0 on x86_64

clang version:
$ cc --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM
6.0.1)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to