From patchwork Sat Jun 11 15:42:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 100017 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 E10F6B708B for ; Sun, 12 Jun 2011 01:42:56 +1000 (EST) Received: (qmail 21561 invoked by alias); 11 Jun 2011 15:42:53 -0000 Received: (qmail 21552 invoked by uid 22791); 11 Jun 2011 15:42:52 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Jun 2011 15:42:39 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 11 Jun 2011 08:42:38 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by orsmga001.jf.intel.com with ESMTP; 11 Jun 2011 08:42:38 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 4FCBFC2266; Sat, 11 Jun 2011 08:42:35 -0700 (PDT) Date: Sat, 11 Jun 2011 08:42:35 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: PATCH [2/n]: Prepare x32: Convert pointer to TLS symbol if needed Message-ID: <20110611154235.GA19926@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi, Backend may promote pointers to Pmode. Before we force a TLS symbol to a pseudo, we may need to convert it to proper mode. OK for trunk? Thanks. H.J. ---- 2011-06-11 H.J. Lu * calls.c (precompute_register_parameters): Convert pointer to TLS symbol if needed. diff --git a/gcc/calls.c b/gcc/calls.c index feb98d2..de98267 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -706,7 +706,13 @@ precompute_register_parameters (int num_actuals, struct arg_data *args, pseudo now. TLS symbols sometimes need a call to resolve. */ if (CONSTANT_P (args[i].value) && !targetm.legitimate_constant_p (args[i].mode, args[i].value)) - args[i].value = force_reg (args[i].mode, args[i].value); + { + if (GET_MODE (args[i].value) != args[i].mode) + args[i].value = convert_to_mode (args[i].mode, + args[i].value, + args[i].unsignedp); + args[i].value = force_reg (args[i].mode, args[i].value); + } /* If we are to promote the function arg to a wider mode, do it now. */