From: Jakub Jelinek Date: Mon, 5 Jul 2004 21:37:40 +0000 (+0200) Subject: expr.c (expand_assignment): Disable the bitfield += optimizations. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7682ef833a7aadac91f2fd21d2c61b74f4d4c957;p=gcc.git expr.c (expand_assignment): Disable the bitfield += optimizations. * expr.c (expand_assignment): Disable the bitfield += optimizations. * gcc.c-torture/execute/20040629-1.c (FIELDS1, FIELDS2): Define to nothing if not yet defined. Use it in b, c and d type definitions. * gcc.c-torture/execute/20040705-1.c: New test. * gcc.c-torture/execute/20040705-2.c: New test. From-SVN: r84133 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2b6a628fcc7..7e4ae9b2e2d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2004-07-05 Jakub Jelinek + + * expr.c (expand_assignment): Disable the bitfield += optimizations. + 2004-07-05 Joseph S. Myers * doc/sourcebuild.texi: Revert previous patch. diff --git a/gcc/expr.c b/gcc/expr.c index 3c15a7bde7a..b5feed7a19f 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -3802,7 +3802,9 @@ expand_assignment (tree to, tree from, int want_value) MEM_KEEP_ALIAS_SET_P (to_rtx) = 1; } - while (mode1 == VOIDmode && !want_value + /* Disabled temporarily. GET_MODE (to_rtx) is often not the right + mode. */ + while (0 && mode1 == VOIDmode && !want_value && bitpos + bitsize <= BITS_PER_WORD && bitsize < BITS_PER_WORD && GET_MODE_BITSIZE (GET_MODE (to_rtx)) <= BITS_PER_WORD diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e12cd88c26f..2a29944a62a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2004-07-05 Jakub Jelinek + + * gcc.c-torture/execute/20040629-1.c (FIELDS1, FIELDS2): Define to + nothing if not yet defined. Use it in b, c and d type definitions. + * gcc.c-torture/execute/20040705-1.c: New test. + * gcc.c-torture/execute/20040705-2.c: New test. + 2004-07-05 Giovanni Bajo PR c++/2518 diff --git a/gcc/testsuite/gcc.c-torture/execute/20040629-1.c b/gcc/testsuite/gcc.c-torture/execute/20040629-1.c index 9180d6c2920..6b3e9069240 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20040629-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20040629-1.c @@ -4,9 +4,16 @@ extern void abort (void); extern void exit (int); -struct { unsigned int i : 6, j : 11, k : 15; } b; -struct { unsigned int i : 5, j : 1, k : 26; } c; -struct { unsigned int i : 16, j : 8, k : 8; } d; +#ifndef FIELDS1 +#define FIELDS1 +#endif +#ifndef FIELDS2 +#define FIELDS2 +#endif + +struct { FIELDS1 unsigned int i : 6, j : 11, k : 15; FIELDS2 } b; +struct { FIELDS1 unsigned int i : 5, j : 1, k : 26; FIELDS2 } c; +struct { FIELDS1 unsigned int i : 16, j : 8, k : 8; FIELDS2 } d; unsigned int ret1 (void) { return b.i; } unsigned int ret2 (void) { return b.j; } diff --git a/gcc/testsuite/gcc.c-torture/execute/20040705-1.c b/gcc/testsuite/gcc.c-torture/execute/20040705-1.c new file mode 100644 index 00000000000..a9ba88ec2e9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20040705-1.c @@ -0,0 +1,2 @@ +#define FIELDS1 long long l; +#include "20040629-1.c" diff --git a/gcc/testsuite/gcc.c-torture/execute/20040705-2.c b/gcc/testsuite/gcc.c-torture/execute/20040705-2.c new file mode 100644 index 00000000000..a36fb6a681e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20040705-2.c @@ -0,0 +1,2 @@ +#define FIELDS2 long long l; +#include "20040629-1.c"