https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93380
--- Comment #2 from Robert Dumitru <robert.dumitru at cyberthorstudios dot com> --- Hi Andrew, Thank you for your pointing out that. I will report the issue to ARM as well. However, regarding 1 and 2: 1. I understand this looks like a gdb bug, but my investigation pointed me to consider that what gdb does is correct- at least partially. It tries to read the memory to find the size of the array. If the memory is not initialised with the correct value, the size can be huge - hence - virtual memory exhausted bug. I will try and check with a newer gdb. Maybe gdb should know the expression can not be evaluated before right instructions are executed? 2. I checked with gcc 9.2.1 20191025 and the this still happens.