From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2734 invoked by alias); 29 Jun 2011 08:45:26 -0000 Received: (qmail 2710 invoked by uid 22791); 29 Jun 2011 08:45:24 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f49.google.com (HELO mail-fx0-f49.google.com) (209.85.161.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Jun 2011 08:45:10 +0000 Received: by fxd20 with SMTP id 20so877409fxd.22 for ; Wed, 29 Jun 2011 01:45:09 -0700 (PDT) Received: by 10.223.145.149 with SMTP id d21mr855719fav.149.1309337109184; Wed, 29 Jun 2011 01:45:09 -0700 (PDT) Received: from richards-thinkpad (gbibp9ph1--blueice3n2.emea.ibm.com [195.212.29.84]) by mx.google.com with ESMTPS id w15sm680648faj.23.2011.06.29.01.45.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jun 2011 01:45:08 -0700 (PDT) From: Richard Sandiford To: "H.J. Lu" Mail-Followup-To: "H.J. Lu" ,gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Cc: gcc-patches@gcc.gnu.org Subject: Re: PATCH [2/n]: Prepare x32: Convert pointer to TLS symbol if needed References: <20110611154235.GA19926@intel.com> Date: Wed, 29 Jun 2011 08:55:00 -0000 In-Reply-To: <20110611154235.GA19926@intel.com> (H. J. Lu's message of "Sat, 11 Jun 2011 08:42:35 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2011-06/txt/msg02203.txt.bz2 "H.J. Lu" writes: > @@ -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); > + } But if GET_MODE (args[i].value) != args[i].mode, then the call to targetm.legitimate_constant_p looks wrong. The mode passed in the first argument is supposed to the mode of the second argument. Is there any reason why this and the following: /* If we are to promote the function arg to a wider mode, do it now. */ if (args[i].mode != TYPE_MODE (TREE_TYPE (args[i].tree_value))) args[i].value = convert_modes (args[i].mode, TYPE_MODE (TREE_TYPE (args[i].tree_value)), args[i].value, args[i].unsignedp); need to be done in the current order? I can't think of any off-hand. If not, would swapping them also fix the bug? (I can't review this either way, of course.) Richard