This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC Status Report (2004-03-09)
On Thu, Apr 01, 2004 at 03:28:06PM -0500, Jakub Jelinek wrote:
> 2004-04-01 Jakub Jelinek <jakuB@redhat.com>
> Eric Botcazou <ebotcazou@libertysurf.fr>
>
> PR optimization/13424, optimization/12419
> * explow.c (maybe_set_unchanging): Revert 2003-04-07 patch.
> Set RTX_UNCHANGING_P even for read-only DECL_EXTERNAL decls.
> * expr.c (store_constructor): When clearing aggregate because
> of an incomplete or mostly zero constructor, do the clearing
> without /u flag and then emit a blockage.
Just for completeness, this patch doesn't prevent all double /u writes.
But it is no longer related to the clearing.
E.g. the testcase below, although it is not miscompiled on IA-64,
has many double /u stores because of bitfields.
2004-04-01 Jakub Jelinek <jakuB@redhat.com>
* gcc.c-torture/execute/20040401-2.c: New test.
--- gcc/testsuite/gcc.c-torture/execute/20040401-2.c.jj 2004-01-21 17:12:41.000000000 +0100
+++ gcc/testsuite/gcc.c-torture/execute/20040401-2.c 2004-04-01 20:46:44.327326004 +0200
@@ -0,0 +1,77 @@
+/* PR optimization/8634 */
+
+extern void abort (void);
+
+struct cfoo {
+ const int a : 15;
+ int b : 17;
+ const int c : 19;
+ int d : 13;
+ const int e : 14;
+ int f : 18;
+ const int g : 20;
+ int h : 12;
+};
+
+struct foo {
+ int a : 15;
+ int b : 17;
+ int c : 19;
+ int d : 13;
+ int e : 14;
+ int f : 18;
+ int g : 20;
+ int h : 12;
+};
+
+int test1 ()
+{
+ struct cfoo X = { .a = 'A', .c = 'C', .e = 'E', .g = 'G' };
+ struct foo Y;
+ __builtin_memcpy (&Y, &X, sizeof (X));
+ if (Y.a != 'A' || Y.b != 0 || Y.c != 'C' || Y.d != 0
+ || Y.e != 'E' || Y.f != 0 || Y.g != 'G' || Y.h != 0)
+ abort ();
+ return 0;
+}
+
+int test2 ()
+{
+ struct cfoo X = { .a = 'A', .d = 'D', .e = 'E', .h = 'H' };
+ struct foo Y;
+ __builtin_memcpy (&Y, &X, sizeof (X));
+ if (Y.a != 'A' || Y.b != 0 || Y.c != 0 || Y.d != 'D'
+ || Y.e != 'E' || Y.f != 0 || Y.g != 0 || Y.h != 'H')
+ abort ();
+ return 0;
+}
+
+int test3 ()
+{
+ struct cfoo X = { .a = 'A', .b = 'B', .c = 'C', .d = 'D',
+ .e = 'E', .f = 'F', .g = 'G', .h = 'H' };
+ struct foo Y;
+ __builtin_memcpy (&Y, &X, sizeof (X));
+ if (Y.a != 'A' || Y.b != 'B' || Y.c != 'C' || Y.d != 'D'
+ || Y.e != 'E' || Y.f != 'F' || Y.g != 'G' || Y.h != 'H')
+ abort ();
+ return 0;
+}
+
+int test4 ()
+{
+ const struct foo X = { .a = 'A', .b = 'B', .c = 'C', .d = 'D',
+ .e = 'E', .f = 'F', .g = 'G', .h = 'H' };
+ struct foo Y;
+ __builtin_memcpy (&Y, &X, sizeof (X));
+ if (Y.a != 'A' || Y.b != 'B' || Y.c != 'C' || Y.d != 'D'
+ || Y.e != 'E' || Y.f != 'F' || Y.g != 'G' || Y.h != 'H')
+ abort ();
+ return 0;
+}
+
+int main ()
+{
+ test1 (); test2 (); test3 (); test4 ();
+ return 0;
+}
Jakub