aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-02-21 18:46:42 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-02-21 18:46:42 +0100
commit956d3e61a029d40846994b99b7b2b12986ccb047 (patch)
tree239874141f4de1215749f0f4177be528c11520d5 /gcc
parentd4cbfca47f47194a267f387c473416a62befb93b (diff)
downloadgcc-956d3e61a029d40846994b99b7b2b12986ccb047.zip
gcc-956d3e61a029d40846994b99b7b2b12986ccb047.tar.gz
gcc-956d3e61a029d40846994b99b7b2b12986ccb047.tar.bz2
re PR target/79633 (ICE in gimple_call_arg, at gimple.h:3163)
PR target/79633 * tree-chkp-opt.c (chkp_optimize_string_function_calls): Use is_gimple_call instead of comparing gimple_code with GIMPLE_CALL. Use gimple_call_builtin_p. * gcc.target/i386/mpx/pr79633.c: New test. From-SVN: r245634
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/pr79633.c11
-rw-r--r--gcc/tree-chkp-opt.c9
4 files changed, 22 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a58a516..e265311 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2017-02-21 Jakub Jelinek <jakub@redhat.com>
+ PR target/79633
+ * tree-chkp-opt.c (chkp_optimize_string_function_calls): Use
+ is_gimple_call instead of comparing gimple_code with GIMPLE_CALL.
+ Use gimple_call_builtin_p.
+
PR target/79570
* sel-sched.c (moveup_expr_cached): Don't call sel_bb_head
on temporarily removed DEBUG_INSNs.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f6f2e37..02e4dec 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2017-02-21 Jakub Jelinek <jakub@redhat.com>
+ PR target/79633
+ * gcc.target/i386/mpx/pr79633.c: New test.
+
PR target/79570
* gcc.dg/pr79570.c: New test.
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79633.c b/gcc/testsuite/gcc.target/i386/mpx/pr79633.c
new file mode 100644
index 0000000..2a60ee8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr79633.c
@@ -0,0 +1,11 @@
+/* PR target/79633 */
+/* { dg-do compile } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -w -O2" } */
+
+extern void *memcpy ();
+
+void
+foo ()
+{
+ memcpy ();
+}
diff --git a/gcc/tree-chkp-opt.c b/gcc/tree-chkp-opt.c
index 6c84cae..ebe0545 100644
--- a/gcc/tree-chkp-opt.c
+++ b/gcc/tree-chkp-opt.c
@@ -964,15 +964,12 @@ chkp_optimize_string_function_calls (void)
gimple *stmt = gsi_stmt (i);
tree fndecl;
- if (gimple_code (stmt) != GIMPLE_CALL
- || !gimple_call_with_bounds_p (stmt))
+ if (!is_gimple_call (stmt)
+ || !gimple_call_with_bounds_p (stmt)
+ || !gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
continue;
fndecl = gimple_call_fndecl (stmt);
-
- if (!fndecl || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
- continue;
-
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMCPY_CHKP
|| DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMPCPY_CHKP
|| DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMMOVE_CHKP