diff options
author | Richard Biener <rguenther@suse.de> | 2020-05-19 07:58:33 +0200 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:03:51 -0300 |
commit | 3d910f08c004b1b43444ceb9074c03a96585cfcc (patch) | |
tree | e3443a23a3d4422505ab7becf14fc86ee4d06425 /gcc/tree-inline.c | |
parent | 4b224c7bf7faf7cd5443600d3afd7ed254a84f43 (diff) | |
download | gcc-3d910f08c004b1b43444ceb9074c03a96585cfcc.zip gcc-3d910f08c004b1b43444ceb9074c03a96585cfcc.tar.gz gcc-3d910f08c004b1b43444ceb9074c03a96585cfcc.tar.bz2 |
c/95141 - fix bogus integer overflow warning
This fixes an integer overflow warning that ultimatively happens because
of TREE_OVERFLOW propagating through transforms and the existing guard
against this,
375 if (TREE_OVERFLOW_P (ret)
376 && !TREE_OVERFLOW_P (op0)
377 && !TREE_OVERFLOW_P (op1))
378 overflow_warning (EXPR_LOC_OR_LOC (expr, input_location,
being insufficient. Rather than trying to use sth like walk_tree to
exhaustively walk operands (with the possibility of introducing
quadraticness when folding larger expressions recursively) the
following amends the above with an ad-hoc test for a binary op0
with a possibly constant op1.
2020-05-30 Richard Biener <rguenther@suse.de>
PR c/95141
gcc/c
* c-fold.c (c_fully_fold_internal): Enhance guard on
overflow_warning.
gcc/testsuite
* gcc.dg/pr95141.c: New testcase.
Diffstat (limited to 'gcc/tree-inline.c')
0 files changed, 0 insertions, 0 deletions