Message ID | CA+=Sn1m19B-h7Gq9E=zTUPRSEhLzZVtJKXf8vM2qHhQ4753mZw@mail.gmail.com |
---|---|
State | New |
Headers | show |
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 789c8b6..cb8b922 100644 (file) --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -3079,6 +3079,11 @@ expand_value_return (rtx val) else mode = promote_function_mode (type, old_mode, &unsignedp, funtype, 1); + /* If the mode of val is not VOID mode (that is val is not a constant), + use it for the old mode. */ + if (mode != BLKmode && GET_MODE (val) != VOIDmode) + old_mode = GET_MODE(val); + if (mode != old_mode) val = convert_modes (mode, old_mode, val, unsignedp);