aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorIlya Enkovich <enkovich.gnu@gmail.com>2015-06-18 10:18:48 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-06-18 10:18:48 +0000
commit55429190dd99a471a22b88a9576920b6cf17d803 (patch)
tree14a8b94e9c742f74901f64a3b969172d115077c8 /gcc/function.c
parent855f036dcc09c3c0a7718bdcb0fd4125b57c1dce (diff)
downloadgcc-55429190dd99a471a22b88a9576920b6cf17d803.zip
gcc-55429190dd99a471a22b88a9576920b6cf17d803.tar.gz
gcc-55429190dd99a471a22b88a9576920b6cf17d803.tar.bz2
re PR target/66569 ([CHKP] internal compiler error: in assign_by_spills)
gcc/ PR target/66569 * function.c (assign_bounds): Add arguments assign_regs, assign_special, assign_bt. (assign_parms): For vararg functions handle bounds in BT and special slots after incoming vararg bounds. gcc/testsuite/ PR target/66569 * gcc.target/i386/mpx/chkp-vararg.c: New test. From-SVN: r224602
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/gcc/function.c b/gcc/function.c
index ac0458a..ea0eba8 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3489,9 +3489,11 @@ assign_parm_load_bounds (struct assign_parm_data_one *data,
static void
assign_bounds (vec<bounds_parm_data> &bndargs,
- struct assign_parm_data_all &all)
+ struct assign_parm_data_all &all,
+ bool assign_regs, bool assign_special,
+ bool assign_bt)
{
- unsigned i, pass, handled = 0;
+ unsigned i, pass;
bounds_parm_data *pbdata;
if (!bndargs.exists ())
@@ -3505,17 +3507,20 @@ assign_bounds (vec<bounds_parm_data> &bndargs,
{
/* Pass 0 => regs only. */
if (pass == 0
- && (!pbdata->parm_data.entry_parm
- || GET_CODE (pbdata->parm_data.entry_parm) != REG))
+ && (!assign_regs
+ ||(!pbdata->parm_data.entry_parm
+ || GET_CODE (pbdata->parm_data.entry_parm) != REG)))
continue;
/* Pass 1 => slots only. */
else if (pass == 1
- && (!pbdata->parm_data.entry_parm
- || GET_CODE (pbdata->parm_data.entry_parm) == REG))
+ && (!assign_special
+ || (!pbdata->parm_data.entry_parm
+ || GET_CODE (pbdata->parm_data.entry_parm) == REG)))
continue;
/* Pass 2 => BT only. */
else if (pass == 2
- && pbdata->parm_data.entry_parm)
+ && (!assign_bt
+ || pbdata->parm_data.entry_parm))
continue;
if (!pbdata->parm_data.entry_parm
@@ -3536,14 +3541,7 @@ assign_bounds (vec<bounds_parm_data> &bndargs,
else
assign_parm_setup_stack (&all, pbdata->bounds_parm,
&pbdata->parm_data);
-
- /* Count handled bounds to make sure we miss nothing. */
- handled++;
}
-
- gcc_assert (handled == bndargs.length ());
-
- bndargs.release ();
}
/* Assign RTL expressions to the function's parameters. This may involve
@@ -3668,12 +3666,14 @@ assign_parms (tree fndecl)
/* We expect this is the last parm. Otherwise it is wrong
to assign bounds right now. */
gcc_assert (i == (fnargs.length () - 1));
- assign_bounds (bndargs, all);
+ assign_bounds (bndargs, all, true, false, false);
targetm.calls.setup_incoming_vararg_bounds (all.args_so_far,
data.promoted_mode,
data.passed_type,
&pretend_bytes,
false);
+ assign_bounds (bndargs, all, false, true, true);
+ bndargs.release ();
}
}
@@ -3685,7 +3685,8 @@ assign_parms (tree fndecl)
bound_no++;
}
- assign_bounds (bndargs, all);
+ assign_bounds (bndargs, all, true, true, true);
+ bndargs.release ();
if (targetm.calls.split_complex_arg)
assign_parms_unsplit_complex (&all, fnargs);