+2020-01-07 Martin Liska <mliska@suse.cz>
+
+ PR tree-optimization/92860
+ * common.opt: Make in Optimization option
+ as it is affected by -O0, which is an Optimization
+ option.
+ * tree-inline.c (tree_inlinable_function_p):
+ Use opt_for_fn for warn_inline.
+ (expand_call_inline): Likewise.
+
2020-01-07 Martin Liska <mliska@suse.cz>
PR tree-optimization/92860
Warn when a switch case falls through.
Winline
-Common Var(warn_inline) Warning
+Common Var(warn_inline) Warning Optimization
Warn when an inlined function cannot be inlined.
Winvalid-memory-model
+2020-01-07 Martin Liska <mliska@suse.cz>
+
+ PR tree-optimization/92860
+ * gcc.dg/pr92860-2.c: New test.
+
2020-01-07 Martin Liska <mliska@suse.cz>
PR tree-optimization/92860
--- /dev/null
+/* PR tree-optimization/92860 */
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2 -fgnu89-inline" } */
+
+#pragma GCC push_options
+#pragma GCC optimize("-O0")
+#pragma GCC pop_options
+
+inline int q(void); /* { dg-warning "body not available" } */
+inline int t(void)
+{
+ return q(); /* { dg-message "called from here" } */
+}
return false;
/* We only warn for functions declared `inline' by the user. */
- do_warning = (warn_inline
+ do_warning = (opt_for_fn (fn, warn_inline)
&& DECL_DECLARED_INLINE_P (fn)
&& !DECL_NO_INLINE_WARNING_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn));
inform (DECL_SOURCE_LOCATION (cfun->decl),
"called from this function");
}
- else if (warn_inline
+ else if (opt_for_fn (fn, warn_inline)
&& DECL_DECLARED_INLINE_P (fn)
&& !DECL_NO_INLINE_WARNING_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn)