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

            Bug ID: 89934
           Summary: [9 Regression] ICE in tree_fits_uhwi_p, at tree.c:7237
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20190210 and 20190217, at -O[s123].
(gcc-8 needs -Wall, and changed behavior before 20180525)


$ cat z1.c
char *strncpy();
void foo (char *a)
{
  strncpy (a, a);
}


$ gcc-9-20190331 -c z1.c -O2
z1.c: In function 'foo':
z1.c:4:3: warning: too few arguments to built-in function 'strncpy' expecting 3
[-Wbuiltin-declaration-mismatch]
    4 |   strncpy (a, a);
      |   ^~~~~~~
z1.c:1:7: note: declared here
    1 | char *strncpy();
      |       ^~~~~~~
during GIMPLE pass: wrestrict
z1.c:2:6: internal compiler error: Segmentation fault
    2 | void foo (char *a)
      |      ^~~
0xa748df crash_signal
        ../../gcc/toplev.c:326
0xca6a37 tree_fits_uhwi_p(tree_node const*)
        ../../gcc/tree.c:7237
0x6aecbc get_size_range(tree_node*, tree_node**, bool)
        ../../gcc/calls.c:1238
0x83ca3e builtin_access
        ../../gcc/gimple-ssa-warn-restrict.c:735
0x83d39f check_bounds_or_overlap(gimple*, tree_node*, tree_node*, tree_node*,
tree_node*, bool, bool)
        ../../gcc/gimple-ssa-warn-restrict.c:1933
0x83f7f0 check_call
        ../../gcc/gimple-ssa-warn-restrict.c:1904
0x83f7f0 before_dom_children
        ../../gcc/gimple-ssa-warn-restrict.c:105
0x1164c54 dom_walker::walk(basic_block_def*)
        ../../gcc/domwalk.c:353
0x835aa7 execute
        ../../gcc/gimple-ssa-warn-restrict.c:119

Reply via email to