From: Alexander Ivchenko Date: Thu, 8 Jun 2017 16:05:59 +0000 (+0000) Subject: re PR middle-end/79988 ([CHKP] ICE in tree check: accessed operand 5 of call_expr... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=77db6c1549c8e8d831a5fa0a246415e7572678e2;p=gcc.git re PR middle-end/79988 ([CHKP] ICE in tree check: accessed operand 5 of call_expr with 4 operands in ix86_expand_builtin, at config/i386/i386.c:36851) 2017-06-08 Alexander Ivchenko PR middle-end/79988 * tree-chkp.c (chkp_gimple_call_builtin_p): Remove gimple_call_builtin_p call. 017-06-08 Alexander Ivchenko PR middle-end/79988 * gcc.target/i386/mpx/pr79988.c: New test. From-SVN: r249023 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 141836fcdfb..5b8d35ece2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-06-08 Alexander Ivchenko + + PR middle-end/79988 + * tree-chkp.c (chkp_gimple_call_builtin_p): Remove + gimple_call_builtin_p call. + 2017-06-08 Jan Hubicka * system.h (fancy_abort): Annotate by ATTRIBUTE_COLD. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e077cbb5f5a..0cefe33825c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-06-08 Alexander Ivchenko + + PR middle-end/79988 + * gcc.target/i386/mpx/pr79988.c: New test. + 2017-06-08 Alexander Ivchenko * gcc.target/i386/mpx/hard-reg-2-lbv.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79988.c b/gcc/testsuite/gcc.target/i386/mpx/pr79988.c new file mode 100644 index 00000000000..a6e43eba562 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/pr79988.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx" } */ + +void foo(unsigned char * __seg_gs *pointer_gs) { + pointer_gs[5] = 0; +} diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c index e36ecbfbbe0..3464343682d 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -435,7 +435,11 @@ chkp_gimple_call_builtin_p (gimple *call, enum built_in_function code) { tree fndecl; - if (gimple_call_builtin_p (call, BUILT_IN_MD) + /* We are skipping the check for address-spaces, that's + why we don't use gimple_call_builtin_p directly here. */ + if (is_gimple_call (call) + && (fndecl = gimple_call_fndecl (call)) != NULL + && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD && (fndecl = targetm.builtin_chkp_function (code)) && (DECL_FUNCTION_CODE (gimple_call_fndecl (call)) == DECL_FUNCTION_CODE (fndecl)))