]> git.ipfire.org Git - thirdparty/gcc.git/commit
varasm: Fix ICE with -fsyntax-only [PR99035]
authorJakub Jelinek <jakub@redhat.com>
Wed, 10 Feb 2021 18:52:37 +0000 (19:52 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 19 Mar 2021 23:27:48 +0000 (00:27 +0100)
commita964f494cd5a90f631b8c0c01777a9899e0351ce
treef33efa923ac074d8c10c55e705370d3b13481790
parent4b47af4346ad0e8a428c09791111f6f61feb6579
varasm: Fix ICE with -fsyntax-only [PR99035]

My FE change from 2 years ago uses TREE_ASM_WRITTEN in -fsyntax-only
mode more aggressively to avoid "expanding" functions multiple times.
With -fsyntax-only nothing is really expanded, so I think it is acceptable
to adjust the assert and allow declare_weak at any time, with -fsyntax-only
we know it is during parsing only anyway.

2021-02-10  Jakub Jelinek  <jakub@redhat.com>

PR c++/99035
* varasm.c (declare_weak): For -fsyntax-only, allow even
TREE_ASM_WRITTEN function decls.

* g++.dg/ext/weak6.C: New test.

(cherry picked from commit 0f39fb7b001df7cdba56cd5c572d0737667acd2c)
gcc/testsuite/g++.dg/ext/weak6.C [new file with mode: 0644]
gcc/varasm.c