From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 475 invoked by alias); 14 Sep 2009 15:42:23 -0000 Received: (qmail 464 invoked by uid 22791); 14 Sep 2009 15:42:22 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate8-bp.emea.ibm.com (HELO mtagate8.de.ibm.com) (195.212.17.168) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Sep 2009 15:42:14 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.1/8.13.1) with ESMTP id n8EFgBJp006884 for ; Mon, 14 Sep 2009 15:42:11 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8EFg94Y2031646 for ; Mon, 14 Sep 2009 17:42:11 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8EFg9ee026200 for ; Mon, 14 Sep 2009 17:42:09 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n8EFg86x026189; Mon, 14 Sep 2009 17:42:08 +0200 Message-Id: <200909141542.n8EFg86x026189@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 14 Sep 2009 17:42:08 +0200 Subject: Re: i370 port To: mutazilah@gmail.com (Paul Edwards) Date: Mon, 14 Sep 2009 15:42:00 -0000 From: "Ulrich Weigand" Cc: joseph@codesourcery.com (Joseph S. Myers), gcc@gcc.gnu.org In-Reply-To: <65E668F7450F461E82E66A815F06EEDF@Paullaptop> from "Paul Edwards" at Sep 10, 2009 08:32:30 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00250.txt.bz2 Paul Edwards wrote: > int > i370_branch_dest (branch) > rtx branch; > { > rtx dest = SET_SRC (PATTERN (branch)); > int dest_uid; > int dest_addr; > > /* first, compute the estimated address of the branch target */ > if (GET_CODE (dest) == IF_THEN_ELSE) > dest = XEXP (dest, 1); > dest = XEXP (dest, 0); This is set up only to handle direct branches of the form (set (pc) (label_ref ...)) and indirect branches of the form (set (pc) (if_then_else (...) (label_ref ...) (pc))) but *not* indirect branches of the form (set (pc) (if_then_else (...) (pc) (label_ref ...))) This latter form is accepted by the "negated conditional jump instructions in the i370.md file, like so: (define_insn "" [(set (pc) (if_then_else (eq (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" "")))) ; (clobber (reg:SI 14)) ] "" "* { check_label_emit (); mvs_check_page (0, 4, 0); if (i370_short_branch(insn) || mvs_check_label (CODE_LABEL_NUMBER (operands[0]))) { Therefore, the i370_branch_dest routine needs to handle those as well. Probably something along the following lines: if (GET_CODE (dest) == IF_THEN_ELSE) { if (GET_CODE (XEXP (dest, 1) == LABEL_REF) dest = XEXP (dest, 1); else dest = XEXP (dest, 2); } gcc_assert (GET_CODE (dest) == LABEL_REF); dest = XEXP (dest, 0); Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com