mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-11 20:00:30 +08:00
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
This commit is contained in:
parent
822baa84c8
commit
7254c5fa73
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
@ -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,
|
||||
|
22
gcc/testsuite/g++.dg/other/anon-union.C
Normal file
22
gcc/testsuite/g++.dg/other/anon-union.C
Normal file
@ -0,0 +1,22 @@
|
||||
// { 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user