aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2020-05-06 15:53:33 -0400
committerMarek Polacek <polacek@redhat.com>2020-05-18 19:01:54 -0400
commit2d4e1e144c25e526e4f668be5a0bc10d0c1c738c (patch)
tree1e73b7bcfa85d209cf4dcd1ada19fb46f881b49a /gcc/c/c-parser.c
parentbf732686c0b9c42a2fe119db774c5a65e5a97174 (diff)
downloadgcc-2d4e1e144c25e526e4f668be5a0bc10d0c1c738c.zip
gcc-2d4e1e144c25e526e4f668be5a0bc10d0c1c738c.tar.gz
gcc-2d4e1e144c25e526e4f668be5a0bc10d0c1c738c.tar.bz2
c++: ICE when shortening right shift [PR94955]
Since r10-6527 fold_for_warn calls maybe_constant_value, which means it can fold more than it previously could. In this testcase it means that cp_build_binary_op/RSHIFT_EXPR set short_shift because now we were able to fold op1 to an INTEGER_CST. But then when actually performing the shortening we crashed because cp_fold_rvalue wasn't able to fold as much as f_f_w and so tree_int_cst_sgn crashed on a NOP_EXPR. Therefore the calls should probably match. PR c++/94955 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of cp_fold_rvalue. * g++.dg/cpp0x/constexpr-shift2.C: New test.
Diffstat (limited to 'gcc/c/c-parser.c')
0 files changed, 0 insertions, 0 deletions