https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102347
--- Comment #10 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 23 Sep 2021, linkw at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102347 > > --- Comment #9 from Kewen Lin <linkw at gcc dot gnu.org> --- > (In reply to Peter Bergner from comment #7) > > (In reply to Martin Liška from comment #6) > > > Quickly looking at the rs6000 code, it fails here: > > > > > > #1 0x0000000011a0993c in rs6000_invalid_builtin > > > (fncode=MMA_BUILTIN_DISASSEMBLE_ACC_INTERNAL) at > > > ../../gcc/config/rs6000/rs6000-call.c:11643 > > > #2 0x0000000011a13134 in rs6000_builtin_decl (code=1603, > > > initialize_p=true) > > > at ../../gcc/config/rs6000/rs6000-call.c:13870 > > > #3 0x00000000115c3900 in unpack_ts_function_decl_value_fields > > > (bp=0x3fffffffe2f0, expr=0x3fffaf195700) at > > > ../../gcc/tree-streamer-in.c:361 > > > #4 0x00000000115c4790 in streamer_read_tree_bitfields (ib=0x3fffffffe6a0, > > > data_in=0x132d1910, expr=0x3fffaf195700) at > > > ../../gcc/tree-streamer-in.c:528 > > > #5 0x0000000010deaa28 in lto_read_tree_1 (ib=0x3fffffffe6a0, > > > data_in=0x132d1910, expr=0x3fffaf195700) at > > > ../../gcc/lto-streamer-in.c:1697 > > > > > > which relies on rs6000_builtin_mask. Note the mask is set here: > > > rs6000_builtin_mask = rs6000_builtin_mask_calculate (); > > > > > > where rs6000_builtin_mask_calculate is based on TARGET_* values. Yeah, that's not going to work - if there are different builtin decls for different flags then you have to use different BUILT_IN_* codes as well.