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

            Bug ID: 79763
           Summary: [CHKP] ICE in chkp_find_bounds: Unexpected tree code
                    real_cst in tree-chkp.c:3681
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: ienkovich at gcc dot gnu.org
  Target Milestone: ---

Starting from introduction of MPX, we ICE on an LLVM test-case:

$ cat
/home/marxin/BIG/Programming/llvm-project/clang/test/CodeGen/func-ptr-cast-decl.c
// RUN: %clang_cc1 -emit-llvm-only %s -verify
// expected-no-diagnostics
// PR5882

int q_sk_num(void *a);
typedef int (*fptr)(double);
void a() { ((fptr)q_sk_num)(0); }

$ gcc
/home/marxin/BIG/Programming/llvm-project/clang/test/CodeGen/func-ptr-cast-decl.c
-fcheck-pointer-bounds
-mmpx/home/marxin/BIG/Programming/llvm-project/clang/test/CodeGen/func-ptr-cast-decl.c:
In function ‘a’:
/home/marxin/BIG/Programming/llvm-project/clang/test/CodeGen/func-ptr-cast-decl.c:7:13:
warning: function called through a non-compatible type
 void a() { ((fptr)q_sk_num)(0); }
            ~^~~~~~~~~~~~~~~
/home/marxin/BIG/Programming/llvm-project/clang/test/CodeGen/func-ptr-cast-decl.c:
In function ‘a.chkp’:
/home/marxin/BIG/Programming/llvm-project/clang/test/CodeGen/func-ptr-cast-decl.c:7:1:
internal compiler error: chkp_find_bounds: Unexpected tree code real_cst
 void a() { ((fptr)q_sk_num)(0); }
 ^~~~
0xe230e7 chkp_find_bounds_1
        ../../gcc/tree-chkp.c:3681
0xe27a0f chkp_find_bounds
        ../../gcc/tree-chkp.c:3702
0xe27a0f chkp_add_bounds_to_call_stmt
        ../../gcc/tree-chkp.c:1899
0xe27a0f chkp_instrument_function
        ../../gcc/tree-chkp.c:4286
0xe27a0f chkp_execute
        ../../gcc/tree-chkp.c:4470
0xe27a0f execute
        ../../gcc/tree-chkp.c:4529

Reply via email to