c++: Tweak VLA representation.
authorJason Merrill <jason@redhat.com>
Mon, 11 May 2020 18:05:46 +0000 (14:05 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 11 May 2020 18:50:41 +0000 (14:50 -0400)
commitf315d1477d5164cb8ec1a004ce368dd52d47092a
tree2af6ff6fd5368ffc7e2955570f0e826bdf5a74b9
parent3a3e1ea9c674e50e402d5410970411ea6590f630
c++: Tweak VLA representation.

If we put the SAVE_EXPR for a VLA size inside the MINUS_EXPR rather than
outside, it will work better with constant folding.

The equivalent change was made in the C front-end in 2004, in commit
r0-64535-g8b0b9aefd29dfe6398857bcf5628662e2f0e21f6

gcc/cp/ChangeLog
2020-05-11  Jason Merrill  <jason@redhat.com>

* decl.c (compute_array_index_type_loc): Stabilize before building
the MINUS_EXPR.
gcc/cp/ChangeLog
gcc/cp/decl.c