[llvm-bugs] [Bug 34583] New: LLVM does not generate correct code on arm

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 12 14:22:53 PDT 2017


            Bug ID: 34583
           Summary: LLVM does not generate correct code on arm
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: yunlian at chromium.org
                CC: llvm-bugs at lists.llvm.org

Created attachment 19150
  --> https://bugs.llvm.org/attachment.cgi?id=19150&action=edit
The pre-processed file.

We found a LLVM change makes one of our test fail.

The mis-compiled function is show below. If I remove the assertions at the
beginning of this function, the test passes.

I put the pre-processed code in the attachment.
The command line to compile the code is
/usr/bin/clang --sysroot=/build/kevin -Qunused-arguments -grecord-gcc-switches
-fstack-protector-strong -pie -fno-omit-frame-pointer -D_FORTIFY_SOURCE=2
-mthumb -c -MD -MF bsdrm/src/egl.pic.d -O2 -O2 -pipe -march=armv8-a+crc
-mtune=cortex-a57.cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -g
-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables
-I/build/kevin/usr/include/libdrm -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
-Wall -Werror -fno-strict-aliasing -Wformat=2 -fstack-protector-strong
-fvisibility=internal -ggdb3 -Wa,--noexecstack -O2 -std=gnu99
-I/build/kevin/usr/include/libdrm -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
-B/usr/libexec/gcc/armv7a-cros-linux-gnueabi -target
armv7a-cros-linux-gnueabihf -mfloat-abi=hard 

EGLImageKHR bs_egl_image_create_gbm(struct bs_egl *self, struct gbm_bo *bo)

        int fds[GBM_MAX_PLANES];

        EGLint khr_image_attrs[37] ={12375, 2400, 12374, 1600, 12913,
875713112, 0};

        initStruct(self, bo, fds,  khr_image_attrs);

        size_t attrs_index = 6;
        for (size_t plane = 0; plane < gbm_bo_get_num_planes(bo) ;  plane++) {
                khr_image_attrs[attrs_index++] = EGL_DMA_BUF_PLANE0_FD_EXT +
plane * 3;
                khr_image_attrs[attrs_index++] = fds[plane];
                khr_image_attrs[attrs_index++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT
+ plane * 3;
                khr_image_attrs[attrs_index++] = gbm_bo_get_plane_offset(bo,
                khr_image_attrs[attrs_index++] = EGL_DMA_BUF_PLANE0_PITCH_EXT +
plane * 3;
                khr_image_attrs[attrs_index++] = gbm_bo_get_plane_stride(bo,
                if (self->use_dma_buf_import_modifiers) {
                        const uint64_t modifier =
                        khr_image_attrs[attrs_index++] =
                            EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT + plane * 2;
                        khr_image_attrs[attrs_index++] = modifier &
                        khr_image_attrs[attrs_index++] =
                            EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT + plane * 2;
                        khr_image_attrs[attrs_index++] = modifier >> 32;

        khr_image_attrs[attrs_index++] = EGL_NONE;

        EGLImageKHR image =
            self->CreateImageKHR(self->display, EGL_NO_CONTEXT,
                                 NULL /* no client buffer */, khr_image_attrs);

        return image;

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/20170912/570f30bd/attachment.html>

More information about the llvm-bugs mailing list