This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC ICE bug with segfault...
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: leon zadorin <leonleon77 at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 22 Aug 2016 16:58:25 +0200
- Subject: Re: GCC ICE bug with segfault...
- Authentication-results: sourceware.org; auth=none
- References: <CAPpySAZrpS5RNSXFM+pMD-P0Zs4t_yO6J0J77rPeRZYKFthxbA@mail.gmail.com>
On 2016.08.22 at 18:47 +1000, leon zadorin wrote:
> Hello,
>
> I am not sure whether I can report a bug without an account in
> bugzilla (account creation temporarily disabled on that site)
>
> ... so I am posting this here for the time being
>
> GCC (trunk, rev 239646 -- but likely with earlier versions also, I
> haven't had the chance to test those yet) appears to ICE with
> segmentation fault given the following code (validity of which aside
> for the moment):
>
> #include <stdlib.h>
> #include <string.h>
>
> struct Blah {
> char * a;
> };
>
> template <typename T>
> void Test(T & Obj) {
> auto && a(Obj.a);
> a = (char*)::malloc(1024 * 1024);
> ::memset(a + 28, 'X', 6);
> }
>
> int main() {
> Blah d;
> Test(d);
> return 0;
> }
>
> When compiled as
> c++ -Wall main.c++
>
> Causes GCC itself to crash hard:
>
> main.c++: In function 'void Test(T&)':
> main.c++:12:25: internal compiler error: Segmentation fault
> ::memset(a + 28, 'X', 6);
Thanks.
I've opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77321.
--
Markus