On Sun, Nov 9, 2014 at 8:16 PM, Uros Bizjak <ubiz...@gmail.com> wrote:
>> The following patch solves PR63620. The details can be found >> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63620 >> >> The patch is more than just the problem solution. It adds global live >> analysis for pseudos when it is necessary (live info change on a BB >> border triggers it). The patch opens a door for global optimizations >> and transformations in LRA and it will be also useful for performance >> problems reported by people in coming LRA rematerialization. >> >> The impact on compiler time is insignificant about 0.3% on whole >> SPEC2000 compilation (and about the same on a compilation of 500K >> lines FORTRAN file). >> >> The patch was successfully bootstrapped on x86/x86-64, ppc64, and ARM and >> tested on >> x86/x86-64 and ppc64. > > Did you also try to bootstrap with r216987 [1] reverted? This revision > adds a workaround for this problem on i686. > > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63620#c24 Unfortunately, the patch doesn't fix the original problem when mentioned revision is reverted. I have attached patch to the message. The testcase from the PR that fails to reload PIC register is: --cut here-- /* { dg-do compile { target i?86-*-* } } */ /* { dg-options "-O2 -mfpmath=sse -msse -fPIC" } */ static const __float128 cf = 0.1E+30Q; typedef __float128 (*func)(__float128 x); __float128 test (__float128 x, int p, func f) { x = f (x); if (p) x = f (cf); return x; } /* { dg-final { scan-assembler "get_pc_thunk" } } */ --cut here-- Uros.
Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 217269) +++ config/i386/i386.md (working copy) @@ -2783,11 +2783,7 @@ (define_insn "*pushtf" [(set (match_operand:TF 0 "push_operand" "=<,<") (match_operand:TF 1 "general_no_elim_operand" "x,*roF"))] - "(TARGET_64BIT || TARGET_SSE) - && (!ix86_use_pseudo_pic_reg () - || !can_create_pseudo_p () - || GET_CODE (operands[1]) != CONST_DOUBLE - || standard_sse_constant_p (operands[1]))" + "TARGET_64BIT || TARGET_SSE" { /* This insn should be already split before reg-stack. */ gcc_unreachable (); @@ -2813,10 +2809,7 @@ (define_insn "*pushxf" [(set (match_operand:XF 0 "push_operand" "=<,<") (match_operand:XF 1 "general_no_elim_operand" "f,Yx*roF"))] - "!ix86_use_pseudo_pic_reg () - || !can_create_pseudo_p () - || GET_CODE (operands[1]) != CONST_DOUBLE - || standard_80387_constant_p (operands[1]) > 0" + "" { /* This insn should be already split before reg-stack. */ gcc_unreachable (); @@ -2848,13 +2841,7 @@ (define_insn "*pushdf" [(set (match_operand:DF 0 "push_operand" "=<,<,<,<") (match_operand:DF 1 "general_no_elim_operand" "f,Yd*roF,rmF,x"))] - "!ix86_use_pseudo_pic_reg () - || !can_create_pseudo_p () - || GET_CODE (operands[1]) != CONST_DOUBLE - || (!(TARGET_SSE2 && TARGET_SSE_MATH) - && standard_80387_constant_p (operands[1]) > 0) - || (TARGET_SSE2 && TARGET_SSE_MATH - && standard_sse_constant_p (operands[1]))" + "" { /* This insn should be already split before reg-stack. */ gcc_unreachable ();