diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-27 11:31:55 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-27 11:31:55 +0000 |
commit | 53ea50ea0050dbb03b0a34ae5db4e1c6193d2d3d (patch) | |
tree | 28545f40a581570ca5d9ad5adf96ce72bc4c49ca /gcc | |
parent | 4272a2e82e431ac85afd0404d49b28043dc480ee (diff) | |
download | gcc-53ea50ea0050dbb03b0a34ae5db4e1c6193d2d3d.tar.gz |
* opts.c (decode_options): If optimize is bigger than 255,
set it to 255.
* gcc.dg/O16384.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154699 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/opts.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/O16384.c | 15 |
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e3c27aa7a66..1519f27b193 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 3a825ce364d..7660bd894fd 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 cd4c631b336..e1c93e03f50 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 00000000000..32e17d4e68d --- /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; +} |