From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19281 invoked by alias); 22 Dec 2007 00:06:51 -0000 Received: (qmail 19271 invoked by uid 22791); 22 Dec 2007 00:06:50 -0000 X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 22 Dec 2007 00:06:41 +0000 Received: from hiauly1.hia.nrc.ca (hiauly1.hia.nrc.ca [127.0.0.1] (may be forged)) by hiauly1.hia.nrc.ca (8.14.1/8.14.1) with ESMTP id lBM06XbF017064; Fri, 21 Dec 2007 19:06:38 -0500 (EST) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.14.1/8.14.1/Submit) id lBM06XaY017063; Fri, 21 Dec 2007 19:06:33 -0500 (EST) Message-Id: <200712220006.lBM06XaY017063@hiauly1.hia.nrc.ca> Subject: Re: [committed] Fix PR target/34525 - unrecognized insn (take 2) To: dave@hiauly1.hia.nrc.ca (John David Anglin) Date: Sat, 22 Dec 2007 11:05:00 -0000 From: "John David Anglin" Cc: gcc-patches@gcc.gnu.org In-Reply-To: from "John David Anglin" at Dec 19, 2007 08:48:17 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg01061.txt.bz2 > The enclosed change fixes PR target/34525. An unrecognized instruction > was generated because a function label was not forced to memory. Sigh, I forgot to load the label after forcing it to memory. The enclosed updated fixes this. Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11 with no regressions. Committed to trunk. Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) 2007-12-21 John David Anglin PR target/34525 * pa.c (legitimize_pic_address): Emit insn to load function label forced to memory. Index: config/pa/pa.c =================================================================== --- config/pa/pa.c (revision 131125) +++ config/pa/pa.c (working copy) @@ -694,19 +694,37 @@ tmp_reg = ((reload_in_progress || reload_completed) ? reg : gen_reg_rtx (Pmode)); - /* Force function labels into memory. */ if (function_label_operand (orig, mode)) - orig = force_const_mem (mode, orig); - - emit_move_insn (tmp_reg, - gen_rtx_PLUS (word_mode, pic_offset_table_rtx, - gen_rtx_HIGH (word_mode, orig))); - pic_ref - = gen_const_mem (Pmode, - gen_rtx_LO_SUM (Pmode, tmp_reg, - gen_rtx_UNSPEC (Pmode, + { + /* Force function label into memory. */ + orig = XEXP (force_const_mem (mode, orig), 0); + /* Load plabel address from DLT. */ + emit_move_insn (tmp_reg, + gen_rtx_PLUS (word_mode, pic_offset_table_rtx, + gen_rtx_HIGH (word_mode, orig))); + pic_ref + = gen_const_mem (Pmode, + gen_rtx_LO_SUM (Pmode, tmp_reg, + gen_rtx_UNSPEC (Pmode, + gen_rtvec (1, orig), + UNSPEC_DLTIND14R))); + emit_move_insn (reg, pic_ref); + /* Now load address of function descriptor. */ + pic_ref = gen_rtx_MEM (Pmode, reg); + } + else + { + /* Load symbol reference from DLT. */ + emit_move_insn (tmp_reg, + gen_rtx_PLUS (word_mode, pic_offset_table_rtx, + gen_rtx_HIGH (word_mode, orig))); + pic_ref + = gen_const_mem (Pmode, + gen_rtx_LO_SUM (Pmode, tmp_reg, + gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_DLTIND14R))); + } current_function_uses_pic_offset_table = 1; mark_reg_pointer (reg, BITS_PER_UNIT);