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
This commit is contained in:
Brad Lucier 2000-09-22 07:22:07 +00:00 committed by Mark Mitchell
parent 401219a6c9
commit 18424ae17a
5 changed files with 34 additions and 3 deletions

View File

@ -1,3 +1,11 @@
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>
* dwarf2out.c (add_const_value_attribute): Multiply by length, not 4.

View File

@ -160,6 +160,10 @@ extern int warn_packed;
extern int warn_padded;
/* Warn when an optimization pass is disabled. */
extern int warn_disabled_optimization;
/* Nonzero if generating code to do profiling. */
extern int profile_flag;

View File

@ -685,7 +685,12 @@ gcse_main (f, file)
a couple switch statements. So we require a relatively large number
of basic blocks and the ratio of edges to blocks to be high. */
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. */
if (! can_copy_init_p)

View File

@ -131,7 +131,7 @@ in the following sections.
-fsyntax-only -pedantic -pedantic-errors
-w -W -Wall -Waggregate-return
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment
-Wconversion -Werror -Wformat
-Wconversion -Wdisabled-optimization -Werror -Wformat
-Wid-clash-@var{len} -Wimplicit -Wimplicit-int
-Wimplicit-function-declaration -Wimport
-Werror-implicit-function-declaration -Wfloat-equal -Winline
@ -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
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
Make all warnings into errors.
@end table

View File

@ -1397,6 +1397,10 @@ int warn_packed;
int warn_padded;
/* Warn when an optimization pass is disabled. */
int warn_disabled_optimization;
/* Likewise for -W. */
lang_independent_options W_options[] =
@ -1423,7 +1427,9 @@ lang_independent_options W_options[] =
{"packed", &warn_packed, 1,
"Warn when the packed attribute has no effect on struct layout"},
{"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)