From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31137 invoked by alias); 15 Feb 2011 16:02:48 -0000 Received: (qmail 31125 invoked by uid 22791); 15 Feb 2011 16:02:47 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_05,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Feb 2011 16:02:40 +0000 Received: by iyj8 with SMTP id 8so209462iyj.20 for ; Tue, 15 Feb 2011 08:02:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.206.206 with SMTP id fv14mr4139986ibb.75.1297785758657; Tue, 15 Feb 2011 08:02:38 -0800 (PST) Received: by 10.231.19.130 with HTTP; Tue, 15 Feb 2011 08:02:38 -0800 (PST) In-Reply-To: References: Date: Tue, 15 Feb 2011 17:25:00 -0000 Message-ID: Subject: Re: code gen for C string literals From: kevin diggs To: Ian Lance Taylor Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00218.txt.bz2 On Mon, Feb 14, 2011 at 11:46 AM, Ian Lance Taylor wrote: > kevin diggs writes: > >> "in GENERIC"??? Is this the initial RTL output? > > GENERIC is the name for the tree representation used by the C frontend. > Since a string literal only appears in an operand, STRING_CST is what > you will see in GIMPLE as well. > >> that string literals are far more common. Off the top of your head do >> you know what I would search for for something like: >> >> int im_a_global_int; >> >> which would be treated similarly to a string literal (at least as far >> as how it is accessed), right? > > That's a very general question and I'm not sure just how to answer it. > At the GENERIC/GIMPLE level that is just a variable. =A0At the RTL level > it will turn into a memory address (a MEM). > I am asking if there is something like STRING_CST that the frontend will return for for global'ish (i.e. non-auto stuff that is found from locations other than the stack) data items that I can similarly search the code for. Thanks! kevin P.S.: If you would be so kind as to jot down a sentence or two as to what GIMPLE (some other frontends' tree?) is and how it relates to SIMPLE (C frontend tree representation) I would REALLY appreciate it! Ditto for something called SSA? > Ian >