Commit 18424ae1 by Brad Lucier Committed by Mark Mitchell

toplev.c (warn_disabled_optimization): Declare new warning flag.

        * toplev.c (warn_disabled_optimization): Declare new warning flag.
        * flags.h (warn_disabled_optimization): Add it here.
        * gcse.c (gcse_main): Add warning when disabled.
        * invoke.texi: Document -Wdisabled-optimization

Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r36568
parent 401219a6
2000-09-22 Brad Lucier <lucier@math.purdue.edu>
Mark Mitchell <mark@codesourcery.com>
* toplev.c (warn_disabled_optimization): Declare new warning flag.
* flags.h (warn_disabled_optimization): Add it here.
* gcse.c (gcse_main): Add warning when disabled.
* invoke.texi: Document -Wdisabled-optimization
2000-09-21 Jason Merrill <jason@redhat.com> 2000-09-21 Jason Merrill <jason@redhat.com>
* dwarf2out.c (add_const_value_attribute): Multiply by length, not 4. * dwarf2out.c (add_const_value_attribute): Multiply by length, not 4.
......
...@@ -160,6 +160,10 @@ extern int warn_packed; ...@@ -160,6 +160,10 @@ extern int warn_packed;
extern int warn_padded; extern int warn_padded;
/* Warn when an optimization pass is disabled. */
extern int warn_disabled_optimization;
/* Nonzero if generating code to do profiling. */ /* Nonzero if generating code to do profiling. */
extern int profile_flag; extern int profile_flag;
......
...@@ -685,7 +685,12 @@ gcse_main (f, file) ...@@ -685,7 +685,12 @@ gcse_main (f, file)
a couple switch statements. So we require a relatively large number a couple switch statements. So we require a relatively large number
of basic blocks and the ratio of edges to blocks to be high. */ of basic blocks and the ratio of edges to blocks to be high. */
if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20) if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20)
return 0; {
if (warn_disabled_optimization)
warning ("GCSE disabled: %d > 1000 basic blocks and %d >= 20 edges/basic block",
n_basic_blocks, n_edges / n_basic_blocks);
return 0;
}
/* See what modes support reg/reg copy operations. */ /* See what modes support reg/reg copy operations. */
if (! can_copy_init_p) if (! can_copy_init_p)
......
...@@ -131,7 +131,7 @@ in the following sections. ...@@ -131,7 +131,7 @@ in the following sections.
-fsyntax-only -pedantic -pedantic-errors -fsyntax-only -pedantic -pedantic-errors
-w -W -Wall -Waggregate-return -w -W -Wall -Waggregate-return
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment
-Wconversion -Werror -Wformat -Wconversion -Wdisabled-optimization -Werror -Wformat
-Wid-clash-@var{len} -Wimplicit -Wimplicit-int -Wid-clash-@var{len} -Wimplicit -Wimplicit-int
-Wimplicit-function-declaration -Wimport -Wimplicit-function-declaration -Wimport
-Werror-implicit-function-declaration -Wfloat-equal -Winline -Werror-implicit-function-declaration -Wfloat-equal -Winline
...@@ -2018,6 +2018,14 @@ the warning messages, use @samp{-Wno-long-long}. Flags ...@@ -2018,6 +2018,14 @@ the warning messages, use @samp{-Wno-long-long}. Flags
@samp{-Wlong-long} and @samp{-Wno-long-long} are taken into account @samp{-Wlong-long} and @samp{-Wno-long-long} are taken into account
only when @samp{-pedantic} flag is used. only when @samp{-pedantic} flag is used.
@item -Wdisabled-optimization
Warn if a requested optimization pass is disabled. This warning does
not generally indicate that there is anything wrong with your code; it
merely indicates that GCC's optimizers were unable to handle the code
effectively. Often, the problem is that your code is too big or too
complex; GCC will refuse to optimize programs when the optimization
itself is likely to take inordinate amounts of time.
@item -Werror @item -Werror
Make all warnings into errors. Make all warnings into errors.
@end table @end table
......
...@@ -1397,6 +1397,10 @@ int warn_packed; ...@@ -1397,6 +1397,10 @@ int warn_packed;
int warn_padded; int warn_padded;
/* Warn when an optimization pass is disabled. */
int warn_disabled_optimization;
/* Likewise for -W. */ /* Likewise for -W. */
lang_independent_options W_options[] = lang_independent_options W_options[] =
...@@ -1423,7 +1427,9 @@ lang_independent_options W_options[] = ...@@ -1423,7 +1427,9 @@ lang_independent_options W_options[] =
{"packed", &warn_packed, 1, {"packed", &warn_packed, 1,
"Warn when the packed attribute has no effect on struct layout"}, "Warn when the packed attribute has no effect on struct layout"},
{"padded", &warn_padded, 1, {"padded", &warn_padded, 1,
"Warn when padding is required to align struct members"} "Warn when padding is required to align struct members"},
{"disabled-optimization", &warn_disabled_optimization, 1,
"Warn when an optimization pass is disabled"}
}; };
/* Output files for assembler code (real compiler output) /* Output files for assembler code (real compiler output)
......
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