+2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR fortran/66605
+ * cgraphunit.c (cgraph_node::finalize_function): Do not call
+ do_warn_unused_parameter.
+ * function.c (do_warn_unused_parameter): Move from here.
+ * function.h (do_warn_unused_parameter): Do not declare.
+
2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
PR target/65697
+2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR fortran/66605
+ * gcc-interface/misc.c (gnat_post_options): No need to disable
+ warn_unused_parameter anymore.
+
2015-06-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): When
sorry ("-fexcess-precision=standard for Ada");
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
- /* ??? The warning machinery is outsmarted by Ada. */
- warn_unused_parameter = 0;
-
/* No psABI change warnings for Ada. */
warn_psabi = 0;
+2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR fortran/66605
+ * c-common.c (do_warn_unused_parameter): Move here.
+ * c-common.h (do_warn_unused_parameter): Declare.
+
2015-06-29 Marek Polacek <polacek@redhat.com>
PR c/66322
warning_at (loc, OPT_Wdouble_promotion, gmsgid, source_type, result_type);
}
+/* Possibly warn about unused parameters. */
+
+void
+do_warn_unused_parameter (tree fn)
+{
+ tree decl;
+
+ for (decl = DECL_ARGUMENTS (fn);
+ decl; decl = DECL_CHAIN (decl))
+ if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
+ && DECL_NAME (decl) && !DECL_ARTIFICIAL (decl)
+ && !TREE_NO_WARNING (decl))
+ warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wunused_parameter,
+ "unused parameter %qD", decl);
+}
+
+
/* Setup a TYPE_DECL node as a typedef representation.
X is a TYPE_DECL for a typedef statement. Create a brand new
tree op0, tree op1,
tree result_type,
enum tree_code resultcode);
+extern void do_warn_unused_parameter (tree);
extern void do_warn_double_promotion (tree, tree, tree, const char *,
location_t);
extern void set_underlying_type (tree);
+2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR fortran/66605
+ * c-decl.c (finish_function): Call do_warn_unused_parameter.
+
2015-06-29 Marek Polacek <polacek@redhat.com>
PR c/66322
function. */
maybe_warn_unused_local_typedefs ();
+ /* Possibly warn about unused parameters. */
+ if (warn_unused_parameter)
+ do_warn_unused_parameter (fndecl);
+
/* Store the end of the function, so that we get good line number
info for the epilogue. */
cfun->function_end_locus = input_location;
if (!TREE_ASM_WRITTEN (decl))
(*debug_hooks->deferred_inline_function) (decl);
- /* Possibly warn about unused parameters. */
- if (warn_unused_parameter)
- do_warn_unused_parameter (decl);
-
if (!no_collect)
ggc_collect ();
+2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR fortran/66605
+ * decl.c (finish_function): Call do_warn_unused_parameter.
+
2015-06-29 Marek Polacek <polacek@redhat.com>
PR c/66322
function. */
maybe_warn_unused_local_typedefs ();
+ /* Possibly warn about unused parameters. */
+ if (warn_unused_parameter
+ && !processing_template_decl
+ && !DECL_CLONED_FUNCTION_P (fndecl))
+ do_warn_unused_parameter (fndecl);
+
/* Genericize before inlining. */
if (!processing_template_decl)
{
diddle_return_value (do_use_return_reg, NULL);
}
-/* Possibly warn about unused parameters. */
-void
-do_warn_unused_parameter (tree fn)
-{
- tree decl;
-
- for (decl = DECL_ARGUMENTS (fn);
- decl; decl = DECL_CHAIN (decl))
- if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
- && DECL_NAME (decl) && !DECL_ARTIFICIAL (decl)
- && !TREE_NO_WARNING (decl))
- warning (OPT_Wunused_parameter, "unused parameter %q+D", decl);
-}
-
/* Set the location of the insn chain starting at INSN to LOC. */
static void
extern void thread_prologue_and_epilogue_insns (void);
extern void diddle_return_value (void (*)(rtx, void*), void*);
extern void clobber_return_register (void);
-extern void do_warn_unused_parameter (tree);
extern void expand_function_end (void);
extern rtx get_arg_pointer_save_area (void);
extern void maybe_copy_prologue_epilogue_insn (rtx, rtx);
+2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR fortran/66605
+ * gfortran.dg/wunused-parameter.f90: New test.
+
2015-06-29 Richard Henderson <rth@redhat.com>
* gcc.target/i386/asm-flag-1.c: New.
--- /dev/null
+! { dg-do compile }
+! { dg-options "-Wunused-parameter" }
+! PR66605
+MODULE test
+ IMPLICIT NONE
+ INTEGER, PARAMETER :: wp = KIND(1.0D0)
+CONTAINS
+SUBROUTINE sub (neq, time, y, dydt)
+ IMPLICIT NONE
+ INTEGER :: neq
+ REAL(WP) :: time, y(neq), dydt(neq)
+
+ dydt(1) = 1.0 / y(1)
+END SUBROUTINE sub
+END MODULE