Message ID | 2274492.VkOA7UxnmJ@polaris |
---|---|
State | New |
Headers | show |
From: Eric Botcazou <ebotcazou@adacore.com> Date: Wed, 14 Jun 2017 12:40:57 +0200 > This fixes > > FAIL: gcc.c-torture/execute/20101011-1.c -O2 execution test > FAIL: gcc.c-torture/execute/20101011-1.c -O2 -flto -fno-use-linker-plugin - > flto-partition=none execution test > FAIL: gcc.c-torture/execute/20101011-1.c -O2 -flto -fuse-linker-plugin -fno- > fat-lto-objects execution test > FAIL: gcc.c-torture/execute/20101011-1.c -O3 -g execution test > FAIL: gcc.c-torture/execute/20101011-1.c -Os execution test > > on 64-bit SPARC with -mcpu=niagara. There is exactly the same guard a few > lines below for the DIV case. > > Tested on SPARC64/Linux and x86-64/Linux, applied on the mainline. Thanks for fixing this.
Index: simplify-rtx.c =================================================================== --- simplify-rtx.c (revision 249091) +++ simplify-rtx.c (working copy) @@ -3194,7 +3194,8 @@ simplify_binary_operation_1 (enum rtx_co case UDIV: /* 0/x is 0 (or x&0 if x has side-effects). */ - if (trueop0 == CONST0_RTX (mode)) + if (trueop0 == CONST0_RTX (mode) + && !cfun->can_throw_non_call_exceptions) { if (side_effects_p (op1)) return simplify_gen_binary (AND, mode, op1, trueop0);