aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto-opts.c')
-rw-r--r--gcc/lto-opts.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 9a635b1..026b323 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -167,7 +167,7 @@ lto_write_options (void)
"-fno-strict-overflow");
/* Append options from target hook and store them to offload_lto section. */
- if (strcmp (section_name_prefix, OFFLOAD_SECTION_NAME_PREFIX) == 0)
+ if (lto_stream_offload_p)
{
char *offload_opts = targetm.offload_options ();
char *offload_ptr = offload_opts;
@@ -208,7 +208,7 @@ lto_write_options (void)
/* Do not store target-specific options in offload_lto section. */
if ((cl_options[option->opt_index].flags & CL_TARGET)
- && strcmp (section_name_prefix, OFFLOAD_SECTION_NAME_PREFIX) == 0)
+ && lto_stream_offload_p)
continue;
/* Drop options created from the gcc driver that will be rejected
@@ -221,8 +221,7 @@ lto_write_options (void)
We do not need those. The only exception is -foffload option, if we
write it in offload_lto section. Also drop all diagnostic options. */
if ((cl_options[option->opt_index].flags & (CL_DRIVER|CL_WARNING))
- && (strcmp (section_name_prefix, OFFLOAD_SECTION_NAME_PREFIX) != 0
- || option->opt_index != OPT_foffload_))
+ && (!lto_stream_offload_p || option->opt_index != OPT_foffload_))
continue;
for (j = 0; j < option->canonical_option_num_elements; ++j)