diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-05-02 21:19:05 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-05-02 21:19:05 +0200 |
commit | e81f2f4855876c5d85ab9870c5a150ee1a59ee73 (patch) | |
tree | 474e08653a604e67669f1de5e92de28cddf19790 /libjava/classpath/native/jni/qt-peer/qtaudioclip.cpp | |
parent | 1e27e9a3184c948b499a21ff20181611514ed720 (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
The pr120057-1.c testcase is incorrectly rejected since
r15-4377 (and for a while it also ICEd after the error), i.e.
the optimization of large C initializers using RAW_DATA_CST.
Similarly, the embed-18.c testcase is incorrectly rejected since
the embed support has been introduced and RAW_DATA_CST used for that.
The callers of check_constexpr_init (store_init_value and
output_init_element) compute int_const_expr as
int_const_expr = (TREE_CODE (init) == INTEGER_CST
&& !TREE_OVERFLOW (init)
&& INTEGRAL_TYPE_P (TREE_TYPE (init)));
but that is only passed through down to check_constexpr_init.
I think tweaking those 2 callers to also allow RAW_DATA_CST for
int_const_expr when check_constexpr_init needs top special case it
no matter what would be larger, so the patch just changes
check_constexpr_init to deal with RAW_DATA_CST in the initializers.
For TYPE_UNSIGNED char precision integral types RAW_DATA_CST is
always valid, for !TYPE_UNSIGNED we need to check for 128-255 values
being turned into negative ones.
2025-05-02 Jakub Jelinek <jakub@redhat.com>
PR c/120057
* c-typeck.cc (check_constexpr_init): Handle RAW_DATA_CST.
* gcc.dg/cpp/embed-18.c: New test.
* gcc.dg/pr120057-1.c: New test.
* gcc.dg/pr120057-2.c: New test.
Diffstat (limited to 'libjava/classpath/native/jni/qt-peer/qtaudioclip.cpp')
0 files changed, 0 insertions, 0 deletions