docker-engine: new package
[buildroot-gz.git] / package / guile / 0004-workaround-ice-ssa-corruption.patch
blob54f3158a91632941857eadcc675503542824c510
1 libguile/vm-i-system.c: workaround ice ssa corruption while compiling with option -g -O
3 While compiling with option -g -O, there was a ssa corruption:
4 ..
5 Unable to coalesce ssa_names 48 and 3476 which are marked as MUST COALESCE.
6 sp_48(ab) and sp_3476(ab)
7 guile-2.0.11/libguile/vm-engine.c: In function 'vm_debug_engine':
8 guile-2.0.11/libguile/vm.c:673:19: internal compiler error: SSA corruption
9 #define VM_NAME vm_debug_engine
11 guile-2.0.11/libguile/vm-engine.c:39:1: note: in expansion of macro 'VM_NAME'
12 VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
14 Please submit a full bug report,
15 with preprocessed source if appropriate.
16 See <http://gcc.gnu.org/bugs.html> for instructions.
17 ...
19 Tweak libguile/vm-i-system.c to add boundary value check to workaround it.
21 Upstream-Status: Pending
23 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
25 Fixes Buildroot autobuilder failures on AArch64.
27 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
28 ---
29 libguile/vm-i-system.c | 20 ++++++++++++++++----
30 1 file changed, 16 insertions(+), 4 deletions(-)
32 diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
33 --- a/libguile/vm-i-system.c
34 +++ b/libguile/vm-i-system.c
35 @@ -625,10 +625,22 @@ VM_DEFINE_INSTRUCTION (47, bind_optionals_shuffle, "bind-optionals/shuffle", 6,
36 /* now shuffle up, from walk to ntotal */
38 scm_t_ptrdiff nshuf = sp - walk + 1, i;
39 - sp = (fp - 1) + ntotal + nshuf;
40 - CHECK_OVERFLOW ();
41 - for (i = 0; i < nshuf; i++)
42 - sp[-i] = walk[nshuf-i-1];
43 + /* check the value of nshuf to workaround ice ssa corruption */
44 + /* while compiling with -O -g */
45 + if (nshuf > 0)
46 + {
47 + sp = (fp - 1) + ntotal + nshuf;
48 + CHECK_OVERFLOW ();
49 + for (i = 0; i < nshuf; i++)
50 + sp[-i] = walk[nshuf-i-1];
51 + }
52 + else
53 + {
54 + sp = (fp - 1) + ntotal + nshuf;
55 + CHECK_OVERFLOW ();
56 + for (i = 0; i < nshuf; i++)
57 + sp[-i] = walk[nshuf-i-1];
58 + }
60 /* and fill optionals & keyword args with SCM_UNDEFINED */
61 while (walk <= (fp - 1) + ntotal)
62 --
63 1.9.1