re PR c++/67376 (Comparison with pointer to past-the-end of array fails inside consta...
authorJakub Jelinek <jakub@redhat.com>
Tue, 22 Dec 2015 20:47:58 +0000 (21:47 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 22 Dec 2015 20:47:58 +0000 (21:47 +0100)
commitd6dd2c8e29213be6d5f95106bcb9b2cb7cbabb48
tree2db18c0a05eec9cf42467509904fc197af7af259
parentb5c4bc31baa52fc4ef51a89dcf97413f34c86d70
re PR c++/67376 (Comparison with pointer to past-the-end of array fails inside constant expression)

PR c++/67376
* fold-const.c (size_low_cst): Removed.
(fold_comparison): For POINTER_PLUS_EXPR where base is ADDR_EXPR
call get_inner_reference and handle INDIRECT_REF base of it.  Use
offset_int for computation of the bitpos.
(fold_binary_loc) <case EQ_EXPR, NE_EXPR>: Formatting
fixes for X +- Y CMP X and C - X CMP X folding.  Add X CMP X +- Y
and X CMP C - X folding.

* g++.dg/cpp0x/constexpr-67376.C: New test.

From-SVN: r231909
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-67376.C [new file with mode: 0644]