re PR c/34351 (Please get us the "volatile register" warning back)

2008-02-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 34351
	* doc/invoke.texi (-Wall): Add -Wvolatile-register-var.
	* c-opts.c (c_common_handle_option): Wall enables
	Wvolatile-register-var.
	* common.opt: Move Wvolatile-register-var to...
	* c.opt: ...here.
testsuite/
	* gcc.dg/pr34351.c: New.

From-SVN: r132675
parent e8fc888d
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 34351
* doc/invoke.texi (-Wall): Add -Wvolatile-register-var.
* c-opts.c (c_common_handle_option): Wall enables
Wvolatile-register-var.
* common.opt: Move Wvolatile-register-var to...
* c.opt: ...here.
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* common.opt (Wlarger-than=): New. * common.opt (Wlarger-than=): New.
* doc/invoke.texi (Warning Options): Replace -Wlarger-than- with * doc/invoke.texi (Warning Options): Replace -Wlarger-than- with
-Wlarger-than=. -Wlarger-than=.
......
...@@ -407,6 +407,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -407,6 +407,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
if (warn_strict_overflow == -1) if (warn_strict_overflow == -1)
warn_strict_overflow = value; warn_strict_overflow = value;
warn_array_bounds = value; warn_array_bounds = value;
warn_volatile_register_var = value;
/* Only warn about unknown pragmas that are not in system /* Only warn about unknown pragmas that are not in system
headers. */ headers. */
......
...@@ -465,6 +465,10 @@ Wvla ...@@ -465,6 +465,10 @@ Wvla
C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
Warn if a variable length array is used Warn if a variable length array is used
Wvolatile-register-var
C ObjC C++ ObjC++ Var(warn_volatile_register_var) Warning
Warn when a register variable is declared volatile
Wwrite-strings Wwrite-strings
C ObjC C++ ObjC++ Var(warn_write_strings) Warning C ObjC C++ ObjC++ Var(warn_write_strings) Warning
In C++, nonzero means warn about deprecated conversion from string literals to `char *'. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard. In C++, nonzero means warn about deprecated conversion from string literals to `char *'. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard.
......
...@@ -232,10 +232,6 @@ Wunused-variable ...@@ -232,10 +232,6 @@ Wunused-variable
Common Var(warn_unused_variable) Warning Common Var(warn_unused_variable) Warning
Warn when a variable is unused Warn when a variable is unused
Wvolatile-register-var
Common Var(warn_register_var) Warning
Warn when a register variable is declared volatile
Wcoverage-mismatch Wcoverage-mismatch
Common RejectNegative Var(warn_coverage_mismatch) Warning Common RejectNegative Var(warn_coverage_mismatch) Warning
Warn instead of error in case profiles in -fprofile-use do not match Warn instead of error in case profiles in -fprofile-use do not match
......
...@@ -2683,6 +2683,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}. ...@@ -2683,6 +2683,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
-Wunused-label @gol -Wunused-label @gol
-Wunused-value @gol -Wunused-value @gol
-Wunused-variable @gol -Wunused-variable @gol
-Wvolatile-register-var @gol
} }
Note that some warning flags are not implied by @option{-Wall}. Some of Note that some warning flags are not implied by @option{-Wall}. Some of
...@@ -4017,7 +4018,8 @@ the variable length array. ...@@ -4017,7 +4018,8 @@ the variable length array.
@opindex Wno-volatile-register-var @opindex Wno-volatile-register-var
Warn if a register variable is declared volatile. The volatile Warn if a register variable is declared volatile. The volatile
modifier does not inhibit all optimizations that may eliminate reads modifier does not inhibit all optimizations that may eliminate reads
and/or writes to register variables. and/or writes to register variables. This warning is enabled by
@option{-Wall}.
@item -Wdisabled-optimization @item -Wdisabled-optimization
@opindex Wdisabled-optimization @opindex Wdisabled-optimization
......
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* gcc.dg/pr34351.c: New.
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* gcc.dg/Wlarger-than2.c: New. * gcc.dg/Wlarger-than2.c: New.
/* { dg-do compile } */
/* { dg-options "-Wall" } */
register int * volatile x asm ("r13"); /* { dg-warning "optimization may eliminate reads and/or writes to register variables" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment