Commit 7254c5fa by Jakub Jelinek Committed by Jakub Jelinek

expr.c (expand_expr): When checking promoted value, use DECL_MODE (exp) and not mode.

	* 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
parent 822baa84
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
just once, not in each if branch and check its return value for
error_mark_node.
......
......@@ -6452,7 +6452,7 @@ expand_expr (exp, target, tmode, modifier)
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. */
......
......@@ -4,6 +4,8 @@
* 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,
......
// { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment