@@ -1689,7 +1689,7 @@ Common Report Var(flag_profile_correction)
Enable correction of flow inconsistent profile data input
fprofile-generate
-Common
+Common Var(flag_profile_generate)
Enable common options for generating profile info for profile feedback directed optimizations
fprofile-generate=
@@ -833,6 +833,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
error_at (loc, "only one -flto-partition value can be specified");
}
+ if (opts->x_flag_generate_lto && opts->x_flag_profile_generate)
+ warning_at (loc, 0, "enabling both -fprofile-generate and -flto is a bad idea");
+
/* We initialize opts->x_flag_split_stack to -1 so that targets can set a
default value if they choose based on other options. */
if (opts->x_flag_split_stack == -1)
@@ -1728,6 +1731,7 @@ common_handle_option (struct gcc_options *opts,
case OPT_fprofile_generate_:
opts->x_profile_data_prefix = xstrdup (arg);
+ opts->x_flag_profile_generate = true;
value = true;
/* No break here - do -fprofile-generate processing. */
case OPT_fprofile_generate: