optc-save-gen.awk: Set var_opt_hash for initial optimizations and set current index for other...

gcc/:
	* optc-save-gen.awk: Set var_opt_hash for initial optimizations
	and set current index for other optimizations.
gcc/testsuite/:
	* gcc.dg/func-attr-1.c: New test.

From-SVN: r268860
This commit is contained in:
Ian Lance Taylor 2019-02-14 00:25:40 +00:00 committed by Ian Lance Taylor
parent b6f4a7876d
commit 471f9e24a6
4 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2019-02-13 Ian Lance Taylor <iant@golang.org>
* optc-save-gen.awk: Set var_opt_hash for initial optimizations
and set current index for other optimizations.
2019-02-13 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/sse.md (vec_set<VI4F_256_512:mode>_0): Use

View File

@ -770,8 +770,11 @@ print "}";
n_opt_val = 3;
var_opt_val[0] = "x_optimize"
var_opt_val_type[0] = "char "
var_opt_hash[0] = 1;
var_opt_val[1] = "x_optimize_size"
var_opt_hash[1] = 1;
var_opt_val[2] = "x_optimize_debug"
var_opt_hash[2] = 1;
var_opt_val_type[1] = "char "
var_opt_val_type[2] = "char "
for (i = 0; i < n_opts; i++) {
@ -787,8 +790,9 @@ for (i = 0; i < n_opts; i++) {
otype = var_type_struct(flags[i])
var_opt_val_type[n_opt_val] = otype;
var_opt_val[n_opt_val++] = "x_" name;
var_opt_val[n_opt_val] = "x_" name;
var_opt_hash[n_opt_val] = flag_set_p("Optimization", flags[i]);
n_opt_val++;
}
}
print "";

View File

@ -1,3 +1,7 @@
2019-02-13 Ian Lance Taylor <iant@golang.org>
* gcc.dg/func-attr-1.c: New test.
2019-02-13 Uroš Bizjak <ubizjak@gmail.com>
* gcc.target/i386/sse2-init-v2di-2.c (dg-final): Update scan string.

View File

@ -0,0 +1,23 @@
/* Test that setting -Os in a function attribute works. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-rtl-bbro" } */
extern void f1 ();
extern int f2 ();
__attribute__ ((__optimize__ ("O2")))
void
f3()
{
}
__attribute__ ((__optimize__ ("-Os", "-falign-functions", "-falign-jumps", "-falign-labels", "-falign-loops", "-fno-inline-functions", "-foptimize-strlen")))
int
f4 () {
if (f2 () == 0) {
f1 ();
}
return 0;
}
/* { dg-final { scan-rtl-dump-not "Duplicated bb" "bbro" } } */