From patchwork Fri Dec 2 18:39:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 128934 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 D49EEB6F64 for ; Sat, 3 Dec 2011 05:40:15 +1100 (EST) Received: (qmail 3562 invoked by alias); 2 Dec 2011 18:40:12 -0000 Received: (qmail 3544 invoked by uid 22791); 2 Dec 2011 18:40:10 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Dec 2011 18:39:54 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (jimi mo1) (RZmta 26.10 AUTH) with ESMTPA id e033ddnB2GMo7O ; Fri, 2 Dec 2011 19:39:27 +0100 (MET) Message-ID: <4ED91B5F.7030904@gjlay.de> Date: Fri, 02 Dec 2011 19:39:27 +0100 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: Denis Chertykov CC: gcc-patches@gcc.gnu.org, Ian Lance Taylor , Steven Bosscher , sean@depagnier.com, GCC Mailing List Subject: Re: [Patch,AVR] Was/Fix: error linking lto1 for target avr References: <4ED216F7.3070901@gjlay.de> <4ED27DF2.2080907@gjlay.de> <4ED383C3.5040402@gjlay.de> <4ED51080.9090306@gjlay.de> In-Reply-To: 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 Denis Chertykov wrote: > 2011/11/29 Georg-Johann Lay : >> Ian Lance Taylor wrote: >>> Georg-Johann Lay writes: >>> >>>> So if a frontend can define address spaces and it is a generic feature, the >>>> question is how to get the name of an address space in a generic, language >>>> independent way. >>> We could decide that all frontends that use address spaces must define a >>> printable name for each address space. That would mean changing the >>> middle-end address space interface to give a name to each address space. >>> The current middle-end address space interface does not require that >>> address spaces have a name. I was not involved in the addition of >>> address spaces to gcc, and I don't know why they followed the path they >>> did. >>> >>> Ian >> Presumably they chose that approach to keep it simple or it is even a >> performance issue to move the name around. >> >> I attached a patch but I fail to find the right configure options for >> gcc/binutils as the testsuite complains >> >> ./avr/bin/ld: bad -plugin option >> >> Configured gcc with --enable-lto and binutils 2.21 with --enable-plugin. >> >> Maybe the patch can be pre-approved so that the others can proceed with their work? > > Better to complete this work. > > Denis. http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02574.html I now switched back to --disable-lto as I could not resolve the problems that appear to be a collect2 issue, see http://gcc.gnu.org/ml/gcc-help/2011-12/msg00016.html What I can do is: * build the compiler with the patch and with LTO enabled and without getting a linker error for c_addr_space_name. * I cannot get usable results from testsuite because of collect2 breakage * Testsuite passes fine with the patch and --disable-lto the only regression that I get is gcc.c-torture/execute/vector-subscript-1.c which is because of bogus testcase that assumes sizeof(int) = 4 and passes with the fix or - __builtin_memcpy(a, &val3, 16); + __builtin_memcpy(a, &val3, 4*sizeof(int)); Ok for trunk? Johann * config/avr/avr.h (ADDR_SPACE_PGM, ADDR_SPACE_PGM1, ADDR_SPACE_PGM2, ADDR_SPACE_PGM3, ADDR_SPACE_PGM4, ADDR_SPACE_PGM5, ADDR_SPACE_PGMX): Write as enum. (avr_addrspace_t): New typedef. (avr_addrspace): New declaration. * config/avr/avr-c.c (avr_toupper): New static function. (avr_register_target_pragmas, avr_cpu_cpp_builtins): Use avr_addrspace to get address space information. * config/avr/avr.c (avr_addrspace): New variable. (avr_out_lpm, avr_pgm_check_var_decl, avr_insert_attributes, avr_asm_named_section, avr_section_type_flags, avr_asm_select_section, avr_addr_space_address_mode, avr_addr_space_convert, avr_emit_movmemhi): Use it. (avr_addr_space_pointer_mode): Forward to avr_addr_space_address_mode. (avr_pgm_segment): Remove. Index: gcc/testsuite/gcc.c-torture/execute/vector-subscript-1.c =================================================================== --- gcc/testsuite/gcc.c-torture/execute/vector-subscript-1.c (revision 181932) +++ gcc/testsuite/gcc.c-torture/execute/vector-subscript-1.c (working copy) @@ -49,7 +49,7 @@ int main( int argc, char* argv[] ) if (*f(&val3, 3 ) != 4) __builtin_abort (); - __builtin_memcpy(a, &val3, 16); + __builtin_memcpy(a, &val3, sizeof(a)); for(i = 0; i < 4; i++) if (a[i] != i+1) __builtin_abort ();