File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -175,12 +175,30 @@ static void orte_debugger_init_before_spawn(orte_job_t *jdata);
175175
176176ORTE_DECLSPEC void * __opal_attribute_optnone__ MPIR_Breakpoint (void );
177177
178+ /*
179+ * Attempt to prevent the compiler from optimizing out
180+ * MPIR_Breakpoint().
181+ *
182+ * Some older versions of automake can add -O3 to every
183+ * file via CFLAGS (which was demonstrated in automake v1.13.4),
184+ * so there is a possibility that the compiler will see
185+ * this function as a NOOP and optimize it out on older versions.
186+ * While using the current/recommended version of automake
187+ * does not do this, the following will help those
188+ * stuck with an older version, as well as guard against
189+ * future regressions.
190+ *
191+ * See the following git issue for more discussion:
192+ * https://github.com/open-mpi/ompi/issues/5501
193+ */
194+ static volatile void * volatile noop_mpir_breakpoint_ptr = NULL ;
195+
178196/*
179197 * Breakpoint function for parallel debuggers
180198 */
181199void * MPIR_Breakpoint (void )
182200{
183- return NULL ;
201+ return noop_mpir_breakpoint_ptr ;
184202}
185203
186204/* local objects */
You can’t perform that action at this time.
0 commit comments