<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLVM does not generate correct code on arm"
   href="https://bugs.llvm.org/show_bug.cgi?id=34583">34583</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM does not generate correct code on arm
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yunlian@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19150" name="attach_19150" title="The pre-processed file.">attachment 19150</a> <a href="attachment.cgi?id=19150&action=edit" title="The pre-processed file.">[details]</a></span>
The pre-processed file.

We found a LLVM change makes one of our test fail.
<a href="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">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</a>

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;
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>