[Bug target/79144] cmpstrnsi optimization breaks glibc
acsawdey at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 19 15:45:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79144
--- Comment #2 from acsawdey at gcc dot gnu.org ---
Alan,
Thanks for jumping in here. What I tried yesterday was this code to try to
get the correct name:
+ const char *id =
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME
+ (builtin_decl_explicit (BUILT_IN_STRCMP)));
+ if (id == NULL || *id == 0)
+ id = "strcmp";
+ else if (*id == '*')
+ id++;
+ emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, id),
+ target, LCT_NORMAL, GET_MODE (target), 2,
+ force_reg (Pmode, XEXP (src1, 0)), Pmode,
+ force_reg (Pmode, XEXP (src2, 0)), Pmode);
But this didn't work for reasons I don't quite understand.
The other discussion of this starts here on gcc-patches:
https://gcc.gnu.org/ml/gcc-patches/2017-01/msg00843.html
More information about the Gcc-bugs
mailing list