From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26215 invoked by alias); 27 Jan 2017 14:44:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 26205 invoked by uid 89); 27 Jan 2017 14:44:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=U*dmalcolm, sk:dmalcol, dmalcolmredhatcom, dmalcolm@redhat.com X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Jan 2017 14:44:16 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F3BF3A769D; Fri, 27 Jan 2017 14:44:16 +0000 (UTC) Received: from vpn-233-2.phx2.redhat.com (vpn-233-2.phx2.redhat.com [10.3.233.2]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0REiFXm009607; Fri, 27 Jan 2017 09:44:16 -0500 Message-ID: <1485528254.20340.204.camel@redhat.com> Subject: Re: [PATCH] docs: Add __GIMPLE and __RTL to the "Internals" doc From: David Malcolm To: Richard Biener Cc: GCC Patches Date: Fri, 27 Jan 2017 14:44:00 -0000 In-Reply-To: References: <1485449562-16996-1-git-send-email-dmalcolm@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg02162.txt.bz2 On Fri, 2017-01-27 at 13:20 +0100, Richard Biener wrote: > On Thu, Jan 26, 2017 at 5:52 PM, David Malcolm > wrote: > > The "internals" documentation has a "Testsuites" chapter; this > > patch > > adds some notes to it, describing the __GIMPLE and __RTL extensions > > to the C frontend. > > > > Builds; passed visual inspection of .info, .html, .pdf. and .dvi. > > > > OK for trunk? > > > > gcc/ChangeLog: > > * doc/sourcebuild.texi (Testsuites): Add "GIMPLE Tests" and > > "RTL Tests" to menu. > > (GIMPLE Tests): New node. > > (RTL Tests): New node. > > --- > > gcc/doc/sourcebuild.texi | 89 > > ++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 89 insertions(+) > > > > diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi > > index 292a3c7..6c047288 100644 > > --- a/gcc/doc/sourcebuild.texi > > +++ b/gcc/doc/sourcebuild.texi > > @@ -863,6 +863,8 @@ here; FIXME: document the others. > > * profopt Testing:: Support for testing profile-directed > > optimizations. > > * compat Testing:: Support for testing binary compatibility. > > * Torture Tests:: Support for torture testing using multiple > > options. > > +* GIMPLE Tests:: Support for testing GIMPLE passes. > > +* RTL Tests:: Support for testing RTL passes. > > @end menu > > > > @node Test Idioms > > @@ -2931,3 +2933,90 @@ set ADDITIONAL_TORTURE_OPTIONS [list \ > > @{ -O2 -ftree-loop-linear @} \ > > @{ -O2 -fpeel-loops @} ] > > @end smallexample > > + > > +@node GIMPLE Tests > > +@section Support for testing GIMPLE passes > > + > > +As of gcc 7, C functions can be tagged with @code{__GIMPLE} to > > indicate > > +that the function body will be RTL, rather than C. The compiler > > requires the > > GIMPLE, not RTL Oops; fixed. > > +option @option{-fgimple} to enable this functionality. For > > example: > > + > > +@smallexample > > +/* @{ dg-do compile @} */ > > +/* @{ dg-options "-O -fgimple" @} */ > > + > > +void __GIMPLE (startwith ("dse2")) foo () > > +@{ > > + int a; > > + > > +bb_2: > > + if (a > 4) > > + goto bb_3; > > + else > > + goto bb_4; > > + > > +bb_3: > > + a_2 = 10; > > + goto bb_5; > > + > > +bb_4: > > + a_3 = 20; > > + > > +bb_5: > > + a_1 = __PHI (bb_3: a_2, bb_4: a_3); > > + a_4 = a_1 + 4; > > + > > + return; > > +@} > > +@end smallexample > > + > > +The @code{startwith} argument indicates at which pass to begin. > > + > > +Example DejaGnu tests of RTL can be seen in the source tree at (s/RTL/GIMPLE/ here as well) > > +@file{gcc/testsuite/gcc.dg/gimplefe-*.c}. > > + > > +The @code{__GIMPLE} parser is integrated with the C tokenizer and > > +preprocessor, so it should be possible to use macros to build out > > +test coverage. > > Can you add a sentence "A dump modifier -gimple exists to make tree > dumps > look more closely to valid GIMPLE input." or something along this > line? I wrote: +Use the dump modifier @code{-gimple} (e.g. @option{-fdump-tree-all-gimple}) +to make tree dumps more closely follow the format accepted by the GIMPLE +parser. > Ok with these changes (and thanks for finding a proper place for some > docs) Thanks; committed to trunk as r244977. [...snip...]