Looks fine, go ahead check it in, and please add the bug# in your checkin 
message.

Gautam



________________________________
From: shuxin yang <shuxin.ope...@gmail.com>
To: Gautam Chakrabarti <gautam.c...@yahoo.com>
Cc: open64-devel@lists.sourceforge.net
Sent: Thu, December 2, 2010 4:10:29 PM
Subject: Re: [Open64-devel] request code review

You are right. How about this one? Thanks

Shuxin

Index: gcc/tree.c
===================================================================
--- gcc/tree.c  (revision 3413)
+++ gcc/tree.c  (working copy)
@@ -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,


On Thu, Dec 2, 2010 at 2:41 PM, Gautam Chakrabarti <gautam.c...@yahoo.com> 
wrote:

Hi,
>
>Could you use the conditional to guard code at a smaller granularity, i.e., 
>maybe guard only the code under the FUNCTION_DECL case statement (ideally 
>enclose the smallest chunk of code depending on this)? The reason is there is 
>some other code under the CPR() conditional that needs DECL_LANG_SPECIFIC, and 
>they are already guarded as such. There is some code under CPR() which is 
>valid 
>even if DECL_LANG_SPECIFIC is NULL. So we probably don't want to disable these 
>codes just because this field is null, unless we can prove it's safe to do so.
>
>Thanks,
>Gautam
>
>
>
>
________________________________

>



      
------------------------------------------------------------------------------
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
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to