One example is 0xff000000, we can get it by

  mov r1, 255
  lsl r1, r1, 24

Gcc generates following code:

  ldr r1, .L2
  ...
.L2
  .word   -16777216


-- 
           Summary: shift a small constant to get larger one
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carrot at google dot com
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: arm-eabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40482

Reply via email to