~ubuntu-branches/ubuntu/precise/gccgo-4.7/precise

« back to all changes in this revision

Viewing changes to debian/patches/libffi-ppc64.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-27 10:36:09 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120327103609-wl8mwk1kwc3nix3u
Tags: 4.7.0-0ubuntu1
GCC 4.7.0 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: Fix libffi build failure on powerpc multilib
 
2
 
 
3
        * src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp.
 
4
        Silence casting pointer to integer of different size warning.
 
5
        Delete goto to previously deleted label.
 
6
        (ffi_call): Silence possibly undefined warning.
 
7
        (ffi_closure_helper_SYSV): Declare variable type.
 
8
 
 
9
--- a/src/libffi/src/powerpc/ffi.c
 
10
+++ b/src/libffi/src/powerpc/ffi.c
 
11
@@ -146,6 +146,7 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
 
12
   gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS;
 
13
   intarg_count = 0;
 
14
 #ifndef __NO_FPRS__
 
15
+  double double_tmp;
 
16
   fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS;
 
17
   fparg_count = 0;
 
18
   copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c);
 
19
@@ -155,9 +156,9 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
 
20
   next_arg.u = stack + 2;
 
21
 
 
22
   /* Check that everything starts aligned properly.  */
 
23
-  FFI_ASSERT (((unsigned) (char *) stack & 0xF) == 0);
 
24
-  FFI_ASSERT (((unsigned) copy_space.c & 0xF) == 0);
 
25
-  FFI_ASSERT (((unsigned) stacktop.c & 0xF) == 0);
 
26
+  FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
 
27
+  FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0);
 
28
+  FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
 
29
   FFI_ASSERT ((bytes & 0xF) == 0);
 
30
   FFI_ASSERT (copy_space.c >= next_arg.c);
 
31
 
 
32
@@ -211,8 +212,6 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
 
33
 
 
34
        case FFI_TYPE_DOUBLE:
 
35
          /* With FFI_LINUX_SOFT_FLOAT doubles are handled like UINT64.  */
 
36
-         if (ecif->cif->abi == FFI_LINUX_SOFT_FLOAT)
 
37
-           goto soft_double_prep;
 
38
          double_tmp = **p_argv.d;
 
39
 
 
40
          if (fparg_count >= NUM_FPR_ARG_REGISTERS)
 
41
@@ -925,7 +924,7 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
 
42
    */
 
43
   unsigned int smst_buffer[2];
 
44
   extended_cif ecif;
 
45
-  unsigned int rsize;
 
46
+  unsigned int rsize = 0;
 
47
 
 
48
   ecif.cif = cif;
 
49
   ecif.avalue = avalue;
 
50
@@ -1132,7 +1131,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
 
51
 
 
52
          if (nf < 8)
 
53
            {
 
54
-             temp = pfr->d;
 
55
+             double temp = pfr->d;
 
56
              pfr->f = (float) temp;
 
57
              avalue[i] = pfr;
 
58
              nf++;
 
59
 
 
60