This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: one test case, two bugs (C++ & backend)
- To: drepper at cygnus dot com
- Subject: Re: one test case, two bugs (C++ & backend)
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 07 Oct 1999 22:48:54 -0700
- Cc: gcc-bugs at sourceware dot cygnus dot com
- Organization: CodeSourcery, LLC
- References: <m3n1tvg5o0.fsf@localhost.localnet>
The front-end portion of the test-case is fixed with this patch.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
1999-10-07 Mark Mitchell <mark@codesourcery.com>
* semantics.c (expand_stmt): Don't pretend to have asmspecs for
local statics if we don't really have them.
Index: testsuite/g++.old-deja/g++.other/static9.C
===================================================================
RCS file: static9.C
diff -N static9.C
*** /dev/null Sat Dec 5 20:30:03 1998
--- static9.C Thu Oct 7 22:41:13 1999
***************
*** 0 ****
--- 1,17 ----
+ // Build don't link:
+ // Origin: Ulrich Drepper <drepper@cygnus.com>
+
+ struct st
+ {
+ int a, b, c, d;
+ };
+
+ void g ()
+ {
+ static const st i = { 0,1,2,3 };
+ }
+
+ void h ()
+ {
+ static const st i = { 0,1,2,3 };
+ }
Index: cp/semantics.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/semantics.c,v
retrieving revision 1.95
diff -c -p -r1.95 semantics.c
*** semantics.c 1999/10/07 16:41:47 1.95
--- semantics.c 1999/10/08 05:41:15
*************** expand_stmt (t)
*** 2301,2309 ****
DECL_ANON_UNION_ELEMS (decl));
}
else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
! rest_of_decl_compilation
! (decl, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)),
! /*top_level=*/0, /*at_end=*/0);
resume_momentary (i);
}
--- 2301,2321 ----
DECL_ANON_UNION_ELEMS (decl));
}
else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
! {
! const char *asmspec = NULL;
!
! if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
! {
! /* The only way this situaton can occur is if the
! user specified a name for this DECL using the
! `attribute' syntax. */
! asmspec = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
! DECL_ASSEMBLER_NAME (decl) = DECL_NAME (decl);
! }
!
! rest_of_decl_compilation (decl, asmspec,
! /*top_level=*/0, /*at_end=*/0);
! }
resume_momentary (i);
}