https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66310
--- Comment #6 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- When using the REPEAT intrinsic as a parameter, the frontend is simplifying this to an actual string constant of the requested length. In this process it is attempting to allocate length + 1 in order to internally NULL terminate the string. The NULL termination is not strictly needed and when I remove it on my system I get the expected results: f951: out of memory allocating 8589934588 bytes after a total of 569344 bytes Each character is a wide character to accommodate different encodings and in this case is 4 bytes. When trying to allocate len + 1 where len is huge, the result is wrapped, signed vs unsigned integers. I am tempted to put in an arbitrary limit on the size of string constants and issue a warning when it happens and truncate the result to the allowed limit. This would give a more useful message. If I were to do this, what would be a reasonable limit for string constants? How about 2^30 = 1073741824? The other choice we have here is do nothing and close this as WON'T FIX. Although the error message we get from the OS: "f951: out of memory allocating 18446744065119617024 " is confusing. I can cast the signed integer length to uint32_t and avoid the big number. Any opinions?