]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* common.opt (Wstrict-aliasing=, Wstrict-overflow=, fabi-version=,
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 12 Jun 2010 00:13:23 +0000 (00:13 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 12 Jun 2010 00:13:23 +0000 (00:13 +0000)
flto-compression-level=, ftree-parallelize-loops=): Add
RejectNegative.

testsuite:
* gcc.dg/opts-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160640 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/common.opt
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/opts-1.c [new file with mode: 0644]

index a2e6acecd157e252650f62592d11bf50b102407d..4c5d32b1a91aebea6261588824418e8577d13935 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-11  Joseph Myers  <joseph@codesourcery.com>
+
+       * common.opt (Wstrict-aliasing=, Wstrict-overflow=, fabi-version=,
+       flto-compression-level=, ftree-parallelize-loops=): Add
+       RejectNegative.
+
 2010-06-11  Joseph Myers  <joseph@codesourcery.com>
 
        * opts-common.c: Include options.h.
index f001e026fc940f87b802274f4170bda308fdfbb5..dc9b342e0eac5eda0c5ac34617148ad5e90feec5 100644 (file)
@@ -173,7 +173,7 @@ Common Warning
 Warn about code which might break strict aliasing rules
 
 Wstrict-aliasing=
-Common Joined UInteger Var(warn_strict_aliasing) Init(-1) Warning
+Common Joined RejectNegative UInteger Var(warn_strict_aliasing) Init(-1) Warning
 Warn about code which might break strict aliasing rules
 
 Wstrict-overflow
@@ -181,7 +181,7 @@ Common Warning
 Warn about optimizations that assume that signed overflow is undefined
 
 Wstrict-overflow=
-Common Joined UInteger Var(warn_strict_overflow) Init(-1) Warning
+Common Joined RejectNegative UInteger Var(warn_strict_overflow) Init(-1) Warning
 Warn about optimizations that assume that signed overflow is undefined
 
 Wsuggest-attribute=const
@@ -305,7 +305,7 @@ Common Separate
 ; Additional positive integers will be assigned as new versions of
 ; the ABI become the default version of the ABI.
 fabi-version=
-Common Joined UInteger Var(flag_abi_version) Init(2)
+Common Joined RejectNegative UInteger Var(flag_abi_version) Init(2)
 
 falign-functions
 Common Report Var(align_functions,0) Optimization UInteger
@@ -794,7 +794,7 @@ Enable link-time optimization.
 
 ; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
 flto-compression-level=
-Common Joined UInteger Var(flag_lto_compression_level) Init(-1)
+Common Joined RejectNegative UInteger Var(flag_lto_compression_level) Init(-1)
 -flto-compression-level=<number>       Use zlib compression level <number> for IL
 
 flto-report
@@ -1338,7 +1338,7 @@ Common Report Var(flag_tree_loop_optimize) Init(1) Optimization
 Enable loop optimizations on tree level
 
 ftree-parallelize-loops=
-Common Report Joined UInteger Var(flag_tree_parallelize_loops) Init(1)
+Common Report Joined RejectNegative UInteger Var(flag_tree_parallelize_loops) Init(1)
 Enable automatic parallelization of loops
 
 ftree-phiprop
index b6d4be9b5e223ac82f95f92f04131da6850089f0..4d2a83da63f8b0447e74b24d2df53f62d9e63709 100644 (file)
@@ -1,3 +1,7 @@
+2010-06-11  Joseph Myers  <joseph@codesourcery.com>
+
+       * gcc.dg/opts-1.c: New test.
+
 2010-06-11  Joseph Myers  <joseph@codesourcery.com>
 
        * gcc.dg/funroll-loops-all.c: Update expected error.
diff --git a/gcc/testsuite/gcc.dg/opts-1.c b/gcc/testsuite/gcc.dg/opts-1.c
new file mode 100644 (file)
index 0000000..0d16c3d
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test negative forms of various options are rejected.  */
+/* { dg-do compile } */
+/* { dg-options "-Wno-strict-aliasing=1 -Wno-strict-overflow=1 -fno-abi-version=1 -fno-lto-compression-level=1 -fno-tree-parallelize-loops=1" } */
+
+/* { dg-error "-fno-abi-version" "-fno-abi-version" { target *-*-* } 0 } */
+/* { dg-error "-fno-lto-compression-level" "-fno-lto-compression-level" { target *-*-* } 0 } */
+/* { dg-error "-fno-tree-parallelize-loops" "-fno-tree-parallelize-loops" { target *-*-* } 0 } */
+/* { dg-warning "-Wno-strict-overflow" "-Wno-strict-overflow" { target *-*-* } 0 } */
+/* { dg-warning "-Wno-strict-aliasing" "-Wno-strict-aliasing" { target *-*-* } 0 } */