re PR c++/6073 ([Solaris] Internal compiler error in simplify_gen_subreg, at simplify-rtx.c:2711)
PR c++/6073 * class.c (finish_struct_1): Update static field's DECL_MODE even if its type is a variant of t. * g++.dg/opt/static1.C: New test. From-SVN: r51549
This commit is contained in:
parent
c9045f47b6
commit
c7f4981a51
@ -1,3 +1,9 @@
|
||||
2002-03-29 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/6073
|
||||
* class.c (finish_struct_1): Update static field's DECL_MODE even
|
||||
if its type is a variant of t.
|
||||
|
||||
2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine.
|
||||
|
@ -5191,7 +5191,7 @@ finish_struct_1 (t)
|
||||
working on. */
|
||||
for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x))
|
||||
if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x)
|
||||
&& TREE_TYPE (x) == t)
|
||||
&& same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (x)), t))
|
||||
DECL_MODE (x) = TYPE_MODE (t);
|
||||
|
||||
/* Done with FIELDS...now decide whether to sort these for
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-03-29 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* g++.dg/opt/static1.C: New test.
|
||||
|
||||
2002-03-28 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* gcc.dg/weak-1.c: Fix typo in scan-assembler pattern.
|
||||
|
20
gcc/testsuite/g++.dg/opt/static1.C
Normal file
20
gcc/testsuite/g++.dg/opt/static1.C
Normal file
@ -0,0 +1,20 @@
|
||||
// PR c++/6073
|
||||
// This testcase ICEd because finish_struct_bits changed
|
||||
// A's and const A's TYPE_MODE from QI to BLK, but did
|
||||
// not change a's DECL_MODE because its mode was not
|
||||
// TYPE_MAIN_VARIANT.
|
||||
|
||||
struct A
|
||||
{
|
||||
static const A a;
|
||||
~A ();
|
||||
};
|
||||
|
||||
void bar (A x);
|
||||
void foo ();
|
||||
|
||||
void
|
||||
foo ()
|
||||
{
|
||||
bar (A::a);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user