d: Fix PR96429: Pointer subtraction uses TRUNC_DIV_EXPR
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 3 Aug 2020 20:35:38 +0000 (22:35 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Tue, 4 Aug 2020 08:25:22 +0000 (10:25 +0200)
commit3a3fda119036f46bfa70e06e7c69e04e78040079
treecc8009d15548d8e188c44e54d0d0ce100e0d0ddc
parent863de9321813f947018cc60b06ba163ddcfbb5f2
d: Fix PR96429: Pointer subtraction uses TRUNC_DIV_EXPR

gcc/d/ChangeLog:

PR d/96429
* expr.cc (ExprVisitor::visit (BinExp*)): Use EXACT_DIV_EXPR for
pointer diff expressions.

gcc/testsuite/ChangeLog:

PR d/96429
* gdc.dg/pr96429.d: New test.
gcc/d/expr.cc
gcc/testsuite/gdc.dg/pr96429.d [new file with mode: 0644]