This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/20319] -fkeep-static-consts with -O asserted doesn't keep consts
- From: "gary at intrepid dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jun 2005 23:40:50 -0000
- Subject: [Bug c/20319] -fkeep-static-consts with -O asserted doesn't keep consts
- References: <20050304170516.20319.gary@intrepid.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gary at intrepid dot com 2005-06-20 23:40 -------
I guess that tagging the bug with a "documentation" keyword doesn't
necessarily say that the bug is being classified only as a defect in the
documentation. However, if that is the meaning of this keyword, then I'd like
to clarify the bug report.
- yes, the documentation, source code commments and -help are either
incomplete or do not accurately describe present behavior.
- -fkepp-static-consts behaves in an unexpected manner, in that when asserted,
it enables a behavior that is already enabled by default. And interestingly,
it has no effect when optimization is enabled.
- Only -fno-keep-static-consts has an effect, and then only when optimization
is not enabled.
- In general, I think it would be best if switches which selectively control
optimizations, enable that optimization when asserted, and disable the
optimization when negatively asserted (ie, when prefixed with no- ...). Thus
I recommend that -fkeep-static-consts be deprecated, and replaced by a new
switch, named something like -fdelete-unused-static-consts. It would also be
a good idea to look at the other optimization enabling switches to ensure that
they follow this convention. Ideally, each optimization level such as O1, O2,
O3, Os, and Ot would be definitively and completely expressed by the selective
optimization options they enable.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20319