]> gcc.gnu.org Git - 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>
Tue, 20 Apr 2021 23:28:12 +0000 (01:28 +0200)
commit6496e9154309cbd911f944147da1246628e393da
tree22aadae71fcdcaa18e4a1ebef301dfb35a52ebe0
parent024f7908cbdd82e4e23a06e6df47f3823e8bdf59
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 a964f494cd5a90f631b8c0c01777a9899e0351ce)
gcc/testsuite/g++.dg/ext/weak6.C [new file with mode: 0644]
gcc/varasm.c
This page took 0.058851 seconds and 5 git commands to generate.