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

            Bug ID: 93927
           Summary: ICE: 'verify_gimple' failed (error: invalid conversion
                    in gimple call)
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-10.0.1-alpha20200223 snapshot (g:3133bed5d0327e8a9cd0a601b7ecdb9de4fc825d),
9.2, 8.3, 7.3, 6.3 all ICE when compiling the following testcase w/ -fchecking:

long int
strstr (const char *, const char *);

char *
bb (char *nl)
{
  return !!strstr (nl, "0") ? "0" : "1";
}

% gcc-10.0.1 -c gjtieyri.c
gjtieyri.c: In function 'bb':
gjtieyri.c:5:1: error: invalid conversion in gimple call
    5 | bb (char *nl)
      | ^~
long int

char *

_1 = __builtin_strchr (nl, 48);
during GIMPLE pass: lower
gjtieyri.c:5:1: internal compiler error: 'verify_gimple' failed
0xdd03ed verify_gimple_in_seq(gimple*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200223/work/gcc-10-20200223/gcc/tree-cfg.c:5111
0xcad140 execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200223/work/gcc-10-20200223/gcc/passes.c:1985
0xcade5c do_per_function
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200223/work/gcc-10-20200223/gcc/passes.c:1638
0xcade5c execute_todo
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200223/work/gcc-10-20200223/gcc/passes.c:2037

Or:

--- /home/asolokha/t1/gjtieyri.c
+++ #<buffer gjtieyri.c>
@@ -1,8 +1,8 @@
 long int
-strstr (const char *, const char *);
+strchr (const char *, int);

 char *
 bb (char *nl)
 {
-  return !!strstr (nl, "0") ? "0" : "1";
+  return !!strchr (nl, 0) ? "0" : "1";
 }


% gcc-10.0.1 -c gjtieyri.c
gjtieyri.c: In function 'bb':
gjtieyri.c:5:1: error: type mismatch in 'pointer_plus_expr'
    5 | bb (char *nl)
      | ^~
long int

char *

long unsigned int

_1 = nl + D.1941;
during GIMPLE pass: lower
gjtieyri.c:5:1: internal compiler error: 'verify_gimple' failed
0xdd03ed verify_gimple_in_seq(gimple*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200223/work/gcc-10-20200223/gcc/tree-cfg.c:5111
0xcad140 execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200223/work/gcc-10-20200223/gcc/passes.c:1985
0xcade5c do_per_function
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200223/work/gcc-10-20200223/gcc/passes.c:1638
0xcade5c execute_todo
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200223/work/gcc-10-20200223/gcc/passes.c:2037

Given the age of the issue, it must have been filed already, but I failed to
find an earlier PR.

Reply via email to