From: Ilya Enkovich Date: Mon, 2 Mar 2015 10:47:54 +0000 (+0000) Subject: re PR target/65184 (ICE: in expand_expr_addr_expr_1, at expr.c:7760 with -mabi=ms... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df265bd262f3f39d9eaf19087f0139ffb53a4d75;p=gcc.git re PR target/65184 (ICE: in expand_expr_addr_expr_1, at expr.c:7760 with -mabi=ms -fcheck-pointer-bounds -mmpx) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5850dc40bbb..606d4c72b7a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-02 Ilya Enkovich + + PR target/65184 + * gcc/config/i386/i386.c (ix86_pass_by_reference) Bounds + are never passed by reference. + 2015-03-02 Ilya Enkovich PR target/65183 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index bec13249901..ab8f03acdc6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c1584168c8d..940bb13ec61 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-02 Ilya Enkovich + + PR target/65184 + * gcc.target/i386/pr65184.c: New. + 2015-03-02 Ilya Enkovich 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 index 00000000000..0355f29a0f2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr65184.c @@ -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 (); +}