From patchwork Wed Apr 8 18:01:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 459402 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7EADA140077 for ; Thu, 9 Apr 2015 04:01:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Dr/tggHD; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=ggpHB+Agqn3H3t2IFQ 7tlbOHBXDz2MWrgS8IquTPGfG8Yt6nHWom8IwRYtk8WoTTH8Awvqut/K5WStGc+A z52zUiKlyMsZF0HELh5W09/9KcPaHmBPFEap+rvYRX/pxSNovHtreAJfnv4W2JPn wX+jyuqIV/f3h+ibpTKoRHtKo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=6bFlfQxSGVWgkllGIWTFy9yO 20Y=; b=Dr/tggHDNu48e1XJHbEnVCMxR50h2naegpIZN8puxUdCAHzqeCYDRvHq XDB4SAv+pYuGHV9EA/nF2Pk9d0ysLW2rDzkIDKHjME/qFqfdLhQni7Qdh8hAk3b2 1JfaNGm1Hub14vyaaUFrBGxPjZpeyh67LYyJAQkMgEl9uvFJ4E0= Received: (qmail 42902 invoked by alias); 8 Apr 2015 18:01:09 -0000 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 Received: (qmail 42880 invoked by uid 89); 8 Apr 2015 18:01:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-lb0-f169.google.com Received: from mail-lb0-f169.google.com (HELO mail-lb0-f169.google.com) (209.85.217.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 08 Apr 2015 18:01:06 +0000 Received: by lbbzk7 with SMTP id zk7so73150825lbb.0 for ; Wed, 08 Apr 2015 11:01:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.67.107 with SMTP id m11mr24329100lbt.43.1428516063320; Wed, 08 Apr 2015 11:01:03 -0700 (PDT) Received: by 10.152.45.3 with HTTP; Wed, 8 Apr 2015 11:01:03 -0700 (PDT) In-Reply-To: <20150401232053.GC56578@kam.mff.cuni.cz> References: <20150308003800.GA50226@kam.mff.cuni.cz> <20150308233744.GA27547@kam.mff.cuni.cz> <20150401232053.GC56578@kam.mff.cuni.cz> Date: Wed, 8 Apr 2015 20:01:03 +0200 Message-ID: Subject: Re: Fix increase_alignment From: Bernhard Reutner-Fischer To: Jan Hubicka Cc: GCC Patches , David Edelsohn , richard.sandiford@arm.com X-IsSubscribed: yes On 2 April 2015 at 01:20, Jan Hubicka wrote: >> >> Your follow-up patch 88ada5e935d58223ae2d9ce6d0c1c71c372680a8 a.k.a r221269 >> added this to emit_local(): >> >> static bool >> -emit_local (tree decl ATTRIBUTE_UNUSED, >> +emit_local (tree decl, >> const char *name ATTRIBUTE_UNUSED, >> unsigned HOST_WIDE_INT size ATTRIBUTE_UNUSED, >> unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED) >> { >> + int align = symtab_node::get (decl)->definition_alignment (); >> #if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL >> ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name, >> - size, DECL_ALIGN (decl)); >> + size, align); >> return true; >> #elif defined ASM_OUTPUT_ALIGNED_LOCAL >> - ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, DECL_ALIGN (decl)); >> + ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align); >> return true; >> #else >> ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded); >> return false; >> #endif >> } >> >> which gives >> >> gcc/varasm.c:1936:7: error: unused variable ‘align’ [-Werror=unused-variable] >> int align = symtab_node::get (decl)->definition_alignment (); >> ^ >> >> on >> log/alpha64-dec-vms >> log/alpha-dec-vms >> log/i686-cygwinOPT-enable-threads=yes >> log/i686-mingw32crt >> log/i686-openbsd3.0 >> log/i686-pc-msdosdjgpp >> log/m68k-openbsd >> >> Maybe just flag it as used or copy-move it? > > Yep, lets just move it into the ifdefs. Can you please check that the alignment Committed revision 221925. > looks right atone of those targets? I am not quite sure who is supposed to > do so on targets not defining ASM_OUTPUT_ALIGNED_LOCAL. > > Perhaps we want then to prvent vectorizer from updating the alignments. I have no idea how the alignment on those targets are supposed to look like, sorry. thanks, ------------------------------------------------------------------------ r221925 | aldot | 2015-04-08 19:56:18 +0200 (Wed, 08 Apr 2015) | 22 lines emit_local(): Fix unused warning Honzas r221269 produced gcc/varasm.c:1936:7: error: unused variable ‘align’ [-Werror=unused-variable] int align = symtab_node::get (decl)->definition_alignment (); ^ on e.g.: log/alpha64-dec-vms log/alpha-dec-vms log/i686-cygwinOPT-enable-threads=yes log/i686-mingw32crt log/i686-openbsd3.0 log/i686-pc-msdosdjgpp log/m68k-openbsd Silence this by moving the variable into the corresponding blocks and adding back the ATTRIBUTE_UNUSED decoration for the decl param. ------------------------------------------------------------------------ Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 221924) +++ gcc/ChangeLog (revision 221925) @@ -1,3 +1,7 @@ +2015-04-08 Bernhard Reutner-Fischer + + * varasm.c (emit_local): Move definition of align. + 2015-04-08 Julian Brown * config/nvptx/mkoffload.c (process): Support variable mapping. Index: gcc/varasm.c =================================================================== --- gcc/varasm.c (revision 221924) +++ gcc/varasm.c (revision 221925) @@ -1928,17 +1928,18 @@ /* A noswitch_section_callback for lcomm_section. */ static bool -emit_local (tree decl, +emit_local (tree decl ATTRIBUTE_UNUSED, const char *name ATTRIBUTE_UNUSED, unsigned HOST_WIDE_INT size ATTRIBUTE_UNUSED, unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED) { +#if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL int align = symtab_node::get (decl)->definition_alignment (); -#if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name, size, align); return true; #elif defined ASM_OUTPUT_ALIGNED_LOCAL + int align = symtab_node::get (decl)->definition_alignment (); ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align); return true; #else