mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/61564 (#pragma GCC optimize ("-fno-lto") causes the compiler to crash)
2016-06-07 Richard Biener <rguenther@suse.de> PR c/61564 * c-common.c (parse_optimize_options): Only apply CL_OPTIMIZATION options and warn about others. * common.opt (ffast-math): Make Optimization. * gcc.dg/Wpragmas-1.c: New testcase. * gcc.dg/Wattributes-4.c: Likewise. * gcc.dg/ipa/pr70646.c: Drop optimize pragma in favor of dg-option entry. From-SVN: r237174
This commit is contained in:
parent
6dc0465867
commit
bfd67b4731
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-06-07 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR c/61564
|
||||||
|
* common.opt (ffast-math): Make Optimization.
|
||||||
|
|
||||||
2016-06-07 Simon Dardis <simon.dardis@imgtec.com>
|
2016-06-07 Simon Dardis <simon.dardis@imgtec.com>
|
||||||
Prachi Godbole <prachi.godbole@imgtec.com>
|
Prachi Godbole <prachi.godbole@imgtec.com>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-06-07 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR c/61564
|
||||||
|
* c-common.c (parse_optimize_options): Only apply CL_OPTIMIZATION
|
||||||
|
options and warn about others.
|
||||||
|
|
||||||
2016-06-01 Eduard Sanou <dhole@openmailbox.org>
|
2016-06-01 Eduard Sanou <dhole@openmailbox.org>
|
||||||
|
|
||||||
* c-common.c (get_source_date_epoch): Rename to
|
* c-common.c (get_source_date_epoch): Rename to
|
||||||
|
|
|
||||||
|
|
@ -9580,6 +9580,29 @@ parse_optimize_options (tree args, bool attr_p)
|
||||||
decode_cmdline_options_to_array_default_mask (opt_argc, opt_argv,
|
decode_cmdline_options_to_array_default_mask (opt_argc, opt_argv,
|
||||||
&decoded_options,
|
&decoded_options,
|
||||||
&decoded_options_count);
|
&decoded_options_count);
|
||||||
|
/* Drop non-Optimization options. */
|
||||||
|
unsigned j = 1;
|
||||||
|
for (i = 1; i < decoded_options_count; ++i)
|
||||||
|
{
|
||||||
|
if (! (cl_options[decoded_options[i].opt_index].flags & CL_OPTIMIZATION))
|
||||||
|
{
|
||||||
|
ret = false;
|
||||||
|
if (attr_p)
|
||||||
|
warning (OPT_Wattributes,
|
||||||
|
"bad option %s to optimize attribute",
|
||||||
|
decoded_options[i].orig_option_with_args_text);
|
||||||
|
else
|
||||||
|
warning (OPT_Wpragmas,
|
||||||
|
"bad option %s to pragma attribute",
|
||||||
|
decoded_options[i].orig_option_with_args_text);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (i != j)
|
||||||
|
decoded_options[j] = decoded_options[i];
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
decoded_options_count = j;
|
||||||
|
/* And apply them. */
|
||||||
decode_options (&global_options, &global_options_set,
|
decode_options (&global_options, &global_options_set,
|
||||||
decoded_options, decoded_options_count,
|
decoded_options, decoded_options_count,
|
||||||
input_location, global_dc);
|
input_location, global_dc);
|
||||||
|
|
|
||||||
|
|
@ -1287,7 +1287,7 @@ EnumValue
|
||||||
Enum(excess_precision) String(standard) Value(EXCESS_PRECISION_STANDARD)
|
Enum(excess_precision) String(standard) Value(EXCESS_PRECISION_STANDARD)
|
||||||
|
|
||||||
ffast-math
|
ffast-math
|
||||||
Common
|
Common Optimization
|
||||||
|
|
||||||
ffat-lto-objects
|
ffat-lto-objects
|
||||||
Common Var(flag_fat_lto_objects)
|
Common Var(flag_fat_lto_objects)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,11 @@
|
||||||
|
2016-06-07 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR c/61564
|
||||||
|
* gcc.dg/Wpragmas-1.c: New testcase.
|
||||||
|
* gcc.dg/Wattributes-4.c: Likewise.
|
||||||
|
* gcc.dg/ipa/pr70646.c: Drop optimize pragma in favor of dg-option
|
||||||
|
entry.
|
||||||
|
|
||||||
2016-06-07 Christophe Lyon <christophe.lyon@linaro.org>
|
2016-06-07 Christophe Lyon <christophe.lyon@linaro.org>
|
||||||
|
|
||||||
* gcc.target/aarch64/advsimd-intrinsics/p64_p128.c: Remove
|
* gcc.target/aarch64/advsimd-intrinsics/p64_p128.c: Remove
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
/* { dg-do compile } */
|
||||||
|
|
||||||
|
int __attribute__((optimize("no-lto"))) main(void){return 0;} /* { dg-warning "bad option" } */
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
/* { dg-do compile } */
|
||||||
|
|
||||||
|
#pragma GCC push_options
|
||||||
|
#pragma GCC optimize ("-fno-lto") /* { dg-warning "bad option" } */
|
||||||
|
int main(void){return 0;}
|
||||||
|
#pragma GCC pop_options
|
||||||
|
|
||||||
|
/* ??? The FEs still apply the pragma string as optimize attribute to
|
||||||
|
all functions thus the diagnostic will be repeated for each function
|
||||||
|
affected. */
|
||||||
|
/* { dg-message "bad option" "" { target *-*-* } 0 } */
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
/* { dg-do run } */
|
/* { dg-do run } */
|
||||||
/* { dg-options "-O2" } */
|
/* { dg-options "-O2 -fno-unit-at-a-time" } */
|
||||||
|
|
||||||
#pragma GCC optimize("no-unit-at-a-time")
|
|
||||||
|
|
||||||
typedef unsigned char u8;
|
typedef unsigned char u8;
|
||||||
typedef unsigned long long u64;
|
typedef unsigned long long u64;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue