This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [lto] Add test case for ICE after error messages


2008/11/13 Diego Novillo <dnovillo@google.com>:
> On Thu, Nov 13, 2008 at 06:36, Hans-Peter Nilsson <hp@bitrange.com> wrote:
>> On Sun, 9 Nov 2008, Diego Novillo wrote:
>>> +++ gcc.dg/lto/20081109_0.c   (revision 0)
>>> @@ -0,0 +1,3 @@
>>> +/* { dg-do compile } */
>>> +/* { dg-options "{-w -flto-single}" }  */
>>
>> The curlies look redundant, if not benevolently wrong, a new
>> style using tcl quotes.
>
> They aren't, unfortunately.  dg-options is a list of lists.  The main
> loop in lto.exp:lto-execute does 'foreach option $option_list'.
> Without the braces, "-w -flto-single" would do two compiles, one with
> -w and one with -flto-single.
>
> I've been debating whether to make dg-options just a single string, as
> it's fairly easy to be stung by this.  In fact, I just noticed a
> couple of tests that have it wrong.  Initially, I liked the
> flexibility of adding multiple sets of options.  But I think it's not
> worth the confusion.

I think this would be useful in general and not only for LTO testsuite
(with a different name). Couldn't it be moved to some more general
place?

As an alternative, couldn't this be implemented thought multiple
dg-options? Like:

/* { dg-do compile } */
/* { dg-options "-O1" }  */
/* { dg-options "-O2" }  */
/* { dg-options "-O3" }  */

On the other hand, perhaps an explicit new dg-command is clearer:

/* { dg-do compile } */
/* { dg-multi-options "{-O1}  {-O2}  {-O3}" }  */


Cheers,

Manuel.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]