[llvm-bugs] [Bug 44639] New: Optimization bug compiling for ARM v7a (32-bit)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 23 10:27:55 PST 2020


            Bug ID: 44639
           Summary: Optimization bug compiling for ARM v7a (32-bit)
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: brianp at dashlogic.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 23048
  --> https://bugs.llvm.org/attachment.cgi?id=23048&action=edit
Android Studio example project

My development environment is using Windows 10, Android Studio v3.5.3, Android
NDK v20.0.5594570, with Clang v8.0.7. This bug appears to only happen when
targeting armeabi-v7a for 32-bit Android, and not for arm64-v8a or any x86

While working with the pixman graphics library compiling for Android, we've
found a bug when optimizations are turned off using #pragma optimize off during
a release variant build of the app. The exact error message is:

[armeabi-v7a] Compile arm    : myappnative <= android.c
fatal error: error in backend: symbol '.LPC5_0' can not be undefined in a
subtraction expression

I've pulled some snippets of source out of the pixman library into an example
project that reproduces this error (attached).

In the attached example project, in the file android.c, the error happens on
line 144 and line 174, as follows (line 144 shown):

src_flags = narrow | op_flags[op].src;

If replaced with src_flags = 0, the error goes away. The error also gets
resolved if #pragma optimize is removed, or if compiled as a debug build.

I don't understand the LLVM/Clang code well enough to know for sure, but in
researching this bug I came across the following possibly related bugs:

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/20200123/24a277e1/attachment.html>

More information about the llvm-bugs mailing list