re PR c/64440 (-Wdiv-by-zero false negative on const variables)
authorMarek Polacek <polacek@redhat.com>
Wed, 7 Jan 2015 08:21:50 +0000 (08:21 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 7 Jan 2015 08:21:50 +0000 (08:21 +0000)
commit4a9a42abc4f30bd63ef666e972dcbce0f05f0d0d
treed0f2a4cd5014273666c800236267295be4add8a2
parent2cc901dcb29e15e06bfeab82a9834b6254b4ae0f
re PR c/64440 (-Wdiv-by-zero false negative on const variables)

PR c/64440
* c-common.c (c_fully_fold_internal): Warn for division and modulo
if orig_op1 isn't INTEGER_CST, op1 is INTEGER_CST and is zero.

* gcc.dg/pr64440.c: New test.
* c-c++-common/pr56607.c: Don't limit dg-warnings to C++.

From-SVN: r219279
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr56607.c
gcc/testsuite/gcc.dg/pr64440.c [new file with mode: 0644]