summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-02-15 08:17:24 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-02-15 08:17:24 +0100
commitf521d9d8ad83137bd2965556f2395a264efa80d7 (patch)
tree619ab47720d6b4e80b5c45a661ea8ff0285ecb36
parent8a9f2a6bbd6bdf164ca987edac34ac72447881a5 (diff)
downloadgcc-f521d9d8ad83137bd2965556f2395a264efa80d7.tar.gz
re PR other/89342 (ICE in maybe_default_option, at opts.c:347)
PR other/89342 * optc-save-gen.awk: Handle optimize_fast like optimize_size or optimize_debug. * opth-gen.awk: Likewise. * gcc.dg/pr89342.c: New test. From-SVN: r268924
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/optc-save-gen.awk13
-rw-r--r--gcc/opth-gen.awk3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr89342.c11
5 files changed, 34 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a41a0a9151f..6045ad0d248 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR other/89342
+ * optc-save-gen.awk: Handle optimize_fast like optimize_size or
+ optimize_debug.
+ * opth-gen.awk: Likewise.
+
2019-02-15 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/i386.h (TARGET_SUBTARGET64_ISA_DEFAULT):
diff --git a/gcc/optc-save-gen.awk b/gcc/optc-save-gen.awk
index 72ebc448ccc..7ecd1eb9cc7 100644
--- a/gcc/optc-save-gen.awk
+++ b/gcc/optc-save-gen.awk
@@ -81,7 +81,7 @@ print "void";
print "cl_optimization_save (struct cl_optimization *ptr, struct gcc_options *opts)";
print "{";
-n_opt_char = 3;
+n_opt_char = 4;
n_opt_short = 0;
n_opt_int = 0;
n_opt_enum = 0;
@@ -90,9 +90,11 @@ n_opt_other = 0;
var_opt_char[0] = "optimize";
var_opt_char[1] = "optimize_size";
var_opt_char[2] = "optimize_debug";
+var_opt_char[3] = "optimize_fast";
var_opt_range["optimize"] = "0, 255";
var_opt_range["optimize_size"] = "0, 1";
var_opt_range["optimize_debug"] = "0, 1";
+var_opt_range["optimize_fast"] = "0, 1";
# Sort by size to mimic how the structure is laid out to be friendlier to the
# cache.
@@ -767,16 +769,19 @@ for (i = 0; i < n_target_val; i++) {
print "}";
-n_opt_val = 3;
+n_opt_val = 4;
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_val_type[1] = "char "
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 "
+var_opt_hash[2] = 1;
+var_opt_val[3] = "x_optimize_fast"
+var_opt_val_type[3] = "char "
+var_opt_hash[3] = 1;
for (i = 0; i < n_opts; i++) {
if (flag_set_p("(Optimization|PerFunction)", flags[i])) {
name = var_name(flags[i])
diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk
index a143c41a8d6..297456f62e7 100644
--- a/gcc/opth-gen.awk
+++ b/gcc/opth-gen.awk
@@ -132,7 +132,7 @@ print "/* Structure to save/restore optimization and target specific options. *
print "struct GTY(()) cl_optimization";
print "{";
-n_opt_char = 3;
+n_opt_char = 4;
n_opt_short = 0;
n_opt_int = 0;
n_opt_enum = 0;
@@ -140,6 +140,7 @@ n_opt_other = 0;
var_opt_char[0] = "unsigned char x_optimize";
var_opt_char[1] = "unsigned char x_optimize_size";
var_opt_char[2] = "unsigned char x_optimize_debug";
+var_opt_char[3] = "unsigned char x_optimize_fast";
for (i = 0; i < n_opts; i++) {
if (flag_set_p("(Optimization|PerFunction)", flags[i])) {
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a08f4013197..f122cd78037 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR other/89342
+ * gcc.dg/pr89342.c: New test.
+
2019-02-14 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/89354
diff --git a/gcc/testsuite/gcc.dg/pr89342.c b/gcc/testsuite/gcc.dg/pr89342.c
new file mode 100644
index 00000000000..3bc779c1ddc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr89342.c
@@ -0,0 +1,11 @@
+/* PR other/89342 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+__attribute__((optimize("Ofast")))
+void foo (void)
+{
+ __attribute__((optimize("no-inline")))
+ void bar (void) {}
+ bar ();
+}