From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12624 invoked by alias); 3 Jul 2005 14:31:21 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 12603 invoked by uid 22791); 3 Jul 2005 14:31:14 -0000 Received: from mr1-n.kom.tuwien.ac.at (HELO mr.tuwien.ac.at) (128.131.2.109) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 03 Jul 2005 14:31:14 +0000 Received: from ahab.auto.tuwien.ac.at (ahab.auto.tuwien.ac.at [128.130.60.8]) by mr.tuwien.ac.at (8.12.10/8.12.8) with ESMTP id j63EV9nO013695; Sun, 3 Jul 2005 16:31:09 +0200 (MEST) Received: from ahab.auto.tuwien.ac.at (localhost.localdomain [127.0.0.1]) by ahab.auto.tuwien.ac.at (8.12.11/8.12.11) with ESMTP id j63EV8ON027190; Sun, 3 Jul 2005 16:31:08 +0200 Received: (from mkoegler@localhost) by ahab.auto.tuwien.ac.at (8.12.11/8.12.11/Submit) id j63EV4Er027185; Sun, 3 Jul 2005 16:31:04 +0200 Date: Sun, 03 Jul 2005 14:31:00 -0000 From: Martin Koegler To: James E Wilson Cc: gcc@gcc.gnu.org Subject: Re: named address spaces (update) Message-ID: <20050703143104.GA18820@ahab.auto.tuwien.ac.at> References: <20050629084740.GA8315@ahab.auto.tuwien.ac.at> <42C5F29E.6000004@specifixinc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <42C5F29E.6000004@specifixinc.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-07/txt/msg00091.txt.bz2 On Fri, Jul 01, 2005 at 06:49:18PM -0700, James E Wilson wrote: > Martin Koegler wrote: > >I continued to work on the support for named address spaces in GCC. > > An possible issue is the effect on gcc memory usage and compile time. I > see you increased the size of MEM rtl which will increase memory usage. > Also, there seem to be a lot of hooks in commonly called functions > which may slow down gcc. Most users won't be happy if gcc gets slower > in order to implement an obscure feature that most don't need. It would > be useful to measure the effect on compile time performance, and try to > reduce it if it is too much. Named address spaces will need some bits to store information about them in the RTL as well as in the tree nodes. I could change the patch, that it only creates code on target, which support it. But I do not like this idea, because future enhancements (like support for different sized pointers) will probably require bigger changes in the core, which will get more difficult, if only some architectures use it. If have not done any benchmarks yet, as I am working on improving my m68hc05 GCC port. I ran the GCC testsuite (only for the C frontend) with my patches on the i386 frontend and it took about 45 minutes complete on a modern P4 system (I have not collected more information, so it says nothing). > It would be helpful if you used -p when running diff. That includes > function names in the output, which makes the patch easier to read. > Also, a ChangeLog entry would help. The next time, I send an update, I will try to produced a better readable patch. > I see lots of places where you haven't followed the GNU coding > conventions. This will matter if you are serious about getting this > patch into the FSF tree. Comments need to start with a capital letter > and end with a period. Functions must have a comment before them that > explains what they do, and what their arguments are. Spaces before open > parentheses. Spaces before and after operators like = and !=. I have not cared about any formating conventions yet, as it is a preview patch (and the mentioned errors are no technical problem). Merging this patch will need a backend, which supports it. I do not intend to try to include my m68hc05 port in the GCC mainline, as I know no (potential) user base for this port (except my BCU SDK). So this patch will need an other backend, problably avr, over which it will find its way in the GCC CVS. > namespace means something different in C++. I don't think it is wise to > reuse it here. addressspace or addrspace makes more sense. In my working tree, I switch to addrspace: ADDRSPACE (EEPROM, HI); I also added an information about the minimum pointer size to start to work on non Pmode pointer. > In previous threads, Joseph Myers pointed you at a formal proposal to > extend the ISO C language with a similar feature. Have you looked at > this? If we are adding this feature, it would be best if we followed > the standard, instead of inventing our own incompatible extensions. Yes, I took it as base for the semantics (e.g. showed the need for the addrspace merge functions). I have not changed the C frontend to support address space attributes, so the specified syntax is not implemented. Instead I currently use GCC attributes. The attribute handlers in my backend only set the address space, without allocation variables into a specific section or detecting errors (eg. parameters with EERPOM attribute). > It isn't clear why you want both decl and type attributes. If we are > doing this right, it seems that it should just be a type attribute (type > qualifier?), and then for decls you can get the info from their type. My first implementation used a GCC type attribute to store the address space of the current value. I had serveral problems: * DWARF2 errors on arrays (#21106) * need to rewrite recursivly each element of type (which my contain structures, unions, ...) if a address space is set In http://gcc.gnu.org/ml/gcc/2005-04/msg01438.html, this was rated as bad idea. If the address space is set, it would be possible, that only the the address space is only stored in the top level node and every code, which access a part of the type, would duplicate the subtree and store the correct address space in the new top. This would require bigger changes, than the current solution. Now, I do not store the address space of variables in the type to avoid all propagation problems, I had in former implementations. Only for pointers, I store the address space, the pointer points to, in the type. I do the propagation while creating the different tree expression now (by storing the address space of the result in the expression). Using this approach, it is not possible to create something like typedef int eint __attribute__ (eeprom);, where eint x; will allocate x in the eeprom. On the other hand, situations, where eint is used in a structure (in the normal address space), can not happen. The ISO document does not explicitly state, if such constructs are allowed or not, so I can't say, if the ISO C extension support this. As I store the address space in the DECL, this can be best changed by a DECL attribute. For pointer (and references), I need a way to specifiy the address space of the target. Here a type attribute is the only solution, as they may be used in a structure. mfg Martin Kögler