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