Glob to match bare-metal SuperH target triple in config.gcc seems wrong (sh*-superh-elf)?
John Scott
jscott@posteo.net
Tue Apr 14 02:38:14 GMT 2026
Hi,
I noticed at https://forge.sourceware.org/gcc/gcc-mirror/src/branch/master/gcc/config.gcc#L3399 that a glob expression "sh*-superh-elf" is used, and it's apparently intended to match embedded SuperH targets. However, the use of the "superh" token in the target triple appears to be serving as a manufacturer name. This looks like it could be a mistake; for example, I simply use the target triple "sh-elf" when building Debian's bare-metal toolchain, and so this clause wouldn't take effect. It's also weird to see SuperH used in the manufacturer field anyway (Hitachi and Renesas would be more fitting if this were intended).
On the other hand, such as at lines 3429 and 3466 there, it seems like "sh-superh-*" is intended to be the same as "sh4-*", but only if there is no suffix on the CPU name. For example, sh2-superh-elf wouldn't get this "magic" treatment of being promoted to sh4.
This is, at the very least, confusing, and if it's on purpose some in-line commentary would be helpful. Maybe there was a historical reason for this? Otherwise it would be fitting if the matching expression didn't include a manufacturer/vendor name because that is imprecise and doesn't make a lot of sense here.
Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 411 bytes
Desc: This is a digitally signed message part
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20260414/3b61b938/attachment.sig>
More information about the Gcc
mailing list