From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126687 invoked by alias); 22 Feb 2019 22:34:19 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 126512 invoked by uid 89); 22 Feb 2019 22:34:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*r:sk:dynamic, H*RU:sk:dynamic, Hx-spam-relays-external:sk:dynamic, device X-HELO: 5.mo1.mail-out.ovh.net Received: from 5.mo1.mail-out.ovh.net (HELO 5.mo1.mail-out.ovh.net) (178.33.45.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Feb 2019 22:34:17 +0000 Received: from player799.ha.ovh.net (unknown [10.109.143.225]) by mo1.mail-out.ovh.net (Postfix) with ESMTP id 3A72015BC2B for ; Fri, 22 Feb 2019 23:34:15 +0100 (CET) Received: from netng.pl (dynamic-78-8-169-236.ssp.dialog.net.pl [78.8.169.236]) (Authenticated sender: lukasz.kostka@netng.pl) by player799.ha.ovh.net (Postfix) with ESMTPSA id A7DBF3015E8E for ; Fri, 22 Feb 2019 22:34:14 +0000 (UTC) From: =?utf-8?Q?=C5=81ukasz_Kostka?= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: AVR __progmem__ variable reading Message-Id: Date: Fri, 22 Feb 2019 22:34:00 -0000 To: gcc@gcc.gnu.org X-Ovh-Tracer-Id: 8711650530820807496 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddruddtgdduieegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenuc X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00126.txt.bz2 Hi I am using for a while now gcc and especially __progmem__ attribute. I=E2= =80=99d like to report a feature request for gcc to handle reading from fla= sh memory variables. Compiler has all the knowledge (target device, availab= ility of LPM, ELPM instructions etc.) in order to properly interpret variab= le is accessed (eg. by array subscription). This would remove need for any assembly code written to do this. Make user code much cleaner. GCC having all this knowledge can optimize end assembly code. Simple attribute addition will switch from array in memory to array in flas= h. Can serve as future implementations for other platforms. What do you think ?