This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Update pass manager to handle generate_summary/transform functions
"Rafael Espindola" <espindola@google.com> writes:
> --- a/gcc/tree-cfg.c
> +++ b/gcc/tree-cfg.c
> @@ -7197,10 +7197,13 @@ execute_warn_function_return (void)
> && TREE_OPERAND (last, 0) == NULL
> && !TREE_NO_WARNING (last))
> {
> + location_t saved_input_location = input_location;
> location = EXPR_LOCATION (last);
> if (location == UNKNOWN_LOCATION)
> location = cfun->function_end_locus;
> + input_location = location;
> warning (OPT_Wreturn_type, "%Hcontrol reaches end of non-void function", &location);
> + input_location = saved_input_location;
> TREE_NO_WARNING (cfun->decl) = 1;
> break;
> }
Why is it necessary to set input_location before calling this warning?
The warning uses %H anyhow.
Otherwise the patch is OK.
Thanks.
Ian