http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58579
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code CC| |burnus at gcc dot gnu.org Known to fail| |4.8.1, 4.9.0 --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> --- The generated code (-fdump-tree-original) looks odd: D.1887 = &i; D.1888 = *D.1887; D.1890 = MAX_EXPR <D.1888, 0> * 64; D.1891 = (void * restrict) __builtin_malloc (MAX_EXPR <(unsigned long) D.1890, 1>); Why is there the multiplication by 64? We have a kind=1 character, i.e. one should have multiplied by 1 (byte). Random guess: That's the bit size of a pointer. (That it fails with that multiplication is clear: gfortran uses a (signed) 32bit variable for the string length - and 33554432 * 64 == 2**31 - but (2**31-1) is the largest positive 32bit integer.)