~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/c6/c6ad1ad6dda8f5ad8c3c29f2e81af61ad799def8.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: Apply #660525 fix to in-tree libffi
 
2
 
 
3
--- a/src/libffi/src/m68k/sysv.S
 
4
+++ b/src/libffi/src/m68k/sysv.S
 
5
@@ -2,9 +2,10 @@
 
6
        
 
7
    sysv.S - Copyright (c) 2012 Alan Hourihane
 
8
            Copyright (c) 1998, 2012 Andreas Schwab
 
9
-           Copyright (c) 2008 Red Hat, Inc. 
 
10
-   
 
11
-   m68k Foreign Function Interface 
 
12
+           Copyright (c) 2008 Red Hat, Inc.
 
13
+           Copyright (c) 2012 Thorsten Glaser
 
14
+
 
15
+   m68k Foreign Function Interface
 
16
 
 
17
    Permission is hereby granted, free of charge, to any person obtaining
 
18
    a copy of this software and associated documentation files (the
 
19
@@ -168,8 +169,28 @@ retstruct1:
 
20
 
 
21
 retstruct2:
 
22
        btst    #7,%d2
 
23
-       jbeq    noretval
 
24
+       jbeq    retsint8
 
25
        move.w  %d0,(%a1)
 
26
+       jbra    epilogue
 
27
+
 
28
+retsint8:
 
29
+       btst    #8,%d2
 
30
+       jbeq    retsint16
 
31
+       | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
 
32
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
 
33
+       ext.w   %d0
 
34
+       ext.l   %d0
 
35
+#else
 
36
+       extb.l  %d0
 
37
+#endif
 
38
+       move.l  %d0,(%a1)
 
39
+       jbra    epilogue
 
40
+
 
41
+retsint16:
 
42
+       btst    #9,%d2
 
43
+       jbeq    noretval
 
44
+       ext.l   %d0
 
45
+       move.l  %d0,(%a1)
 
46
 
 
47
 noretval:
 
48
 epilogue:
 
49
@@ -201,8 +222,10 @@ CALLFUNC(ffi_closure_SYSV):
 
50
        lsr.l   #1,%d0
 
51
        jne     1f
 
52
        jcc     .Lcls_epilogue
 
53
+       | CIF_FLAGS_INT
 
54
        move.l  -12(%fp),%d0
 
55
 .Lcls_epilogue:
 
56
+       | no CIF_FLAGS_*
 
57
        unlk    %fp
 
58
        rts
 
59
 1:
 
60
@@ -210,6 +233,7 @@ CALLFUNC(ffi_closure_SYSV):
 
61
        lsr.l   #2,%d0
 
62
        jne     1f
 
63
        jcs     .Lcls_ret_float
 
64
+       | CIF_FLAGS_DINT
 
65
        move.l  (%a0)+,%d0
 
66
        move.l  (%a0),%d1
 
67
        jra     .Lcls_epilogue
 
68
@@ -224,6 +248,7 @@ CALLFUNC(ffi_closure_SYSV):
 
69
        lsr.l   #2,%d0
 
70
        jne     1f
 
71
        jcs     .Lcls_ret_ldouble
 
72
+       | CIF_FLAGS_DOUBLE
 
73
 #if defined(__MC68881__) || defined(__HAVE_68881__)
 
74
        fmove.d (%a0),%fp0
 
75
 #else
 
76
@@ -242,17 +267,37 @@ CALLFUNC(ffi_closure_SYSV):
 
77
        jra     .Lcls_epilogue
 
78
 1:
 
79
        lsr.l   #2,%d0
 
80
-       jne     .Lcls_ret_struct2
 
81
+       jne     1f
 
82
        jcs     .Lcls_ret_struct1
 
83
+       | CIF_FLAGS_POINTER
 
84
        move.l  (%a0),%a0
 
85
        move.l  %a0,%d0
 
86
        jra     .Lcls_epilogue
 
87
 .Lcls_ret_struct1:
 
88
        move.b  (%a0),%d0
 
89
        jra     .Lcls_epilogue
 
90
-.Lcls_ret_struct2:
 
91
+1:
 
92
+       lsr.l   #2,%d0
 
93
+       jne     1f
 
94
+       jcs     .Lcls_ret_sint8
 
95
+       | CIF_FLAGS_STRUCT2
 
96
        move.w  (%a0),%d0
 
97
        jra     .Lcls_epilogue
 
98
+.Lcls_ret_sint8:
 
99
+       move.l  (%a0),%d0
 
100
+       | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
 
101
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
 
102
+       ext.w   %d0
 
103
+       ext.l   %d0
 
104
+#else
 
105
+       extb.l  %d0
 
106
+#endif
 
107
+       jra     .Lcls_epilogue
 
108
+1:
 
109
+       | CIF_FLAGS_SINT16
 
110
+       move.l  (%a0),%d0
 
111
+       ext.l   %d0
 
112
+       jra     .Lcls_epilogue
 
113
        CFI_ENDPROC()
 
114
 
 
115
        .size   CALLFUNC(ffi_closure_SYSV),.-CALLFUNC(ffi_closure_SYSV)
 
116
--- a/src/libffi/src/m68k/ffi.c
 
117
+++ b/src/libffi/src/m68k/ffi.c
 
118
@@ -123,6 +123,8 @@ ffi_prep_args (void *stack, extended_cif
 
119
 #define CIF_FLAGS_POINTER      32
 
120
 #define CIF_FLAGS_STRUCT1      64
 
121
 #define CIF_FLAGS_STRUCT2      128
 
122
+#define CIF_FLAGS_SINT8                256
 
123
+#define CIF_FLAGS_SINT16       512
 
124
 
 
125
 /* Perform machine dependent cif processing */
 
126
 ffi_status
 
127
@@ -200,6 +202,14 @@ ffi_prep_cif_machdep (ffi_cif *cif)
 
128
       cif->flags = CIF_FLAGS_DINT;
 
129
       break;
 
130
 
 
131
+    case FFI_TYPE_SINT16:
 
132
+      cif->flags = CIF_FLAGS_SINT16;
 
133
+      break;
 
134
+
 
135
+    case FFI_TYPE_SINT8:
 
136
+      cif->flags = CIF_FLAGS_SINT8;
 
137
+      break;
 
138
+
 
139
     default:
 
140
       cif->flags = CIF_FLAGS_INT;
 
141
       break;