re PR target/65184 (ICE: in expand_expr_addr_expr_1, at expr.c:7760 with -mabi=ms...
authorIlya Enkovich <ilya.enkovich@intel.com>
Mon, 2 Mar 2015 10:47:54 +0000 (10:47 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Mon, 2 Mar 2015 10:47:54 +0000 (10:47 +0000)
gcc/

PR target/65184
* gcc/config/i386/i386.c (ix86_pass_by_reference) Bounds
are never passed by reference.

gcc/testsuite/

PR target/65184
* gcc.target/i386/pr65184.c: New.

From-SVN: r221106

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr65184.c [new file with mode: 0644]

index 5850dc40bbb35d62ccd9830faeca51fb1141569c..606d4c72b7a7a9d4d335b752bd5ad3565213f089 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-02  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR target/65184
+       * gcc/config/i386/i386.c (ix86_pass_by_reference) Bounds
+       are never passed by reference.
+
 2015-03-02  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        PR target/65183
index bec132499015d65618a7e414d424ed64d7b0ce20..ab8f03acdc615f2739ad7e70831ce19327fc8f00 100644 (file)
@@ -7914,6 +7914,11 @@ ix86_pass_by_reference (cumulative_args_t cum_v, machine_mode mode,
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
 
+  /* Bounds are never passed by reference.  */
+  if ((type && POINTER_BOUNDS_TYPE_P (type))
+      || POINTER_BOUNDS_MODE_P (mode))
+    return false;
+
   /* See Windows x64 Software Convention.  */
   if (TARGET_64BIT && (cum ? cum->call_abi : ix86_abi) == MS_ABI)
     {
index c1584168c8d42f3b14d280c93e9c8f4454cbf1bd..940bb13ec612991eebcc3ae8b1b26ac446fb69fb 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-02  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR target/65184
+       * gcc.target/i386/pr65184.c: New.
+
 2015-03-02  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        PR target/65183
diff --git a/gcc/testsuite/gcc.target/i386/pr65184.c b/gcc/testsuite/gcc.target/i386/pr65184.c
new file mode 100644 (file)
index 0000000..0355f29
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
+/* { dg-options "-O2 -mabi=ms -fcheck-pointer-bounds -mmpx" } */
+
+void
+foo (int *a)
+{
+  if (a[0] != a[1] * 2333)
+    __builtin_abort ();
+}
+
+void
+bar (int *a)
+{
+  if (a[0] != a[1] * 2333)
+    __builtin_abort ();
+}