mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
2fb19bb38bb1892cba56c52c132c22731bbdc2e9
During ML discussions of a match.pd pattern that was introducing a new instance of 'warn_strict_overflow', Richard mentioned that this use should be discouraged [1]. After pointing out that this usage was documented in tree.h he then explained that we should remove the note from the header [2]. Here's the reasoning: "Ah, we should remove that note. -Wstrict-overflow proved useless IMO, it's way too noisy as it diagnoses when the compiler relies on overflow not happening, not diagnosing when it possibly happens. That's not a very useful diagnostic to have - it does not point to a possible problem in the code (we could as well diagnose _all_ signed arithmetic operations for the same argument that we might eventually rely on overflow not happening)." Aside from removing the tree.h node we're also removing the 2 references in match.pd. match.pd patterns tend to be copied around to serve as a base for new patterns (like I did in [3] adding a 'fold_overflow_warning'), and if we want to discourage the use avoiding its spread is a good start. Note that there are a lot of references left, most of them in gcc/fold-const.cc. Some references are using in nested helpers inside the file, entangled with code that does other things. Removing all references from the project is out of scope for this quick patch. [1] https://gcc.gnu.org/pipermail/gcc-patches/2026-January/705320.html [2] https://gcc.gnu.org/pipermail/gcc-patches/2026-January/705482.html [3] https://gcc.gnu.org/pipermail/gcc-patches/2026-January/704992.html gcc/ChangeLog: * match.pd: remove 'fold_overflow_warning' references. * tree.h (TYPE_OVERFLOW_UNDEFINED): remove note telling that we must use warn_strict_overflow for every optimization based on TYPE_OVERFLOW_UNDEFINED. gcc/testsuite/ChangeLog: * gcc.dg/Wstrict-overflow-1.c: Removed because we no longer issue a 'fold_overflow_warning' with the `(le (minus (@0 INTEGER_CST@1)) INTEGER_CST@2)` pattern. Signed-off-by: Daniel Barboza <daniel.barboza@oss.qualcomm.com>
…
…
…
…
…
…
…
…
…
…
…
…
…
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.
Description
Languages
C++
30.7%
C
30%
Ada
14.5%
D
6.1%
Go
5.7%
Other
12.5%