diff options
author | Yangyu Chen <cyy@cyyself.name> | 2024-11-05 11:21:22 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2024-11-13 17:01:41 +0800 |
commit | 9bf0dbe67244fffc5cb939e51ead2876557c8c37 (patch) | |
tree | 90de670917fb57386cbc320520f75fd99c107b31 /libgcc | |
parent | f530a8c61383b174a476b64f46d56adeedf49dc4 (diff) | |
download | gcc-9bf0dbe67244fffc5cb939e51ead2876557c8c37.zip gcc-9bf0dbe67244fffc5cb939e51ead2876557c8c37.tar.gz gcc-9bf0dbe67244fffc5cb939e51ead2876557c8c37.tar.bz2 |
Introduce TARGET_CLONES_ATTR_SEPARATOR for RISC-V
Some architectures may use ',' in the attribute string, but it is not
used as the separator for different targets. To avoid conflict, we
introduce a new macro TARGET_CLONES_ATTR_SEPARATOR to separate different
clones.
As an example, according to RISC-V C-API Specification [1], RISC-V allows
',' in the attribute string in the "arch=" option to specify one more
ISA extensions in the same target function, which conflict with the
default separator to separate different clones. This patch introduces
TARGET_CLONES_ATTR_SEPARATOR for RISC-V and choose '#' as the separator,
since '#' is not allowed in the target_clones option string.
[1] https://github.com/riscv-non-isa/riscv-c-api-doc/blob/c6c5d6d9cf96b342293315a5dff3d25e96ef8191/src/c-api.adoc#__attribute__targetattr-string
Signed-off-by: Yangyu Chen <cyy@cyyself.name>
gcc/ChangeLog:
* defaults.h (TARGET_CLONES_ATTR_SEPARATOR): Define new macro.
* multiple_target.cc (get_attr_str): Use
TARGET_CLONES_ATTR_SEPARATOR to separate attributes.
(separate_attrs): Likewise.
(expand_target_clones): Likewise.
* attribs.cc (attr_strcmp): Likewise.
(sorted_attr_string): Likewise.
* tree.cc (get_target_clone_attr_len): Likewise.
* config/riscv/riscv.h (TARGET_CLONES_ATTR_SEPARATOR): Define
TARGET_CLONES_ATTR_SEPARATOR for RISC-V.
* doc/tm.texi: Document TARGET_CLONES_ATTR_SEPARATOR.
* doc/tm.texi.in: Likewise.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions