From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29535 invoked by alias); 26 Oct 2008 08:27:43 -0000 Received: (qmail 29443 invoked by uid 48); 26 Oct 2008 08:26:22 -0000 Date: Sun, 26 Oct 2008 08:27:00 -0000 Message-ID: <20081026082622.29442.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/37909] internal compiler error: in fixup_mova, at config/sh/sh.c:3756 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kkojima at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg01663.txt.bz2 ------- Comment #4 from kkojima at gcc dot gnu dot org 2008-10-26 08:26 ------- sh_reorg might insert a new mova in SH_FIXUP_PCLOAD phase. When untangle_mova looks this mova insn, it may not be associated with the insn address yet but the current code takes its undefined address. It seems that this mova should be skipped there because it will be handled later. I'm testing the attached patch. -- * config/sh/sh.c (untangle_mova): Return -1 when NEW_MOVA has no address. --- ORIG/trunk/gcc/config/sh/sh.c 2008-10-22 09:11:15.000000000 +0900 +++ LOCAL/trunk/gcc/config/sh/sh.c 2008-10-26 10:36:59.000000000 +0900 @@ -3826,6 +3826,10 @@ untangle_mova (int *num_mova, rtx *first if (optimize) { + /* If NEW_MOVA has no address yet, it will be handled later. */ + if (INSN_ADDRESSES_SIZE() <= (unsigned) INSN_UID (new_mova)) + return -1; + n_addr = INSN_ADDRESSES (INSN_UID (new_mova)); n_target = INSN_ADDRESSES (INSN_UID (XEXP (MOVA_LABELREF (new_mova), 0))); if (n_addr > n_target || n_addr + 1022 < n_target) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37909