[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


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

            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.
https://bugs.chromium.org/p/chromium/issues/detail?id=758878&q=owner%3Ame&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

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/tmp/portage/chromeos-base/drm-tests-0.0.1-r100/work/drm-tests-0.0.1/bsdrm/include
-I/build/kevin/usr/include/libdrm -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
-DUSE_ATOMIC_API -D_FORTIFY_SOURCE=2 -fPIC -o a.e test.i
-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)
{
        assert(self);
        assert(self->CreateImageKHR);

        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,
plane);
                khr_image_attrs[attrs_index++] = EGL_DMA_BUF_PLANE0_PITCH_EXT +
plane * 3;
                khr_image_attrs[attrs_index++] = gbm_bo_get_plane_stride(bo,
plane);
                if (self->use_dma_buf_import_modifiers) {
                        const uint64_t modifier =
gbm_bo_get_format_modifier(bo);
                        khr_image_attrs[attrs_index++] =
                            EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT + plane * 2;
                        khr_image_attrs[attrs_index++] = modifier &
0xfffffffful;
                        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,
EGL_LINUX_DMA_BUF_EXT,
                                 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