ARM assembler: fix undefined behaviour in fits_shifter
authorhans <hans@chromium.org>
Wed, 4 Mar 2015 03:13:30 +0000 (19:13 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 4 Mar 2015 03:13:40 +0000 (03:13 +0000)
commit721fdb56e0fc92c662c7d8b42be8a1d689c3b535
tree086a23c872cb846ae5162cb30652534e6652bf6a
parent3709b9254e9d054796f6735b0f5cefed65ce69d3
ARM assembler: fix undefined behaviour in fits_shifter

Bit-shifts have undefined behaviour if the shift amount is greater
or equal to the width of the type.

In this case the code would do imm32 >> 32 when rot == 0.

A newer version of Clang unrolled the loop, optimized the first
iteration away, causing the test suite to fail with:

  #
  # Fatal error in ../src/arm/assembler-arm.cc, line 1212
  # Check failed: !rn.is(ip).
  #

as well as crashing when running Chromium tests on Android (at least
we think this was the cause, see the bug).

BUG=463436, 444089
LOG=Y

Review URL: https://codereview.chromium.org/979633002

Cr-Commit-Position: refs/heads/master@{#26974}
src/arm/assembler-arm.cc