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

nightstrike <nightstrike at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=71588
                URL|                            |https://godbolt.org/z/33ajc
                   |                            |bbnr

--- Comment #5 from nightstrike <nightstrike at gmail dot com> ---
I verified on godbolt.org that the original code will still cause the ICE that
the PR was trying to fix when using the builtin variants of the two functions
requiring size_t.  This avoids the extension issue altogether, which doesn't
work in every case:

https://godbolt.org/z/33ajcbbnr

```
char *strcpy (char *, const char *)  __attribute__ ((__pure__));

char a; 

char *foo ()
{
  char *c = __builtin_malloc (__builtin_strlen(&a));
  return strcpy (c, &a);
}
```

<source>: In function 'foo':
<source>:5:7: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Compiler returned: 1


Note that I had to go back to a 4.7 compiler (4.7.1, 4.7.4, either one) to get
it to fail, because the fix was backported to many branches.

Note also that the testcase filename is wrong.  I would suggest that a real fix
also does a `git mv` to rename the testcase from pr71558.c to pr71588.c to
avoid further confusion about the purpose of the test.

Reply via email to