[Bug tree-optimization/63278] Fails to compute loop bound from constant string

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 16 14:23:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63278

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
typedef __SIZE_TYPE__ size_t;
inline constexpr size_t hashString(const char* str, size_t hash = 5381)
{
return (*str) ? hashString(str + 1, hash + (hash << 5) + *str) : hash;
}
constexpr size_t c = hashString("foo");

works just fine, so I think we're talking here about optimization (should e.g.
cp gimplification or genericization at -O+ for constexpr functions if all
arguments are const/constexpr try maybe_constant_value?



More information about the Gcc-bugs mailing list