aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-11-27 12:31:55 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-11-27 12:31:55 +0100
commite96fee3e91436d8183a5dd06223b37ae8393c928 (patch)
tree28545f40a581570ca5d9ad5adf96ce72bc4c49ca
parent85539630e3abdad70f84d87eb0a4458f44961e03 (diff)
downloadgcc-e96fee3e91436d8183a5dd06223b37ae8393c928.zip
gcc-e96fee3e91436d8183a5dd06223b37ae8393c928.tar.gz
gcc-e96fee3e91436d8183a5dd06223b37ae8393c928.tar.bz2
opts.c (decode_options): If optimize is bigger than 255, set it to 255.
* opts.c (decode_options): If optimize is bigger than 255, set it to 255. * gcc.dg/O16384.c: New test. From-SVN: r154699
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/opts.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/O16384.c15
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e3c27aa..1519f27 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-27 Jakub Jelinek <jakub@redhat.com>
+
+ * opts.c (decode_options): If optimize is bigger than 255,
+ set it to 255.
+
2009-11-26 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (mulv16qi3): Change back from an expander
diff --git a/gcc/opts.c b/gcc/opts.c
index 3a825ce..7660bd8 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -829,6 +829,8 @@ decode_options (unsigned int argc, const char **argv)
if (optimize_val != -1)
{
optimize = optimize_val;
+ if ((unsigned int) optimize > 255)
+ optimize = 255;
optimize_size = 0;
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cd4c631..e1c93e0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-27 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/O16384.c: New test.
+
2009-11-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35112
diff --git a/gcc/testsuite/gcc.dg/O16384.c b/gcc/testsuite/gcc.dg/O16384.c
new file mode 100644
index 0000000..32e17d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/O16384.c
@@ -0,0 +1,15 @@
+/* Test insane -O argument. */
+/* { dg-do compile } */
+/* { dg-options "-O16384" } */
+
+__attribute__((__optimize__(16396), __noinline__)) void
+foo (void)
+{
+}
+
+int
+main (void)
+{
+ foo ();
+ return 0;
+}