From patchwork Thu Oct 7 12:49:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 67049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 45FC3B6F07 for ; Thu, 7 Oct 2010 23:49:33 +1100 (EST) Received: (qmail 32091 invoked by alias); 7 Oct 2010 12:49:29 -0000 Received: (qmail 32079 invoked by uid 22791); 7 Oct 2010 12:49:26 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-pv0-f175.google.com (HELO mail-pv0-f175.google.com) (74.125.83.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Oct 2010 12:49:20 +0000 Received: by pvg6 with SMTP id 6so144793pvg.20 for ; Thu, 07 Oct 2010 05:49:19 -0700 (PDT) Received: by 10.114.109.10 with SMTP id h10mr747718wac.53.1286455759113; Thu, 07 Oct 2010 05:49:19 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id q29sm752807waj.6.2010.10.07.05.49.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 07 Oct 2010 05:49:17 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 3A779170C206; Thu, 7 Oct 2010 23:19:11 +1030 (CST) Date: Thu, 7 Oct 2010 23:19:11 +1030 From: Alan Modra To: Richard Henderson Cc: gcc-patches@gcc.gnu.org, David Edelsohn Subject: Re: [RS6000] PR 45807 r2 eh_frame info error Message-ID: <20101007124911.GF29181@bubble.grove.modra.org> Mail-Followup-To: Richard Henderson , gcc-patches@gcc.gnu.org, David Edelsohn References: <20100927142714.GS16376@bubble.grove.modra.org> <20101001032712.GE16376@bubble.grove.modra.org> <4CA61727.6060001@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4CA61727.6060001@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Fri, Oct 01, 2010 at 10:15:19AM -0700, Richard Henderson wrote: > Better, maybe, to use gen_int_mode here instead of the > explicit sign-extension trick. I did consider that when writing the original patch, and decided it was hardly necessary for a simple constant. After all, I knew the integer promotion rules and how to do sign extension. Turned out of course that didn't mean I could write flawless code.. David said this morning he'd rather gen_int_mode for maintainability, even if the code is now correct, so here goes. Committed r165101. * config/rs6000/rs6000.c (rs6000_emit_prologue): Use gen_int_mode rather than sign extension by hand. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 165080) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -20214,7 +20214,7 @@ rs6000_emit_prologue (void) /* In AIX ABI we need to make sure r2 is really saved. */ if (TARGET_AIX && crtl->calls_eh_return) { - rtx tmp_reg, tmp_reg_si, compare_result, toc_save_done, jump; + rtx tmp_reg, tmp_reg_si, hi, lo, compare_result, toc_save_done, jump; long toc_restore_insn; gcc_assert (frame_reg_rtx == frame_ptr_rtx @@ -20232,15 +20232,13 @@ rs6000_emit_prologue (void) toc adjusting stub. */ emit_move_insn (tmp_reg_si, gen_rtx_MEM (SImode, tmp_reg)); toc_restore_insn = TARGET_32BIT ? 0x80410014 : 0xE8410028; - toc_restore_insn = (toc_restore_insn ^ 0x80000000) - 0x80000000; - emit_insn (gen_xorsi3 (tmp_reg_si, tmp_reg_si, - GEN_INT (toc_restore_insn & ~0xffff))); + hi = gen_int_mode (toc_restore_insn & ~0xffff, SImode); + emit_insn (gen_xorsi3 (tmp_reg_si, tmp_reg_si, hi)); compare_result = gen_rtx_REG (CCUNSmode, CR0_REGNO); validate_condition_mode (EQ, CCUNSmode); + lo = gen_int_mode (toc_restore_insn & 0xffff, SImode); emit_insn (gen_rtx_SET (VOIDmode, compare_result, - gen_rtx_COMPARE (CCUNSmode, tmp_reg_si, - GEN_INT (toc_restore_insn - & 0xffff)))); + gen_rtx_COMPARE (CCUNSmode, tmp_reg_si, lo))); toc_save_done = gen_label_rtx (); jump = gen_rtx_IF_THEN_ELSE (VOIDmode, gen_rtx_EQ (VOIDmode, compare_result,