Author: dgilmore Date: 2011-01-27 18:28:49 -0500 (Thu, 27 Jan 2011) New Revision: 3470
Modified: trunk/osprey/be/com/privatize_common.cxx trunk/osprey/be/com/wn_mp.cxx trunk/osprey/crayf90/fe90/i_cvrt.c trunk/osprey/crayf90/fe90/p_directiv.c trunk/osprey/crayf90/fe90/sytb.h trunk/osprey/crayf90/fe90/sytb.m trunk/osprey/crayf90/sgi/cwh_stab.cxx trunk/osprey/ipa/main/optimize/ipo_split.cxx Log: Fixed Bug 686 (Problem using OMP THREADPRIVATE module in FORTRAN module). Reviewed and approved by Michael Lai. Modified: trunk/osprey/be/com/privatize_common.cxx =================================================================== --- trunk/osprey/be/com/privatize_common.cxx 2011-01-25 22:08:21 UTC (rev 3469) +++ trunk/osprey/be/com/privatize_common.cxx 2011-01-27 23:28:49 UTC (rev 3470) @@ -1,4 +1,7 @@ /* + * Copyright (C) 2010 Advanced Micro Devices, Inc. All Rights Reserved. + */ +/* * Copyright 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. */ @@ -507,9 +510,11 @@ if (st) { ST *split_block; ST *common_block = ST_Source_Block(st, &split_block); - if (ST_is_thread_private(st) || - (split_block && ST_is_thread_private(split_block)) || - (common_block && ST_is_thread_private(common_block))) { + + // Note that symbols in blocks are now marked to be thread private + // since it is possible that some symbols can be referenced as thread + // private and some as global. + if (ST_is_thread_private(st)) { ST *new_st; // renamed version of st ST *new_st_for_common_blk; Modified: trunk/osprey/be/com/wn_mp.cxx =================================================================== --- trunk/osprey/be/com/wn_mp.cxx 2011-01-25 22:08:21 UTC (rev 3469) +++ trunk/osprey/be/com/wn_mp.cxx 2011-01-27 23:28:49 UTC (rev 3470) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (C) 2009-2010 Advanced Micro Devices, Inc. All Rights Reserved. */ /* @@ -5904,7 +5904,7 @@ } if (!match) Fail_FmtAssertion ( "bad copyin st (%s) in MP processing", - ST_st_idx(copyin_st) ); + ST_name(copyin_st) ); if (copyin_global_st) common_block = copyin_global_st; else Modified: trunk/osprey/crayf90/fe90/i_cvrt.c =================================================================== --- trunk/osprey/crayf90/fe90/i_cvrt.c 2011-01-25 22:08:21 UTC (rev 3469) +++ trunk/osprey/crayf90/fe90/i_cvrt.c 2011-01-27 23:28:49 UTC (rev 3470) @@ -13487,6 +13487,10 @@ flag = flag | ((long64) 1 << FEI_OBJECT_ADDRTAKEN); } + if (ATD_TASK_PRIVATE(attr_idx) && SB_BLK_TYPE(sb_idx) != Stack) { + flag |= 1 << FEI_SEG_THREADPRIVATE; + } + if (class == Component) { PDG_DBG_PRINT_START PDG_DBG_PRINT_C("fei_member"); Modified: trunk/osprey/crayf90/fe90/p_directiv.c =================================================================== --- trunk/osprey/crayf90/fe90/p_directiv.c 2011-01-25 22:08:21 UTC (rev 3469) +++ trunk/osprey/crayf90/fe90/p_directiv.c 2011-01-27 23:28:49 UTC (rev 3470) @@ -1,4 +1,7 @@ /* + * Copyright (C) 2010 Advanced Micro Devices, Inc. All Rights Reserved. + */ +/* * Copyright (C) 2006. QLogic Corporation. All Rights Reserved. */ @@ -1372,6 +1375,15 @@ SB_BLK_TYPE(sb_idx) = Threadprivate; SB_RUNTIME_INIT(sb_idx) = FALSE; SB_IS_COMMON(sb_idx) = TRUE; + + /* Mark elements of the common block as thread private. + */ + attr_idx = SB_FIRST_ATTR_IDX(sb_idx); + + while (attr_idx != NULL_IDX) { + ATD_TASK_PRIVATE(attr_idx) = TRUE; + attr_idx = ATD_NEXT_MEMBER_IDX(attr_idx); + } } if (LA_CH_VALUE == SLASH) { @@ -1405,6 +1417,11 @@ AT_OBJ_CLASS(attr_idx) = Data_Obj; SET_IMPL_TYPE(attr_idx); } + /* Note that symbols in blocks are now marked to be thread private + * since it is possible that some symbols can be referenced as thread + * private and some as global. + */ + ATD_TASK_PRIVATE(attr_idx) = TRUE; #ifdef KEY if (ATD_STOR_BLK_IDX(attr_idx) == NULL_IDX) { assign_storage_blk(attr_idx); Modified: trunk/osprey/crayf90/fe90/sytb.h =================================================================== --- trunk/osprey/crayf90/fe90/sytb.h 2011-01-25 22:08:21 UTC (rev 3469) +++ trunk/osprey/crayf90/fe90/sytb.h 2011-01-27 23:28:49 UTC (rev 3470) @@ -396,12 +396,9 @@ Uint orig_module_idx : 20; boolean module_object : 1; -#ifdef KEY boolean flag57 : 1; - Uint unused : 10; -#else - Uint unused : 11; -#endif + boolean flag58 : 1; + Uint unused : 9; Uint unused1 : 8; Uint field7 : 24; Modified: trunk/osprey/crayf90/fe90/sytb.m =================================================================== --- trunk/osprey/crayf90/fe90/sytb.m 2011-01-25 22:08:21 UTC (rev 3469) +++ trunk/osprey/crayf90/fe90/sytb.m 2011-01-27 23:28:49 UTC (rev 3470) @@ -1262,6 +1262,15 @@ # endif # ifdef _DEBUG +# define ATD_TASK_PRIVATE(IDX) \ + ((AT_OBJ_CLASS(IDX) == Data_Obj) ? \ + attr_tbl:sytb_var_error("ATD_TASK_PRIVATE", IDX)) \ + [IDX].fld.flag58 +# else +# define ATD_TASK_PRIVATE(IDX) attr_tbl[IDX].fld.flag58 +# endif + +# ifdef _DEBUG # define ATD_TASK_COPYIN(IDX) \ ((AT_OBJ_CLASS(IDX) == Data_Obj) ? \ attr_aux_tbl:attr_aux_var_error("ATD_TASK_COPYIN", IDX)) \ @@ -1325,14 +1334,10 @@ # define ATD_TASK_LASTTHREAD(IDX) attr_aux_tbl[IDX].fld.flag16 # endif -# ifdef _DEBUG -# define ATD_TASK_PRIVATE(IDX) \ - ((AT_OBJ_CLASS(IDX) == Data_Obj) ? \ - attr_aux_tbl:attr_aux_var_error("ATD_TASK_PRIVATE", IDX)) \ - [IDX].fld.flag12 -# else -# define ATD_TASK_PRIVATE(IDX) attr_aux_tbl[IDX].fld.flag12 -# endif +/* Module elements can be private or shared, see bug 686. + * ATD_TASK_PRIVATE is now a field of an element of attr_tbl (not + * attr_aux_tbl) since attr_aux_tbl is not exported in modules. + */ # ifdef _DEBUG # define ATD_TASK_REDUCTION(IDX) \ Modified: trunk/osprey/crayf90/sgi/cwh_stab.cxx =================================================================== --- trunk/osprey/crayf90/sgi/cwh_stab.cxx 2011-01-25 22:08:21 UTC (rev 3469) +++ trunk/osprey/crayf90/sgi/cwh_stab.cxx 2011-01-27 23:28:49 UTC (rev 3470) @@ -1,4 +1,7 @@ /* + * Copyright (C) 2010 Advanced Micro Devices, Inc. All Rights Reserved. + */ +/* * Copyright (C) 2008. PathScale, LLC. All Rights Reserved. */ /* @@ -993,6 +996,10 @@ Set_ST_is_const_var(st); } + if (test_flag(flag_bits,FEI_SEG_THREADPRIVATE)) { + Set_ST_is_thread_private(st); + } + /* if dummy, name is the address. CQ, array, character results */ /* are addresses. Struct temp addresses should be values if 16B */ /* or less and are converted here rather than FE */ Modified: trunk/osprey/ipa/main/optimize/ipo_split.cxx =================================================================== --- trunk/osprey/ipa/main/optimize/ipo_split.cxx 2011-01-25 22:08:21 UTC (rev 3469) +++ trunk/osprey/ipa/main/optimize/ipo_split.cxx 2011-01-27 23:28:49 UTC (rev 3470) @@ -365,6 +365,8 @@ Set_TY_name_idx(Ty_Table[ty_idx], ST_name_idx(*new_st)); Set_TY_split(Ty_Table[ty_idx]); Set_ST_is_split_common(new_st); + if (ST_is_thread_private(s)) + Set_ST_is_thread_private(new_st); // attach the field information if (Field_Map) ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel