This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, PR target/68416, i386, MPX] Add bounds registers to ALL_REGS set


Hi,

This patch fixes redundant bndmov problem by adding bounds registers to
ALL_REGS set.  This patch was bootstrapped and regtested on
x86_64-unknown-linux-gnu.  OK for trunk and gcc-5-branch?

Thanks,
Ilya
--
gcc/

2015-11-26  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/68416
	* config/i386/i386.h (enum reg_class): Add
	bounds registers to ALL_REGS.

gcc/testsuite/

2015-11-26  Ilya Enkovich  <enkovich.gnu@gmail.com>

	PR target/68416
	* gcc.target/i386/mpx/pr68416.c: New test.


diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index ceda472..e69c9cc 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1457,7 +1457,7 @@ enum reg_class
 { 0x1ff1ffff,0xffffffe0,   0x1f },       /* FLOAT_INT_SSE_REGS */        \
        { 0x0,       0x0, 0x1fc0 },       /* MASK_EVEX_REGS */           \
        { 0x0,       0x0, 0x1fe0 },       /* MASK_REGS */                 \
-{ 0xffffffff,0xffffffff, 0x1fff }                                        \
+{ 0xffffffff,0xffffffff,0x1ffff }                                        \
 }
 
 /* The same information, inverted:
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr68416.c b/gcc/testsuite/gcc.target/i386/mpx/pr68416.c
new file mode 100644
index 0000000..10587ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr68416.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mmpx -fcheck-pointer-bounds" } */
+/* { dg-final { scan-assembler-not "bndmov" } } */
+
+int
+foo(int **arr, int i)
+{
+  return (*arr)[i];
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]