* expr.c (expand_expr): When checking promoted value, use
DECL_MODE (exp) and not mode.
* g++.dg/other/anon-union.C: New test.
From-SVN: r47674
+2001-12-05 Jakub Jelinek <jakub@redhat.com>
+
+ * expr.c (expand_expr): When checking promoted value, use
+ DECL_MODE (exp) and not mode.
+
2001-12-05 Jakub Jelinek <jakub@redhat.com>
* c-typeck.c (output_init_element): Call digest_init
but mark it so that we know that it was already extended. */
if (GET_CODE (DECL_RTL (exp)) == REG
- && GET_MODE (DECL_RTL (exp)) != mode)
+ && GET_MODE (DECL_RTL (exp)) != DECL_MODE (exp))
{
/* Get the signedness used for this variable. Ensure we get the
same mode we got when the variable was declared. */
* gcc.dg/noncompile/20011025-1.c: New test.
+ * g++.dg/other/anon-union.C: New test.
+
2001-12-04 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.c-torture/execute/20000722-1.x,
--- /dev/null
+// { dg-do compile }
+// { dg-options -O2 }
+
+int foo ();
+double bar (void)
+{
+ union
+ {
+ char a[8];
+ double b;
+ };
+
+ a[0] = foo ();
+ a[1] = foo ();
+ a[2] = foo ();
+ a[3] = foo ();
+ a[4] = foo ();
+ a[5] = foo ();
+ a[6] = foo ();
+ a[7] = foo ();
+ return b;
+}