From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31224 invoked by alias); 19 Feb 2015 21:08:58 -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 31208 invoked by uid 89); 19 Feb 2015 21:08:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.4 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ob0-f179.google.com Received: from mail-ob0-f179.google.com (HELO mail-ob0-f179.google.com) (209.85.214.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 19 Feb 2015 21:08:56 +0000 Received: by mail-ob0-f179.google.com with SMTP id wp4so19482839obc.10 for ; Thu, 19 Feb 2015 13:08:54 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.62.42 with SMTP id v10mr4301110oer.45.1424380134495; Thu, 19 Feb 2015 13:08:54 -0800 (PST) Received: by 10.76.134.102 with HTTP; Thu, 19 Feb 2015 13:08:54 -0800 (PST) In-Reply-To: References: <54E21B33.8020905@redhat.com> Date: Thu, 19 Feb 2015 21:16:00 -0000 Message-ID: Subject: Re: [PATCH] PR rtl-optimization/32219: optimizer causees wrong code in pic/hidden/weak symbol checking From: "H.J. Lu" To: Uros Bizjak Cc: Richard Henderson , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg01230.txt.bz2 On Thu, Feb 19, 2015 at 1:07 PM, H.J. Lu wrote: > On Thu, Feb 19, 2015 at 1:04 PM, Uros Bizjak wrote: >> On Mon, Feb 16, 2015 at 5:30 PM, Richard Henderson wrote: >> >>>>>> 2015-02-12 H.J. Lu >>>>>> Richard Henderson >>>>>> >>>>>> PR rtl/32219 >>>>>> * cgraphunit.c (cgraph_node::finalize_function): Set definition >>>>>> before notice_global_symbol. >>>>>> (varpool_node::finalize_decl): Likewise. >>>>>> * varasm.c (default_binds_local_p_2): Rename from >>>>>> default_binds_local_p_1, add weak_dominate argument. Use direct >>>>>> returns instead of assigning to local variable. Unify varpool and >>>>>> cgraph paths via symtab_node. Reject undef weak variables before >>>>>> testing visibility. Reorder tests for simplicity. >>>>>> (default_binds_local_p): Use default_binds_local_p_2. >>>>>> (default_binds_local_p_1): Likewise. >>>>>> (decl_binds_to_current_def_p): Unify varpool and cgraph paths >>>>>> via symtab_node. >>>>>> (default_elf_asm_output_external): Emit visibility when specified. >>>>> >>>>> It looks like this patch broke alphaev68-linux-gnu [1]. There are many >>>>> failures of the type: >>>>> >>>>> /tmp/cck7V7MR.o: In function >>>>> `__static_initialization_and_destruction_0(int, int)':^M >>>>> (.text+0x3ac): relocation truncated to fit: GPRELHIGH against symbol >>>>> `std::__cxx11::basic_string, >>>>> std::allocator >::~basic_string()@@GLIBCXX_3.4.21' defined in >>>>> .text section in >>>>> /space/uros/gcc-build/alphaev68-unknown-linux-gnu/./libstdc++-v3/src/.libs/libstdc++.so^M >>>>> /space/homedirs/uros/local/bin/ld: /tmp/cck7V7MR.o: gp-relative >>>>> relocation against dynamic symbol >>>> >>>> It could be related to: >>>> >>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65064 >>>> >>>> Before this bug fix, all common symbols don't bind locally, >>>> which is one of PR 32219 bugs. After this fix, common >>>> symbols bind locally. It may cause problems on targets with >>>> small data sections and common symbols aren't in small >>>> data section: >>> >>> This is a destructor, and so obviously not a common symbol. >>> >>> I'll have a look. >> >> The attached patch fixes all alpha-linux-gnu failures. >> >> 2015-02-19 Uros Bizjak >> >> * config/alpha/alpha.c (alpha_in_small_data_p): Reject common symbols. >> >> Patch was bootstrapped and regression tested on alphaev68-linux-gnu. >> >> OK for mainline? >> > > You may want to use something like this: > > https://gcc.gnu.org/ml/gcc-patches/2015-02/msg01105.html > See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65064 for why. -- H.J.