diff -Nrc3pad gcc-3.1.1/gcc/testsuite/ChangeLog gcc-3.2/gcc/testsuite/ChangeLog *** gcc-3.1.1/gcc/testsuite/ChangeLog Thu Jul 25 23:39:38 2002 --- gcc-3.2/gcc/testsuite/ChangeLog Wed Aug 14 09:00:33 2002 *************** *** 1,3 **** --- 1,40 ---- + 2002-08-14 Release Manager + + * GCC 3.2 Released. + + 2002-08-08 Jakub Jelinek + + * gcc.dg/bitfld-3.c: New test. + + 2002-08-07 Jakub Jelinek + Richard Henderson + + * gcc.dg/i386-bitfield1.c: New test. + * g++.dg/abi/bitfield3.C: New test. + + 2002-08-01 Benjamin Kosnik + + * g++.old-deja/g++.abi/ptrflags.C (expect): Change + __qualifier_flags to __flags. + + 2002-07-24 Roger Sayle + + * gcc.c-torture/execute/memset-3.c: New testcase. + + 2002-06-14 Jason Merrill + + * g++.dg/abi/layout1.C: New test. + * g++.dg/abi/layout2.C: New test. + * g++.dg/abi/mangle8.C: New test. + + 2002-05-14 Jason Merrill + + * g++.dg/abi/rtti1.C: New test. + + 2002-01-03 Jakub Jelinek + + * gcc.dg/gnu89-init-2.c: New test. + 2002-07-25 Release Manager * GCC 3.1.1 Released. diff -Nrc3pad gcc-3.1.1/gcc/testsuite/g++.dg/abi/bitfield3.C gcc-3.2/gcc/testsuite/g++.dg/abi/bitfield3.C *** gcc-3.1.1/gcc/testsuite/g++.dg/abi/bitfield3.C Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/g++.dg/abi/bitfield3.C Wed Aug 7 18:11:00 2002 *************** *** 0 **** --- 1,80 ---- + // Test for oversized bitfield alignment in structs on IA-32 + // { dg-do run { target i?86-*-* } } + // { dg-options "-O2" } + + struct A + { + char a; + int b : 224; // { dg-warning "exceeds its type" "" } + char c; + } a, a4[4]; + + struct B + { + char d; + A e; + char f; + } b; + + struct C + { + char g; + long long h : 64; + char i; + } c, c4[4]; + + struct D + { + char j; + C k; + char l; + } d; + + struct E + { + char m; + long long n : 160; // { dg-warning "exceeds its type" "" } + char o; + } e, e4[4]; + + struct F + { + char p; + E q; + char r; + } f; + + int main (void) + { + if (&a.c - &a.a != 32) + return 1; + if (sizeof (a) != 36) + return 2; + if (sizeof (a4) != 4 * 36) + return 3; + if (sizeof (b) != 2 * 4 + 36) + return 4; + if (__alignof__ (b.e) != 4) + return 5; + if (&c.i - &c.g != 12) + return 6; + if (sizeof (c) != 16) + return 7; + if (sizeof (c4) != 4 * 16) + return 8; + if (sizeof (d) != 2 * 4 + 16) + return 9; + if (__alignof__ (d.k) != 4) + return 10; + if (&e.o - &e.m != 24) + return 11; + if (sizeof (e) != 28) + return 12; + if (sizeof (e4) != 4 * 28) + return 13; + if (sizeof (f) != 2 * 4 + 28) + return 14; + if (__alignof__ (f.q) != 4) + return 15; + return 0; + } diff -Nrc3pad gcc-3.1.1/gcc/testsuite/g++.dg/abi/layout1.C gcc-3.2/gcc/testsuite/g++.dg/abi/layout1.C *** gcc-3.1.1/gcc/testsuite/g++.dg/abi/layout1.C Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/g++.dg/abi/layout1.C Fri Jul 26 23:23:02 2002 *************** *** 0 **** --- 1,31 ---- + // Red Hat bugzilla 64535 + // Bug: We are allocationg stuff into the tail padding of POD class "A". + // { dg-do run } + + struct A + { + int x; + char y; + }; + + struct B : public A { + virtual void f () {} + char z; + }; + + A a = { 21, 42 }; + B b; + + int + main (void) + { + b.x = 12; + b.y = 24; + b.z = 36; + + A *ap = &b; + + *ap = a; + + return (b.z != 36); + } diff -Nrc3pad gcc-3.1.1/gcc/testsuite/g++.dg/abi/layout2.C gcc-3.2/gcc/testsuite/g++.dg/abi/layout2.C *** gcc-3.1.1/gcc/testsuite/g++.dg/abi/layout2.C Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/g++.dg/abi/layout2.C Fri Jul 26 23:23:02 2002 *************** *** 0 **** --- 1,33 ---- + // Red Hat bugzilla 65210 + // { dg-do run } + + struct A { + int a; + }; + + struct B : public virtual A {}; + + struct C { + long double c; + }; + + struct D : public virtual C { + int d; + }; + + struct E : public B, public D { + int e; + }; + + E e; + + /* The layout of E should begin with the B-in-E vtable pointer, followed by + the D-in-E vtable pointer. The bug was that we used to pad out the D + fields for long double alignment. */ + + int main () + { + D* dp = &e; + unsigned long d_offset = ((char*)dp) - ((char*) &e); + return (d_offset != sizeof(void *)); + } diff -Nrc3pad gcc-3.1.1/gcc/testsuite/g++.dg/abi/mangle8.C gcc-3.2/gcc/testsuite/g++.dg/abi/mangle8.C *** gcc-3.1.1/gcc/testsuite/g++.dg/abi/mangle8.C Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/g++.dg/abi/mangle8.C Fri Jul 26 23:23:02 2002 *************** *** 0 **** --- 1,16 ---- + // Red Hat bugzilla 65035 + // Bug: We were encoding the name of the instantiation as 'operator int' + // rather than 'operator T'. + // { dg-do compile } + + struct C { + template + operator T (); + }; + + template + C::operator T () { return 0; } + + template C::operator int (); + + // { dg-final { scan-assembler _ZN1CcvT_IiEEv } } diff -Nrc3pad gcc-3.1.1/gcc/testsuite/g++.dg/abi/rtti1.C gcc-3.2/gcc/testsuite/g++.dg/abi/rtti1.C *** gcc-3.1.1/gcc/testsuite/g++.dg/abi/rtti1.C Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/g++.dg/abi/rtti1.C Fri Jul 26 23:23:02 2002 *************** *** 0 **** --- 1,13 ---- + // Test that we don't emit the type_info for a polymorphic class other than + // with the vtable. + + struct A { + virtual ~A(); + }; + + void f () + { + throw A(); + } + + // { dg-final { scan-assembler-dem-not {\ntypeinfo for A[: \t\n]} } } diff -Nrc3pad gcc-3.1.1/gcc/testsuite/g++.old-deja/g++.abi/ptrflags.C gcc-3.2/gcc/testsuite/g++.old-deja/g++.abi/ptrflags.C *** gcc-3.1.1/gcc/testsuite/g++.old-deja/g++.abi/ptrflags.C Thu Nov 16 04:14:37 2000 --- gcc-3.2/gcc/testsuite/g++.old-deja/g++.abi/ptrflags.C Thu Aug 1 21:56:28 2002 *************** *** 1,5 **** // Test rtti pointer flags ! // Copyright (C) 2000 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 15 Apr 2000 #include --- 1,5 ---- // Test rtti pointer flags ! // Copyright (C) 2000, 2002 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 15 Apr 2000 #include *************** int expect (int flags, std::type_info co *** 18,24 **** dynamic_cast (&info); if (!ptr) return 0; ! if (ptr->__qualifier_flags != flags) return 0; return 1; } --- 18,24 ---- dynamic_cast (&info); if (!ptr) return 0; ! if (ptr->__flags != flags) return 0; return 1; } diff -Nrc3pad gcc-3.1.1/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog gcc-3.2/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog *** gcc-3.1.1/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog Thu Jul 25 23:39:40 2002 --- gcc-3.2/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog Wed Aug 14 09:00:36 2002 *************** *** 1,3 **** --- 1,7 ---- + 2002-08-14 Release Manager + + * GCC 3.2 Released. + 2002-07-25 Release Manager * GCC 3.1.1 Released. diff -Nrc3pad gcc-3.1.1/gcc/testsuite/gcc.c-torture/execute/memset-3.c gcc-3.2/gcc/testsuite/gcc.c-torture/execute/memset-3.c *** gcc-3.1.1/gcc/testsuite/gcc.c-torture/execute/memset-3.c Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/gcc.c-torture/execute/memset-3.c Fri Jul 26 23:23:03 2002 *************** *** 0 **** --- 1,208 ---- + /* Copyright (C) 2002 Free Software Foundation. + + Test memset with various combinations of constant pointer alignments and + lengths to make sure any optimizations in the compiler are correct. + + Written by Roger Sayle, July 22, 2002. */ + + #ifndef MAX_OFFSET + #define MAX_OFFSET (sizeof (long long)) + #endif + + #ifndef MAX_COPY + #define MAX_COPY 15 + #endif + + #ifndef MAX_EXTRA + #define MAX_EXTRA (sizeof (long long)) + #endif + + #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) + + static union { + char buf[MAX_LENGTH]; + long long align_int; + long double align_fp; + } u; + + char A = 'A'; + + void reset () + { + int i; + + for (i = 0; i < MAX_LENGTH; i++) + u.buf[i] = 'a'; + } + + void check (int off, int len, int ch) + { + char *q; + int i; + + q = u.buf; + for (i = 0; i < off; i++, q++) + if (*q != 'a') + abort (); + + for (i = 0; i < len; i++, q++) + if (*q != ch) + abort (); + + for (i = 0; i < MAX_EXTRA; i++, q++) + if (*q != 'a') + abort (); + } + + int main () + { + int len; + char *p; + + /* off == 0 */ + for (len = 0; len < MAX_COPY; len++) + { + reset (); + + p = memset (u.buf, '\0', len); + if (p != u.buf) abort (); + check (0, len, '\0'); + + p = memset (u.buf, A, len); + if (p != u.buf) abort (); + check (0, len, 'A'); + + p = memset (u.buf, 'B', len); + if (p != u.buf) abort (); + check (0, len, 'B'); + } + + /* off == 1 */ + for (len = 0; len < MAX_COPY; len++) + { + reset (); + + p = memset (u.buf+1, '\0', len); + if (p != u.buf+1) abort (); + check (1, len, '\0'); + + p = memset (u.buf+1, A, len); + if (p != u.buf+1) abort (); + check (1, len, 'A'); + + p = memset (u.buf+1, 'B', len); + if (p != u.buf+1) abort (); + check (1, len, 'B'); + } + + /* off == 2 */ + for (len = 0; len < MAX_COPY; len++) + { + reset (); + + p = memset (u.buf+2, '\0', len); + if (p != u.buf+2) abort (); + check (2, len, '\0'); + + p = memset (u.buf+2, A, len); + if (p != u.buf+2) abort (); + check (2, len, 'A'); + + p = memset (u.buf+2, 'B', len); + if (p != u.buf+2) abort (); + check (2, len, 'B'); + } + + /* off == 3 */ + for (len = 0; len < MAX_COPY; len++) + { + reset (); + + p = memset (u.buf+3, '\0', len); + if (p != u.buf+3) abort (); + check (3, len, '\0'); + + p = memset (u.buf+3, A, len); + if (p != u.buf+3) abort (); + check (3, len, 'A'); + + p = memset (u.buf+3, 'B', len); + if (p != u.buf+3) abort (); + check (3, len, 'B'); + } + + /* off == 4 */ + for (len = 0; len < MAX_COPY; len++) + { + reset (); + + p = memset (u.buf+4, '\0', len); + if (p != u.buf+4) abort (); + check (4, len, '\0'); + + p = memset (u.buf+4, A, len); + if (p != u.buf+4) abort (); + check (4, len, 'A'); + + p = memset (u.buf+4, 'B', len); + if (p != u.buf+4) abort (); + check (4, len, 'B'); + } + + /* off == 5 */ + for (len = 0; len < MAX_COPY; len++) + { + reset (); + + p = memset (u.buf+5, '\0', len); + if (p != u.buf+5) abort (); + check (5, len, '\0'); + + p = memset (u.buf+5, A, len); + if (p != u.buf+5) abort (); + check (5, len, 'A'); + + p = memset (u.buf+5, 'B', len); + if (p != u.buf+5) abort (); + check (5, len, 'B'); + } + + /* off == 6 */ + for (len = 0; len < MAX_COPY; len++) + { + reset (); + + p = memset (u.buf+6, '\0', len); + if (p != u.buf+6) abort (); + check (6, len, '\0'); + + p = memset (u.buf+6, A, len); + if (p != u.buf+6) abort (); + check (6, len, 'A'); + + p = memset (u.buf+6, 'B', len); + if (p != u.buf+6) abort (); + check (6, len, 'B'); + } + + /* off == 7 */ + for (len = 0; len < MAX_COPY; len++) + { + reset (); + + p = memset (u.buf+7, '\0', len); + if (p != u.buf+7) abort (); + check (7, len, '\0'); + + p = memset (u.buf+7, A, len); + if (p != u.buf+7) abort (); + check (7, len, 'A'); + + p = memset (u.buf+7, 'B', len); + if (p != u.buf+7) abort (); + check (7, len, 'B'); + } + + exit (0); + } + diff -Nrc3pad gcc-3.1.1/gcc/testsuite/gcc.dg/bitfld-3.c gcc-3.2/gcc/testsuite/gcc.dg/bitfld-3.c *** gcc-3.1.1/gcc/testsuite/gcc.dg/bitfld-3.c Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/gcc.dg/bitfld-3.c Wed Aug 7 23:16:44 2002 *************** *** 0 **** --- 1,67 ---- + /* Test for bitfield alignment in structs and unions. */ + /* { dg-do run } */ + /* { dg-options "-O2" } */ + + extern void abort (void); + extern void exit (int); + + typedef long la __attribute__((aligned (8))); + + struct A + { + char a; + union UA + { + char x; + la y : 6; + } b; + char c; + } a; + + struct B + { + char a; + union UB + { + char x; + long y : 6 __attribute__((aligned (8))); + } b; + char c; + } b; + + struct C + { + char a; + struct UC + { + la y : 6; + } b; + char c; + } c; + + struct D + { + char a; + struct UD + { + long y : 6 __attribute__((aligned (8))); + } b; + char c; + } d; + + int main (void) + { + if (sizeof (a) != sizeof (b)) + abort (); + if (sizeof (a) != sizeof (c)) + abort (); + if (sizeof (a) != sizeof (d)) + abort (); + if ((&a.c - &a.a) != (&b.c - &b.a)) + abort (); + if ((&a.c - &a.a) != (&c.c - &c.a)) + abort (); + if ((&a.c - &a.a) != (&d.c - &d.a)) + abort (); + exit (0); + } diff -Nrc3pad gcc-3.1.1/gcc/testsuite/gcc.dg/gnu89-init-2.c gcc-3.2/gcc/testsuite/gcc.dg/gnu89-init-2.c *** gcc-3.1.1/gcc/testsuite/gcc.dg/gnu89-init-2.c Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/gcc.dg/gnu89-init-2.c Fri Jul 26 23:23:03 2002 *************** *** 0 **** --- 1,25 ---- + /* Test whether __compound_literal.* objects are not emitted unless + they are actually needed. */ + /* Origin: Jakub Jelinek */ + /* { dg-do compile } */ + /* { dg-options "-std=gnu89 -O2" } */ + /* { dg-final { scan-assembler-not "__compound_literal" } } */ + + struct A { int i; int j; int k[4]; }; + struct B { }; + struct C { int i; }; + struct D { int i; struct C j; }; + + struct A a = (struct A) { .j = 6, .k[2] = 12 }; + struct B b = (struct B) { }; + int c[] = (int []) { [2] = 6, 7, 8 }; + int d[] = (int [3]) { 1 }; + int e[2] = (int []) { 1, 2 }; + int f[2] = (int [2]) { 1 }; + struct C g[3] = { [2] = (struct C) { 13 }, [1] = (const struct C) { 12 } }; + struct D h = { .j = (struct C) { 15 }, .i = 14 }; + struct D i[2] = { [1].j = (const struct C) { 17 }, + [0] = { 0, (struct C) { 16 } } }; + static const int *j = 1 ? (const int *) 0 : & (const int) { 26 }; + int k = (int) sizeof ((int [6]) { 1, 2, 3, 4, 5, 6 }) + 4; + int l = (int) sizeof ((struct C) { 16 }); diff -Nrc3pad gcc-3.1.1/gcc/testsuite/gcc.dg/i386-bitfield1.c gcc-3.2/gcc/testsuite/gcc.dg/i386-bitfield1.c *** gcc-3.1.1/gcc/testsuite/gcc.dg/i386-bitfield1.c Thu Jan 1 00:00:00 1970 --- gcc-3.2/gcc/testsuite/gcc.dg/i386-bitfield1.c Wed Aug 7 18:11:00 2002 *************** *** 0 **** --- 1,53 ---- + // Test for bitfield alignment in structs on IA-32 + // { dg-do run { target i?86-*-* } } + // { dg-options "-O2" } + + extern void abort (void); + extern void exit (int); + + struct A + { + char a; + long long b : 61; + char c; + } a, a4[4]; + + struct B + { + char d; + struct A e; + char f; + } b; + + struct C + { + char g; + union U + { + char u1; + long long u2; + long long u3 : 64; + } h; + char i; + } c; + + int main (void) + { + if (&a.c - &a.a != 12) + abort (); + if (sizeof (a) != 16) + abort (); + if (sizeof (a4) != 4 * 16) + abort (); + if (sizeof (b) != 2 * 4 + 16) + abort (); + if (__alignof__ (b.e) != 4) + abort (); + if (&c.i - &c.g != 12) + abort (); + if (sizeof (c) != 16) + abort (); + if (__alignof__ (c.h) != 4) + abort (); + exit (0); + }