[Bug c/81153] New: Incorrect annotation causes an internal compiler error at tree-ssanames.c line 375

2017-06-21 Thread ernst.vanveenendaal at prismtech dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81153

Bug ID: 81153
   Summary: Incorrect annotation causes an internal compiler error
at tree-ssanames.c line 375
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ernst.vanveenendaal at prismtech dot com
  Target Milestone: ---

Created attachment 41599
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41599&action=edit
reproducer

I encounted an internal compiler error:
test.c: In function ‘main’:
test.c:8:8: internal compiler error: in get_range_info, at tree-ssanames.c:375
  void *ptr2 = my_realloc(ptr,20);
^~~~

because the code I was trying to compile had an incorrect annotation for a
function prototype. Correction the annotation fixed the crash, but I don't
expect the compiler to crash on such an error.

GCC version is gcc-7 (SUSE Linux) 7.1.1 20170530 [gcc-7-branch revision 248621]
on OpenSuse thumbleweed

Reproducer (just build with gcc test.c):

test.c:
===
#include "test.h"
#include 
#include 

void main(void)
{
void *ptr = malloc(20);
void *ptr2 = my_realloc(ptr,20);
printf("ptr = %x, ptr2 = %x\n", ptr, ptr2);
}

void* my_realloc(void* ptr, int size) 
{
return realloc(ptr, size);
}

===
test.h
===
void *my_realloc(void*, int) 
__attribute__((alloc_size(1)));

===

Compiling this with gcc will result in an error:

test.c: In function ‘main’:
test.c:8:8: internal compiler error: in get_range_info, at tree-ssanames.c:375
  void *ptr2 = my_realloc(ptr,20);
^~~~

[Bug c/81153] Incorrect annotation causes an internal compiler error at tree-ssanames.c line 375

2017-06-21 Thread ernst.vanveenendaal at prismtech dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81153

--- Comment #1 from ernst.vanveenendaal at prismtech dot com ---
Created attachment 41600
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41600&action=edit
reproducer