https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66048
--- Comment #2 from Ilya Enkovich <ienkovich at gcc dot gnu.org> --- (In reply to Uroš Bizjak from comment #1) > There is a *very* picky assert in mode-switching.c that otherwise allows > various exceptions when expected sequence: > > (set (reg X) ...) > > (use (reg X)) With MPX we have multiple (use (reg X)) and only the last one is examined. It is always the one created for bounds. Simple swap makes it work. With this patch test passes: --- a/gcc/function.c +++ b/gcc/function.c @@ -5224,8 +5224,8 @@ diddle_return_value_1 (void (*doit) (rtx, void *), void *arg, rtx outgoing) void diddle_return_value (void (*doit) (rtx, void *), void *arg) { - diddle_return_value_1 (doit, arg, crtl->return_rtx); diddle_return_value_1 (doit, arg, crtl->return_bnd); + diddle_return_value_1 (doit, arg, crtl->return_rtx); } static void