aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-08-11 12:01:13 +0200
committerMartin Liska <marxin@gcc.gnu.org>2017-08-11 10:01:13 +0000
commitfe8a99d8cdcfacf14b603b99a7730d18ce0ccd1f (patch)
tree811303a849108a7aac4ab132aa9d5b1becc7e2df /gcc
parenta8b522b483ebb8c972ecfde8779a7a6ec16aecd6 (diff)
downloadgcc-fe8a99d8cdcfacf14b603b99a7730d18ce0ccd1f.zip
gcc-fe8a99d8cdcfacf14b603b99a7730d18ce0ccd1f.tar.gz
gcc-fe8a99d8cdcfacf14b603b99a7730d18ce0ccd1f.tar.bz2
Do not instrument void variables with MPX (PR tree-opt/79987).
2017-08-11 Martin Liska <mliska@suse.cz> PR tree-opt/79987 * tree-chkp.c (chkp_get_bounds_for_decl_addr): Do not instrument variables of void type. 2017-08-11 Martin Liska <mliska@suse.cz> PR tree-opt/79987 * gcc.target/i386/mpx/pr79987.c: New test. From-SVN: r251049
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/pr79987.c5
-rw-r--r--gcc/tree-chkp.c3
4 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a926516..9be7f17 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-08-11 Martin Liska <mliska@suse.cz>
+ PR tree-opt/79987
+ * tree-chkp.c (chkp_get_bounds_for_decl_addr): Do not instrument
+ variables of void type.
+
+2017-08-11 Martin Liska <mliska@suse.cz>
+
* asan.c (asan_protect_global): Replace ASM_OUTPUT_DEF with
TARGET_SUPPORTS_ALIASES.
* cgraph.c (cgraph_node::create_same_body_alias): Likewise.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 76c07405..80ee13e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2017-08-11 Martin Liska <mliska@suse.cz>
+ PR tree-opt/79987
+ * gcc.target/i386/mpx/pr79987.c: New test.
+
+2017-08-11 Martin Liska <mliska@suse.cz>
+
PR ipa/81213
* gcc.target/i386/pr81213.c: New test.
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79987.c b/gcc/testsuite/gcc.target/i386/mpx/pr79987.c
new file mode 100644
index 0000000..b3ebda9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr79987.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+extern void foo;
+void *bar = &foo; /* { dg-warning "taking address of expression of type .void." } */
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index 12af458..951aec1 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -3197,6 +3197,9 @@ chkp_get_bounds_for_decl_addr (tree decl)
&& !flag_chkp_incomplete_type)
return chkp_get_zero_bounds ();
+ if (VOID_TYPE_P (TREE_TYPE (decl)))
+ return chkp_get_zero_bounds ();
+
if (flag_chkp_use_static_bounds
&& VAR_P (decl)
&& (TREE_STATIC (decl)