This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFT/RFA] Fix AIX fallout from PR/19653 patch


	Geoff's proposed patch works for me.  Even a more limited patch
works: 

*** rs6000.c    (revision 112731)
--- rs6000.c    (working copy)
*************** rs6000_legitimize_reload_address (rtx x,
*** 3446,3455 ****
      }
  
    if (TARGET_TOC
        && constant_pool_expr_p (x)
        && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (x), mode))
      {
        (x) = create_TOC_reference (x);
        *win = 1;
        return x;
      }
--- 3446,3456 ----
      }
  
    if (TARGET_TOC
+       && GET_CODE (x) == SYMBOL_REF
        && constant_pool_expr_p (x)
        && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (x), mode))
      {
        (x) = create_TOC_reference (x);
        *win = 1;
        return x;
      }

However, the the code generated for the testcase now is worse than before
the regclass change: an extra load and an extra TOC entry.

GCC 4.0.3:

LC..0:
        .tc FD_0_0[TC],0x0,0x0
.f:
        mflr 0
        stw 0,8(1)
        stwu 1,-72(1)
        lwz 11,LC..0(2)
        lwz 12,LC..0+4(2)
        stw 12,56(1)
        li 10,0
        stw 11,64(1)
        stw 12,68(1)
        lfd 4,64(1)
	li 3,0

trunk:

LC..0:
        .tc FD_0_0[TC],0x0,0x0
LC..1:
        .tc LC..0.P4[TC],LC..0+4
.f:
        mflr 0
        stw 0,8(1)
        stwu 1,-80(1)
        lwz 9,LC..1(2)
        lwz 9,0(9)
        stw 9,56(1)
        li 10,0
        lfd 4,LC..0(2)
        li 3,0
        lwz 4,LC..0(2)
        lwz 5,LC..0+4(2)


The smallest and simplest testcase is an unprototyped function, but the
real effect of this change is in stdarg functions, which also fail.

	I do not doubt that the rs6000 port can be modified to recover the
original performance with the regclass change, however it's not a task
that I enjoy inheriting.

David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]