[Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation

2018-07-19 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86586 --- Comment #7 from Alexander Monakov --- Another possible compromise is to add 'bool for_warnings = false' argument to maybe_constant_value, store it along with the reduced tree in cv_cache (perhaps even by setting a flag on the tree itself?),

[Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation

2018-07-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86586 --- Comment #6 from Jakub Jelinek --- That said, if the -W* does't affect code generation goal is very important and we don't find any other way, perhaps the price to pay for that is acceptable. Even the PR86569 patch isn't without cost (in

[Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation

2018-07-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86586 --- Comment #5 from Jakub Jelinek --- That is the costly variant, the already slow C++ FE will need to compute and instantiate a lot of things that aren't really needed.

[Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation

2018-07-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86586 --- Comment #4 from Richard Biener --- cp_fully_fold smells like it could have side-effects as well, of course. Yeah, it calls maybe_constant_value as well ;)

[Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation

2018-07-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86586 --- Comment #3 from Richard Biener --- Like with diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 1335da5e9bc..aaa56697f29 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -5322,7 +5322,6 @@ cp_build_binary_op (location_t location,

[Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation

2018-07-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86586 --- Comment #2 from Richard Biener --- (In reply to Jakub Jelinek from comment #1) > Yeah, I think it is a dup. There are many other cases where we call > maybe_constant_value for some warning only, and we assume it is a safe thing > to do. >

[Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation

2018-07-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86586 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1