From 1aaa1e021498ca2a3ebab0b28bfc6d0b85c15dca Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Tue, 26 Jan 2016 15:44:30 +0000 Subject: [PATCH] Patch for score-p 1.4.2 fixing instrumentation issue with gfortran>=4.9. --- packages/performance/scorep/scorep-1.4.2 | 2 +- .../scorep/scorep-1.4.2-0001.patch | 84 +++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 packages/performance/scorep/scorep-1.4.2-0001.patch diff --git a/packages/performance/scorep/scorep-1.4.2 b/packages/performance/scorep/scorep-1.4.2 index a19ddf2..d9d0cd5 100755 --- a/packages/performance/scorep/scorep-1.4.2 +++ b/packages/performance/scorep/scorep-1.4.2 @@ -31,6 +31,6 @@ then fi src_prepare () { - patch -p2 < $SCLASS_DIR/$SCLASSFILE-0001.patch + patch -p1 < $SCLASS_DIR/$SCLASSFILE-0001.patch } diff --git a/packages/performance/scorep/scorep-1.4.2-0001.patch b/packages/performance/scorep/scorep-1.4.2-0001.patch new file mode 100644 index 0000000..2ef4726 --- /dev/null +++ b/packages/performance/scorep/scorep-1.4.2-0001.patch @@ -0,0 +1,84 @@ +Index: trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_inst_descriptor.inc.c +=================================================================== +--- trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_inst_descriptor.inc.c (revision 8827) ++++ trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_inst_descriptor.inc.c (revision 9322) +@@ -201,19 +201,19 @@ + + /* The struct is 64 bytes, because of reserved entries */ + DECL_SIZE( region_descr_var ) = build_int_cst( size_type_node, 64 * BITS_PER_UNIT ); + DECL_SIZE_UNIT( region_descr_var ) = build_int_cst( size_type_node, 64 ); + +- DECL_INITIAL( region_descr_var ) = region_descr_value; +- DECL_CONTEXT( region_descr_var ) = current_function_decl; +- set_decl_section_name( region_descr_var, region_descrs_section ); ++ DECL_INITIAL( region_descr_var ) = region_descr_value; ++ DECL_CONTEXT( region_descr_var ) = current_function_decl; + TREE_PUBLIC( region_descr_var ) = 0; + TREE_USED( region_descr_var ) = 1; + DECL_PRESERVE_P( region_descr_var ) = 1; + DECL_ARTIFICIAL( region_descr_var ) = 1; + DECL_IGNORED_P( region_descr_var ) = 1; + TREE_STATIC( region_descr_var ) = 1; ++ set_decl_section_name( region_descr_var, region_descrs_section ); + + mark_decl_referenced( region_descr_var ); + varpool_finalize_decl( region_descr_var ); + + DECL_SEEN_IN_BIND_EXPR_P( region_descr_var ) = 1; +Index: trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_inst_handle.inc.c +=================================================================== +--- trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_inst_handle.inc.c (revision 8827) ++++ trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_inst_handle.inc.c (revision 9322) +@@ -59,20 +59,20 @@ + tree handle_var = build_decl( UNKNOWN_LOCATION, + VAR_DECL, + get_identifier( region_handle_var_name ), + handle->type ); + +- DECL_INITIAL( handle_var ) = build_int_cst( handle->type, 0 ); +- DECL_CONTEXT( handle_var ) = current_function_decl; +- set_decl_section_name( handle_var, region_handles_section ); ++ DECL_INITIAL( handle_var ) = build_int_cst( handle->type, 0 ); ++ DECL_CONTEXT( handle_var ) = current_function_decl; + TREE_STATIC( handle_var ) = 1; + TREE_PUBLIC( handle_var ) = 0; + TREE_USED( handle_var ) = 1; + DECL_PRESERVE_P( handle_var ) = 1; + DECL_ARTIFICIAL( handle_var ) = 0; + DECL_IGNORED_P( handle_var ) = 0; + varpool_finalize_decl( handle_var ); ++ set_decl_section_name( handle_var, region_handles_section ); + + DECL_SEEN_IN_BIND_EXPR_P( handle_var ) = 1; + record_vars( handle_var ); + + handle->var = handle_var; +Index: trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_cxx.cpp +=================================================================== +--- trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_cxx.cpp (revision 8874) ++++ trunk/src/adapters/compiler/gcc-plugin/scorep_plugin_cxx.cpp (revision 9322) +@@ -64,18 +64,22 @@ + }; + + class pass_instrument : public gimple_opt_pass + { + public: +- pass_instrument ( gcc::context* ctxt ) ++ pass_instrument( gcc::context* ctxt ) + : gimple_opt_pass( pass_data_instrument, ctxt ) + { + } + + /* opt_pass methods: */ + unsigned int ++#if SCOREP_GCC_PLUGIN_TARGET_VERSION >= 5000 ++ execute( function* ) ++#else + execute() ++#endif + { + return scorep_plugin_pass_instrument_function(); + } + + opt_pass* +