]> git.ipfire.org Git - thirdparty/gcc.git/commit
varasm: Handle RAW_DATA_CST in compare_constant [PR117199]
authorJakub Jelinek <jakub@redhat.com>
Tue, 22 Oct 2024 18:21:56 +0000 (20:21 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 22 Oct 2024 18:21:56 +0000 (20:21 +0200)
commitf616bc412c820d1fe1211ab68873607d7bfe2709
tree1a1a3d1edbaec88e5f0d350e56816f379aeceb85
parent8f173da4520ddf64f3926580042f1103146bf0bd
varasm: Handle RAW_DATA_CST in compare_constant [PR117199]

On the following testcase without LTO we unnecessarily don't merge
two identical .LC* constants (constant hashing computes the same hash,
but as compare_constant returned false for the RAW_DATA_CST in it,
it never compares equal), and with LTO fails to link because LTO assumes such
constants have to be merged and so doesn't emit the other constant.

2024-10-22  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/117199
* varasm.cc (compare_constant): Handle RAW_DATA_CST.  Formatting fix
in the STRING_CST case.

* gcc.dg/lto/pr117199_0.c: New test.
gcc/testsuite/gcc.dg/lto/pr117199_0.c [new file with mode: 0644]
gcc/varasm.cc