https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119629
Bug ID: 119629 Summary: mismatch between [power9-64] builtins and their instructions Product: gcc Version: 14.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: aoliva at gcc dot gnu.org Target Milestone: --- cmpeqb's conditions are TARGET_P9_MISC && TARGET_64BIT, but the conditions that enable the expansion of __builtin_scalar_byte_in_set are those of [power9-64], namely TARGET_MODULE && TARGET_POWERPC64. On a powerpc-elf standard build, TARGET_POWERPC64 is enabled, but TARGET_64BIT isn't, and so gcc.target/powerpc/byte-in-set-2.c fails to compile with an ICE (instruction not recognized) instead of the expected error. This raises a number of problems: - instructions and expanders for these builtins don't have their conditions tested, so they must necessarily follow from the builtin conditions, and this case clearly isn't - TARGET_64BIT seems to imply TARGET_POWERPC64, but TARGET_POWERPC64 doesn't imply TARGET_64BIT - TARGET_MODULO isn't used very often in conditions in the .md file, but it can be controlled independently from TARGET_P9_MISC - the groupings of builtins doesn't seem to correspond to the conditions of instructions that implement them - the misuse of TARGET_64BIT in cmpeqb alone makes me worry that other instructions guarded by it may have the same condition mismatch problem. cfuged seems to be one of those, and [power10-64] accepts TARGET_POWERPC64 instead. there may be more. it looks like a review by someone familiar with this port and these instructions would probably be useful