Author: syang
Date: 2010-12-03 12:51:12 -0500 (Fri, 03 Dec 2010)
New Revision: 3416
Modified:
trunk/osprey-gcc-4.2.0/gcc/tree.c
Log:
Fix to bug #594
approved by : Gautam
Modified: trunk/osprey-gcc-4.2.0/gcc/tree.c
===================================================================
--- trunk/osprey-gcc-4.2.0/gcc/tree.c 2010-12-03 13:04:25 UTC (rev 3415)
+++ trunk/osprey-gcc-4.2.0/gcc/tree.c 2010-12-03 17:51:12 UTC (rev 3416)
@@ -10522,6 +10522,23 @@
if (CPR()) { /* C++ */
switch (TREE_CODE(t)) {
case FUNCTION_DECL:
+
+ if (!DECL_LANG_SPECIFIC (t)) {
+ /* Following C++ snippet necessitates the need of condition
+ * "if (!DECL_LANG_SPECIFIC(t))"
+ *
+ * #pragma weak bar1 = foo1
+ * extern "C" void foo1 (void) { }
+ *
+ * The front end creates a decl tree both for bar1() and
foo1().
+ * The decl.lang_specific field of the decl tree for bar1() is
NULL,
+ * as evidenced in maybe_apply_pending_pragma_weaks().
+ * If the <t> being procesed is the decl tree for bar1(),
calling
+ * macros like DECL_GLOBAL_CTOR_P will incur segamentation
fault.
+ */
+ break;
+ }
+
_gs_bv(cp_decl_flags, GS_DECL_GLOBAL_CTOR_P,
DECL_GLOBAL_CTOR_P(t));
_gs_bv(cp_decl_flags, GS_DECL_GLOBAL_DTOR_P,
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel