re PR middle-end/80341 (gcc miscompiles division of signed char)
authorRichard Biener <rguenther@suse.de>
Fri, 7 Apr 2017 08:20:24 +0000 (08:20 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 7 Apr 2017 08:20:24 +0000 (08:20 +0000)
commit2d143ba8cfef7ef480c639882fd5518b7afd822b
tree88b5a716645aa02574e38f724825464aecb22de9
parent5291ab733b6584b2b0252178625088812f66e689
re PR middle-end/80341 (gcc miscompiles division of signed char)

2017-04-07  Richard Biener  <rguenther@suse.de>

PR middle-end/80341
* tree.c (get_unwidened): Also handle ! for_type case for
INTEGER_CSTs.
* convert.c (do_narrow): Split out from ...
(convert_to_integer_1): ... here.  Do not pass final truncation
type to get_unwidened for TRUNC_DIV_EXPR.

* gcc.dg/torture/pr80341.c: New testcase.

From-SVN: r246756
gcc/ChangeLog
gcc/convert.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr80341.c [new file with mode: 0644]
gcc/tree.c