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:
parent
b6f4a7876d
commit
471f9e24a6
@ -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
|
||||
|
@ -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 "";
|
||||
|
@ -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.
|
||||
|
23
gcc/testsuite/gcc.dg/func-attr-1.c
Normal file
23
gcc/testsuite/gcc.dg/func-attr-1.c
Normal 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" } } */
|
Loading…
Reference in New Issue
Block a user