From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 422 invoked by alias); 12 Apr 2002 20:46:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 397 invoked by uid 71); 12 Apr 2002 20:46:01 -0000 Date: Fri, 12 Apr 2002 13:46:00 -0000 Message-ID: <20020412204601.396.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Geoffrey Keating Subject: Re: c/3711: rename 20020307-2.c after change Reply-To: Geoffrey Keating X-SW-Source: 2002-04/txt/msg00673.txt.bz2 List-Id: The following reply was made to PR c/3711; it has been noted by GNATS. From: Geoffrey Keating To: gcc-patches@gcc.gnu.org, gcc-gnats@gcc.gnu.org, rth@redhat.com Cc: Subject: Re: c/3711: rename 20020307-2.c after change Date: Fri, 12 Apr 2002 13:41:31 -0700 Way back in March, rth changed 20020307-2.c in mainline, which made it fail, but didn't change its name... This patch corrects the oversight. Bootstrapped & tested with the C language only. -- Geoff Keating ===File ~/patches/gcc-20020702-2-rename.patch=============== Index: ChangeLog =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/ChangeLog,v retrieving revision 1.1800 diff -p -u -p -r1.1800 ChangeLog --- ChangeLog 12 Apr 2002 10:59:27 -0000 1.1800 +++ ChangeLog 12 Apr 2002 20:23:00 -0000 @@ -1,3 +1,8 @@ +2002-04-12 Geoffrey Keating + + * gcc.c-torture/execute/20020412-1.c: New file, renamed from + gcc.c-torture/execute/20020307-2.c. + 2002-04-12 Richard Sandiford * g++.dg/ext/attrib5.C, Index: gcc.c-torture/execute/20020307-2.c =================================================================== RCS file: gcc.c-torture/execute/20020307-2.c diff -N gcc.c-torture/execute/20020307-2.c --- gcc.c-torture/execute/20020307-2.c 26 Mar 2002 08:53:14 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,56 +0,0 @@ -/* PR c/3711 - This testcase ICEd on IA-32 at -O0 and was miscompiled otherwise, - because std_expand_builtin_va_arg didn't handle variable size types. */ - -#include - -extern void abort (void); -extern void exit (int); - -void bar (int c) -{ - static int d = '0'; - - if (c != d++) - abort (); - if (c < '0' || c > '9') - abort (); -} - -void foo (int size, ...) -{ - struct - { - char x[size]; - } d; - va_list ap; - int i; - - va_start (ap, size); - d = va_arg (ap, typeof (d)); - for (i = 0; i < size; i++) - bar (d.x[i]); - d = va_arg (ap, typeof (d)); - for (i = 0; i < size; i++) - bar (d.x[i]); - va_end (ap); -} - -int main (void) -{ - int z = 5; - struct { char a[z]; } x, y; - - x.a[0] = '0'; - x.a[1] = '1'; - x.a[2] = '2'; - x.a[3] = '3'; - x.a[4] = '4'; - y.a[0] = '5'; - y.a[1] = '6'; - y.a[2] = '7'; - y.a[3] = '8'; - y.a[4] = '9'; - foo (z, x, y); - exit (0); -} Index: gcc.c-torture/execute/20020412-1.c =================================================================== RCS file: gcc.c-torture/execute/20020412-1.c diff -N gcc.c-torture/execute/20020412-1.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gcc.c-torture/execute/20020412-1.c 12 Apr 2002 20:23:01 -0000 @@ -0,0 +1,56 @@ +/* PR c/3711 + This testcase ICEd on IA-32 at -O0 and was miscompiled otherwise, + because std_expand_builtin_va_arg didn't handle variable size types. */ + +#include + +extern void abort (void); +extern void exit (int); + +void bar (int c) +{ + static int d = '0'; + + if (c != d++) + abort (); + if (c < '0' || c > '9') + abort (); +} + +void foo (int size, ...) +{ + struct + { + char x[size]; + } d; + va_list ap; + int i; + + va_start (ap, size); + d = va_arg (ap, typeof (d)); + for (i = 0; i < size; i++) + bar (d.x[i]); + d = va_arg (ap, typeof (d)); + for (i = 0; i < size; i++) + bar (d.x[i]); + va_end (ap); +} + +int main (void) +{ + int z = 5; + struct { char a[z]; } x, y; + + x.a[0] = '0'; + x.a[1] = '1'; + x.a[2] = '2'; + x.a[3] = '3'; + x.a[4] = '4'; + y.a[0] = '5'; + y.a[1] = '6'; + y.a[2] = '7'; + y.a[3] = '8'; + y.a[4] = '9'; + foo (z, x, y); + exit (0); +} ============================================================