From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2515 invoked by alias); 25 Aug 2014 11:24:36 -0000 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 Received: (qmail 2497 invoked by uid 89); 25 Aug 2014 11:24:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: arjuna.pair.com Received: from arjuna.pair.com (HELO arjuna.pair.com) (209.68.5.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 25 Aug 2014 11:24:32 +0000 Received: by arjuna.pair.com (Postfix, from userid 3006) id 404638A29D; Mon, 25 Aug 2014 07:24:30 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id 3F9F58A298; Mon, 25 Aug 2014 07:24:30 -0400 (EDT) Date: Mon, 25 Aug 2014 11:24:00 -0000 From: Hans-Peter Nilsson To: Ilya Enkovich cc: gcc-patches , Evgeny Stupachenko Subject: Re: Enable EBX for x86 in 32bits PIC code In-Reply-To: Message-ID: References: <20140707114750.GB31640@tucnak.redhat.com> <20140822121151.GA60032@msticlxl57.ims.intel.com> User-Agent: Alpine 2.02 (BSF 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg02315.txt.bz2 On Mon, 25 Aug 2014, Ilya Enkovich wrote: > 2014-08-23 5:47 GMT+04:00 Hans-Peter Nilsson : > > ...did you send the right version of the patch? > > This one uses the RTX-returning hook only in boolean tests, > > unless I misread. (I did, but not by much.) > NULL returned by hook means we do not have implicit pic arg to > pass/receive and there are pieces of code which should be executed > only when implicit pic arg exists. This causes these boolean tests. Well, obviously, but... > There are also non boolean usages. E.g.: I thing singular ("usage") is more correct? I saw only one such use. :) > + rtx old_reg = targetm.calls.implicit_pic_arg (fndecl); > + rtx new_reg = gen_reg_rtx (GET_MODE (old_reg)); > + emit_move_insn (new_reg, old_reg); > + pic_offset_table_rtx = new_reg; And before that, it's called as a boolean test, throwing away the result! I suggest you change the hook to return a boolean, with a pointer argument to a variable to set, passed as NULL from callers not interested in the actual value. I.e. instead of: > >> +@deftypefn {Target Hook} rtx TARGET_IMPLICIT_PIC_ARG (const_tree @var{fntype_or_decl}) make it a: @deftypefn {Target Hook} bool TARGET_IMPLICIT_PIC_ARG (const_tree @var{fntype_or_decl}, rtx *@var{addr}) brgds, H-P