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]

Patch to "fix" table jumps on the alpha


The alpha appears to generate table jumps which involve
the pic register by calling gen_rtx_REG instead of using
pic_offset_table_rtx.  This prevents VRP from optimizing
the jump since it sees a random hard register (which it
knows nothing about) instead of the pic register (which
it understands).

This patch passes make bootstrap and make check on Dec Alpha 4.0f.

ChangeLog:

Wed Nov 28 00:20:22 EST 2001  John Wehle  (john@feith.com)

	* alpha.md (tablejump): Use pic_offset_table_rtx
	instead of gen_rtx_REG.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/config/alpha/alpha.md.ORIGINAL	Mon Nov  5 16:35:26 2001
--- gcc/config/alpha/alpha.md	Tue Nov 27 14:27:36 2001
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 4966,4972 ****
      {
        rtx dest = gen_reg_rtx (DImode);
        emit_insn (gen_extendsidi2 (dest, operands[0]));
!       emit_insn (gen_adddi3 (dest, gen_rtx_REG (DImode, 29), dest));	
        operands[0] = dest;
      }
  })
--- 4966,4972 ----
      {
        rtx dest = gen_reg_rtx (DImode);
        emit_insn (gen_extendsidi2 (dest, operands[0]));
!       emit_insn (gen_adddi3 (dest, pic_offset_table_rtx, dest));	
        operands[0] = dest;
      }
  })
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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