https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66313
--- Comment #22 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Thu Jun 1 08:05:24 2017 New Revision: 248771 URL: https://gcc.gnu.org/viewcvs?rev=248771&root=gcc&view=rev Log: 2017-06-01 Richard Biener <rguent...@suse.de> PR middle-end/66313 * fold-const.c (fold_plusminus_mult_expr): If the factored factor may be zero use a wrapping type for the inner operation. * tree-tailcall.c (independent_of_stmt_p): Pass in to_move bitmap and handle moved defs. (process_assignment): Properly guard the unary op case. Return a tri-state indicating that moving the stmt before the call may allow to continue. Pass through to_move. (find_tail_calls): Handle moving unrelated defs before the call. * c-c++-common/ubsan/pr66313.c: New testcase. * gcc.dg/tree-ssa/loop-15.c: Adjust. Added: trunk/gcc/testsuite/c-c++-common/ubsan/pr66313.c Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c trunk/gcc/tree-tailcall.c