File tree 1 file changed +19
-1
lines changed
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);
175
175
176
176
ORTE_DECLSPEC void * __opal_attribute_optnone__ MPIR_Breakpoint (void );
177
177
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
+
178
196
/*
179
197
* Breakpoint function for parallel debuggers
180
198
*/
181
199
void * MPIR_Breakpoint (void )
182
200
{
183
- return NULL ;
201
+ return noop_mpir_breakpoint_ptr ;
184
202
}
185
203
186
204
/* local objects */
You can’t perform that action at this time.
0 commit comments