]> git.ipfire.org Git - thirdparty/gcc.git/commit
expr: Use constant_lower_bound classifying constructor els [PR116595].
authorRobin Dapp <rdapp@ventanamicro.com>
Thu, 3 Apr 2025 14:46:05 +0000 (16:46 +0200)
committerRobin Dapp <rdapp@ventanamicro.com>
Wed, 9 Apr 2025 09:45:13 +0000 (11:45 +0200)
commitf183ae0ae891a471764876eb1e69239904598bb4
tree9b60884a0b308c07d58f4ca19cac0637a1e1db20
parentee65440cbd8042a5e5885e18bde70f8d530e4404
expr: Use constant_lower_bound classifying constructor els [PR116595].

In categorize_ctor_elements_1 we do
  VECTOR_CST_NELTS (value).to_constant ()
but VALUE's type can be a VLA vector (since r15-5780-g17b520a10cdaab).

This patch uses constant_lower_bound instead.

PR middle-end/116595

gcc/ChangeLog:

* expr.cc (categorize_ctor_elements_1): Use
constant_lower_bound.

gcc/testsuite/ChangeLog:

* g++.target/riscv/rvv/autovec/pr116595.C: New test.
gcc/expr.cc
gcc/testsuite/g++.target/riscv/rvv/autovec/pr116595.C [new file with mode: 0644]