[llvm-bugs] [Bug 45960] New: Clang generates improperly aligned code for aarch64, cortex-a53 for O2

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 17 11:30:33 PDT 2020


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

            Bug ID: 45960
           Summary: Clang generates improperly aligned code for aarch64,
                    cortex-a53 for O2
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jazzman40 at tamuraweb.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

Created attachment 23499
  --> https://bugs.llvm.org/attachment.cgi?id=23499&action=edit
Source code and generated code for O1 and O2 for test case

Using Clang 11.0.0
Cross compile on macOS Catalina 10.15.4 to Arm cortex-A53 (Raspberry Pi 3)


Clang generates incorrect code for Optimization level 2 (-O2). Same source code
works for -O1. The problem is in the optimization. It tries to optimize string
handling by using halfword and word instructions, but on a character buffer,
the data can be unaligned on the proper boundary, and thus a data exception is
raised at run time.

-- 
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/20200517/785f26a9/attachment.html>


More information about the llvm-bugs mailing list