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

--- Comment #12 from Uros Bizjak <ubizjak at gmail dot com> 2012-02-24 19:29:20 
UTC ---
(In reply to comment #11)

> I checked a similar fix into hjl/x32/addr32, hjl/x32/gcc-4_6-branch and
> hjl/x32/gcc-4_6-branch+mx32 branches. I also added "I" code to print
> constant address as positive 32bit integer for x32:

I think we can simply disable these two patterns on x32.

This is with disabled patterns:

0000000000000000 <x32_O3_main>:
   0:   b8 00 00 e0 fe          mov    $0xfee00000,%eax
   5:   8b 00                   mov    (%rax),%eax
   7:   a8 01                   test   $0x1,%al
   9:   74 01                   je     c <x32_O3_main+0xc>
   b:   90                      nop
   c:   b8 00 00 e0 fe          mov    $0xfee00000,%eax
  11:   8b 50 08                mov    0x8(%rax),%edx
  14:   89 50 04                mov    %edx,0x4(%rax)
  17:   c3                      retq   

and with enabled patterns:

0000000000000000 <x32_O3_main>:
   0:   a1 00 00 e0 fe 00 00    movabs 0xfee00000,%eax
   7:   00 00 
   9:   a8 01                   test   $0x1,%al
   b:   74 01                   je     e <x32_O3_main+0xe>
   d:   90                      nop
   e:   a1 08 00 e0 fe 00 00    movabs 0xfee00008,%eax
  15:   00 00 
  17:   a3 04 00 e0 fe 00 00    movabs %eax,0xfee00004
  1e:   00 00 
  20:   c3                      retq   

There is simply no need for movabs from/to mem, since there is no 64bit
addresses. And code size is horrible (and I bet that the former code runs
faster).

Reply via email to