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



             Bug #: 56338

           Summary: register spill caused by loading constant

    Classification: Unclassified

           Product: gcc

           Version: unknown

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: other

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: nel...@seznam.cz





Consider attached code(smaller testcase has same bug but do not manifest by

spilling). 



gcc-4.7 -O3 spills rbp and rbx. 

  pushq %rbp

  .cfi_def_cfa_offset 16

  .cfi_offset 6, -16

  pxor  %xmm5, %xmm5

  movl  $63, %r10d

  movabsq $-9223372036854775808, %r11

  pushq %rbx

  .cfi_def_cfa_offset 24

  .cfi_offset 3, -24

  movl  $64, %ebx



Only use of rbx is this in loop below.: 

  movq  %rbx, %rdx



Same thing happens with 63 moved to r10d and used to initialize other register.

Reply via email to