[Bug sanitizer/80386] UBSAN: false positive - constant folding and reassosiation before instrumentation
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 11 12:11:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80386
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the bug has been introduced during C++ delayed folding, the
associate:
code in fold_binary_loc seems to heavily assume that the arguments have been
folded already, but that is not the case here, the C++ FE doesn't want to fold
things early, but when it calls save_expr, it unfortunately does that:
3339 tree
3340 save_expr (tree expr)
3341 {
3342 tree t = fold (expr);
3343 tree inner;
So, wonder if we just shouldn't get rid of of the fold call in there, I think
it isn't that useful if the arguments aren't folded anyway and fold is not
recursive, only cp_fold or c_fully_fold is.
More information about the Gcc-bugs
mailing list