From patchwork Thu Aug 20 14:33:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 509063 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 C18841401EF for ; Fri, 21 Aug 2015 00:33:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=UXdLCjG9; 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:to:cc :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=r8S/Nlnq+pZuGkVe B4v9NXFeV8oWqfXbWRvHqA93A+odPpiPGzWdEcqq2ivU/LJJbs+l68T2ekTGGDzt zuk15ZjWJL+rKfmdbLhJqNossfjDaUdCDgQrpXRMA3dYlcVUJ9GiaOy8oQrQzLcw RMglPyzm3EiDcVmejicIzjb2u24= 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:to:cc :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=2H9zLcXGMx6/DYxZ5EIrWV 9mVuw=; b=UXdLCjG94bnOQ15gKGEnqUwCog5vyhTloaT9XnXa/UdlGSmHrChPXs sIlqz+LTidWC6ldgIJyHH+zJvDeHMjCfhbd1q4VWSR8TvUfoxNSbl7eRWIWe6aKk 2o0uDUpvzKsAdixdQXHMKeP9vLXGU1kEl1ut4Ak0H/Ufon07Ih24M= Received: (qmail 31999 invoked by alias); 20 Aug 2015 14:33:35 -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 31984 invoked by uid 89); 20 Aug 2015 14:33:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.220) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 20 Aug 2015 14:33:24 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwR/bcHRirORRW3yMcVao= X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (ip-213-135-1-215.intersaar.de [213.135.1.215]) by smtp.strato.de (RZmta 37.11 DYNA|AUTH) with ESMTPSA id w02284r7KEXK26x (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 20 Aug 2015 16:33:20 +0200 (CEST) To: GCC Patches Cc: Denis Chertykov From: Georg-Johann Lay Subject: [avr, 5 + trunk, committed]: Fix "KiB" diagnostic for wrong address space. Message-ID: <55D5E52B.1040904@gjlay.de> Date: Thu, 20 Aug 2015 16:33:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-IsSubscribed: yes https://gcc.gnu.org/r227034 https://gcc.gnu.org/r227035 If an address space is used that's beyond the flash of the current device (number of 64 KiB segments as specified by -mn-flash=) a diagnostic complains and prints the currently specified numbers of flash segments, i.e. 64 KiB chunks, and used "KiB" as unit. Hence the avr_n_flash number of segments has to be multiplied by 64 in order to convert from number of segments to KiB. Applied as obvious to trunk and gcc-5-branch (4.9 does not print the size). Johann Index: config/avr/avr.c =================================================================== --- config/avr/avr.c (revision 227034) +++ config/avr/avr.c (revision 227035) @@ -9255,10 +9255,10 @@ avr_pgm_check_var_decl (tree node) { if (TYPE_P (node)) error ("%qT uses address space %qs beyond flash of %d KiB", - node, avr_addrspace[as].name, avr_n_flash); + node, avr_addrspace[as].name, 64 * avr_n_flash); else error ("%s %q+D uses address space %qs beyond flash of %d KiB", - reason, node, avr_addrspace[as].name, avr_n_flash); + reason, node, avr_addrspace[as].name, 64 * avr_n_flash); } else { @@ -9305,7 +9305,7 @@ avr_insert_attributes (tree node, tree * if (avr_addrspace[as].segment >= avr_n_flash) { error ("variable %q+D located in address space %qs beyond flash " - "of %d KiB", node, avr_addrspace[as].name, avr_n_flash); + "of %d KiB", node, avr_addrspace[as].name, 64 * avr_n_flash); } else if (!AVR_HAVE_LPM && avr_addrspace[as].pointer_size > 2) {