diff options
author | Brad Lucier <lucier@math.purdue.edu> | 2000-09-22 07:22:07 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-09-22 07:22:07 +0000 |
commit | 18424ae17a3b474ac341c9e57e74c487dcdec15a (patch) | |
tree | aeb1f76a6793c86109041c2fad56320edbf89a4e | |
parent | 401219a6c93d1ba14cee07ed0ab7935f04072358 (diff) | |
download | gcc-18424ae17a3b474ac341c9e57e74c487dcdec15a.zip gcc-18424ae17a3b474ac341c9e57e74c487dcdec15a.tar.gz gcc-18424ae17a3b474ac341c9e57e74c487dcdec15a.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/flags.h | 4 | ||||
-rw-r--r-- | gcc/gcse.c | 7 | ||||
-rw-r--r-- | gcc/invoke.texi | 10 | ||||
-rw-r--r-- | gcc/toplev.c | 8 |
5 files changed, 34 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 49524b4..c44d716 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/flags.h b/gcc/flags.h index 8fa2e87..6a87edb 100644 --- a/gcc/flags.h +++ b/gcc/flags.h @@ -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; @@ -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) diff --git a/gcc/invoke.texi b/gcc/invoke.texi index cea95c4..43aafba 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -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 diff --git a/gcc/toplev.c b/gcc/toplev.c index 74e0e3eb..76ff873 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -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) |