https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87314
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> --- It isn't just with malloc, the following are not optimized either. int f(){ int a; return &a=="hello"; } int g(){ return "bye"=="hello"; }