+2017-11-15 Martin Liska <mliska@suse.cz>
+
+ * tree-cfg.c (pass_warn_function_return::execute):
+ Compare warn_return_type for greater than zero.
+
2017-11-15 Sebastian Peryt <sebastian.peryt@intel.com>
PR target/82941
+2017-11-15 Martin Liska <mliska@suse.cz>
+
+ * options.c (gfc_post_options):
+ Do not set default value of warn_return_type.
+ * trans-decl.c (gfc_trans_deferred_vars):
+ Compare warn_return_type for greater than zero.
+ (generate_local_decl): Likewise
+ (gfc_generate_function_code): Likewise.
+
2017-11-13 Fritz Reese <fritzoreese@gmail.com>
PR fortran/78240
gfc_fatal_error ("Maximum subrecord length cannot exceed %d",
MAX_SUBRECORD_LENGTH);
- if (warn_return_type == -1)
- warn_return_type = 0;
-
gfc_cpp_post_options ();
if (gfc_option.allow_std & GFC_STD_F2008)
break;
}
/* TODO: move to the appropriate place in resolve.c. */
- if (warn_return_type && el == NULL)
+ if (warn_return_type > 0 && el == NULL)
gfc_warning (OPT_Wreturn_type,
"Return value of function %qs at %L not set",
proc_sym->name, &proc_sym->declared_at);
else if (sym->attr.flavor == FL_PROCEDURE)
{
/* TODO: move to the appropriate place in resolve.c. */
- if (warn_return_type
+ if (warn_return_type > 0
&& sym->attr.function
&& sym->result
&& sym != sym->result
if (result == NULL_TREE || artificial_result_decl)
{
/* TODO: move to the appropriate place in resolve.c. */
- if (warn_return_type && sym == sym->result)
+ if (warn_return_type > 0 && sym == sym->result)
gfc_warning (OPT_Wreturn_type,
"Return value of function %qs at %L not set",
sym->name, &sym->declared_at);
- if (warn_return_type)
+ if (warn_return_type > 0)
TREE_NO_WARNING(sym->backend_decl) = 1;
}
if (result != NULL_TREE)
/* If we see "return;" in some basic block, then we do reach the end
without returning a value. */
- else if (warn_return_type
+ else if (warn_return_type > 0
&& !TREE_NO_WARNING (fun->decl)
&& EDGE_COUNT (EXIT_BLOCK_PTR_FOR_FN (fun)->preds) > 0
&& !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fun->decl))))