This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/51391] Differences between setting Winline in command-line and through pragma GCC diagnostic
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 03 Dec 2011 11:04:48 +0000
- Subject: [Bug c/51391] Differences between setting Winline in command-line and through pragma GCC diagnostic
- Auto-submitted: auto-generated
- References: <bug-51391-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51391
--- Comment #14 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-12-03 11:04:48 UTC ---
This patch fixes the issue:
Index: gcc/opts.c
===================================================================
--- gcc/opts.c (revision 180166)
+++ gcc/opts.c (working copy)
@@ -1423,10 +1423,20 @@ common_handle_option (struct gcc_options
enable_warning_as_error (arg, value, lang_mask, handlers,
opts, opts_set, loc, dc);
break;
+ case OPT_Winline:
+ if (opts->x_optimize == 0)
+ {
+ /* Inlining does not work if not optimizing,
+ so force it not to be done. */
+ opts->x_warn_inline = 0;
+ opts->x_flag_no_inline = 1;
+ }
+ break;
+
case OPT_Wlarger_than_:
opts->x_larger_than_size = value;
opts->x_warn_larger_than = value != -1;
break;
Feel free to take it and prepare it for submission:
http://gcc.gnu.org/contribute.html#patches