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