https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67376
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Wed Feb 10 18:24:29 2016 New Revision: 233285 URL: https://gcc.gnu.org/viewcvs?rev=233285&root=gcc&view=rev Log: Backported from mainline 2015-12-22 Jakub Jelinek <ja...@redhat.com> 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. Added: branches/gcc-5-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-67376.C Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/fold-const.c branches/gcc-5-branch/gcc/testsuite/ChangeLog