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

« back to all changes in this revision

Viewing changes to .svn/pristine/47/47fe26c73ac69b1fd011a3587c411718bf3e1b4a.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: updates from the 4.8 branch upto 20140930 (r215742).
 
2
 
 
3
last_updated()
 
4
{
 
5
        cat > ${dir}LAST_UPDATED <<EOF
 
6
Tue Sep 30 23:23:25 CEST 2014
 
7
Tue Sep 30 21:23:25 UTC 2014 (revision 215742)
 
8
EOF
 
9
}
 
10
 
 
11
LANG=C svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_4_8_3_release svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch \
 
12
        | sed -r 's,^--- (\S+)\t(\S+)(.*)$,--- a/src/\1\t\2,;s,^\+\+\+ (\S+)\t(\S+)(.*)$,+++ b/src/\1\t\2,' \
 
13
        | awk '/^Index:.*\.(class|texi)/ {skip=1; next} /^Index:/ { skip=0 } skip==0'
 
14
 
 
15
Index: libstdc++-v3/python/libstdcxx/v6/printers.py
 
16
===================================================================
 
17
--- a/src/libstdc++-v3/python/libstdcxx/v6/printers.py  (.../tags/gcc_4_8_3_release)
 
18
+++ b/src/libstdc++-v3/python/libstdcxx/v6/printers.py  (.../branches/gcc-4_8-branch)
 
19
@@ -1,4 +1,4 @@
 
20
-# Pretty-printers for libstc++.
 
21
+# Pretty-printers for libstdc++.
 
22
 
 
23
 # Copyright (C) 2008-2013 Free Software Foundation, Inc.
 
24
 
 
25
@@ -18,7 +18,51 @@
 
26
 import gdb
 
27
 import itertools
 
28
 import re
 
29
+import sys
 
30
 
 
31
+### Python 2 + Python 3 compatibility code
 
32
+
 
33
+# Resources about compatibility:
 
34
+#
 
35
+#  * <http://pythonhosted.org/six/>: Documentation of the "six" module
 
36
+
 
37
+# FIXME: The handling of e.g. std::basic_string (at least on char)
 
38
+# probably needs updating to work with Python 3's new string rules.
 
39
+#
 
40
+# In particular, Python 3 has a separate type (called byte) for
 
41
+# bytestrings, and a special b"" syntax for the byte literals; the old
 
42
+# str() type has been redefined to always store Unicode text.
 
43
+#
 
44
+# We probably can't do much about this until this GDB PR is addressed:
 
45
+# <https://sourceware.org/bugzilla/show_bug.cgi?id=17138>
 
46
+
 
47
+if sys.version_info[0] > 2:
 
48
+    ### Python 3 stuff
 
49
+    Iterator = object
 
50
+    # Python 3 folds these into the normal functions.
 
51
+    imap = map
 
52
+    izip = zip
 
53
+    # Also, int subsumes long
 
54
+    long = int
 
55
+else:
 
56
+    ### Python 2 stuff
 
57
+    class Iterator:
 
58
+        """Compatibility mixin for iterators
 
59
+
 
60
+        Instead of writing next() methods for iterators, write
 
61
+        __next__() methods and use this mixin to make them work in
 
62
+        Python 2 as well as Python 3.
 
63
+
 
64
+        Idea stolen from the "six" documentation:
 
65
+        <http://pythonhosted.org/six/#six.Iterator>
 
66
+        """
 
67
+
 
68
+        def next(self):
 
69
+            return self.__next__()
 
70
+
 
71
+    # In Python 2, we still need these from itertools
 
72
+    from itertools import imap, izip
 
73
+
 
74
 # Try to use the new-style pretty-printing if available.
 
75
 _use_gdb_pp = True
 
76
 try:
 
77
@@ -51,7 +95,7 @@
 
78
         # anything fancier here.
 
79
         field = typ.fields()[0]
 
80
         if not field.is_base_class:
 
81
-            raise ValueError, "Cannot find type %s::%s" % (str(orig), name)
 
82
+            raise ValueError("Cannot find type %s::%s" % (str(orig), name))
 
83
         typ = field.type
 
84
 
 
85
 class SharedPointerPrinter:
 
86
@@ -87,7 +131,7 @@
 
87
 class StdListPrinter:
 
88
     "Print a std::list"
 
89
 
 
90
-    class _iterator:
 
91
+    class _iterator(Iterator):
 
92
         def __init__(self, nodetype, head):
 
93
             self.nodetype = nodetype
 
94
             self.base = head['_M_next']
 
95
@@ -97,7 +141,7 @@
 
96
         def __iter__(self):
 
97
             return self
 
98
 
 
99
-        def next(self):
 
100
+        def __next__(self):
 
101
             if self.base == self.head:
 
102
                 raise StopIteration
 
103
             elt = self.base.cast(self.nodetype).dereference()
 
104
@@ -135,7 +179,7 @@
 
105
 class StdSlistPrinter:
 
106
     "Print a __gnu_cxx::slist"
 
107
 
 
108
-    class _iterator:
 
109
+    class _iterator(Iterator):
 
110
         def __init__(self, nodetype, head):
 
111
             self.nodetype = nodetype
 
112
             self.base = head['_M_head']['_M_next']
 
113
@@ -144,7 +188,7 @@
 
114
         def __iter__(self):
 
115
             return self
 
116
 
 
117
-        def next(self):
 
118
+        def __next__(self):
 
119
             if self.base == 0:
 
120
                 raise StopIteration
 
121
             elt = self.base.cast(self.nodetype).dereference()
 
122
@@ -180,7 +224,7 @@
 
123
 class StdVectorPrinter:
 
124
     "Print a std::vector"
 
125
 
 
126
-    class _iterator:
 
127
+    class _iterator(Iterator):
 
128
         def __init__ (self, start, finish, bitvec):
 
129
             self.bitvec = bitvec
 
130
             if bitvec:
 
131
@@ -198,7 +242,7 @@
 
132
         def __iter__(self):
 
133
             return self
 
134
 
 
135
-        def next(self):
 
136
+        def __next__(self):
 
137
             count = self.count
 
138
             self.count = self.count + 1
 
139
             if self.bitvec:
 
140
@@ -265,7 +309,7 @@
 
141
 class StdTuplePrinter:
 
142
     "Print a std::tuple"
 
143
 
 
144
-    class _iterator:
 
145
+    class _iterator(Iterator):
 
146
         def __init__ (self, head):
 
147
             self.head = head
 
148
 
 
149
@@ -276,13 +320,13 @@
 
150
                 # Set the actual head to the first pair.
 
151
                 self.head  = self.head.cast (nodes[0].type)
 
152
             elif len (nodes) != 0:
 
153
-                raise ValueError, "Top of tuple tree does not consist of a single node."
 
154
+                raise ValueError("Top of tuple tree does not consist of a single node.")
 
155
             self.count = 0
 
156
 
 
157
         def __iter__ (self):
 
158
             return self
 
159
 
 
160
-        def next (self):
 
161
+        def __next__ (self):
 
162
             nodes = self.head.type.fields ()
 
163
             # Check for further recursions in the inheritance tree.
 
164
             if len (nodes) == 0:
 
165
@@ -289,7 +333,7 @@
 
166
                 raise StopIteration
 
167
             # Check that this iteration has an expected structure.
 
168
             if len (nodes) != 2:
 
169
-                raise ValueError, "Cannot parse more than 2 nodes in a tuple tree."
 
170
+                raise ValueError("Cannot parse more than 2 nodes in a tuple tree.")
 
171
 
 
172
             # - Left node is the next recursion parent.
 
173
             # - Right node is the actual class contained in the tuple.
 
174
@@ -341,7 +385,7 @@
 
175
             return self.visualizer.display_hint ()
 
176
         return None
 
177
 
 
178
-class RbtreeIterator:
 
179
+class RbtreeIterator(Iterator):
 
180
     def __init__(self, rbtree):
 
181
         self.size = rbtree['_M_t']['_M_impl']['_M_node_count']
 
182
         self.node = rbtree['_M_t']['_M_impl']['_M_header']['_M_left']
 
183
@@ -353,7 +397,7 @@
 
184
     def __len__(self):
 
185
         return int (self.size)
 
186
 
 
187
-    def next(self):
 
188
+    def __next__(self):
 
189
         if self.count == self.size:
 
190
             raise StopIteration
 
191
         result = self.node
 
192
@@ -405,7 +449,7 @@
 
193
     "Print a std::map or std::multimap"
 
194
 
 
195
     # Turn an RbtreeIterator into a pretty-print iterator.
 
196
-    class _iter:
 
197
+    class _iter(Iterator):
 
198
         def __init__(self, rbiter, type):
 
199
             self.rbiter = rbiter
 
200
             self.count = 0
 
201
@@ -414,9 +458,9 @@
 
202
         def __iter__(self):
 
203
             return self
 
204
 
 
205
-        def next(self):
 
206
+        def __next__(self):
 
207
             if self.count % 2 == 0:
 
208
-                n = self.rbiter.next()
 
209
+                n = next(self.rbiter)
 
210
                 n = n.cast(self.type).dereference()['_M_value_field']
 
211
                 self.pair = n
 
212
                 item = n['first']
 
213
@@ -447,7 +491,7 @@
 
214
     "Print a std::set or std::multiset"
 
215
 
 
216
     # Turn an RbtreeIterator into a pretty-print iterator.
 
217
-    class _iter:
 
218
+    class _iter(Iterator):
 
219
         def __init__(self, rbiter, type):
 
220
             self.rbiter = rbiter
 
221
             self.count = 0
 
222
@@ -456,8 +500,8 @@
 
223
         def __iter__(self):
 
224
             return self
 
225
 
 
226
-        def next(self):
 
227
-            item = self.rbiter.next()
 
228
+        def __next__(self):
 
229
+            item = next(self.rbiter)
 
230
             item = item.cast(self.type).dereference()['_M_value_field']
 
231
             # FIXME: this is weird ... what to do?
 
232
             # Maybe a 'set' display hint?
 
233
@@ -522,7 +566,7 @@
 
234
 class StdDequePrinter:
 
235
     "Print a std::deque"
 
236
 
 
237
-    class _iter:
 
238
+    class _iter(Iterator):
 
239
         def __init__(self, node, start, end, last, buffer_size):
 
240
             self.node = node
 
241
             self.p = start
 
242
@@ -534,7 +578,7 @@
 
243
         def __iter__(self):
 
244
             return self
 
245
 
 
246
-        def next(self):
 
247
+        def __next__(self):
 
248
             if self.p == self.last:
 
249
                 raise StopIteration
 
250
 
 
251
@@ -619,7 +663,7 @@
 
252
     def display_hint (self):
 
253
         return 'string'
 
254
 
 
255
-class Tr1HashtableIterator:
 
256
+class Tr1HashtableIterator(Iterator):
 
257
     def __init__ (self, hash):
 
258
         self.node = hash['_M_bbegin']['_M_node']['_M_nxt']
 
259
         self.node_type = find_type(hash.type, '__node_type').pointer()
 
260
@@ -627,7 +671,7 @@
 
261
     def __iter__ (self):
 
262
         return self
 
263
 
 
264
-    def next (self):
 
265
+    def __next__ (self):
 
266
         if self.node == 0:
 
267
             raise StopIteration
 
268
         node = self.node.cast(self.node_type)
 
269
@@ -655,8 +699,8 @@
 
270
         return '[%d]' % i
 
271
 
 
272
     def children (self):
 
273
-        counter = itertools.imap (self.format_count, itertools.count())
 
274
-        return itertools.izip (counter, Tr1HashtableIterator (self.hashtable()))
 
275
+        counter = imap (self.format_count, itertools.count())
 
276
+        return izip (counter, Tr1HashtableIterator (self.hashtable()))
 
277
 
 
278
 class Tr1UnorderedMapPrinter:
 
279
     "Print a tr1::unordered_map"
 
280
@@ -688,11 +732,11 @@
 
281
         return '[%d]' % i
 
282
 
 
283
     def children (self):
 
284
-        counter = itertools.imap (self.format_count, itertools.count())
 
285
+        counter = imap (self.format_count, itertools.count())
 
286
         # Map over the hash table and flatten the result.
 
287
-        data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
 
288
+        data = self.flatten (imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
 
289
         # Zip the two iterators together.
 
290
-        return itertools.izip (counter, data)
 
291
+        return izip (counter, data)
 
292
 
 
293
     def display_hint (self):
 
294
         return 'map'
 
295
@@ -700,7 +744,7 @@
 
296
 class StdForwardListPrinter:
 
297
     "Print a std::forward_list"
 
298
 
 
299
-    class _iterator:
 
300
+    class _iterator(Iterator):
 
301
         def __init__(self, nodetype, head):
 
302
             self.nodetype = nodetype
 
303
             self.base = head['_M_next']
 
304
@@ -709,7 +753,7 @@
 
305
         def __iter__(self):
 
306
             return self
 
307
 
 
308
-        def next(self):
 
309
+        def __next__(self):
 
310
             if self.base == 0:
 
311
                 raise StopIteration
 
312
             elt = self.base.cast(self.nodetype).dereference()
 
313
@@ -764,7 +808,7 @@
 
314
         # A small sanity check.
 
315
         # FIXME
 
316
         if not self.compiled_rx.match(name + '<>'):
 
317
-            raise ValueError, 'libstdc++ programming error: "%s" does not match' % name
 
318
+            raise ValueError('libstdc++ programming error: "%s" does not match' % name)
 
319
         printer = RxPrinter(name, function)
 
320
         self.subprinters.append(printer)
 
321
         self.lookup[name] = printer
 
322
Index: libstdc++-v3/scripts/run_doxygen
 
323
===================================================================
 
324
--- a/src/libstdc++-v3/scripts/run_doxygen      (.../tags/gcc_4_8_3_release)
 
325
+++ b/src/libstdc++-v3/scripts/run_doxygen      (.../branches/gcc-4_8-branch)
 
326
@@ -193,8 +193,15 @@
 
327
 if $do_latex; then
 
328
     cd ${outdir}/${mode}
 
329
 
 
330
-    # Also drop in the header file and style sheet
 
331
-    doxygen -w latex header.tex doxygen.sty
 
332
+    # Grrr, Doxygen 1.8.x changed the -w latex options.
 
333
+    need_footer=`doxygen -h | sed -n -e '/-w latex/s=.*footer.*=true=p'`
 
334
+
 
335
+    # Also drop in the header file (maybe footer file) and style sheet
 
336
+    if $need_footer; then
 
337
+      doxygen -w latex header.tex footer.tex doxygen.sty
 
338
+    else
 
339
+      doxygen -w latex header.tex doxygen.sty
 
340
+    fi
 
341
     
 
342
     echo ::
 
343
     echo :: LaTeX pages begin with
 
344
Index: libstdc++-v3/doc/xml/manual/status_cxx2011.xml
 
345
===================================================================
 
346
--- a/src/libstdc++-v3/doc/xml/manual/status_cxx2011.xml        (.../tags/gcc_4_8_3_release)
 
347
+++ b/src/libstdc++-v3/doc/xml/manual/status_cxx2011.xml        (.../branches/gcc-4_8-branch)
 
348
@@ -226,10 +226,12 @@
 
349
       <entry/>
 
350
     </row>
 
351
     <row>
 
352
+      <?dbhtml bgcolor="#B0B0B0" ?>
 
353
       <entry>18.8.6</entry>
 
354
       <entry><code>nested_exception</code></entry>
 
355
-      <entry>Y</entry>
 
356
-      <entry/>
 
357
+      <entry>Partial</entry>
 
358
+      <entry>Follows an earlier C++0x draft, not the final specification.
 
359
+      </entry>
 
360
     </row>
 
361
     <row>
 
362
       <entry>18.9</entry>
 
363
@@ -1119,10 +1121,11 @@
 
364
       <entry/>
 
365
     </row>
 
366
     <row>
 
367
+      <?dbhtml bgcolor="#B0B0B0" ?>
 
368
       <entry>21.4</entry>
 
369
       <entry>Class template <code>basic_string</code></entry>
 
370
-      <entry>Y</entry>
 
371
-      <entry/>
 
372
+      <entry>Partial</entry>
 
373
+      <entry>Missing <code>getline</code> overloads for rvalue streams.</entry>
 
374
     </row>
 
375
     <row>
 
376
       <entry>21.5</entry>
 
377
Index: libstdc++-v3/doc/html/manual/status.html
 
378
===================================================================
 
379
--- a/src/libstdc++-v3/doc/html/manual/status.html      (.../tags/gcc_4_8_3_release)
 
380
+++ b/src/libstdc++-v3/doc/html/manual/status.html      (.../branches/gcc-4_8-branch)
 
381
@@ -165,7 +165,8 @@
 
382
              <code class="code">set_new_handler</code> is not thread-safe.
 
383
       </td></tr><tr><td align="left">18.7</td><td align="left">Type identification</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">18.7.1</td><td align="left">Class type_info</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.7.2</td><td align="left">Class bad_cast</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.7.3</td><td align="left">Class bad_typeid</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8</td><td align="left">Exception handling</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">18.8.1</td><td align="left">Class exception</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8.2</td><td align="left">Class bad_exception</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">18.8.3</td><td align="left">Abnormal termination</td><td align="left">Partial</td><td align="left">Missing <code class="code">get_terminate</code>.
 
384
              <code class="code">set_terminate</code> is not thread-safe.
 
385
-      </td></tr><tr><td align="left">18.8.4</td><td align="left"><code class="code">uncaught_exception</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8.5</td><td align="left">Exception Propagation</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8.6</td><td align="left"><code class="code">nested_exception</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9</td><td align="left">Initializer lists</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">18.9.1</td><td align="left">Initializer list constructors</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9.2</td><td align="left">Initializer list access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9.3</td><td align="left">Initializer list range access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.10</td><td align="left">Other runtime support</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
 
386
+      </td></tr><tr><td align="left">18.8.4</td><td align="left"><code class="code">uncaught_exception</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8.5</td><td align="left">Exception Propagation</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">18.8.6</td><td align="left"><code class="code">nested_exception</code></td><td align="left">Partial</td><td align="left">Follows an earlier C++0x draft, not the final specification.
 
387
+      </td></tr><tr><td align="left">18.9</td><td align="left">Initializer lists</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">18.9.1</td><td align="left">Initializer list constructors</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9.2</td><td align="left">Initializer list access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9.3</td><td align="left">Initializer list range access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.10</td><td align="left">Other runtime support</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
 
388
        <span class="emphasis"><em>19</em></span>
 
389
       </td><td colspan="3" align="left">
 
390
        <span class="emphasis"><em>Diagnostics</em></span>
 
391
@@ -187,7 +188,7 @@
 
392
        <span class="emphasis"><em>21</em></span>
 
393
       </td><td colspan="3" align="left">
 
394
        <span class="emphasis"><em>Strings</em></span>
 
395
-      </td></tr><tr><td align="left">21.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2</td><td align="left">Character traits</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">21.2.1</td><td align="left">Character traits requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.2</td><td align="left">traits typedefs</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.3</td><td align="left"><code class="code">char_traits</code> specializations</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.2.3.1</td><td align="left">struct <code class="code">char_traits&lt;char&gt;</code></td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr bgcolor="#B0B0B0"><td align="left">21.2.3.2</td><td align="left">struct <code class="code">char_traits&lt;char16_t&gt;</code></td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr><td align="left">21.2.3.3</td><td align="left">struct <code class="code">char_traits&lt;char32_t&gt;</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.3.4</td><td align="left">struct <code class="code">char_traits&lt;wchar_t&gt;</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.3</td><td align="left">String classes</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.4</td><td align="left">Class template <code class="code">basic_string</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.5</td><td align="left">Numeric Conversions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.6</td><td align="left">Hash support</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.7</td><td align="left">Null-terminated sequence utilities</td><td align="left">Partial</td><td align="left">C library dependency.
 
396
+      </td></tr><tr><td align="left">21.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2</td><td align="left">Character traits</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">21.2.1</td><td align="left">Character traits requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.2</td><td align="left">traits typedefs</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.3</td><td align="left"><code class="code">char_traits</code> specializations</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.2.3.1</td><td align="left">struct <code class="code">char_traits&lt;char&gt;</code></td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr bgcolor="#B0B0B0"><td align="left">21.2.3.2</td><td align="left">struct <code class="code">char_traits&lt;char16_t&gt;</code></td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr><td align="left">21.2.3.3</td><td align="left">struct <code class="code">char_traits&lt;char32_t&gt;</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.3.4</td><td align="left">struct <code class="code">char_traits&lt;wchar_t&gt;</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.3</td><td align="left">String classes</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.4</td><td align="left">Class template <code class="code">basic_string</code></td><td align="left">Partial</td><td align="left">Missing <code class="code">getline</code> overloads for rvalue streams.</td></tr><tr><td align="left">21.5</td><td align="left">Numeric Conversions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.6</td><td align="left">Hash support</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.7</td><td align="left">Null-terminated sequence utilities</td><td align="left">Partial</td><td align="left">C library dependency.
 
397
       Missing <code class="filename">&lt;cuchar&gt;</code>
 
398
       </td></tr><tr><td align="left">
 
399
        <span class="emphasis"><em>22</em></span>
 
400
Index: libstdc++-v3/doc/html/manual/abi.html
 
401
===================================================================
 
402
--- a/src/libstdc++-v3/doc/html/manual/abi.html (.../tags/gcc_4_8_3_release)
 
403
+++ b/src/libstdc++-v3/doc/html/manual/abi.html (.../branches/gcc-4_8-branch)
 
404
@@ -96,7 +96,7 @@
 
405
    definitions, where the version definition is the maximum for a
 
406
    particular release. Labels are cumulative. If a particular release
 
407
    is not listed, it has the same version labels as the preceding
 
408
-   release.</p><p>This corresponds to the mapfile: gcc/libgcc-std.ver</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: GCC_3.0</p></li><li class="listitem"><p>GCC 3.3.0: GCC_3.3</p></li><li class="listitem"><p>GCC 3.3.1: GCC_3.3.1</p></li><li class="listitem"><p>GCC 3.3.2: GCC_3.3.2</p></li><li class="listitem"><p>GCC 3.3.4: GCC_3.3.4</p></li><li class="listitem"><p>GCC 3.4.0: GCC_3.4</p></li><li class="listitem"><p>GCC 3.4.2: GCC_3.4.2</p></li><li class="listitem"><p>GCC 3.4.4: GCC_3.4.4</p></li><li class="listitem"><p>GCC 4.0.0: GCC_4.0.0</p></li><li class="listitem"><p>GCC 4.1.0: GCC_4.1.0</p></li><li class="listitem"><p>GCC 4.2.0: GCC_4.2.0</p></li><li class="listitem"><p>GCC 4.3.0: GCC_4.3.0</p></li><li class="listitem"><p>GCC 4.4.0: GCC_4.4.0</p></li><li class="listitem"><p>GCC 4.5.0: GCC_4.5.0</p></li><li class="listitem"><p>GCC 4.6.0: GCC_4.6.0</p></li><li class="listitem"><p>GCC 4.7.0: GCC_4.7.0</p></li></ul></div></li><li class="listitem"><p>
 
409
+   release.</p><p>This corresponds to the mapfile: gcc/libgcc-std.ver</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: GCC_3.0</p></li><li class="listitem"><p>GCC 3.3.0: GCC_3.3</p></li><li class="listitem"><p>GCC 3.3.1: GCC_3.3.1</p></li><li class="listitem"><p>GCC 3.3.2: GCC_3.3.2</p></li><li class="listitem"><p>GCC 3.3.4: GCC_3.3.4</p></li><li class="listitem"><p>GCC 3.4.0: GCC_3.4</p></li><li class="listitem"><p>GCC 3.4.2: GCC_3.4.2</p></li><li class="listitem"><p>GCC 3.4.4: GCC_3.4.4</p></li><li class="listitem"><p>GCC 4.0.0: GCC_4.0.0</p></li><li class="listitem"><p>GCC 4.1.0: GCC_4.1.0</p></li><li class="listitem"><p>GCC 4.2.0: GCC_4.2.0</p></li><li class="listitem"><p>GCC 4.3.0: GCC_4.3.0</p></li><li class="listitem"><p>GCC 4.4.0: GCC_4.4.0</p></li><li class="listitem"><p>GCC 4.5.0: GCC_4.5.0</p></li><li class="listitem"><p>GCC 4.6.0: GCC_4.6.0</p></li><li class="listitem"><p>GCC 4.7.0: GCC_4.7.0</p></li><li class="listitem"><p>GCC 4.8.0: GCC_4.8.0</p></li></ul></div></li><li class="listitem"><p>
 
410
        Release versioning on the libstdc++.so binary, implemented in
 
411
        the same way as the libgcc_s.so binary above. Listed is the
 
412
        filename: <code class="constant">DT_SONAME</code> can be deduced from
 
413
@@ -111,7 +111,7 @@
 
414
        has the same filename and <code class="constant">DT_SONAME</code> as the
 
415
        preceding release.
 
416
       </p><p>It is versioned as follows:
 
417
-    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: libstdc++.so.3.0.0</p></li><li class="listitem"><p>GCC 3.0.1: libstdc++.so.3.0.1</p></li><li class="listitem"><p>GCC 3.0.2: libstdc++.so.3.0.2</p></li><li class="listitem"><p>GCC 3.0.3: libstdc++.so.3.0.2 (See Note 1)</p></li><li class="listitem"><p>GCC 3.0.4: libstdc++.so.3.0.4</p></li><li class="listitem"><p>GCC 3.1.0: libstdc++.so.4.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.1.1: libstdc++.so.4.0.1</p></li><li class="listitem"><p>GCC 3.2.0: libstdc++.so.5.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.2.1: libstdc++.so.5.0.1</p></li><li class="listitem"><p>GCC 3.2.2: libstdc++.so.5.0.2</p></li><li class="listitem"><p>GCC 3.2.3: libstdc++.so.5.0.3 (See Note 2)</p></li><li class="listitem"><p>GCC 3.3.0: libstdc++.so.5.0.4</p></li><li class="listitem"><p>GCC 3.3.1: libstdc++.so.5.0.5</p></li><li class="listitem"><p>GCC 3.4.0: libstdc++.so.6.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.4.1: libstdc++.so.6.0.1</p></li><li class="listitem"><p>GCC 3.4.2: libstdc++.so.6.0.2</p></li><li class="listitem"><p>GCC 3.4.3: libstdc++.so.6.0.3</p></li><li class="listitem"><p>GCC 4.0.0: libstdc++.so.6.0.4</p></li><li class="listitem"><p>GCC 4.0.1: libstdc++.so.6.0.5</p></li><li class="listitem"><p>GCC 4.0.2: libstdc++.so.6.0.6</p></li><li class="listitem"><p>GCC 4.0.3: libstdc++.so.6.0.7</p></li><li class="listitem"><p>GCC 4.1.0: libstdc++.so.6.0.7</p></li><li class="listitem"><p>GCC 4.1.1: libstdc++.so.6.0.8</p></li><li class="listitem"><p>GCC 4.2.0: libstdc++.so.6.0.9</p></li><li class="listitem"><p>GCC 4.2.1: libstdc++.so.6.0.9 (See Note 3)</p></li><li class="listitem"><p>GCC 4.2.2: libstdc++.so.6.0.9</p></li><li class="listitem"><p>GCC 4.3.0: libstdc++.so.6.0.10</p></li><li class="listitem"><p>GCC 4.4.0: libstdc++.so.6.0.11</p></li><li class="listitem"><p>GCC 4.4.1: libstdc++.so.6.0.12</p></li><li class="listitem"><p>GCC 4.4.2: libstdc++.so.6.0.13</p></li><li class="listitem"><p>GCC 4.5.0: libstdc++.so.6.0.14</p></li><li class="listitem"><p>GCC 4.6.0: libstdc++.so.6.0.15</p></li><li class="listitem"><p>GCC 4.6.1: libstdc++.so.6.0.16</p></li><li class="listitem"><p>GCC 4.7.0: libstdc++.so.6.0.17</p></li><li class="listitem"><p>GCC 4.8.0: libstdc++.so.6.0.18</p></li></ul></div><p>
 
418
+    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: libstdc++.so.3.0.0</p></li><li class="listitem"><p>GCC 3.0.1: libstdc++.so.3.0.1</p></li><li class="listitem"><p>GCC 3.0.2: libstdc++.so.3.0.2</p></li><li class="listitem"><p>GCC 3.0.3: libstdc++.so.3.0.2 (See Note 1)</p></li><li class="listitem"><p>GCC 3.0.4: libstdc++.so.3.0.4</p></li><li class="listitem"><p>GCC 3.1.0: libstdc++.so.4.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.1.1: libstdc++.so.4.0.1</p></li><li class="listitem"><p>GCC 3.2.0: libstdc++.so.5.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.2.1: libstdc++.so.5.0.1</p></li><li class="listitem"><p>GCC 3.2.2: libstdc++.so.5.0.2</p></li><li class="listitem"><p>GCC 3.2.3: libstdc++.so.5.0.3 (See Note 2)</p></li><li class="listitem"><p>GCC 3.3.0: libstdc++.so.5.0.4</p></li><li class="listitem"><p>GCC 3.3.1: libstdc++.so.5.0.5</p></li><li class="listitem"><p>GCC 3.4.0: libstdc++.so.6.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.4.1: libstdc++.so.6.0.1</p></li><li class="listitem"><p>GCC 3.4.2: libstdc++.so.6.0.2</p></li><li class="listitem"><p>GCC 3.4.3: libstdc++.so.6.0.3</p></li><li class="listitem"><p>GCC 4.0.0: libstdc++.so.6.0.4</p></li><li class="listitem"><p>GCC 4.0.1: libstdc++.so.6.0.5</p></li><li class="listitem"><p>GCC 4.0.2: libstdc++.so.6.0.6</p></li><li class="listitem"><p>GCC 4.0.3: libstdc++.so.6.0.7</p></li><li class="listitem"><p>GCC 4.1.0: libstdc++.so.6.0.7</p></li><li class="listitem"><p>GCC 4.1.1: libstdc++.so.6.0.8</p></li><li class="listitem"><p>GCC 4.2.0: libstdc++.so.6.0.9</p></li><li class="listitem"><p>GCC 4.2.1: libstdc++.so.6.0.9 (See Note 3)</p></li><li class="listitem"><p>GCC 4.2.2: libstdc++.so.6.0.9</p></li><li class="listitem"><p>GCC 4.3.0: libstdc++.so.6.0.10</p></li><li class="listitem"><p>GCC 4.4.0: libstdc++.so.6.0.11</p></li><li class="listitem"><p>GCC 4.4.1: libstdc++.so.6.0.12</p></li><li class="listitem"><p>GCC 4.4.2: libstdc++.so.6.0.13</p></li><li class="listitem"><p>GCC 4.5.0: libstdc++.so.6.0.14</p></li><li class="listitem"><p>GCC 4.6.0: libstdc++.so.6.0.15</p></li><li class="listitem"><p>GCC 4.6.1: libstdc++.so.6.0.16</p></li><li class="listitem"><p>GCC 4.7.0: libstdc++.so.6.0.17</p></li><li class="listitem"><p>GCC 4.8.0: libstdc++.so.6.0.18</p></li><li class="listitem"><p>GCC 4.8.3: libstdc++.so.6.0.19</p></li></ul></div><p>
 
419
       Note 1: Error should be libstdc++.so.3.0.3.
 
420
     </p><p>
 
421
       Note 2: Not strictly required.
 
422
@@ -129,7 +129,7 @@
 
423
    GLIBCPP_3.2 for symbols that were introduced in the GCC 3.2.0
 
424
    release.) If a particular release is not listed, it has the same
 
425
    version labels as the preceding release.
 
426
-   </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.1: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.2: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.3: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.4: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.1.0: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>GCC 3.1.1: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>GCC 3.2.0: GLIBCPP_3.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.1: GLIBCPP_3.2.1, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.2: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.3: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.3.0: GLIBCPP_3.2.2, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.1: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.2: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.3: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.4.0: GLIBCXX_3.4, CXXABI_1.3</p></li><li class="listitem"><p>GCC 3.4.1: GLIBCXX_3.4.1, CXXABI_1.3</p></li><li class="listitem"><p>GCC 3.4.2: GLIBCXX_3.4.2</p></li><li class="listitem"><p>GCC 3.4.3: GLIBCXX_3.4.3</p></li><li class="listitem"><p>GCC 4.0.0: GLIBCXX_3.4.4, CXXABI_1.3.1</p></li><li class="listitem"><p>GCC 4.0.1: GLIBCXX_3.4.5</p></li><li class="listitem"><p>GCC 4.0.2: GLIBCXX_3.4.6</p></li><li class="listitem"><p>GCC 4.0.3: GLIBCXX_3.4.7</p></li><li class="listitem"><p>GCC 4.1.1: GLIBCXX_3.4.8</p></li><li class="listitem"><p>GCC 4.2.0: GLIBCXX_3.4.9</p></li><li class="listitem"><p>GCC 4.3.0: GLIBCXX_3.4.10, CXXABI_1.3.2</p></li><li class="listitem"><p>GCC 4.4.0: GLIBCXX_3.4.11, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.4.1: GLIBCXX_3.4.12, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.5.0: GLIBCXX_3.4.14, CXXABI_1.3.4</p></li><li class="listitem"><p>GCC 4.6.0: GLIBCXX_3.4.15, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.6.1: GLIBCXX_3.4.16, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.7.0: GLIBCXX_3.4.17, CXXABI_1.3.6</p></li><li class="listitem"><p>GCC 4.8.0: GLIBCXX_3.4.18, CXXABI_1.3.7</p></li></ul></div></li><li class="listitem"><p>Incremental bumping of a compiler pre-defined macro,
 
427
+   </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.1: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.2: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.3: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.4: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.1.0: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>GCC 3.1.1: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>GCC 3.2.0: GLIBCPP_3.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.1: GLIBCPP_3.2.1, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.2: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.3: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.3.0: GLIBCPP_3.2.2, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.1: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.2: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.3: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.4.0: GLIBCXX_3.4, CXXABI_1.3</p></li><li class="listitem"><p>GCC 3.4.1: GLIBCXX_3.4.1, CXXABI_1.3</p></li><li class="listitem"><p>GCC 3.4.2: GLIBCXX_3.4.2</p></li><li class="listitem"><p>GCC 3.4.3: GLIBCXX_3.4.3</p></li><li class="listitem"><p>GCC 4.0.0: GLIBCXX_3.4.4, CXXABI_1.3.1</p></li><li class="listitem"><p>GCC 4.0.1: GLIBCXX_3.4.5</p></li><li class="listitem"><p>GCC 4.0.2: GLIBCXX_3.4.6</p></li><li class="listitem"><p>GCC 4.0.3: GLIBCXX_3.4.7</p></li><li class="listitem"><p>GCC 4.1.1: GLIBCXX_3.4.8</p></li><li class="listitem"><p>GCC 4.2.0: GLIBCXX_3.4.9</p></li><li class="listitem"><p>GCC 4.3.0: GLIBCXX_3.4.10, CXXABI_1.3.2</p></li><li class="listitem"><p>GCC 4.4.0: GLIBCXX_3.4.11, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.4.1: GLIBCXX_3.4.12, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.5.0: GLIBCXX_3.4.14, CXXABI_1.3.4</p></li><li class="listitem"><p>GCC 4.6.0: GLIBCXX_3.4.15, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.6.1: GLIBCXX_3.4.16, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.7.0: GLIBCXX_3.4.17, CXXABI_1.3.6</p></li><li class="listitem"><p>GCC 4.8.0: GLIBCXX_3.4.18, CXXABI_1.3.7</p></li><li class="listitem"><p>GCC 4.8.3: GLIBCXX_3.4.19, CXXABI_1.3.7</p></li></ul></div></li><li class="listitem"><p>Incremental bumping of a compiler pre-defined macro,
 
428
     __GXX_ABI_VERSION. This macro is defined as the version of the
 
429
     compiler v3 ABI, with g++ 3.0 being version 100. This macro will
 
430
     be automatically defined whenever g++ is used (the curious can
 
431
Index: libstdc++-v3/include/std/future
 
432
===================================================================
 
433
--- a/src/libstdc++-v3/include/std/future       (.../tags/gcc_4_8_3_release)
 
434
+++ b/src/libstdc++-v3/include/std/future       (.../branches/gcc-4_8-branch)
 
435
@@ -351,12 +351,14 @@
 
436
       void
 
437
       _M_set_result(function<_Ptr_type()> __res, bool __ignore_failure = false)
 
438
       {
 
439
-        bool __set = __ignore_failure;
 
440
+        bool __set = false;
 
441
         // all calls to this function are serialized,
 
442
         // side-effects of invoking __res only happen once
 
443
         call_once(_M_once, &_State_base::_M_do_set, this, ref(__res),
 
444
             ref(__set));
 
445
-        if (!__set)
 
446
+       if (__set)
 
447
+         _M_cond.notify_all();
 
448
+       else if (!__ignore_failure)
 
449
           __throw_future_error(int(future_errc::promise_already_satisfied));
 
450
       }
 
451
 
 
452
@@ -471,7 +473,6 @@
 
453
           lock_guard<mutex> __lock(_M_mutex);
 
454
           _M_result.swap(__res);
 
455
         }
 
456
-        _M_cond.notify_all();
 
457
         __set = true;
 
458
       }
 
459
 
 
460
@@ -983,22 +984,25 @@
 
461
       void
 
462
       set_value(const _Res& __r)
 
463
       {
 
464
+       auto __future = _M_future;
 
465
         auto __setter = _State::__setter(this, __r);
 
466
-        _M_future->_M_set_result(std::move(__setter));
 
467
+        __future->_M_set_result(std::move(__setter));
 
468
       }
 
469
 
 
470
       void
 
471
       set_value(_Res&& __r)
 
472
       {
 
473
+       auto __future = _M_future;
 
474
         auto __setter = _State::__setter(this, std::move(__r));
 
475
-        _M_future->_M_set_result(std::move(__setter));
 
476
+        __future->_M_set_result(std::move(__setter));
 
477
       }
 
478
 
 
479
       void
 
480
       set_exception(exception_ptr __p)
 
481
       {
 
482
+       auto __future = _M_future;
 
483
         auto __setter = _State::__setter(__p, this);
 
484
-        _M_future->_M_set_result(std::move(__setter));
 
485
+        __future->_M_set_result(std::move(__setter));
 
486
       }
 
487
     };
 
488
 
 
489
@@ -1081,15 +1085,17 @@
 
490
       void
 
491
       set_value(_Res& __r)
 
492
       {
 
493
+       auto __future = _M_future;
 
494
         auto __setter = _State::__setter(this, __r);
 
495
-        _M_future->_M_set_result(std::move(__setter));
 
496
+        __future->_M_set_result(std::move(__setter));
 
497
       }
 
498
 
 
499
       void
 
500
       set_exception(exception_ptr __p)
 
501
       {
 
502
+       auto __future = _M_future;
 
503
         auto __setter = _State::__setter(__p, this);
 
504
-        _M_future->_M_set_result(std::move(__setter));
 
505
+        __future->_M_set_result(std::move(__setter));
 
506
       }
 
507
     };
 
508
 
 
509
@@ -1166,8 +1172,9 @@
 
510
       void
 
511
       set_exception(exception_ptr __p)
 
512
       {
 
513
+       auto __future = _M_future;
 
514
         auto __setter = _State::__setter(__p, this);
 
515
-        _M_future->_M_set_result(std::move(__setter));
 
516
+        __future->_M_set_result(std::move(__setter));
 
517
       }
 
518
     };
 
519
 
 
520
@@ -1193,8 +1200,9 @@
 
521
   inline void
 
522
   promise<void>::set_value()
 
523
   {
 
524
+    auto __future = _M_future;
 
525
     auto __setter = _State::__setter(this);
 
526
-    _M_future->_M_set_result(std::move(__setter));
 
527
+    __future->_M_set_result(std::move(__setter));
 
528
   }
 
529
 
 
530
 
 
531
Index: libstdc++-v3/include/ext/rope
 
532
===================================================================
 
533
--- a/src/libstdc++-v3/include/ext/rope (.../tags/gcc_4_8_3_release)
 
534
+++ b/src/libstdc++-v3/include/ext/rope (.../branches/gcc-4_8-branch)
 
535
@@ -1544,7 +1544,7 @@
 
536
       typedef typename _Base::allocator_type allocator_type;
 
537
       using _Base::_M_tree_ptr;
 
538
       using _Base::get_allocator;
 
539
-      using _Base::_M_get_allocator;      
 
540
+      using _Base::_M_get_allocator;
 
541
       typedef __GC_CONST _CharT* _Cstrptr;
 
542
       
 
543
       static _CharT _S_empty_c_str[1];
 
544
@@ -1876,8 +1876,9 @@
 
545
           const allocator_type& __a = allocator_type())
 
546
       : _Base(__a)
 
547
       {
 
548
-       this->_M_tree_ptr = (0 == __len) ?
 
549
-         0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
 
550
+       this->_M_tree_ptr = (0 == __len)
 
551
+         ? 0
 
552
+         : _S_new_RopeFunction(__fn, __len, __delete_fn, _M_get_allocator());
 
553
       }
 
554
 
 
555
       rope(const rope& __x, const allocator_type& __a = allocator_type())
 
556
Index: libstdc++-v3/include/bits/stl_tree.h
 
557
===================================================================
 
558
--- a/src/libstdc++-v3/include/bits/stl_tree.h  (.../tags/gcc_4_8_3_release)
 
559
+++ b/src/libstdc++-v3/include/bits/stl_tree.h  (.../branches/gcc-4_8-branch)
 
560
@@ -510,11 +510,11 @@
 
561
 
 
562
       _Link_type
 
563
       _M_end()
 
564
-      { return static_cast<_Link_type>(&this->_M_impl._M_header); }
 
565
+      { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); }
 
566
 
 
567
       _Const_Link_type
 
568
       _M_end() const
 
569
-      { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
 
570
+      { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); }
 
571
 
 
572
       static const_reference
 
573
       _S_value(_Const_Link_type __x)
 
574
Index: libstdc++-v3/include/tr2/bool_set
 
575
===================================================================
 
576
--- a/src/libstdc++-v3/include/tr2/bool_set     (.../tags/gcc_4_8_3_release)
 
577
+++ b/src/libstdc++-v3/include/tr2/bool_set     (.../branches/gcc-4_8-branch)
 
578
@@ -44,7 +44,7 @@
 
579
    *  bool_set
 
580
    *
 
581
    *  See N2136, Bool_set: multi-valued logic
 
582
-   *  by Herv� Br�nnimann, Guillaume Melquiond, Sylvain Pion.
 
583
+   *  by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.
 
584
    *
 
585
    *  The implicit conversion to bool is slippery!  I may use the new
 
586
    *  explicit conversion.  This has been specialized in the language
 
587
Index: libstdc++-v3/ChangeLog
 
588
===================================================================
 
589
--- a/src/libstdc++-v3/ChangeLog        (.../tags/gcc_4_8_3_release)
 
590
+++ b/src/libstdc++-v3/ChangeLog        (.../branches/gcc-4_8-branch)
 
591
@@ -1,3 +1,72 @@
 
592
+2014-08-28  Samuel Bronson  <naesten@gmail.com>
 
593
+
 
594
+       Backport r212453 from trunk
 
595
+       2014-07-11  Samuel Bronson  <naesten@gmail.com>
 
596
+                   Matthias Klose  <doko@ubuntu.com>
 
597
+
 
598
+       PR libstdc++/58962
 
599
+       * python/libstdcxx/v6/printers.py: Port to Python 2+3
 
600
+       (imap): New compat function.
 
601
+       (izip): Likewise.
 
602
+       (Iterator): New mixin to allow writing iterators in Python 3 style
 
603
+       regardless of which version we're running on.
 
604
+       [Python3] (long) New compat alias for "int".
 
605
+       * testsuite/lib/gdb-test.exp: Port to Python 2+3 (print syntax)
 
606
+
 
607
+       Backport r210625 from trunk
 
608
+       2014-05-19  Jonathan Wakely  <jwakely@redhat.com>
 
609
+
 
610
+       * python/libstdcxx/v6/printers.py: Use Python3 raise syntax.
 
611
+
 
612
+2014-08-26  John David Anglin  <danglin@gcc.gnu.org>
 
613
+
 
614
+       * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
 
615
+
 
616
+2014-08-26  Jonathan Wakely  <jwakely@redhat.com>
 
617
+
 
618
+       * doc/xml/manual/status_cxx2011.xml: Correct status table.
 
619
+       * doc/html/manual/*: Regenerate.
 
620
+
 
621
+2014-08-04  Jonathan Wakely  <jwakely@redhat.com>
 
622
+
 
623
+       Backported from mainline
 
624
+       2014-07-29  Jonathan Wakely  <jwakely@redhat.com>
 
625
+
 
626
+       PR libstdc++/61946
 
627
+       * include/ext/rope (rope::rope(char_producer<_CharT>*, size_t, bool,
 
628
+       const allocator_type&)): Pass non-const allocator to
 
629
+       _S_new_RopeFunction.
 
630
+       * testsuite/ext/rope/61946.cc: New.
 
631
+
 
632
+2014-08-04  Zifei Tong  <zifeitong@gmail.com>
 
633
+
 
634
+       * libsupc++/atexit_thread.cc (HAVE___CXA_THREAD_ATEXIT_IMPL): Add
 
635
+       _GLIBCXX_ prefix to macro.
 
636
+
 
637
+2014-06-03  Jonathan Wakely  <jwakely@redhat.com>
 
638
+
 
639
+       Backport from mainline
 
640
+       2014-04-15  Jonathan Wakely  <jwakely@redhat.com>
 
641
+
 
642
+       PR libstdc++/60734
 
643
+       * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast.
 
644
+
 
645
+       Backport from mainline
 
646
+       2014-05-16  Jonathan Wakely  <jwakely@redhat.com>
 
647
+
 
648
+       PR libstdc++/60966
 
649
+       * include/std/future (__future_base::_State_baseV2::_M_set_result):
 
650
+       Signal condition variable after call_once returns.
 
651
+       (__future_base::_State_baseV2::_M_do_set): Do not signal here.
 
652
+       (promise::set_value, promise::set_exception): Increment the reference
 
653
+       count on the shared state until the function returns.
 
654
+       * testsuite/30_threads/promise/60966.cc: New.
 
655
+
 
656
+2014-05-29  Jonathan Wakely  <jwakely@redhat.com>
 
657
+
 
658
+       * include/tr2/bool_set: Use UTF-8 for accented characters.
 
659
+       * scripts/run_doxygen: Handle Doxygen 1.8.x change.
 
660
+
 
661
 2014-05-22  Release Manager
 
662
 
 
663
        * GCC 4.8.3 released.
 
664
Index: libstdc++-v3/libsupc++/atexit_thread.cc
 
665
===================================================================
 
666
--- a/src/libstdc++-v3/libsupc++/atexit_thread.cc       (.../tags/gcc_4_8_3_release)
 
667
+++ b/src/libstdc++-v3/libsupc++/atexit_thread.cc       (.../branches/gcc-4_8-branch)
 
668
@@ -26,7 +26,7 @@
 
669
 #include <new>
 
670
 #include "bits/gthr.h"
 
671
 
 
672
-#if HAVE___CXA_THREAD_ATEXIT_IMPL
 
673
+#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
 
674
 
 
675
 extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
 
676
                                         void *arg, void *d);
 
677
@@ -38,7 +38,7 @@
 
678
   return __cxa_thread_atexit_impl (dtor, obj, dso_handle);
 
679
 }
 
680
 
 
681
-#else /* HAVE___CXA_THREAD_ATEXIT_IMPL */
 
682
+#else /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
 
683
 
 
684
 namespace {
 
685
   // One element in a singly-linked stack of cleanups.
 
686
@@ -142,4 +142,4 @@
 
687
   return 0;
 
688
 }
 
689
 
 
690
-#endif /* HAVE___CXA_THREAD_ATEXIT_IMPL */
 
691
+#endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
 
692
Index: libstdc++-v3/testsuite/30_threads/promise/60966.cc
 
693
===================================================================
 
694
--- a/src/libstdc++-v3/testsuite/30_threads/promise/60966.cc    (.../tags/gcc_4_8_3_release)
 
695
+++ b/src/libstdc++-v3/testsuite/30_threads/promise/60966.cc    (.../branches/gcc-4_8-branch)
 
696
@@ -0,0 +1,67 @@
 
697
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
 
698
+// { dg-options " -std=gnu++11 -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
 
699
+// { dg-options " -std=gnu++11 -pthreads" { target *-*-solaris* } }
 
700
+// { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-darwin* } }
 
701
+// { dg-require-cstdint "" }
 
702
+// { dg-require-gthreads "" }
 
703
+// { dg-require-atomic-builtins "" }
 
704
+
 
705
+// Copyright (C) 2014 Free Software Foundation, Inc.
 
706
+//
 
707
+// This file is part of the GNU ISO C++ Library.  This library is free
 
708
+// software; you can redistribute it and/or modify it under the
 
709
+// terms of the GNU General Public License as published by the
 
710
+// Free Software Foundation; either version 3, or (at your option)
 
711
+// any later version.
 
712
+
 
713
+// This library is distributed in the hope that it will be useful,
 
714
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
715
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
716
+// GNU General Public License for more details.
 
717
+
 
718
+// You should have received a copy of the GNU General Public License along
 
719
+// with this library; see the file COPYING3.  If not see
 
720
+// <http://www.gnu.org/licenses/>.
 
721
+
 
722
+// libstdc++/60966
 
723
+// This test hangs if std::promise::~promise() destroys the
 
724
+// shared state before std::promise::set_value() finishes using it.
 
725
+
 
726
+#include <future>
 
727
+#include <thread>
 
728
+#include <vector>
 
729
+
 
730
+const int THREADS = 10;
 
731
+
 
732
+void run_task(std::promise<void>* pr)
 
733
+{
 
734
+  std::this_thread::sleep_for(std::chrono::milliseconds(100));
 
735
+  pr->set_value();
 
736
+}
 
737
+
 
738
+int main()
 
739
+{
 
740
+  std::vector<std::promise<void>*> tasks(THREADS);
 
741
+  std::vector<std::thread> threads(THREADS);
 
742
+  std::vector<std::future<void>> futures(THREADS);
 
743
+
 
744
+  for (int i = 0; i < THREADS; ++i)
 
745
+  {
 
746
+    std::promise<void>* task = new std::promise<void>;
 
747
+    tasks[i] = task;
 
748
+    futures[i] = task->get_future();
 
749
+    threads[i] = std::thread(run_task, task);
 
750
+  }
 
751
+
 
752
+  for (int i = 0; i < THREADS; ++i)
 
753
+  {
 
754
+    // the temporary future releases the state as soon as wait() returns
 
755
+    std::future<void>(std::move(futures[i])).wait();
 
756
+    // state is ready, should now be safe to delete promise, so it
 
757
+    // releases the shared state too
 
758
+    delete tasks[i];
 
759
+  }
 
760
+
 
761
+  for (auto& t : threads)
 
762
+    t.join();
 
763
+}
 
764
Index: libstdc++-v3/testsuite/ext/rope/61946.cc
 
765
===================================================================
 
766
--- a/src/libstdc++-v3/testsuite/ext/rope/61946.cc      (.../tags/gcc_4_8_3_release)
 
767
+++ b/src/libstdc++-v3/testsuite/ext/rope/61946.cc      (.../branches/gcc-4_8-branch)
 
768
@@ -0,0 +1,31 @@
 
769
+// Copyright (C) 2014 Free Software Foundation, Inc.
 
770
+//
 
771
+// This file is part of the GNU ISO C++ Library.  This library is free
 
772
+// software; you can redistribute it and/or modify it under the
 
773
+// terms of the GNU General Public License as published by the
 
774
+// Free Software Foundation; either version 3, or (at your option)
 
775
+// any later version.
 
776
+
 
777
+// This library is distributed in the hope that it will be useful,
 
778
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
779
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
780
+// GNU General Public License for more details.
 
781
+
 
782
+// You should have received a copy of the GNU General Public License along
 
783
+// with this library; see the file COPYING3.  If not see
 
784
+// <http://www.gnu.org/licenses/>.
 
785
+
 
786
+// { dg-do compile }
 
787
+
 
788
+#include <ext/rope>
 
789
+
 
790
+struct empty_char_prod : __gnu_cxx::char_producer<char>
 
791
+{
 
792
+  virtual void operator()(size_t, size_t, char*) {}
 
793
+};
 
794
+
 
795
+int main ()
 
796
+{
 
797
+  empty_char_prod* ecp = new empty_char_prod;
 
798
+  __gnu_cxx::crope excrope( ecp, 10L, true );
 
799
+}
 
800
Index: libstdc++-v3/testsuite/lib/gdb-test.exp
 
801
===================================================================
 
802
--- a/src/libstdc++-v3/testsuite/lib/gdb-test.exp       (.../tags/gcc_4_8_3_release)
 
803
+++ b/src/libstdc++-v3/testsuite/lib/gdb-test.exp       (.../branches/gcc-4_8-branch)
 
804
@@ -91,7 +91,7 @@
 
805
        }
 
806
     }
 
807
 
 
808
-    set do_whatis_tests [gdb_batch_check "python print gdb.type_printers" \
 
809
+    set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \
 
810
                           "\\\[\\\]"]
 
811
     if {!$do_whatis_tests} {
 
812
        send_log "skipping 'whatis' tests - gdb too old"
 
813
@@ -252,6 +252,6 @@
 
814
 # but not earlier versions.
 
815
 # Return 1 if the version is ok, 0 otherwise.
 
816
 proc gdb_version_check {} {
 
817
-    return [gdb_batch_check "python print gdb.lookup_global_symbol" \
 
818
+    return [gdb_batch_check "python print(gdb.lookup_global_symbol)" \
 
819
              "<built-in function lookup_global_symbol>"]
 
820
 }
 
821
Index: libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt
 
822
===================================================================
 
823
--- a/src/libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt      (.../tags/gcc_4_8_3_release)
 
824
+++ b/src/libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt      (.../branches/gcc-4_8-branch)
 
825
@@ -400,6 +400,7 @@
 
826
 FUNC:_ZNKSt15basic_streambufIwSt11char_traitsIwEE6getlocEv@@GLIBCXX_3.4
 
827
 FUNC:_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
 
828
 FUNC:_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
 
829
+FUNC:_ZNKSt17bad_function_call4whatEv@@GLIBCXX_3.4.18
 
830
 FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
 
831
 FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE5rdbufEv@@GLIBCXX_3.4
 
832
 FUNC:_ZNKSt18basic_stringstreamIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
 
833
@@ -587,6 +588,8 @@
 
834
 FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewm@@GLIBCXX_3.4
 
835
 FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewx@@GLIBCXX_3.4
 
836
 FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewy@@GLIBCXX_3.4
 
837
+FUNC:_ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEj@@GLIBCXX_3.4.18
 
838
+FUNC:_ZNKSt8__detail20_Prime_rehash_policy14_M_need_rehashEjjj@@GLIBCXX_3.4.18
 
839
 FUNC:_ZNKSt8bad_cast4whatEv@@GLIBCXX_3.4.9
 
840
 FUNC:_ZNKSt8ios_base7failure4whatEv@@GLIBCXX_3.4
 
841
 FUNC:_ZNKSt8messagesIcE18_M_convert_to_charERKSs@@GLIBCXX_3.4
 
842
@@ -1204,6 +1207,7 @@
 
843
 FUNC:_ZNSt11regex_errorD0Ev@@GLIBCXX_3.4.15
 
844
 FUNC:_ZNSt11regex_errorD1Ev@@GLIBCXX_3.4.15
 
845
 FUNC:_ZNSt11regex_errorD2Ev@@GLIBCXX_3.4.15
 
846
+FUNC:_ZNSt11this_thread11__sleep_forENSt6chrono8durationIxSt5ratioILx1ELx1EEEENS1_IxS2_ILx1ELx1000000000EEEE@@GLIBCXX_3.4.18
 
847
 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCXX_3.4
 
848
 FUNC:_ZNSt12__basic_fileIcE4fileEv@@GLIBCXX_3.4.1
 
849
 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCXX_3.4
 
850
@@ -1471,6 +1475,11 @@
 
851
 FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEt@@GLIBCXX_3.4
 
852
 FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEx@@GLIBCXX_3.4
 
853
 FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEy@@GLIBCXX_3.4
 
854
+FUNC:_ZNSt13random_device14_M_init_pretr1ERKSs@@GLIBCXX_3.4.18
 
855
+FUNC:_ZNSt13random_device16_M_getval_pretr1Ev@@GLIBCXX_3.4.18
 
856
+FUNC:_ZNSt13random_device7_M_finiEv@@GLIBCXX_3.4.18
 
857
+FUNC:_ZNSt13random_device7_M_initERKSs@@GLIBCXX_3.4.18
 
858
+FUNC:_ZNSt13random_device9_M_getvalEv@@GLIBCXX_3.4.18
 
859
 FUNC:_ZNSt13runtime_errorC1ERKSs@@GLIBCXX_3.4
 
860
 FUNC:_ZNSt13runtime_errorC2ERKSs@@GLIBCXX_3.4
 
861
 FUNC:_ZNSt13runtime_errorD0Ev@@GLIBCXX_3.4
 
862
@@ -1900,6 +1909,8 @@
 
863
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 
864
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 
865
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
 
866
+FUNC:_ZNSt6chrono3_V212steady_clock3nowEv@@GLIBCXX_3.4.19
 
867
+FUNC:_ZNSt6chrono3_V212system_clock3nowEv@@GLIBCXX_3.4.19
 
868
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 
869
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 
870
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
 
871
@@ -2436,6 +2447,7 @@
 
872
 FUNC:__cxa_guard_release@@CXXABI_1.3
 
873
 FUNC:__cxa_pure_virtual@@CXXABI_1.3
 
874
 FUNC:__cxa_rethrow@@CXXABI_1.3
 
875
+FUNC:__cxa_thread_atexit@@CXXABI_1.3.7
 
876
 FUNC:__cxa_throw@@CXXABI_1.3
 
877
 FUNC:__cxa_tm_cleanup@@CXXABI_TM_1
 
878
 FUNC:__cxa_vec_cctor@@CXXABI_1.3
 
879
@@ -2482,6 +2494,7 @@
 
880
 OBJECT:0:CXXABI_1.3.4
 
881
 OBJECT:0:CXXABI_1.3.5
 
882
 OBJECT:0:CXXABI_1.3.6
 
883
+OBJECT:0:CXXABI_1.3.7
 
884
 OBJECT:0:CXXABI_TM_1
 
885
 OBJECT:0:GLIBCXX_3.4
 
886
 OBJECT:0:GLIBCXX_3.4.1
 
887
@@ -2493,6 +2506,8 @@
 
888
 OBJECT:0:GLIBCXX_3.4.15
 
889
 OBJECT:0:GLIBCXX_3.4.16
 
890
 OBJECT:0:GLIBCXX_3.4.17
 
891
+OBJECT:0:GLIBCXX_3.4.18
 
892
+OBJECT:0:GLIBCXX_3.4.19
 
893
 OBJECT:0:GLIBCXX_3.4.2
 
894
 OBJECT:0:GLIBCXX_3.4.3
 
895
 OBJECT:0:GLIBCXX_3.4.4
 
896
@@ -2992,6 +3007,8 @@
 
897
 OBJECT:1:_ZNSt21__numeric_limits_base9is_moduloE@@GLIBCXX_3.4
 
898
 OBJECT:1:_ZNSt21__numeric_limits_base9is_signedE@@GLIBCXX_3.4
 
899
 OBJECT:1:_ZNSt6chrono12system_clock12is_monotonicE@@GLIBCXX_3.4.11
 
900
+OBJECT:1:_ZNSt6chrono3_V212steady_clock9is_steadyE@@GLIBCXX_3.4.19
 
901
+OBJECT:1:_ZNSt6chrono3_V212system_clock9is_steadyE@@GLIBCXX_3.4.19
 
902
 OBJECT:1:_ZSt10adopt_lock@@GLIBCXX_3.4.11
 
903
 OBJECT:1:_ZSt10defer_lock@@GLIBCXX_3.4.11
 
904
 OBJECT:1:_ZSt11try_to_lock@@GLIBCXX_3.4.11
 
905
Index: configure.ac
 
906
===================================================================
 
907
--- a/src/configure.ac  (.../tags/gcc_4_8_3_release)
 
908
+++ b/src/configure.ac  (.../branches/gcc-4_8-branch)
 
909
@@ -1154,6 +1154,9 @@
 
910
   *-mingw*)
 
911
     host_makefile_frag="config/mh-mingw"
 
912
     ;;
 
913
+  alpha*-*-linux*)
 
914
+    host_makefile_frag="config/mh-alpha-linux"
 
915
+    ;;
 
916
   hppa*-hp-hpux10*)
 
917
     host_makefile_frag="config/mh-pa-hpux10"
 
918
     ;;
 
919
Index: ChangeLog
 
920
===================================================================
 
921
--- a/src/ChangeLog     (.../tags/gcc_4_8_3_release)
 
922
+++ b/src/ChangeLog     (.../branches/gcc-4_8-branch)
 
923
@@ -1,3 +1,9 @@
 
924
+2014-07-26  Uros Bizjak  <ubizjak@gmail.com>
 
925
+
 
926
+       PR target/47230
 
927
+       * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
 
928
+       * configure: Regenerate.
 
929
+
 
930
 2014-05-22  Release Manager
 
931
 
 
932
        * GCC 4.8.3 released.
 
933
Index: contrib/ChangeLog
 
934
===================================================================
 
935
--- a/src/contrib/ChangeLog     (.../tags/gcc_4_8_3_release)
 
936
+++ b/src/contrib/ChangeLog     (.../branches/gcc-4_8-branch)
 
937
@@ -1,3 +1,7 @@
 
938
+2014-07-07  Richard Biener  <rguenther@suse.de>
 
939
+
 
940
+        * gennews: Use gcc-3.0/index.html.
 
941
+
 
942
 2014-05-22  Release Manager
 
943
 
 
944
        * GCC 4.8.3 released.
 
945
Index: contrib/gennews
 
946
===================================================================
 
947
--- a/src/contrib/gennews       (.../tags/gcc_4_8_3_release)
 
948
+++ b/src/contrib/gennews       (.../branches/gcc-4_8-branch)
 
949
@@ -37,7 +37,7 @@
 
950
     gcc-3.3/index.html gcc-3.3/changes.html
 
951
     gcc-3.2/index.html gcc-3.2/changes.html
 
952
     gcc-3.1/index.html gcc-3.1/changes.html
 
953
-    gcc-3.0/gcc-3.0.html gcc-3.0/features.html gcc-3.0/caveats.html
 
954
+    gcc-3.0/index.html gcc-3.0/features.html gcc-3.0/caveats.html
 
955
     gcc-2.95/index.html gcc-2.95/features.html gcc-2.95/caveats.html
 
956
     egcs-1.1/index.html egcs-1.1/features.html egcs-1.1/caveats.html
 
957
     egcs-1.0/index.html egcs-1.0/features.html egcs-1.0/caveats.html"
 
958
Index: config/mh-alpha-linux
 
959
===================================================================
 
960
--- a/src/config/mh-alpha-linux (.../tags/gcc_4_8_3_release)
 
961
+++ b/src/config/mh-alpha-linux (.../branches/gcc-4_8-branch)
 
962
@@ -0,0 +1,3 @@
 
963
+# Prevent GPREL16 relocation truncation
 
964
+LDFLAGS += -Wl,--no-relax
 
965
+BOOT_LDFLAGS += -Wl,--no-relax
 
966
Index: config/ChangeLog
 
967
===================================================================
 
968
--- a/src/config/ChangeLog      (.../tags/gcc_4_8_3_release)
 
969
+++ b/src/config/ChangeLog      (.../branches/gcc-4_8-branch)
 
970
@@ -1,3 +1,8 @@
 
971
+2014-07-26  Uros Bizjak  <ubizjak@gmail.com>
 
972
+
 
973
+       PR target/47230
 
974
+       * mh-alpha-linux: New file.
 
975
+
 
976
 2014-05-22  Release Manager
 
977
 
 
978
        * GCC 4.8.3 released.
 
979
Index: libjava/classpath
 
980
===================================================================
 
981
--- a/src/libjava/classpath     (.../tags/gcc_4_8_3_release)
 
982
+++ b/src/libjava/classpath     (.../branches/gcc-4_8-branch)
 
983
 
 
984
Property changes on: libjava/classpath
 
985
___________________________________________________________________
 
986
Modified: svn:mergeinfo
 
987
   Merged /trunk/libjava/classpath:r211733,215049
 
988
Index: configure
 
989
===================================================================
 
990
--- a/src/configure     (.../tags/gcc_4_8_3_release)
 
991
+++ b/src/configure     (.../branches/gcc-4_8-branch)
 
992
@@ -3834,6 +3834,9 @@
 
993
   *-mingw*)
 
994
     host_makefile_frag="config/mh-mingw"
 
995
     ;;
 
996
+  alpha*-*-linux*)
 
997
+    host_makefile_frag="config/mh-alpha-linux"
 
998
+    ;;
 
999
   hppa*-hp-hpux10*)
 
1000
     host_makefile_frag="config/mh-pa-hpux10"
 
1001
     ;;
 
1002
Index: libgcc/ChangeLog
 
1003
===================================================================
 
1004
--- a/src/libgcc/ChangeLog      (.../tags/gcc_4_8_3_release)
 
1005
+++ b/src/libgcc/ChangeLog      (.../branches/gcc-4_8-branch)
 
1006
@@ -1,3 +1,8 @@
 
1007
+2014-09-18  Joseph Myers  <joseph@codesourcery.com>
 
1008
+
 
1009
+       * config/i386/sfp-machine.h (FP_TRAPPING_EXCEPTIONS): Treat clear
 
1010
+       bits not set bits as indicating trapping exceptions.
 
1011
+
 
1012
 2014-05-22  Release Manager
 
1013
 
 
1014
        * GCC 4.8.3 released.
 
1015
Index: libgcc/config/i386/sfp-machine.h
 
1016
===================================================================
 
1017
--- a/src/libgcc/config/i386/sfp-machine.h      (.../tags/gcc_4_8_3_release)
 
1018
+++ b/src/libgcc/config/i386/sfp-machine.h      (.../branches/gcc-4_8-branch)
 
1019
@@ -59,7 +59,7 @@
 
1020
       __sfp_handle_exceptions (_fex);          \
 
1021
   } while (0);
 
1022
 
 
1023
-#define FP_TRAPPING_EXCEPTIONS ((_fcw >> FP_EX_SHIFT) & FP_EX_ALL)
 
1024
+#define FP_TRAPPING_EXCEPTIONS ((~_fcw >> FP_EX_SHIFT) & FP_EX_ALL)
 
1025
 
 
1026
 #define FP_ROUNDMODE           (_fcw & FP_RND_MASK)
 
1027
 #endif
 
1028
Index: gcc/tree-ssa-tail-merge.c
 
1029
===================================================================
 
1030
--- a/src/gcc/tree-ssa-tail-merge.c     (.../tags/gcc_4_8_3_release)
 
1031
+++ b/src/gcc/tree-ssa-tail-merge.c     (.../branches/gcc-4_8-branch)
 
1032
@@ -1060,6 +1060,24 @@
 
1033
     gcc_unreachable ();
 
1034
 }
 
1035
 
 
1036
+/* Return true if gimple operands T1 and T2 have the same value.  */
 
1037
+
 
1038
+static bool
 
1039
+gimple_operand_equal_value_p (tree t1, tree t2)
 
1040
+{
 
1041
+  if (t1 == t2)
 
1042
+    return true;
 
1043
+
 
1044
+  if (t1 == NULL_TREE
 
1045
+      || t2 == NULL_TREE)
 
1046
+    return false;
 
1047
+
 
1048
+  if (operand_equal_p (t1, t2, 0))
 
1049
+    return true;
 
1050
+
 
1051
+  return gvn_uses_equal (t1, t2);
 
1052
+}
 
1053
+
 
1054
 /* Return true if gimple statements S1 and S2 are equal.  Gimple_bb (s1) and
 
1055
    gimple_bb (s2) are members of SAME_SUCC.  */
 
1056
 
 
1057
@@ -1122,8 +1140,9 @@
 
1058
       lhs2 = gimple_get_lhs (s2);
 
1059
       if (TREE_CODE (lhs1) != SSA_NAME
 
1060
          && TREE_CODE (lhs2) != SSA_NAME)
 
1061
-       return (vn_valueize (gimple_vdef (s1))
 
1062
-               == vn_valueize (gimple_vdef (s2)));
 
1063
+       return (operand_equal_p (lhs1, lhs2, 0)
 
1064
+               && gimple_operand_equal_value_p (gimple_assign_rhs1 (s1),
 
1065
+                                                gimple_assign_rhs1 (s2)));
 
1066
       else if (TREE_CODE (lhs1) == SSA_NAME
 
1067
               && TREE_CODE (lhs2) == SSA_NAME)
 
1068
        return vn_valueize (lhs1) == vn_valueize (lhs2);
 
1069
Index: gcc/DATESTAMP
 
1070
===================================================================
 
1071
--- a/src/gcc/DATESTAMP (.../tags/gcc_4_8_3_release)
 
1072
+++ b/src/gcc/DATESTAMP (.../branches/gcc-4_8-branch)
 
1073
@@ -1 +1 @@
 
1074
-20140522
 
1075
+20140930
 
1076
Index: gcc/ipa-cp.c
 
1077
===================================================================
 
1078
--- a/src/gcc/ipa-cp.c  (.../tags/gcc_4_8_3_release)
 
1079
+++ b/src/gcc/ipa-cp.c  (.../branches/gcc-4_8-branch)
 
1080
@@ -447,6 +447,8 @@
 
1081
   else if (!opt_for_fn (node->symbol.decl, optimize)
 
1082
           || !opt_for_fn (node->symbol.decl, flag_ipa_cp))
 
1083
     reason = "non-optimized function";
 
1084
+  else if (node->tm_clone)
 
1085
+    reason = "transactional memory clone";
 
1086
 
 
1087
   if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
 
1088
     fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
 
1089
@@ -2902,6 +2904,11 @@
 
1090
                intersect_with_agg_replacements (cs->caller, src_idx,
 
1091
                                                 &inter, 0);
 
1092
            }
 
1093
+         else
 
1094
+           {
 
1095
+             inter.release ();
 
1096
+             return vNULL;
 
1097
+           }
 
1098
        }
 
1099
       else
 
1100
        {
 
1101
@@ -2917,6 +2924,11 @@
 
1102
              else
 
1103
                intersect_with_plats (src_plats, &inter, 0);
 
1104
            }
 
1105
+         else
 
1106
+           {
 
1107
+             inter.release ();
 
1108
+             return vNULL;
 
1109
+           }
 
1110
        }
 
1111
     }
 
1112
   else if (jfunc->type == IPA_JF_ANCESTOR
 
1113
@@ -3000,7 +3012,8 @@
 
1114
                                          vec<cgraph_edge_p> callers)
 
1115
 {
 
1116
   struct ipa_node_params *dest_info = IPA_NODE_REF (node);
 
1117
-  struct ipa_agg_replacement_value *res = NULL;
 
1118
+  struct ipa_agg_replacement_value *res;
 
1119
+  struct ipa_agg_replacement_value **tail = &res;
 
1120
   struct cgraph_edge *cs;
 
1121
   int i, j, count = ipa_get_param_count (dest_info);
 
1122
 
 
1123
@@ -3044,8 +3057,8 @@
 
1124
          v->offset = item->offset;
 
1125
          v->value = item->value;
 
1126
          v->by_ref = plats->aggs_by_ref;
 
1127
-         v->next = res;
 
1128
-         res = v;
 
1129
+         *tail = v;
 
1130
+         tail = &v->next;
 
1131
        }
 
1132
 
 
1133
     next_param:
 
1134
@@ -3052,6 +3065,7 @@
 
1135
       if (inter.exists ())
 
1136
        inter.release ();
 
1137
     }
 
1138
+  *tail = NULL;
 
1139
   return res;
 
1140
 }
 
1141
 
 
1142
@@ -3060,7 +3074,8 @@
 
1143
 static struct ipa_agg_replacement_value *
 
1144
 known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function_t> known_aggs)
 
1145
 {
 
1146
-  struct ipa_agg_replacement_value *res = NULL;
 
1147
+  struct ipa_agg_replacement_value *res;
 
1148
+  struct ipa_agg_replacement_value **tail = &res;
 
1149
   struct ipa_agg_jump_function *aggjf;
 
1150
   struct ipa_agg_jf_item *item;
 
1151
   int i, j;
 
1152
@@ -3074,9 +3089,10 @@
 
1153
        v->offset = item->offset;
 
1154
        v->value = item->value;
 
1155
        v->by_ref = aggjf->by_ref;
 
1156
-       v->next = res;
 
1157
-       res = v;
 
1158
+       *tail = v;
 
1159
+       tail = &v->next;
 
1160
       }
 
1161
+  *tail = NULL;
 
1162
   return res;
 
1163
 }
 
1164
 
 
1165
Index: gcc/fold-const.c
 
1166
===================================================================
 
1167
--- a/src/gcc/fold-const.c      (.../tags/gcc_4_8_3_release)
 
1168
+++ b/src/gcc/fold-const.c      (.../branches/gcc-4_8-branch)
 
1169
@@ -9213,7 +9213,7 @@
 
1170
   /* Transform comparisons of the form X +- C1 CMP Y +- C2 to
 
1171
      X CMP Y +- C2 +- C1 for signed X, Y.  This is valid if
 
1172
      the resulting offset is smaller in absolute value than the
 
1173
-     original one.  */
 
1174
+     original one and has the same sign.  */
 
1175
   if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0))
 
1176
       && (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR)
 
1177
       && (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
 
1178
@@ -9232,19 +9232,20 @@
 
1179
                                      "a comparison");
 
1180
 
 
1181
       /* Put the constant on the side where it doesn't overflow and is
 
1182
-        of lower absolute value than before.  */
 
1183
+        of lower absolute value and of same sign than before.  */
 
1184
       cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
 
1185
                             ? MINUS_EXPR : PLUS_EXPR,
 
1186
                             const2, const1);
 
1187
       if (!TREE_OVERFLOW (cst)
 
1188
-         && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2))
 
1189
+         && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2)
 
1190
+         && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const2))
 
1191
        {
 
1192
          fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
 
1193
          return fold_build2_loc (loc, code, type,
 
1194
-                             variable1,
 
1195
-                             fold_build2_loc (loc,
 
1196
-                                          TREE_CODE (arg1), TREE_TYPE (arg1),
 
1197
-                                          variable2, cst));
 
1198
+                                 variable1,
 
1199
+                                 fold_build2_loc (loc, TREE_CODE (arg1),
 
1200
+                                                  TREE_TYPE (arg1),
 
1201
+                                                  variable2, cst));
 
1202
        }
 
1203
 
 
1204
       cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
 
1205
@@ -9251,13 +9252,15 @@
 
1206
                             ? MINUS_EXPR : PLUS_EXPR,
 
1207
                             const1, const2);
 
1208
       if (!TREE_OVERFLOW (cst)
 
1209
-         && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1))
 
1210
+         && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1)
 
1211
+         && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const1))
 
1212
        {
 
1213
          fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
 
1214
          return fold_build2_loc (loc, code, type,
 
1215
-                             fold_build2_loc (loc, TREE_CODE (arg0), TREE_TYPE (arg0),
 
1216
-                                          variable1, cst),
 
1217
-                             variable2);
 
1218
+                                 fold_build2_loc (loc, TREE_CODE (arg0),
 
1219
+                                                  TREE_TYPE (arg0),
 
1220
+                                                  variable1, cst),
 
1221
+                                 variable2);
 
1222
        }
 
1223
     }
 
1224
 
 
1225
@@ -11218,7 +11221,6 @@
 
1226
        {
 
1227
          double_int c1, c2, c3, msk;
 
1228
          int width = TYPE_PRECISION (type), w;
 
1229
-         bool try_simplify = true;
 
1230
 
 
1231
          c1 = tree_to_double_int (TREE_OPERAND (arg0, 1));
 
1232
          c2 = tree_to_double_int (arg1);
 
1233
@@ -11255,20 +11257,7 @@
 
1234
                }
 
1235
            }
 
1236
 
 
1237
-         /* If X is a tree of the form (Y * K1) & K2, this might conflict
 
1238
-            with that optimization from the BIT_AND_EXPR optimizations.
 
1239
-            This could end up in an infinite recursion.  */
 
1240
-         if (TREE_CODE (TREE_OPERAND (arg0, 0)) == MULT_EXPR
 
1241
-             && TREE_CODE (TREE_OPERAND (TREE_OPERAND (arg0, 0), 1))
 
1242
-                           == INTEGER_CST)
 
1243
-         {
 
1244
-           tree t = TREE_OPERAND (TREE_OPERAND (arg0, 0), 1);
 
1245
-           double_int masked = mask_with_tz (type, c3, tree_to_double_int (t));
 
1246
-
 
1247
-           try_simplify = (masked != c1);
 
1248
-         }
 
1249
-
 
1250
-         if (try_simplify && c3 != c1)
 
1251
+         if (c3 != c1)
 
1252
            return fold_build2_loc (loc, BIT_IOR_EXPR, type,
 
1253
                                    fold_build2_loc (loc, BIT_AND_EXPR, type,
 
1254
                                                     TREE_OPERAND (arg0, 0),
 
1255
@@ -11658,16 +11647,25 @@
 
1256
          && TREE_CODE (arg0) == MULT_EXPR
 
1257
          && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
 
1258
        {
 
1259
+         double_int darg1 = tree_to_double_int (arg1);
 
1260
          double_int masked
 
1261
-           = mask_with_tz (type, tree_to_double_int (arg1),
 
1262
+           = mask_with_tz (type, darg1,
 
1263
                            tree_to_double_int (TREE_OPERAND (arg0, 1)));
 
1264
 
 
1265
          if (masked.is_zero ())
 
1266
            return omit_two_operands_loc (loc, type, build_zero_cst (type),
 
1267
                                          arg0, arg1);
 
1268
-         else if (masked != tree_to_double_int (arg1))
 
1269
-           return fold_build2_loc (loc, code, type, op0,
 
1270
-                                   double_int_to_tree (type, masked));
 
1271
+         else if (masked != darg1)
 
1272
+           {
 
1273
+             /* Avoid the transform if arg1 is a mask of some
 
1274
+                mode which allows further optimizations.  */
 
1275
+             int pop = darg1.popcount ();
 
1276
+             if (!(pop >= BITS_PER_UNIT
 
1277
+                   && exact_log2 (pop) != -1
 
1278
+                   && double_int::mask (pop) == darg1))
 
1279
+               return fold_build2_loc (loc, code, type, op0,
 
1280
+                                       double_int_to_tree (type, masked));
 
1281
+           }
 
1282
        }
 
1283
 
 
1284
       /* For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,
 
1285
Index: gcc/omp-low.c
 
1286
===================================================================
 
1287
--- a/src/gcc/omp-low.c (.../tags/gcc_4_8_3_release)
 
1288
+++ b/src/gcc/omp-low.c (.../branches/gcc-4_8-branch)
 
1289
@@ -1586,7 +1586,6 @@
 
1290
   TREE_STATIC (decl) = 1;
 
1291
   TREE_USED (decl) = 1;
 
1292
   DECL_ARTIFICIAL (decl) = 1;
 
1293
-  DECL_NAMELESS (decl) = 1;
 
1294
   DECL_IGNORED_P (decl) = 0;
 
1295
   TREE_PUBLIC (decl) = 0;
 
1296
   DECL_UNINLINABLE (decl) = 1;
 
1297
Index: gcc/toplev.c
 
1298
===================================================================
 
1299
--- a/src/gcc/toplev.c  (.../tags/gcc_4_8_3_release)
 
1300
+++ b/src/gcc/toplev.c  (.../branches/gcc-4_8-branch)
 
1301
@@ -1036,16 +1036,19 @@
 
1302
 
 
1303
   if (warn_stack_usage >= 0)
 
1304
     {
 
1305
+      const location_t loc = DECL_SOURCE_LOCATION (current_function_decl);
 
1306
+
 
1307
       if (stack_usage_kind == DYNAMIC)
 
1308
-       warning (OPT_Wstack_usage_, "stack usage might be unbounded");
 
1309
+       warning_at (loc, OPT_Wstack_usage_, "stack usage might be unbounded");
 
1310
       else if (stack_usage > warn_stack_usage)
 
1311
        {
 
1312
          if (stack_usage_kind == DYNAMIC_BOUNDED)
 
1313
-           warning (OPT_Wstack_usage_, "stack usage might be %wd bytes",
 
1314
-                    stack_usage);
 
1315
+           warning_at (loc,
 
1316
+                       OPT_Wstack_usage_, "stack usage might be %wd bytes",
 
1317
+                       stack_usage);
 
1318
          else
 
1319
-           warning (OPT_Wstack_usage_, "stack usage is %wd bytes",
 
1320
-                    stack_usage);
 
1321
+           warning_at (loc, OPT_Wstack_usage_, "stack usage is %wd bytes",
 
1322
+                       stack_usage);
 
1323
        }
 
1324
     }
 
1325
 }
 
1326
Index: gcc/tree-ssa-sccvn.c
 
1327
===================================================================
 
1328
--- a/src/gcc/tree-ssa-sccvn.c  (.../tags/gcc_4_8_3_release)
 
1329
+++ b/src/gcc/tree-ssa-sccvn.c  (.../branches/gcc-4_8-branch)
 
1330
@@ -3015,33 +3015,12 @@
 
1331
   /* If all value numbered to the same value, the phi node has that
 
1332
      value.  */
 
1333
   if (allsame)
 
1334
-    {
 
1335
-      if (is_gimple_min_invariant (sameval))
 
1336
-       {
 
1337
-         VN_INFO (PHI_RESULT (phi))->has_constants = true;
 
1338
-         VN_INFO (PHI_RESULT (phi))->expr = sameval;
 
1339
-       }
 
1340
-      else
 
1341
-       {
 
1342
-         VN_INFO (PHI_RESULT (phi))->has_constants = false;
 
1343
-         VN_INFO (PHI_RESULT (phi))->expr = sameval;
 
1344
-       }
 
1345
+    return set_ssa_val_to (PHI_RESULT (phi), sameval);
 
1346
 
 
1347
-      if (TREE_CODE (sameval) == SSA_NAME)
 
1348
-       return visit_copy (PHI_RESULT (phi), sameval);
 
1349
-
 
1350
-      return set_ssa_val_to (PHI_RESULT (phi), sameval);
 
1351
-    }
 
1352
-
 
1353
   /* Otherwise, see if it is equivalent to a phi node in this block.  */
 
1354
   result = vn_phi_lookup (phi);
 
1355
   if (result)
 
1356
-    {
 
1357
-      if (TREE_CODE (result) == SSA_NAME)
 
1358
-       changed = visit_copy (PHI_RESULT (phi), result);
 
1359
-      else
 
1360
-       changed = set_ssa_val_to (PHI_RESULT (phi), result);
 
1361
-    }
 
1362
+    changed = set_ssa_val_to (PHI_RESULT (phi), result);
 
1363
   else
 
1364
     {
 
1365
       vn_phi_insert (phi, PHI_RESULT (phi));
 
1366
@@ -3142,24 +3121,18 @@
 
1367
      catch those with constants.  The goal here is to simultaneously
 
1368
      combine constants between expressions, but avoid infinite
 
1369
      expansion of expressions during simplification.  */
 
1370
-  if (TREE_CODE (op0) == SSA_NAME)
 
1371
-    {
 
1372
-      if (VN_INFO (op0)->has_constants
 
1373
+  op0 = vn_valueize (op0);
 
1374
+  if (TREE_CODE (op0) == SSA_NAME
 
1375
+      && (VN_INFO (op0)->has_constants
 
1376
          || TREE_CODE_CLASS (code) == tcc_comparison
 
1377
-         || code == COMPLEX_EXPR)
 
1378
-       op0 = valueize_expr (vn_get_expr_for (op0));
 
1379
-      else
 
1380
-       op0 = vn_valueize (op0);
 
1381
-    }
 
1382
+         || code == COMPLEX_EXPR))
 
1383
+    op0 = valueize_expr (vn_get_expr_for (op0));
 
1384
 
 
1385
-  if (TREE_CODE (op1) == SSA_NAME)
 
1386
-    {
 
1387
-      if (VN_INFO (op1)->has_constants
 
1388
-         || code == COMPLEX_EXPR)
 
1389
-       op1 = valueize_expr (vn_get_expr_for (op1));
 
1390
-      else
 
1391
-       op1 = vn_valueize (op1);
 
1392
-    }
 
1393
+  op1 = vn_valueize (op1);
 
1394
+  if (TREE_CODE (op1) == SSA_NAME
 
1395
+      && (VN_INFO (op1)->has_constants
 
1396
+         || code == COMPLEX_EXPR))
 
1397
+    op1 = valueize_expr (vn_get_expr_for (op1));
 
1398
 
 
1399
   /* Pointer plus constant can be represented as invariant address.
 
1400
      Do so to allow further propatation, see also tree forwprop.  */
 
1401
@@ -3217,27 +3190,31 @@
 
1402
     return NULL_TREE;
 
1403
 
 
1404
   orig_op0 = op0;
 
1405
-  if (VN_INFO (op0)->has_constants)
 
1406
-    op0 = valueize_expr (vn_get_expr_for (op0));
 
1407
-  else if (CONVERT_EXPR_CODE_P (code)
 
1408
-          || code == REALPART_EXPR
 
1409
-          || code == IMAGPART_EXPR
 
1410
-          || code == VIEW_CONVERT_EXPR
 
1411
-          || code == BIT_FIELD_REF)
 
1412
+  op0 = vn_valueize (op0);
 
1413
+  if (TREE_CODE (op0) == SSA_NAME)
 
1414
     {
 
1415
-      /* We want to do tree-combining on conversion-like expressions.
 
1416
-         Make sure we feed only SSA_NAMEs or constants to fold though.  */
 
1417
-      tree tem = valueize_expr (vn_get_expr_for (op0));
 
1418
-      if (UNARY_CLASS_P (tem)
 
1419
-         || BINARY_CLASS_P (tem)
 
1420
-         || TREE_CODE (tem) == VIEW_CONVERT_EXPR
 
1421
-         || TREE_CODE (tem) == SSA_NAME
 
1422
-         || TREE_CODE (tem) == CONSTRUCTOR
 
1423
-         || is_gimple_min_invariant (tem))
 
1424
-       op0 = tem;
 
1425
+      if (VN_INFO (op0)->has_constants)
 
1426
+       op0 = valueize_expr (vn_get_expr_for (op0));
 
1427
+      else if (CONVERT_EXPR_CODE_P (code)
 
1428
+              || code == REALPART_EXPR
 
1429
+              || code == IMAGPART_EXPR
 
1430
+              || code == VIEW_CONVERT_EXPR
 
1431
+              || code == BIT_FIELD_REF)
 
1432
+       {
 
1433
+         /* We want to do tree-combining on conversion-like expressions.
 
1434
+            Make sure we feed only SSA_NAMEs or constants to fold though.  */
 
1435
+         tree tem = valueize_expr (vn_get_expr_for (op0));
 
1436
+         if (UNARY_CLASS_P (tem)
 
1437
+             || BINARY_CLASS_P (tem)
 
1438
+             || TREE_CODE (tem) == VIEW_CONVERT_EXPR
 
1439
+             || TREE_CODE (tem) == SSA_NAME
 
1440
+             || TREE_CODE (tem) == CONSTRUCTOR
 
1441
+             || is_gimple_min_invariant (tem))
 
1442
+           op0 = tem;
 
1443
+       }
 
1444
     }
 
1445
 
 
1446
-  /* Avoid folding if nothing changed, but remember the expression.  */
 
1447
+  /* Avoid folding if nothing changed.  */
 
1448
   if (op0 == orig_op0)
 
1449
     return NULL_TREE;
 
1450
 
 
1451
Index: gcc/cgraphunit.c
 
1452
===================================================================
 
1453
--- a/src/gcc/cgraphunit.c      (.../tags/gcc_4_8_3_release)
 
1454
+++ b/src/gcc/cgraphunit.c      (.../branches/gcc-4_8-branch)
 
1455
@@ -1097,7 +1097,7 @@
 
1456
          /* We use local aliases for C++ thunks to force the tailcall
 
1457
             to bind locally.  This is a hack - to keep it working do
 
1458
             the following (which is not strictly correct).  */
 
1459
-         && (! TREE_CODE (target_node->symbol.decl) == FUNCTION_DECL
 
1460
+         && (TREE_CODE (target_node->symbol.decl) != FUNCTION_DECL
 
1461
              || ! DECL_VIRTUAL_P (target_node->symbol.decl))
 
1462
          && ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
 
1463
        {
 
1464
Index: gcc/ChangeLog
 
1465
===================================================================
 
1466
--- a/src/gcc/ChangeLog (.../tags/gcc_4_8_3_release)
 
1467
+++ b/src/gcc/ChangeLog (.../branches/gcc-4_8-branch)
 
1468
@@ -1,3 +1,820 @@
 
1469
+2014-09-30  Jakub Jelinek  <jakub@redhat.com>
 
1470
+
 
1471
+       PR inline-asm/63282
 
1472
+       * ifcvt.c (dead_or_predicable): Don't call redirect_jump_1
 
1473
+       or invert_jump_1 if jump isn't any_condjump_p.
 
1474
+
 
1475
+2014-09-29  Charles Baylis  <charles.baylis@linaro.org>
 
1476
+
 
1477
+       Backport from mainline r212303
 
1478
+       PR target/49423
 
1479
+       * config/arm/arm-protos.h (arm_legitimate_address_p,
 
1480
+       arm_is_constant_pool_ref): Add prototypes.
 
1481
+       * config/arm/arm.c (arm_legitimate_address_p): Remove static.
 
1482
+       (arm_is_constant_pool_ref) New function.
 
1483
+       * config/arm/arm.md (unaligned_loadhis, arm_zero_extendhisi2_v6,
 
1484
+       arm_zero_extendqisi2_v6): Use Uh constraint for memory operand.
 
1485
+       (arm_extendhisi2, arm_extendhisi2_v6): Use Uh constraint for memory
 
1486
+       operand and remove pool_range and neg_pool_range attributes.
 
1487
+       (arm_extendqihi_insn, arm_extendqisi, arm_extendqisi_v6): Remove
 
1488
+       pool_range and neg_pool_range attributes.
 
1489
+       * config/arm/constraints.md (Uh): New constraint. (Uq): Don't allow
 
1490
+       constant pool references.
 
1491
+
 
1492
+2014-09-28  John David Anglin  <danglin@gcc.gnu.org>
 
1493
+
 
1494
+       * config/pa/pa.c (pa_output_function_epilogue): Only update
 
1495
+       last_address when a nonnote insn is found.
 
1496
+
 
1497
+2014-09-25  Oleg Endo  <olegendo@gcc.gnu.org>
 
1498
+
 
1499
+       Backport from mainline
 
1500
+       2014-09-25  Nick Clifton  <nickc@redhat.com>
 
1501
+       2014-09-25  Oleg Endo  <olegendo@gcc.gnu.org>
 
1502
+
 
1503
+       PR target/62218
 
1504
+       * config/sh/sync.md (atomic_fetch_nand<mode>_soft_imask,
 
1505
+       atomic_test_and_set_soft_imask): Fix typo in instruction sequence.
 
1506
+
 
1507
+2014-09-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
1508
+
 
1509
+       Backport from mainline r215559
 
1510
+       2014-09-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
1511
+
 
1512
+       PR target/63335
 
1513
+       * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin):
 
1514
+       Exclude VSX_BUILTIN_XVCMPGEDP_P from special handling.
 
1515
+
 
1516
+2014-09-25  Jakub Jelinek  <jakub@redhat.com>
 
1517
+
 
1518
+       PR tree-optimization/63341
 
1519
+       * tree-vectorizer.h (vect_create_data_ref_ptr,
 
1520
+       vect_create_addr_base_for_vector_ref): Add another tree argument
 
1521
+       defaulting to NULL_TREE.
 
1522
+       * tree-vect-data-refs.c (vect_create_data_ref_ptr): Add byte_offset
 
1523
+       argument, pass it down to vect_create_addr_base_for_vector_ref.
 
1524
+       (vect_create_addr_base_for_vector_ref): Add byte_offset argument,
 
1525
+       add that to base_offset too if non-NULL.
 
1526
+       * tree-vect-stmts.c (vectorizable_load): Add byte_offset variable,
 
1527
+       for dr_explicit_realign_optimized set it to vector byte size
 
1528
+       - 1 instead of setting offset, pass byte_offset down to
 
1529
+       vect_create_data_ref_ptr.
 
1530
+
 
1531
+2014-09-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1532
+
 
1533
+       Back port from trunk:
 
1534
+       2014-09-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1535
+
 
1536
+       * config/rs6000/rs6000.md (f32_vsx): New mode attributes to
 
1537
+       refine the constraints used on 32/64-bit floating point moves.
 
1538
+       (f32_av): Likewise.
 
1539
+       (f64_vsx): Likewise.
 
1540
+       (f64_dm): Likewise.
 
1541
+       (f64_av): Likewise.
 
1542
+       (BOOL_REGS_OUTPUT): Use wt constraint for TImode instead of wa.
 
1543
+       (BOOL_REGS_OP1): Likewise.
 
1544
+       (BOOL_REGS_OP2): Likewise.
 
1545
+       (BOOL_REGS_UNARY): Likewise.
 
1546
+       (mov<mode>_hardfloat, SFmode/SDmode): Tighten down constraints for
 
1547
+       32/64-bit floating point moves.  Do not use wa, instead use ww/ws
 
1548
+       for moves involving VSX registers.  Do not use constraints that
 
1549
+       target VSX registers for decimal types.
 
1550
+       (mov<mode>_hardfloat32, DFmode/DDmode): Likewise.
 
1551
+       (mov<mode>_hardfloat64, DFmode/DDmode): Likewise.
 
1552
+
 
1553
+2014-09-19  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1554
+
 
1555
+       Back port from trunk:
 
1556
+       2014-09-19  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1557
+
 
1558
+       * config/rs6000/predicates.md (fusion_gpr_mem_load): Move testing
 
1559
+       for base_reg_operand to be common between LO_SUM and PLUS.
 
1560
+       (fusion_gpr_mem_combo): New predicate to match a fused address
 
1561
+       that combines the addis and memory offset address.
 
1562
+
 
1563
+       * config/rs6000/rs6000-protos.h (fusion_gpr_load_p): Change
 
1564
+       calling signature.
 
1565
+       (emit_fusion_gpr_load): Likewise.
 
1566
+
 
1567
+       * config/rs6000/rs6000.c (fusion_gpr_load_p): Change calling
 
1568
+       signature to pass each argument separately, rather than
 
1569
+       using an operands array.  Rewrite the insns found by peephole2 to
 
1570
+       be a single insn, rather than hoping the insns will still be
 
1571
+       together when the peephole pass is done.  Drop being called via a
 
1572
+       normal peephole.
 
1573
+       (emit_fusion_gpr_load): Change calling signature to be called from
 
1574
+       the fusion_gpr_load_<mode> insns with a combined memory address
 
1575
+       instead of the peephole pass passing the addis and offset
 
1576
+       separately.
 
1577
+
 
1578
+       * config/rs6000/rs6000.md (UNSPEC_FUSION_GPR): New unspec for GPR
 
1579
+       fusion.
 
1580
+       (power8 fusion peephole): Drop support for doing power8 via a
 
1581
+       normal peephole that was created by the peephole2 pass.
 
1582
+       (power8 fusion peephole2): Create a new insn with the fused
 
1583
+       address, so that the fused operation is kept together after
 
1584
+       register allocation is done.
 
1585
+       (fusion_gpr_load_<mode>): Likewise.
 
1586
+
 
1587
+2014-09-17  Jakub Jelinek  <jakub@redhat.com>
 
1588
+
 
1589
+       PR debug/63284
 
1590
+       * tree-cfgcleanup.c (fixup_noreturn_call): Don't split block
 
1591
+       if there are only debug stmts after the noreturn call, instead
 
1592
+       remove the debug stmts.
 
1593
+
 
1594
+2014-09-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1595
+
 
1596
+       * config/rs6000/vsx.md (vsx_fmav4sf4): Use correct constraints for
 
1597
+       V2DF, V4SF, DF, and DI modes.
 
1598
+       (vsx_fmav2df2): Likewise.
 
1599
+       (vsx_float_fix_<mode>2): Likewise.
 
1600
+       (vsx_reduc_<VEC_reduc_name>_v2df_scalar): Likewise.
 
1601
+
 
1602
+2014-09-10  Alan Modra  <amodra@gmail.com>
 
1603
+
 
1604
+       PR debug/60655
 
1605
+       * dwarf2out.c (mem_loc_descriptor <PLUS>): Return NULL if addend
 
1606
+       can't be output.
 
1607
+
 
1608
+2014-09-09  Richard Biener  <rguenther@suse.de>
 
1609
+
 
1610
+       Backport from mainline
 
1611
+       2014-06-11  Richard Biener  <rguenther@suse.de>
 
1612
+
 
1613
+       PR tree-optimization/61452
 
1614
+       * tree-ssa-sccvn.c (visit_phi): Remove pointless setting of
 
1615
+       expr and has_constants in case we found a leader.
 
1616
+       (simplify_binary_expression): Always valueize operands first.
 
1617
+       (simplify_unary_expression): Likewise.
 
1618
+
 
1619
+2014-09-09  Richard Biener  <rguenther@suse.de>
 
1620
+
 
1621
+       Backport from mainline
 
1622
+       2014-05-05  Richard Biener  <rguenther@suse.de>
 
1623
+
 
1624
+       PR middle-end/61010
 
1625
+       * fold-const.c (fold_binary_loc): Consistently avoid
 
1626
+       canonicalizing X & CST away from a CST that is the mask
 
1627
+       of a mode.
 
1628
+
 
1629
+       2014-05-28  Richard Biener  <rguenther@suse.de>
 
1630
+
 
1631
+       PR middle-end/61045
 
1632
+       * fold-const.c (fold_comparison): When folding
 
1633
+       X +- C1 CMP Y +- C2 to X CMP Y +- C2 +- C1 also ensure
 
1634
+       the sign of the remaining constant operand stays the same.
 
1635
+
 
1636
+       2014-08-11  Richard Biener  <rguenther@suse.de>
 
1637
+
 
1638
+       PR tree-optimization/62075
 
1639
+       * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Properly
 
1640
+       handle uses in patterns.
 
1641
+
 
1642
+2014-09-09  James Greenhalgh  <james.greenhalgh@arm.com>
 
1643
+
 
1644
+       Backport from mainline.
 
1645
+       2014-09-09  James Greenhalgh  <james.greenhalgh@arm.com>
 
1646
+
 
1647
+       * doc/invoke.texi (-march): Use GNU/Linux rather than Linux.
 
1648
+       (-mtune): Likewise.
 
1649
+       (-mcpu): Likewise.
 
1650
+
 
1651
+2014-09-08  Jakub Jelinek  <jakub@redhat.com>
 
1652
+
 
1653
+       PR tree-optimization/60196
 
1654
+       PR tree-optimization/63189
 
1655
+       Backported from mainline
 
1656
+       2013-09-17  Cong Hou  <congh@google.com>
 
1657
+
 
1658
+       * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Fix a bug
 
1659
+       when checking the dot production pattern. The type of rhs operand
 
1660
+       of multiply is now checked correctly.
 
1661
+
 
1662
+2014-09-08  Jakub Jelinek  <jakub@redhat.com>
 
1663
+
 
1664
+       Backported from mainline
 
1665
+       2014-08-06  Vladimir Makarov  <vmakarov@redhat.com>
 
1666
+
 
1667
+       PR debug/61923
 
1668
+       * haifa-sched.c (advance_one_cycle): Fix dump.
 
1669
+       (schedule_block): Don't advance cycle if we are already at the
 
1670
+       beginning of the cycle.
 
1671
+
 
1672
+2014-09-03  Martin Jambor  <mjambor@suse.cz>
 
1673
+
 
1674
+       PR ipa/62015
 
1675
+       * ipa-cp.c (intersect_aggregates_with_edge): Handle impermissible
 
1676
+       pass-trough jump functions correctly.
 
1677
+
 
1678
+2014-09-03  Martin Jambor  <mjambor@suse.cz>
 
1679
+
 
1680
+       PR ipa/61986
 
1681
+       * ipa-cp.c (find_aggregate_values_for_callers_subset): Chain
 
1682
+       created replacements in ascending order of offsets.
 
1683
+       (known_aggs_to_agg_replacement_list): Likewise.
 
1684
+
 
1685
+2014-09-01  Marek Polacek  <polacek@redhat.com>
 
1686
+
 
1687
+       Backport from mainline
 
1688
+       2014-08-21  Marek Polacek  <polacek@redhat.com>
 
1689
+
 
1690
+       PR c/61271
 
1691
+       * expr.c (is_aligning_offset): Remove logical not.
 
1692
+
 
1693
+2014-09-01  Marek Polacek  <polacek@redhat.com>
 
1694
+
 
1695
+       Backport from mainline
 
1696
+       2014-08-19  Marek Polacek  <polacek@redhat.com>
 
1697
+
 
1698
+       PR c/61271
 
1699
+       * cgraphunit.c (handle_alias_pairs): Fix condition.
 
1700
+
 
1701
+2014-08-30  John David Anglin  <danglin@gcc.gnu.org>
 
1702
+
 
1703
+       * config/pa/pa.c (pa_assemble_integer): Don't add PLABEL relocation
 
1704
+       prefix to function labels when generating fast indirect calls.
 
1705
+
 
1706
+2014-08-26  Joel Sherrill <joel.sherrill@oarcorp.com>
 
1707
+
 
1708
+       * doc/invoke.texi: -fno-cxa-atexit should be -fno-use-cxa-atexit.
 
1709
+
 
1710
+2014-08-26  Marek Polacek  <polacek@redhat.com>
 
1711
+
 
1712
+       Backport from mainline
 
1713
+       2014-08-26  Marek Polacek  <polacek@redhat.com>
 
1714
+
 
1715
+       PR c/61271
 
1716
+       * tree-vectorizer.h (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT,
 
1717
+       LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Wrap in parens.
 
1718
+
 
1719
+2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
 
1720
+
 
1721
+       Backport from mainline
 
1722
+       2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
 
1723
+
 
1724
+       PR target/61996
 
1725
+       * config/sh/sh.opt (musermode): Allow negative form.
 
1726
+       * config/sh/sh.c (sh_option_override): Disable TARGET_USERMODE for
 
1727
+       targets that don't support it.
 
1728
+       * doc/invoke.texi (SH Options): Rename sh-*-linux* to sh*-*-linux*.
 
1729
+       Document -mno-usermode option.
 
1730
+
 
1731
+2014-08-23  John David Anglin  <danglin@gcc.gnu.org>
 
1732
+
 
1733
+       PR target/62038
 
1734
+       * config/pa/pa.c (pa_output_function_epilogue): Don't set
 
1735
+       last_address when the current function is a thunk.
 
1736
+       (pa_asm_output_mi_thunk): When we don't have named sections or they
 
1737
+       are not being used, check that thunk can reach the stub table with a
 
1738
+       short branch.
 
1739
+
 
1740
+2014-08-22  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1741
+
 
1742
+       Backport fro mainline
 
1743
+       2014-08-22  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1744
+
 
1745
+       PR target/62195
 
1746
+       * doc/md.texi (Machine Constraints): Update PowerPC wi constraint
 
1747
+       documentation to state it is only for VSX operations.
 
1748
+
 
1749
+       * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Make wi
 
1750
+       constraint only active if VSX.
 
1751
+
 
1752
+       * config/rs6000/rs6000.md (lfiwax): Use wj constraint instead of
 
1753
+       wi cosntraint for ISA 2.07 lxsiwax/lxsiwzx instructions.
 
1754
+       (lfiwzx): Likewise.
 
1755
+
 
1756
+2014-08-15  Tom de Vries  <tom@codesourcery.com>
 
1757
+
 
1758
+       Backport from mainline:
 
1759
+       2014-08-14  Tom de Vries  <tom@codesourcery.com>
 
1760
+
 
1761
+       PR rtl-optimization/62004
 
1762
+       PR rtl-optimization/62030
 
1763
+       * ifcvt.c (rtx_interchangeable_p): New function.
 
1764
+       (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p.
 
1765
+
 
1766
+       2014-08-05  Richard Biener  <rguenther@suse.de>
 
1767
+
 
1768
+       * emit-rtl.h (mem_attrs_eq_p): Declare.
 
1769
+       * emit-rtl.c (mem_attrs_eq_p): Export.
 
1770
+
 
1771
+2014-08-16  John David Anglin  <danglin@gcc.gnu.org>
 
1772
+
 
1773
+       Backport from trunk:
 
1774
+       2014-04-06  John David Anglin  <danglin@gcc.gnu.org>
 
1775
+
 
1776
+       PR debug/55794
 
1777
+       * config/pa/pa.c (pa_output_function_epilogue): Skip address and code
 
1778
+       size accounting for thunks.
 
1779
+       (pa_asm_output_mi_thunk): Use final_start_function() and
 
1780
+       final_end_function() to output function start and end directives.
 
1781
+
 
1782
+2014-08-15  Oleg Endo  <olegendo@gcc.gnu.org>
 
1783
+
 
1784
+       Backport from mainline:
 
1785
+       2014-08-15  Oleg Endo  <olegendo@gcc.gnu.org>
 
1786
+
 
1787
+       * doc/invoke.texi (SH options): Document missing processor variant
 
1788
+       options.  Remove references to Hitachi.  Undocument deprecated mspace
 
1789
+       option.
 
1790
+
 
1791
+2014-08-13  Felix Yang  <fei.yang0953@gmail.com>
 
1792
+
 
1793
+       PR tree-optimization/62073
 
1794
+       * tree-vect-loop.c (vect_is_simple_reduction_1): Check that DEF1 has
 
1795
+       a basic block.
 
1796
+
 
1797
+2014-08-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1798
+
 
1799
+       Backport from mainline
 
1800
+       2014-08-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1801
+
 
1802
+       PR middle-end/62103
 
1803
+       * gimple-fold.c (fold_ctor_reference): Don't fold in presence of
 
1804
+       bitfields, that is when size doesn't match the size of type or the
 
1805
+       size of the constructor.
 
1806
+
 
1807
+2014-08-12  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1808
+
 
1809
+       Backport patch from mainline
 
1810
+       2014-08-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1811
+
 
1812
+       * config/rs6000/constraints.md (wh constraint): New constraint,
 
1813
+       for FP registers if direct move is available.
 
1814
+       (wi constraint): New constraint, for VSX/FP registers that can
 
1815
+       handle 64-bit integers.
 
1816
+       (wj constraint): New constraint for VSX/FP registers that can
 
1817
+       handle 64-bit integers for direct moves.
 
1818
+       (wk constraint): New constraint for VSX/FP registers that can
 
1819
+       handle 64-bit doubles for direct moves.
 
1820
+       (wy constraint): Make documentation match implementation.
 
1821
+
 
1822
+       * config/rs6000/rs6000.c (struct rs6000_reg_addr): Add
 
1823
+       scalar_in_vmx_p field to simplify tests of whether SFmode or
 
1824
+       DFmode can go in the Altivec registers.
 
1825
+       (rs6000_hard_regno_mode_ok): Use scalar_in_vmx_p field.
 
1826
+       (rs6000_setup_reg_addr_masks): Likewise.
 
1827
+       (rs6000_debug_print_mode): Add debug support for scalar_in_vmx_p
 
1828
+       field, and wh/wi/wj/wk constraints.
 
1829
+       (rs6000_init_hard_regno_mode_ok): Setup scalar_in_vmx_p field, and
 
1830
+       the wh/wi/wj/wk constraints.
 
1831
+       (rs6000_preferred_reload_class): If SFmode/DFmode can go in the
 
1832
+       upper registers, prefer VSX registers unless the operation is a
 
1833
+       memory operation with REG+OFFSET addressing.
 
1834
+
 
1835
+       * config/rs6000/vsx.md (VSr mode attribute): Add support for
 
1836
+       DImode.  Change SFmode to use ww constraint instead of d to allow
 
1837
+       SF registers in the upper registers.
 
1838
+       (VSr2): Likewise.
 
1839
+       (VSr3): Likewise.
 
1840
+       (VSr5): Fix thinko in comment.
 
1841
+       (VSa): New mode attribute that is an alternative to wa, that
 
1842
+       returns the VSX register class that a mode can go in, but may not
 
1843
+       be the preferred register class.
 
1844
+       (VS_64dm): New mode attribute for appropriate register classes for
 
1845
+       referencing 64-bit elements of vectors for direct moves and normal
 
1846
+       moves.
 
1847
+       (VS_64reg): Likewise.
 
1848
+       (vsx_mov<mode>): Change wa constraint to <VSa> to limit the
 
1849
+       register allocator to only registers the data type can handle.
 
1850
+       (vsx_le_perm_load_<mode>): Likewise.
 
1851
+       (vsx_le_perm_store_<mode>): Likewise.
 
1852
+       (vsx_xxpermdi2_le_<mode>): Likewise.
 
1853
+       (vsx_xxpermdi4_le_<mode>): Likewise.
 
1854
+       (vsx_lxvd2x2_le_<mode>): Likewise.
 
1855
+       (vsx_lxvd2x4_le_<mode>): Likewise.
 
1856
+       (vsx_stxvd2x2_le_<mode>): Likewise.
 
1857
+       (vsx_add<mode>3): Likewise.
 
1858
+       (vsx_sub<mode>3): Likewise.
 
1859
+       (vsx_mul<mode>3): Likewise.
 
1860
+       (vsx_div<mode>3): Likewise.
 
1861
+       (vsx_tdiv<mode>3_internal): Likewise.
 
1862
+       (vsx_fre<mode>2): Likewise.
 
1863
+       (vsx_neg<mode>2): Likewise.
 
1864
+       (vsx_abs<mode>2): Likewise.
 
1865
+       (vsx_nabs<mode>2): Likewise.
 
1866
+       (vsx_smax<mode>3): Likewise.
 
1867
+       (vsx_smin<mode>3): Likewise.
 
1868
+       (vsx_sqrt<mode>2): Likewise.
 
1869
+       (vsx_rsqrte<mode>2): Likewise.
 
1870
+       (vsx_tsqrt<mode>2_internal): Likewise.
 
1871
+       (vsx_fms<mode>4): Likewise.
 
1872
+       (vsx_nfma<mode>4): Likewise.
 
1873
+       (vsx_eq<mode>): Likewise.
 
1874
+       (vsx_gt<mode>): Likewise.
 
1875
+       (vsx_ge<mode>): Likewise.
 
1876
+       (vsx_eq<mode>_p): Likewise.
 
1877
+       (vsx_gt<mode>_p): Likewise.
 
1878
+       (vsx_ge<mode>_p): Likewise.
 
1879
+       (vsx_xxsel<mode>): Likewise.
 
1880
+       (vsx_xxsel<mode>_uns): Likewise.
 
1881
+       (vsx_copysign<mode>3): Likewise.
 
1882
+       (vsx_float<VSi><mode>2): Likewise.
 
1883
+       (vsx_floatuns<VSi><mode>2): Likewise.
 
1884
+       (vsx_fix_trunc<mode><VSi>2): Likewise.
 
1885
+       (vsx_fixuns_trunc<mode><VSi>2): Likewise.
 
1886
+       (vsx_x<VSv>r<VSs>i): Likewise.
 
1887
+       (vsx_x<VSv>r<VSs>ic): Likewise.
 
1888
+       (vsx_btrunc<mode>2): Likewise.
 
1889
+       (vsx_b2trunc<mode>2): Likewise.
 
1890
+       (vsx_floor<mode>2): Likewise.
 
1891
+       (vsx_ceil<mode>2): Likewise.
 
1892
+       (vsx_<VS_spdp_insn>): Likewise.
 
1893
+       (vsx_xscvspdp): Likewise.
 
1894
+       (vsx_xvcvspuxds): Likewise.
 
1895
+       (vsx_float_fix_<mode>2): Likewise.
 
1896
+       (vsx_set_<mode>): Likewise.
 
1897
+       (vsx_extract_<mode>_internal1): Likewise.
 
1898
+       (vsx_extract_<mode>_internal2): Likewise.
 
1899
+       (vsx_extract_<mode>_load): Likewise.
 
1900
+       (vsx_extract_<mode>_store): Likewise.
 
1901
+       (vsx_splat_<mode>): Likewise.
 
1902
+       (vsx_xxspltw_<mode>): Likewise.
 
1903
+       (vsx_xxspltw_<mode>_direct): Likewise.
 
1904
+       (vsx_xxmrghw_<mode>): Likewise.
 
1905
+       (vsx_xxmrglw_<mode>): Likewise.
 
1906
+       (vsx_xxsldwi_<mode>): Likewise.
 
1907
+       (vsx_xscvdpspn): Tighten constraints to only use register classes
 
1908
+       the types use.
 
1909
+       (vsx_xscvspdpn): Likewise.
 
1910
+       (vsx_xscvdpspn_scalar): Likewise.
 
1911
+
 
1912
+       * config/rs6000/rs6000.h (enum rs6000_reg_class_enum): Add wh, wi,
 
1913
+       wj, and wk constraints.
 
1914
+       (GPR_REG_CLASS_P): New helper macro for register classes targeting
 
1915
+       general purpose registers.
 
1916
+
 
1917
+       * config/rs6000/rs6000.md (f32_dm): Use wh constraint for SDmode
 
1918
+       direct moves.
 
1919
+       (zero_extendsidi2_lfiwz): Use wj constraint for direct move of
 
1920
+       DImode instead of wm.  Use wk constraint for direct move of DFmode
 
1921
+       instead of wm.
 
1922
+       (extendsidi2_lfiwax): Likewise.
 
1923
+       (lfiwax): Likewise.
 
1924
+       (lfiwzx): Likewise.
 
1925
+       (movdi_internal64): Likewise.
 
1926
+
 
1927
+       * doc/md.texi (PowerPC and IBM RS6000): Document wh, wi, wj, and
 
1928
+       wk constraints. Make the wy constraint documentation match them
 
1929
+       implementation.
 
1930
+
 
1931
+2014-08-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1932
+
 
1933
+       Backport from mainline
 
1934
+       2014-06-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1935
+
 
1936
+       PR tree-optimization/61375
 
1937
+       * tree-ssa-math-opts.c (find_bswap_or_nop_1): Cancel optimization if
 
1938
+       symbolic number cannot be represented in an unsigned HOST_WIDE_INT.
 
1939
+       (execute_optimize_bswap): Cancel optimization if CHAR_BIT != 8.
 
1940
+
 
1941
+2014-08-01  Richard Biener  <rguenther@suse.de>
 
1942
+
 
1943
+       PR tree-optimization/61964
 
1944
+       * tree-ssa-tail-merge.c (gimple_operand_equal_value_p): New
 
1945
+       function merged from trunk.
 
1946
+       (gimple_equal_p): Handle non-SSA LHS solely by structural
 
1947
+       equality.
 
1948
+
 
1949
+2014-07-25  Uros Bizjak  <ubizjak@gmail.com>
 
1950
+
 
1951
+       * config/alpha/elf.h: Define TARGET_UNWIND_TABLES_DEFAULT.
 
1952
+
 
1953
+2014-07-24  Kyle McMartin  <kyle@redhat.com>
 
1954
+
 
1955
+       * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define.
 
1956
+
 
1957
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
1958
+
 
1959
+       * config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
 
1960
+       Add prototype.
 
1961
+       * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
 
1962
+       function.  Issue -Wpsabi warning if future GCC releases will use
 
1963
+       different field alignment rules for this type.
 
1964
+       * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
 
1965
+       * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
 
1966
+       * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
 
1967
+
 
1968
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
1969
+
 
1970
+       * config/rs6000/rs6000.c (rs6000_function_arg_boundary): Issue
 
1971
+       -Wpsabi note when encountering a type where future GCC releases
 
1972
+       will apply different alignment requirements.
 
1973
+
 
1974
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
1975
+
 
1976
+       * config/rs6000/rs6000.c (rs6000_function_arg): If a float argument
 
1977
+       does not fit fully into floating-point registers, and there is still
 
1978
+       space in the register parameter area, issue -Wpsabi note that the ABI
 
1979
+       will change in a future GCC release.
 
1980
+
 
1981
+2014-07-23  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
1982
+
 
1983
+       * config/arm/t-rtems-eabi: Add
 
1984
+       mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard,
 
1985
+       mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard,
 
1986
+       mbig-endian/mthumb/march=armv7-r, and
 
1987
+       mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
1988
+       multilibs.
 
1989
+
 
1990
+2014-07-21  Peter Bergner  <bergner@vnet.ibm.com>
 
1991
+
 
1992
+       * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define.
 
1993
+       (LIBTSAN_EARLY_SPEC): Likewise.
 
1994
+       (STATIC_LIBASAN_LIBS): Likewise.
 
1995
+       (STATIC_LIBTSAN_LIBS): Likewise.
 
1996
+
 
1997
+2014-07-19  Eric Botcazou  <ebotcazou@adacore.com>
 
1998
+
 
1999
+       * toplev.c (output_stack_usage): Adjust the location of the warning.
 
2000
+
 
2001
+2014-07-19  Daniel Cederman  <cederman@gaisler.com>
 
2002
+
 
2003
+       * config/sparc/sync.md (*membar_storeload_leon3): New insn.
 
2004
+       (*membar_storeload): Disable for LEON3.
 
2005
+
 
2006
+2014-07-17  Richard Biener  <rguenther@suse.de>
 
2007
+
 
2008
+       PR rtl-optimization/61801
 
2009
+       * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and
 
2010
+       ASM_INPUT don't set reg_pending_barrier if it appears in a
 
2011
+       debug-insn.
 
2012
+
 
2013
+2014-07-16  Jakub Jelinek  <jakub@redhat.com>
 
2014
+
 
2015
+       * omp-low.c (create_omp_child_function): Don't set DECL_NAMELESS
 
2016
+       on the FUNCTION_DECL.
 
2017
+
 
2018
+2014-07-10  Tom G. Christensen  <tgc@jupiterrise.com>
 
2019
+
 
2020
+       * doc/install.texi: Remove links to defunct package providers for
 
2021
+       Solaris.
 
2022
+
 
2023
+2014-07-10  Eric Botcazou  <ebotcazou@adacore.com>
 
2024
+
 
2025
+       PR middle-end/53590
 
2026
+       * function.c (allocate_struct_function): Revert r188667 change.
 
2027
+
 
2028
+2014-07-04  Jakub Jelinek  <jakub@redhat.com>
 
2029
+
 
2030
+       PR tree-optimization/61684
 
2031
+       * tree-ssa-ifcombine.c (recognize_single_bit_test): Make sure
 
2032
+       rhs1 of conversion is a SSA_NAME before using SSA_NAME_DEF_STMT on it.
 
2033
+
 
2034
+2014-06-30  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
2035
+
 
2036
+       Backport from Mainline
 
2037
+       2014-06-20  Jakub Jelinek  <jakub@redhat.com>
 
2038
+       2014-06-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
2039
+
 
2040
+       PR tree-optimization/61306
 
2041
+       * tree-ssa-math-opts.c (struct symbolic_number): Store type of
 
2042
+       expression instead of its size.
 
2043
+       (do_shift_rotate): Adapt to change in struct symbolic_number. Return
 
2044
+       false to prevent optimization when the result is unpredictable due to
 
2045
+       arithmetic right shift of signed type with highest byte is set.
 
2046
+       (verify_symbolic_number_p): Adapt to change in struct symbolic_number.
 
2047
+       (find_bswap_1): Likewise. Return NULL to prevent optimization when the
 
2048
+       result is unpredictable due to sign extension.
 
2049
+       (find_bswap): Adapt to change in struct symbolic_number.
 
2050
+
 
2051
+2014-06-27  Uros Bizjak  <ubizjak@gmail.com>
 
2052
+
 
2053
+       Backport from mainline
 
2054
+       2014-06-26  Uros Bizjak  <ubizjak@gmail.com>
 
2055
+
 
2056
+       PR target/61586
 
2057
+       * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX.
 
2058
+
 
2059
+2014-06-26  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
2060
+
 
2061
+       PR target/61542
 
2062
+       * config/rs6000/vsx.md (vsx_extract_v4sf): Fix bug with element
 
2063
+       extraction other than index 3.
 
2064
+
 
2065
+2014-06-24  Jakub Jelinek  <jakub@redhat.com>
 
2066
+
 
2067
+       PR target/61570
 
2068
+       * config/i386/driver-i386.c (host_detect_local_cpu): For unknown
 
2069
+       model family 6 CPU with has_longmode never use a CPU without
 
2070
+       64-bit support.
 
2071
+
 
2072
+2014-06-20  Chung-Lin Tang  <cltang@codesourcery.com>
 
2073
+
 
2074
+       Backport from mainline
 
2075
+
 
2076
+       2014-06-20  Julian Brown  <julian@codesourcery.com>
 
2077
+                   Chung-Lin Tang  <cltang@codesourcery.com>
 
2078
+
 
2079
+       * config/arm/arm.c (arm_output_mi_thunk): Fix offset for
 
2080
+       TARGET_THUMB1_ONLY. Add comments.
 
2081
+
 
2082
+2014-06-18  Uros Bizjak  <ubizjak@gmail.com>
 
2083
+
 
2084
+       Backport from mainline
 
2085
+       2014-06-06  Uros Bizjak  <ubizjak@gmail.com>
 
2086
+
 
2087
+       PR target/61423
 
2088
+       * config/i386/i386.md (*floatunssi<mode>2_i387_with_xmm): New
 
2089
+       define_insn_and_split pattern, merged from *floatunssi<mode>2_1
 
2090
+       and corresponding splitters.  Zero extend general register
 
2091
+       or memory input operand to XMM temporary.  Enable for
 
2092
+       TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
 
2093
+       (floatunssi<mode>2): Update expander predicate.
 
2094
+
 
2095
+2014-06-18  Richard Henderson  <rth@redhat.com>
 
2096
+
 
2097
+       PR target/61545
 
2098
+       * config/aarch64/aarch64.md (tlsdesc_small): Clobber CC_REGNUM.
 
2099
+
 
2100
+2014-06-17  Nagaraju Mekala <nagaraju.mekala@xilinx.com>
 
2101
+
 
2102
+       Revert on gcc-4_8-branch.
 
2103
+       * config/microblaze/microblaze.md: Add movsi4_rev insn pattern.
 
2104
+       * config/microblaze/predicates.md: Add reg_or_mem_operand predicate.
 
2105
+
 
2106
+2014-06-17  Yufeng Zhang  <yufeng.zhang@arm.com>
 
2107
+
 
2108
+       Backport from mainline
 
2109
+
 
2110
+       PR target/61483
 
2111
+       * config/aarch64/aarch64.c (aarch64_layout_arg): Add new local
 
2112
+       variable 'size'; calculate 'size' right in the front; use
 
2113
+       'size' to compute 'nregs' (when 'allocate_ncrn != 0') and
 
2114
+       pcum->aapcs_stack_words.
 
2115
+
 
2116
+2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
 
2117
+
 
2118
+       Backport from mainline
 
2119
+
 
2120
+       2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
 
2121
+       PR target/61415
 
2122
+       * config/rs6000/rs6000-builtin.def (BU_MISC_1): Delete.
 
2123
+       (BU_MISC_2): Rename to ...
 
2124
+       (BU_LDBL128_2): ... this.
 
2125
+       * config/rs6000/rs6000.h (RS6000_BTM_LDBL128): New define.
 
2126
+       (RS6000_BTM_COMMON): Add RS6000_BTM_LDBL128.
 
2127
+       * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
 
2128
+       RS6000_BTM_LDBL128.
 
2129
+       (rs6000_invalid_builtin): Add long double 128-bit builtin support.
 
2130
+       (rs6000_builtin_mask_names): Add RS6000_BTM_LDBL128.
 
2131
+       * config/rs6000/rs6000.md (unpacktf_0): Remove define)expand.
 
2132
+       (unpacktf_1): Likewise.
 
2133
+       * doc/extend.texi (__builtin_longdouble_dw0): Remove documentation.
 
2134
+       (__builtin_longdouble_dw1): Likewise.
 
2135
+       * doc/sourcebuild.texi (longdouble128): Document.
 
2136
+
 
2137
+2014-06-13  Jason Merrill  <jason@redhat.com>
 
2138
+
 
2139
+       PR c++/60731
 
2140
+       * common.opt (-fno-gnu-unique): Add.
 
2141
+       * config/elfos.h (USE_GNU_UNIQUE_OBJECT): Check it.
 
2142
+
 
2143
+2014-06-12  Georg-Johann Lay  <avr@gjlay.de>
 
2144
+
 
2145
+       Backport from 2014-05-09 trunk r210272
 
2146
+
 
2147
+       * config/avr/avr-fixed.md (round<mode>3): Use -1U instead of -1 in
 
2148
+       unsigned int initializers for regno_in, regno_out.
 
2149
+
 
2150
+       Backport from 2014-05-14 trunk r210418
 
2151
+       * config/avr/avr.h (REG_CLASS_CONTENTS): Use unsigned suffix for
 
2152
+       shifted values to avoid build warning.
 
2153
+
 
2154
+       Backport from 2014-06-12 trunk r211491
 
2155
+
 
2156
+       PR target/61443
 
2157
+       * config/avr/avr.md (push<mode>1): Avoid (subreg(mem)) when
 
2158
+       loading from address spaces.
 
2159
+
 
2160
+2014-06-12  Alan Modra  <amodra@gmail.com>
 
2161
+
 
2162
+       PR target/61300
 
2163
+       * doc/tm.texi.in (INCOMING_REG_PARM_STACK_SPACE): Document.
 
2164
+       * doc/tm.texi: Regenerate.
 
2165
+       * function.c (INCOMING_REG_PARM_STACK_SPACE): Provide default.
 
2166
+       Use throughout in place of REG_PARM_STACK_SPACE.
 
2167
+       * config/rs6000/rs6000.c (rs6000_reg_parm_stack_space): Add
 
2168
+       "incoming" param.  Pass to rs6000_function_parms_need_stack.
 
2169
+       (rs6000_function_parms_need_stack): Add "incoming" param, ignore
 
2170
+       prototype_p when incoming.  Use function decl when incoming
 
2171
+       to handle K&R style functions.
 
2172
+       * config/rs6000/rs6000.h (REG_PARM_STACK_SPACE): Adjust.
 
2173
+       (INCOMING_REG_PARM_STACK_SPACE): Define.
 
2174
+
 
2175
+2014-06-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
2176
+
 
2177
+       Back port from trunk
 
2178
+       2014-06-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
2179
+
 
2180
+       PR target/61431
 
2181
+       * config/rs6000/vsx.md (VSX_LE): Split VSX_D into 2 separate
 
2182
+       iterators, VSX_D that handles 64-bit types, and VSX_LE that
 
2183
+       handles swapping the two 64-bit double words on little endian
 
2184
+       systems.  Include V1TImode and optionally TImode in VSX_LE so that
 
2185
+       these types are properly swapped.  Change all of the insns and
 
2186
+       splits that do the 64-bit swaps to use VSX_LE.
 
2187
+       (vsx_le_perm_load_<mode>): Likewise.
 
2188
+       (vsx_le_perm_store_<mode>): Likewise.
 
2189
+       (splitters for little endian memory operations): Likewise.
 
2190
+       (vsx_xxpermdi2_le_<mode>): Likewise.
 
2191
+       (vsx_lxvd2x2_le_<mode>): Likewise.
 
2192
+       (vsx_stxvd2x2_le_<mode>): Likewise.
 
2193
+
 
2194
+2014-06-05  Martin Jambor  <mjambor@suse.cz>
 
2195
+
 
2196
+       PR ipa/61393
 
2197
+       * ipa-cp.c (determine_versionability): Pretend that tm_clones are
 
2198
+       not versionable.
 
2199
+
 
2200
+2014-06-04  Richard Biener  <rguenther@suse.de>
 
2201
+
 
2202
+       PR tree-optimization/61383
 
2203
+       * tree-ssa-ifcombine.c (bb_no_side_effects_p): Make sure
 
2204
+       stmts can't trap.
 
2205
+
 
2206
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
2207
+
 
2208
+       Backport from mainline
 
2209
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
2210
+
 
2211
+       PR rtl-optimization/60866
 
2212
+       * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
 
2213
+       Default it to -1.  Pass it down to init_simplejump_data.
 
2214
+       (init_simplejump_data): New parameter old_seqno.  Pass it down
 
2215
+       to get_seqno_for_a_jump.
 
2216
+       (get_seqno_for_a_jump): New parameter old_seqno.  Use it for
 
2217
+       initializing new jump seqno as a last resort.  Add comment.
 
2218
+       (sel_redirect_edge_and_branch): Save old seqno of the conditional
 
2219
+       jump and pass it down to sel_init_new_insn.
 
2220
+       (sel_redirect_edge_and_branch_force): Likewise.
 
2221
+
 
2222
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
2223
+
 
2224
+       Backport from mainline
 
2225
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
2226
+
 
2227
+       PR rtl-optimization/60901
 
2228
+       * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
 
2229
+       bb predecessor belongs to the same scheduling region.  Adjust comment.
 
2230
+
 
2231
+2014-06-03  Uros Bizjak  <ubizjak@gmail.com>
 
2232
+
 
2233
+       Backport from mainline
 
2234
+       2014-06-02  Uros Bizjak  <ubizjak@gmail.com>
 
2235
+
 
2236
+       PR target/61239
 
2237
+       * config/i386/i386.c (ix86_expand_vec_perm) [case V32QImode]: Use
 
2238
+       GEN_INT (-128) instead of GEN_INT (128) to set MSB of QImode constant.
 
2239
+
 
2240
+2014-05-28  Guozhi Wei  <carrot@google.com>
 
2241
+
 
2242
+       PR target/61202
 
2243
+       * config/aarch64/arm_neon.h (vqdmulh_n_s16): Change the last operand's
 
2244
+       constraint.
 
2245
+       (vqdmulhq_n_s16): Likewise.
 
2246
+
 
2247
+2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
 
2248
+
 
2249
+       Backport from mainline
 
2250
+       2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
2251
+
 
2252
+       * double-int.c (div_and_round_double) <ROUND_DIV_EXPR>: Use the proper
 
2253
+       predicate to detect a negative quotient.
 
2254
+
 
2255
+2014-05-28  Georg-Johann Lay  <avr@gjlay.de>
 
2256
+
 
2257
+       PR target/61044
 
2258
+       * doc/extend.texi (Local Labels): Note that label differences are
 
2259
+       not supported for AVR.
 
2260
+
 
2261
+2014-05-26  Michael Tautschnig  <mt@debian.org>
 
2262
+
 
2263
+       PR target/61249
 
2264
+       * doc/extend.texi (X86 Built-in Functions): Fix parameter lists of
 
2265
+       __builtin_ia32_vfrczs[sd] and __builtin_ia32_mpsadbw256.
 
2266
+
 
2267
+2014-05-23  Alan Modra  <amodra@gmail.com>
 
2268
+
 
2269
+       PR target/61231
 
2270
+       * config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
 
2271
+       * config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
 
2272
+       Use "Y" constraint rather than "m".
 
2273
+
 
2274
+2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
2275
+
 
2276
+       Backport from mainline
 
2277
+       2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
2278
+
 
2279
+       * config/rs6000/htm.md (ttest): Use correct shift value to get CR0.
 
2280
+
 
2281
+2014-05-22  Richard Earnshaw  <rearnsha@arm.com>
 
2282
+
 
2283
+       PR target/61208
 
2284
+       * arm.md (arm_cmpdi_unsigned): Fix length calculation for Thumb2.
 
2285
+
 
2286
 2014-05-22  Release Manager
 
2287
 
 
2288
        * GCC 4.8.3 released.
 
2289
Index: gcc/testsuite/gcc.target/powerpc/pr63335.c
 
2290
===================================================================
 
2291
--- a/src/gcc/testsuite/gcc.target/powerpc/pr63335.c    (.../tags/gcc_4_8_3_release)
 
2292
+++ b/src/gcc/testsuite/gcc.target/powerpc/pr63335.c    (.../branches/gcc-4_8-branch)
 
2293
@@ -0,0 +1,30 @@
 
2294
+/* { dg-do run { target { powerpc64*-*-* } } } */
 
2295
+/* { dg-require-effective-target powerpc_vsx_ok } */
 
2296
+/* { dg-options "-mvsx" } */
 
2297
+
 
2298
+#include <altivec.h>
 
2299
+
 
2300
+void abort (void);
 
2301
+
 
2302
+vector double vec = (vector double) {99.0, 99.0};
 
2303
+
 
2304
+int main() {
 
2305
+
 
2306
+  int actual = vec_all_nge(vec, vec);
 
2307
+  if ( actual != 0)
 
2308
+    abort();
 
2309
+
 
2310
+  actual = vec_all_nle(vec, vec);
 
2311
+  if ( actual != 0)
 
2312
+    abort();
 
2313
+
 
2314
+  actual = vec_any_nge(vec, vec);
 
2315
+  if ( actual != 0)
 
2316
+    abort();
 
2317
+
 
2318
+  actual = vec_any_nle(vec, vec);
 
2319
+  if ( actual != 0)
 
2320
+    abort();
 
2321
+
 
2322
+  return 0;
 
2323
+}
 
2324
Index: gcc/testsuite/gcc.target/powerpc/tfmode_off.c
 
2325
===================================================================
 
2326
--- a/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../tags/gcc_4_8_3_release)
 
2327
+++ b/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../branches/gcc-4_8-branch)
 
2328
@@ -1,6 +1,7 @@
 
2329
 /* { dg-do assemble } */
 
2330
 /* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
 
2331
 /* { dg-skip-if "no TFmode" { powerpc-*-eabi* } { "*" } { "" } } */
 
2332
+/* { dg-require-effective-target longdouble128 } */
 
2333
 /* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
 
2334
 
 
2335
 typedef float TFmode __attribute__ ((mode (TF)));
 
2336
Index: gcc/testsuite/gcc.target/powerpc/pack02.c
 
2337
===================================================================
 
2338
--- a/src/gcc/testsuite/gcc.target/powerpc/pack02.c     (.../tags/gcc_4_8_3_release)
 
2339
+++ b/src/gcc/testsuite/gcc.target/powerpc/pack02.c     (.../branches/gcc-4_8-branch)
 
2340
@@ -2,6 +2,7 @@
 
2341
 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 
2342
 /* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
 
2343
 /* { dg-require-effective-target powerpc_fprs } */
 
2344
+/* { dg-require-effective-target longdouble128 } */
 
2345
 /* { dg-options "-O2 -mhard-float" } */
 
2346
 
 
2347
 #include <stddef.h>
 
2348
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
 
2349
===================================================================
 
2350
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c   (.../tags/gcc_4_8_3_release)
 
2351
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c   (.../branches/gcc-4_8-branch)
 
2352
@@ -0,0 +1,12 @@
 
2353
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
 
2354
+/* { dg-options "-mabi=elfv2" } */
 
2355
+
 
2356
+struct f8
 
2357
+  {
 
2358
+    float x[8];
 
2359
+  };
 
2360
+
 
2361
+void test (struct f8 a, struct f8 b) /* { dg-message "note: the ABI of passing homogeneous float aggregates will change" } */
 
2362
+{
 
2363
+}
 
2364
+
 
2365
Index: gcc/testsuite/gcc.target/powerpc/htm-ttest.c
 
2366
===================================================================
 
2367
--- a/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c  (.../tags/gcc_4_8_3_release)
 
2368
+++ b/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c  (.../branches/gcc-4_8-branch)
 
2369
@@ -0,0 +1,14 @@
 
2370
+/* { dg-do compile { target { powerpc*-*-* } } } */
 
2371
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 
2372
+/* { dg-require-effective-target powerpc_htm_ok } */
 
2373
+/* { dg-options "-O2 -mhtm" } */
 
2374
+
 
2375
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,3,30,31" { target { ilp32 } } } } */
 
2376
+/* { dg-final { scan-assembler "rldicl r?\[0-9\]+,r?\[0-9\]+,35,62" { target { lp64 } } } } */
 
2377
+
 
2378
+#include <htmintrin.h>
 
2379
+long
 
2380
+ttest (void)
 
2381
+{
 
2382
+  return _HTM_STATE(__builtin_ttest());
 
2383
+}
 
2384
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c
 
2385
===================================================================
 
2386
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c   (.../tags/gcc_4_8_3_release)
 
2387
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c   (.../branches/gcc-4_8-branch)
 
2388
@@ -0,0 +1,12 @@
 
2389
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
 
2390
+/* { dg-options "-mno-compat-align-parm" } */
 
2391
+
 
2392
+struct test
 
2393
+  {
 
2394
+    long a __attribute__((aligned (16)));
 
2395
+  };
 
2396
+
 
2397
+void test (struct test a) /* { dg-message "note: the ABI of passing aggregates with 16-byte alignment will change" } */
 
2398
+{
 
2399
+}
 
2400
+
 
2401
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
 
2402
===================================================================
 
2403
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c   (.../tags/gcc_4_8_3_release)
 
2404
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c   (.../branches/gcc-4_8-branch)
 
2405
@@ -0,0 +1,9 @@
 
2406
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
 
2407
+/* { dg-require-effective-target powerpc_altivec_ok } */
 
2408
+/* { dg-options "-maltivec" } */
 
2409
+
 
2410
+struct test
 
2411
+  {
 
2412
+    int a __attribute__((vector_size (8)));
 
2413
+  }; /* { dg-message "note: the layout of aggregates containing vectors with 8-byte alignment will change" } */
 
2414
+
 
2415
Index: gcc/testsuite/gcc.target/alpha/pr61586.c
 
2416
===================================================================
 
2417
--- a/src/gcc/testsuite/gcc.target/alpha/pr61586.c      (.../tags/gcc_4_8_3_release)
 
2418
+++ b/src/gcc/testsuite/gcc.target/alpha/pr61586.c      (.../branches/gcc-4_8-branch)
 
2419
@@ -0,0 +1,10 @@
 
2420
+/* { dg-do compile } */
 
2421
+/* { dg-options "-O2 -mieee" } */
 
2422
+
 
2423
+void foo (int *dimensions, double **params, int hh)
 
2424
+{
 
2425
+  if (params[hh])
 
2426
+    ;
 
2427
+  else if (dimensions[hh] > 0)
 
2428
+    params[hh][0] = 1.0f;
 
2429
+}
 
2430
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c
 
2431
===================================================================
 
2432
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c  (.../tags/gcc_4_8_3_release)
 
2433
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c  (.../branches/gcc-4_8-branch)
 
2434
@@ -0,0 +1,35 @@
 
2435
+/* Test AAPCS64 layout and __builtin_va_start.
 
2436
+
 
2437
+   Pass named HFA/HVA argument on stack.  */
 
2438
+
 
2439
+/* { dg-do run { target aarch64*-*-* } } */
 
2440
+
 
2441
+#ifndef IN_FRAMEWORK
 
2442
+#define AAPCS64_TEST_STDARG
 
2443
+#define TESTFILE "va_arg-14.c"
 
2444
+#include "type-def.h"
 
2445
+
 
2446
+struct hfa_fx2_t hfa_fx2 = {1.2f, 2.2f};
 
2447
+struct hfa_fx3_t hfa_fx3 = {3.2f, 4.2f, 5.2f};
 
2448
+vf4_t float32x4 = {6.2f, 7.2f, 8.2f, 9.2f};
 
2449
+vf4_t float32x4_2 = {10.2f, 11.2f, 12.2f, 13.2f};
 
2450
+
 
2451
+#include "abitest.h"
 
2452
+#else
 
2453
+  ARG (float, 1.0f, S0, 0)
 
2454
+  ARG (float, 2.0f, S1, 1)
 
2455
+  ARG (float, 3.0f, S2, 2)
 
2456
+  ARG (float, 4.0f, S3, 3)
 
2457
+  ARG (float, 5.0f, S4, 4)
 
2458
+  ARG (float, 6.0f, S5, 5)
 
2459
+  ARG (float, 7.0f, S6, 6)
 
2460
+  ARG (struct hfa_fx3_t, hfa_fx3, STACK, 7)
 
2461
+  /* Previous argument size has been rounded up to the nearest multiple of
 
2462
+     8 bytes.  */
 
2463
+  ARG (struct hfa_fx2_t, hfa_fx2, STACK + 16, 8)
 
2464
+  /* NSAA is rounded up to the nearest natural alignment of float32x4.  */
 
2465
+  ARG (vf4_t, float32x4, STACK + 32, 9)
 
2466
+  ARG (vf4_t, float32x4_2, STACK + 48, LAST_NAMED_ARG_ID)
 
2467
+  DOTS
 
2468
+  LAST_ANON (double, 123456789.987, STACK + 64, 11)
 
2469
+#endif
 
2470
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
 
2471
===================================================================
 
2472
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h   (.../tags/gcc_4_8_3_release)
 
2473
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h   (.../branches/gcc-4_8-branch)
 
2474
@@ -34,6 +34,13 @@
 
2475
   float b;
 
2476
 };
 
2477
 
 
2478
+struct hfa_fx3_t
 
2479
+{
 
2480
+  float a;
 
2481
+  float b;
 
2482
+  float c;
 
2483
+};
 
2484
+
 
2485
 struct hfa_dx2_t
 
2486
 {
 
2487
   double a;
 
2488
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c
 
2489
===================================================================
 
2490
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c  (.../tags/gcc_4_8_3_release)
 
2491
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c  (.../branches/gcc-4_8-branch)
 
2492
@@ -0,0 +1,59 @@
 
2493
+/* Test AAPCS64 layout and __builtin_va_start.
 
2494
+
 
2495
+   Pass named HFA/HVA argument on stack.  */
 
2496
+
 
2497
+/* { dg-do run { target aarch64*-*-* } } */
 
2498
+
 
2499
+#ifndef IN_FRAMEWORK
 
2500
+#define AAPCS64_TEST_STDARG
 
2501
+#define TESTFILE "va_arg-13.c"
 
2502
+
 
2503
+struct float_float_t
 
2504
+{
 
2505
+  float a;
 
2506
+  float b;
 
2507
+} float_float;
 
2508
+
 
2509
+union float_int_t
 
2510
+{
 
2511
+  float b8;
 
2512
+  int b5;
 
2513
+} float_int;
 
2514
+
 
2515
+#define HAS_DATA_INIT_FUNC
 
2516
+void
 
2517
+init_data ()
 
2518
+{
 
2519
+  float_float.a = 1.2f;
 
2520
+  float_float.b = 2.2f;
 
2521
+
 
2522
+  float_int.b8 = 4983.80f;
 
2523
+}
 
2524
+
 
2525
+#include "abitest.h"
 
2526
+#else
 
2527
+  ARG (float, 1.0f, S0, 0)
 
2528
+  ARG (float, 2.0f, S1, 1)
 
2529
+  ARG (float, 3.0f, S2, 2)
 
2530
+  ARG (float, 4.0f, S3, 3)
 
2531
+  ARG (float, 5.0f, S4, 4)
 
2532
+  ARG (float, 6.0f, S5, 5)
 
2533
+  ARG (float, 7.0f, S6, 6)
 
2534
+  ARG (struct float_float_t, float_float, STACK, 7)
 
2535
+  ARG (int,  9, W0, 8)
 
2536
+  ARG (int, 10, W1, 9)
 
2537
+  ARG (int, 11, W2, 10)
 
2538
+  ARG (int, 12, W3, 11)
 
2539
+  ARG (int, 13, W4, 12)
 
2540
+  ARG (int, 14, W5, 13)
 
2541
+  ARG (int, 15, W6, LAST_NAMED_ARG_ID)
 
2542
+  DOTS
 
2543
+  /* Note on the reason of using 'X7' instead of 'W7' here:
 
2544
+     Using 'X7' makes sure the test works in the big-endian mode.
 
2545
+     According to PCS rules B.4 and C.10, the size of float_int is rounded
 
2546
+     to 8 bytes and prepared in the register X7 as if loaded via LDR from
 
2547
+     the memory, with the content of the other 4 bytes unspecified.  The
 
2548
+     test framework will only compare the 4 relavent bytes.  */
 
2549
+  ANON (union float_int_t, float_int, X7, 15)
 
2550
+  LAST_ANON (long long, 12683143434LL, STACK + 8, 16)
 
2551
+#endif
 
2552
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c
 
2553
===================================================================
 
2554
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c  (.../tags/gcc_4_8_3_release)
 
2555
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c  (.../branches/gcc-4_8-branch)
 
2556
@@ -0,0 +1,39 @@
 
2557
+/* Test AAPCS64 layout and __builtin_va_start.
 
2558
+
 
2559
+   Pass named __128int argument on stack.  */
 
2560
+
 
2561
+/* { dg-do run { target aarch64*-*-* } } */
 
2562
+
 
2563
+#ifndef IN_FRAMEWORK
 
2564
+#define AAPCS64_TEST_STDARG
 
2565
+#define TESTFILE "va_arg-15.c"
 
2566
+#include "type-def.h"
 
2567
+
 
2568
+union int128_t qword;
 
2569
+
 
2570
+#define HAS_DATA_INIT_FUNC
 
2571
+void
 
2572
+init_data ()
 
2573
+{
 
2574
+  /* Init signed quad-word integer.  */
 
2575
+  qword.l64 = 0xfdb9753102468aceLL;
 
2576
+  qword.h64 = 0xeca8642013579bdfLL;
 
2577
+}
 
2578
+
 
2579
+#include "abitest.h"
 
2580
+#else
 
2581
+  ARG (int, 1, W0, 0)
 
2582
+  ARG (int, 2, W1, 1)
 
2583
+  ARG (int, 3, W2, 2)
 
2584
+  ARG (int, 4, W3, 3)
 
2585
+  ARG (int, 5, W4, 4)
 
2586
+  ARG (int, 6, W5, 5)
 
2587
+  ARG (int, 7, W6, 6)
 
2588
+  ARG (__int128, qword.i, STACK, LAST_NAMED_ARG_ID)
 
2589
+  DOTS
 
2590
+#ifndef __AAPCS64_BIG_ENDIAN__
 
2591
+  LAST_ANON (int, 8, STACK + 16, 8)
 
2592
+#else
 
2593
+  LAST_ANON (int, 8, STACK + 20, 8)
 
2594
+#endif
 
2595
+#endif
 
2596
Index: gcc/testsuite/gcc.target/avr/torture/pr61443.c
 
2597
===================================================================
 
2598
--- a/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c        (.../tags/gcc_4_8_3_release)
 
2599
+++ b/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c        (.../branches/gcc-4_8-branch)
 
2600
@@ -0,0 +1,134 @@
 
2601
+/* { dg-do run } */
 
2602
+/* { dg-options "-std=gnu99" } */
 
2603
+
 
2604
+#include <stdlib.h>
 
2605
+#include <stdarg.h>
 
2606
+
 
2607
+#define NC __attribute__((noinline,noclone))
 
2608
+
 
2609
+void NC vfun (char n, ...)
 
2610
+{
 
2611
+  va_list ap;
 
2612
+
 
2613
+  va_start (ap, n);
 
2614
+
 
2615
+  switch (n)
 
2616
+    {
 
2617
+    default:
 
2618
+      abort();
 
2619
+    case 1:
 
2620
+      if (11 != va_arg (ap, int))
 
2621
+        abort();
 
2622
+      break;
 
2623
+    case 2:
 
2624
+      if (2222 != va_arg (ap, int))
 
2625
+        abort();
 
2626
+      break;
 
2627
+    case 3:
 
2628
+      if (333333 != va_arg (ap, __int24))
 
2629
+        abort();
 
2630
+      break;
 
2631
+    case 4:
 
2632
+      if (44444444 != va_arg (ap, long))
 
2633
+        abort();
 
2634
+      break;
 
2635
+    case 8:
 
2636
+      if (8888888888888888 != va_arg (ap, long long))
 
2637
+        abort();
 
2638
+      break;
 
2639
+    }
 
2640
+
 
2641
+  va_end (ap);
 
2642
+}
 
2643
+
 
2644
+
 
2645
+void NC boo_qi (const __flash char *p)
 
2646
+{
 
2647
+  vfun (1, *p);
 
2648
+}
 
2649
+
 
2650
+void NC boox_qi (const __memx char *p)
 
2651
+{
 
2652
+  vfun (1, *p);
 
2653
+}
 
2654
+
 
2655
+void NC boo_hi (const __flash int *p)
 
2656
+{
 
2657
+  vfun (2, *p);
 
2658
+}
 
2659
+
 
2660
+void NC boox_hi (const __memx int *p)
 
2661
+{
 
2662
+  vfun (2, *p);
 
2663
+}
 
2664
+
 
2665
+void NC boo_psi (const __flash __int24 *p)
 
2666
+{
 
2667
+  vfun (3, *p);
 
2668
+}
 
2669
+
 
2670
+void NC boox_psi (const __memx __int24 *p)
 
2671
+{
 
2672
+  vfun (3, *p);
 
2673
+}
 
2674
+
 
2675
+void NC boo_si (const __flash long *p)
 
2676
+{
 
2677
+  vfun (4, *p);
 
2678
+}
 
2679
+
 
2680
+void NC boox_si (const __memx long *p)
 
2681
+{
 
2682
+  vfun (4, *p);
 
2683
+}
 
2684
+
 
2685
+void NC boo_di (const __flash long long *p)
 
2686
+{
 
2687
+  vfun (8, *p);
 
2688
+}
 
2689
+
 
2690
+void NC boox_di (const __memx long long *p)
 
2691
+{
 
2692
+  vfun (8, *p);
 
2693
+}
 
2694
+
 
2695
+const __flash char f_qi = 11;
 
2696
+const __flash int f_hi = 2222;
 
2697
+const __flash __int24 f_psi = 333333;
 
2698
+const __flash long f_si = 44444444;
 
2699
+const __flash long long f_di = 8888888888888888;
 
2700
+
 
2701
+const __memx char x_qi = 11;
 
2702
+const __memx int x_hi = 2222;
 
2703
+const __memx __int24 x_psi = 333333;
 
2704
+const __memx long x_si = 44444444;
 
2705
+const __memx long long x_di = 8888888888888888;
 
2706
+
 
2707
+char r_qi = 11;
 
2708
+int r_hi = 2222;
 
2709
+__int24 r_psi = 333333;
 
2710
+long r_si = 44444444;
 
2711
+long long r_di = 8888888888888888;
 
2712
+
 
2713
+int main (void)
 
2714
+{
 
2715
+  boo_qi (&f_qi);
 
2716
+  boo_hi (&f_hi);
 
2717
+  boo_psi (&f_psi);
 
2718
+  boo_si (&f_si);
 
2719
+  boo_di (&f_di);
 
2720
+
 
2721
+  boox_qi (&x_qi);
 
2722
+  boox_hi (&x_hi);
 
2723
+  boox_psi (&x_psi);
 
2724
+  boox_si (&x_si);
 
2725
+  boox_di (&x_di);
 
2726
+
 
2727
+  boox_qi (&r_qi);
 
2728
+  boox_hi (&r_hi);
 
2729
+  boox_psi (&r_psi);
 
2730
+  boox_si (&r_si);
 
2731
+  boox_di (&r_di);
 
2732
+
 
2733
+  exit (0);
 
2734
+}
 
2735
Index: gcc/testsuite/gcc.target/i386/pr61923.c
 
2736
===================================================================
 
2737
--- a/src/gcc/testsuite/gcc.target/i386/pr61923.c       (.../tags/gcc_4_8_3_release)
 
2738
+++ b/src/gcc/testsuite/gcc.target/i386/pr61923.c       (.../branches/gcc-4_8-branch)
 
2739
@@ -0,0 +1,36 @@
 
2740
+/* PR debug/61923 */
 
2741
+/* { dg-do compile } */
 
2742
+/* { dg-options "-O2 -fcompare-debug" } */
 
2743
+
 
2744
+typedef struct
 
2745
+{
 
2746
+  struct
 
2747
+  {
 
2748
+    struct
 
2749
+    {
 
2750
+      char head;
 
2751
+    } tickets;
 
2752
+  };
 
2753
+} arch_spinlock_t;
 
2754
+struct ext4_map_blocks
 
2755
+{
 
2756
+  int m_lblk;
 
2757
+  int m_len;
 
2758
+  int m_flags;
 
2759
+};
 
2760
+int ext4_da_map_blocks_ei_0;
 
2761
+void fn1 (int p1, struct ext4_map_blocks *p2)
 
2762
+{
 
2763
+  int ret;
 
2764
+  if (p2->m_flags)
 
2765
+    {
 
2766
+      ext4_da_map_blocks_ei_0++;
 
2767
+      arch_spinlock_t *lock;
 
2768
+      switch (sizeof *&lock->tickets.head)
 
2769
+      case 1:
 
2770
+      asm("" : "+m"(*&lock->tickets.head) : ""(0));
 
2771
+      __asm__("");
 
2772
+      ret = 0;
 
2773
+    }
 
2774
+  fn2 (p2->m_lblk, p2->m_len);
 
2775
+}
 
2776
Index: gcc/testsuite/gcc.target/i386/pr61423.c
 
2777
===================================================================
 
2778
--- a/src/gcc/testsuite/gcc.target/i386/pr61423.c       (.../tags/gcc_4_8_3_release)
 
2779
+++ b/src/gcc/testsuite/gcc.target/i386/pr61423.c       (.../branches/gcc-4_8-branch)
 
2780
@@ -0,0 +1,38 @@
 
2781
+/* PR target/61423 */
 
2782
+/* { dg-do run { target ia32 } } */
 
2783
+/* { dg-options "-O1 -ftree-vectorize -msse2 -mfpmath=387 -mtune=core2" } */
 
2784
+
 
2785
+#define N 1024
 
2786
+static unsigned int A[N];
 
2787
+
 
2788
+double
 
2789
+__attribute__((noinline))
 
2790
+func (void)
 
2791
+{
 
2792
+  unsigned int sum = 0;
 
2793
+  unsigned i;
 
2794
+  double t;
 
2795
+
 
2796
+  for (i = 0; i < N; i++)
 
2797
+    sum += A[i];
 
2798
+
 
2799
+  t = sum;
 
2800
+  return t;
 
2801
+}
 
2802
+
 
2803
+int
 
2804
+main ()
 
2805
+{
 
2806
+  unsigned i;
 
2807
+  double d;
 
2808
+
 
2809
+  for(i = 0; i < N; i++)
 
2810
+    A[i] = 1;
 
2811
+
 
2812
+  d = func();
 
2813
+
 
2814
+  if (d != 1024.0)
 
2815
+    __builtin_abort ();
 
2816
+
 
2817
+  return 0;
 
2818
+}
 
2819
Index: gcc/testsuite/gcc.target/i386/pr60901.c
 
2820
===================================================================
 
2821
--- a/src/gcc/testsuite/gcc.target/i386/pr60901.c       (.../tags/gcc_4_8_3_release)
 
2822
+++ b/src/gcc/testsuite/gcc.target/i386/pr60901.c       (.../branches/gcc-4_8-branch)
 
2823
@@ -0,0 +1,17 @@
 
2824
+/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts"  } */
 
2825
+
 
2826
+extern int n;
 
2827
+extern void bar (void);
 
2828
+extern int baz (int);
 
2829
+
 
2830
+void
 
2831
+foo (void)
 
2832
+{
 
2833
+  int i, j;
 
2834
+  for (j = 0; j < n; j++)
 
2835
+    {
 
2836
+      for (i = 1; i < j; i++)
 
2837
+       bar ();
 
2838
+      baz (0);
 
2839
+    }
 
2840
+}
 
2841
Index: gcc/testsuite/gcc.target/i386/pr61801.c
 
2842
===================================================================
 
2843
--- a/src/gcc/testsuite/gcc.target/i386/pr61801.c       (.../tags/gcc_4_8_3_release)
 
2844
+++ b/src/gcc/testsuite/gcc.target/i386/pr61801.c       (.../branches/gcc-4_8-branch)
 
2845
@@ -0,0 +1,21 @@
 
2846
+/* PR rtl-optimization/61801 */
 
2847
+/* { dg-do compile } */
 
2848
+/* { dg-options "-Os -fcompare-debug" } */
 
2849
+
 
2850
+int a, c;
 
2851
+int bar (void);
 
2852
+void baz (void);
 
2853
+
 
2854
+void
 
2855
+foo (void)
 
2856
+{
 
2857
+  int d;
 
2858
+  if (bar ())
 
2859
+    {
 
2860
+      int e;
 
2861
+      baz ();
 
2862
+      asm volatile ("" : "=a" (e) : "0" (a), "i" (0));
 
2863
+      d = e;
 
2864
+    }
 
2865
+  c = d;
 
2866
+}
 
2867
Index: gcc/testsuite/gcc.target/i386/pr61446.c
 
2868
===================================================================
 
2869
--- a/src/gcc/testsuite/gcc.target/i386/pr61446.c       (.../tags/gcc_4_8_3_release)
 
2870
+++ b/src/gcc/testsuite/gcc.target/i386/pr61446.c       (.../branches/gcc-4_8-branch)
 
2871
@@ -0,0 +1,14 @@
 
2872
+/* PR rtl-optimization/61446 */
 
2873
+
 
2874
+/* { dg-do compile { target { ia32 } } } */
 
2875
+/* { dg-options "-O2 -march=corei7 -mfpmath=387" } */
 
2876
+
 
2877
+unsigned long long
 
2878
+foo (float a)
 
2879
+{
 
2880
+  const double dfa = a;
 
2881
+  const unsigned int hi = dfa / 0x1p32f;
 
2882
+  const unsigned int lo = dfa - (double) hi * 0x1p32f;
 
2883
+
 
2884
+  return ((unsigned long long) hi << (4 * (8))) | lo;
 
2885
+}
 
2886
Index: gcc/testsuite/gcc.target/mips/pr62030-octeon.c
 
2887
===================================================================
 
2888
--- a/src/gcc/testsuite/gcc.target/mips/pr62030-octeon.c        (.../tags/gcc_4_8_3_release)
 
2889
+++ b/src/gcc/testsuite/gcc.target/mips/pr62030-octeon.c        (.../branches/gcc-4_8-branch)
 
2890
@@ -0,0 +1,50 @@
 
2891
+/* { dg-do run } */
 
2892
+/* { dg-options "-march=octeon" } */
 
2893
+
 
2894
+extern void abort (void);
 
2895
+
 
2896
+struct node
 
2897
+{
 
2898
+  struct node *next;
 
2899
+  struct node *prev;
 
2900
+};
 
2901
+
 
2902
+struct node node;
 
2903
+
 
2904
+struct head
 
2905
+{
 
2906
+  struct node *first;
 
2907
+};
 
2908
+
 
2909
+struct head heads[5];
 
2910
+
 
2911
+int k = 2;
 
2912
+
 
2913
+struct head *head = &heads[2];
 
2914
+
 
2915
+static int __attribute__((noinline))
 
2916
+foo (void)
 
2917
+{
 
2918
+  node.prev = (void *)head;
 
2919
+  head->first = &node;
 
2920
+
 
2921
+  struct node *n = head->first;
 
2922
+  struct head *h = &heads[k];
 
2923
+  struct node *next = n->next;
 
2924
+
 
2925
+  if (n->prev == (void *)h)
 
2926
+    h->first = next;
 
2927
+  else
 
2928
+    n->prev->next = next;
 
2929
+
 
2930
+  n->next = h->first;
 
2931
+  return n->next == &node;
 
2932
+}
 
2933
+
 
2934
+int
 
2935
+main (void)
 
2936
+{
 
2937
+  if (foo ())
 
2938
+    abort ();
 
2939
+  return 0;
 
2940
+}
 
2941
Index: gcc/testsuite/gcc.target/sh/pr61996.c
 
2942
===================================================================
 
2943
--- a/src/gcc/testsuite/gcc.target/sh/pr61996.c (.../tags/gcc_4_8_3_release)
 
2944
+++ b/src/gcc/testsuite/gcc.target/sh/pr61996.c (.../branches/gcc-4_8-branch)
 
2945
@@ -0,0 +1,12 @@
 
2946
+/* Check that the option -musermode has no effect on targets that do not
 
2947
+   support user/privileged mode and that it does not interfere with option
 
2948
+   -matomic-model=soft-imask.  */
 
2949
+/* { dg-do compile }  */
 
2950
+/* { dg-options "-matomic-model=soft-imask" }  */
 
2951
+/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m1*" "-m2*" } }  */
 
2952
+
 
2953
+int
 
2954
+test (void)
 
2955
+{
 
2956
+  return 0;
 
2957
+}
 
2958
Index: gcc/testsuite/lib/target-supports.exp
 
2959
===================================================================
 
2960
--- a/src/gcc/testsuite/lib/target-supports.exp (.../tags/gcc_4_8_3_release)
 
2961
+++ b/src/gcc/testsuite/lib/target-supports.exp (.../branches/gcc-4_8-branch)
 
2962
@@ -1790,6 +1790,15 @@
 
2963
     }]
 
2964
 }
 
2965
 
 
2966
+# Return 1 if the target supports long double of 128 bits,
 
2967
+# 0 otherwise.
 
2968
+
 
2969
+proc check_effective_target_longdouble128 { } {
 
2970
+    return [check_no_compiler_messages longdouble128 object {
 
2971
+       int dummy[sizeof(long double) == 16 ? 1 : -1];
 
2972
+    }]
 
2973
+}
 
2974
+
 
2975
 # Return 1 if the target supports double of 64 bits,
 
2976
 # 0 otherwise.
 
2977
 
 
2978
Index: gcc/testsuite/gfortran.dg/default_format_denormal_2.f90
 
2979
===================================================================
 
2980
--- a/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90       (.../tags/gcc_4_8_3_release)
 
2981
+++ b/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90       (.../branches/gcc-4_8-branch)
 
2982
@@ -1,6 +1,6 @@
 
2983
 ! { dg-require-effective-target fortran_large_real }
 
2984
-! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } }
 
2985
-! Test XFAILed on these platforms because the system's printf() lacks
 
2986
+! { dg-do run { xfail powerpc*-apple-darwin* } }
 
2987
+! Test XFAILed on this platform because the system's printf() lacks
 
2988
 ! proper support for denormalized long doubles. See PR24685
 
2989
 !
 
2990
 ! This tests that the default formats for formatted I/O of reals are
 
2991
Index: gcc/testsuite/gfortran.dg/dot_product_3.f90
 
2992
===================================================================
 
2993
--- a/src/gcc/testsuite/gfortran.dg/dot_product_3.f90   (.../tags/gcc_4_8_3_release)
 
2994
+++ b/src/gcc/testsuite/gfortran.dg/dot_product_3.f90   (.../branches/gcc-4_8-branch)
 
2995
@@ -0,0 +1,15 @@
 
2996
+! { dg-do compile }
 
2997
+! { dg-options "-fdump-tree-original" }
 
2998
+! PR 61999 - this used to ICE.
 
2999
+! Original test case by A. Kasahara
 
3000
+program main
 
3001
+   use, intrinsic:: iso_fortran_env, only: output_unit
 
3002
+
 
3003
+   implicit none
 
3004
+
 
3005
+   write(output_unit, *) dot_product([1, 2], [2.0, 3.0])
 
3006
+
 
3007
+   stop
 
3008
+end program main
 
3009
+! { dg-final { scan-tree-dump-times "8\\.0e\\+0" 1 "original" } }
 
3010
+! { dg-final { cleanup-tree-dump "original" } }
 
3011
Index: gcc/testsuite/gfortran.dg/cray_pointers_10.f90
 
3012
===================================================================
 
3013
--- a/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90        (.../tags/gcc_4_8_3_release)
 
3014
+++ b/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90        (.../branches/gcc-4_8-branch)
 
3015
@@ -0,0 +1,18 @@
 
3016
+! { dg-do run }
 
3017
+! { dg-options "-fcray-pointer" }
 
3018
+!
 
3019
+! PR fortran/45187
 
3020
+!
 
3021
+module foo
 
3022
+  implicit none
 
3023
+  real :: a
 
3024
+  pointer(c_a, a)
 
3025
+end module foo
 
3026
+
 
3027
+program test
 
3028
+  use foo
 
3029
+  real :: z
 
3030
+  c_a = loc(z)
 
3031
+  a = 42
 
3032
+  if (z /= 42) call abort
 
3033
+end program test
 
3034
Index: gcc/testsuite/gfortran.dg/dependency_44.f90
 
3035
===================================================================
 
3036
--- a/src/gcc/testsuite/gfortran.dg/dependency_44.f90   (.../tags/gcc_4_8_3_release)
 
3037
+++ b/src/gcc/testsuite/gfortran.dg/dependency_44.f90   (.../branches/gcc-4_8-branch)
 
3038
@@ -0,0 +1,36 @@
 
3039
+! { dg-do run }
 
3040
+! Tests fix for PR61780 in which the loop reversal mechanism was
 
3041
+! not accounting for the first index being an element so that no
 
3042
+! loop in this dimension is created.
 
3043
+!
 
3044
+! Contributed by Manfred Tietze on clf.
 
3045
+!
 
3046
+program prgm3
 
3047
+    implicit none
 
3048
+    integer, parameter :: n = 10, k = 3
 
3049
+    integer :: i, j
 
3050
+    integer, dimension(n,n) :: y
 
3051
+    integer :: res1(n), res2(n)
 
3052
+
 
3053
+1   format(10i5)
 
3054
+
 
3055
+!initialize
 
3056
+    do i=1,n
 
3057
+        do j=1,n
 
3058
+            y(i,j) = n*i + j
 
3059
+        end do
 
3060
+    end do
 
3061
+    res2 = y(k,:)
 
3062
+
 
3063
+!shift right
 
3064
+    y(k,4:n) = y(k,3:n-1)
 
3065
+    y(k,3) = 0
 
3066
+    res1 = y(k,:)
 
3067
+    y(k,:) = res2
 
3068
+    y(k,n:4:-1) = y(k,n-1:3:-1)
 
3069
+    y(k,3) = 0
 
3070
+    res2 = y(k,:)
 
3071
+!    print *, res1
 
3072
+!    print *, res2
 
3073
+    if (any(res1 /= res2)) call abort ()
 
3074
+end program prgm3
 
3075
Index: gcc/testsuite/gfortran.dg/oldstyle_5.f
 
3076
===================================================================
 
3077
--- a/src/gcc/testsuite/gfortran.dg/oldstyle_5.f        (.../tags/gcc_4_8_3_release)
 
3078
+++ b/src/gcc/testsuite/gfortran.dg/oldstyle_5.f        (.../branches/gcc-4_8-branch)
 
3079
@@ -0,0 +1,8 @@
 
3080
+C { dg-do compile }
 
3081
+      TYPE T
 
3082
+      INTEGER A(2)/1,2/ ! { dg-error "Invalid old style initialization for derived type component" }
 
3083
+      END TYPE
 
3084
+      TYPE S
 
3085
+      INTEGER B/1/ ! { dg-error "Invalid old style initialization for derived type component" }
 
3086
+      END TYPE
 
3087
+      END
 
3088
Index: gcc/testsuite/gfortran.dg/nint_2.f90
 
3089
===================================================================
 
3090
--- a/src/gcc/testsuite/gfortran.dg/nint_2.f90  (.../tags/gcc_4_8_3_release)
 
3091
+++ b/src/gcc/testsuite/gfortran.dg/nint_2.f90  (.../branches/gcc-4_8-branch)
 
3092
@@ -4,7 +4,8 @@
 
3093
 ! http://gcc.gnu.org/ml/fortran/2005-04/msg00139.html
 
3094
 !
 
3095
 ! { dg-do run }
 
3096
-! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc*-*-linux* *-*-mingw* } { "-O0" } { "" } }
 
3097
+! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc-*-linux* powerpc64-*-linux* *-*-mingw* } { "-O0" } { "" } }
 
3098
+! Note that this doesn't fail on powerpc64le-*-linux*.
 
3099
   real(kind=8) :: a
 
3100
   integer(kind=8) :: i1, i2
 
3101
   real :: b
 
3102
Index: gcc/testsuite/gfortran.dg/pointer_intent_7.f90
 
3103
===================================================================
 
3104
--- a/src/gcc/testsuite/gfortran.dg/pointer_intent_7.f90        (.../tags/gcc_4_8_3_release)
 
3105
+++ b/src/gcc/testsuite/gfortran.dg/pointer_intent_7.f90        (.../branches/gcc-4_8-branch)
 
3106
@@ -23,7 +23,7 @@
 
3107
     call bar2 (c)
 
3108
     call bar3 (c)
 
3109
     call bar2p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
 
3110
-    call bar3p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
 
3111
+    call bar3p (b) ! { dg-error "Actual argument to .n. at \\(1\\) must be polymorphic" }
 
3112
     call bar2p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
 
3113
     call bar3p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
 
3114
   end subroutine
 
3115
Index: gcc/testsuite/gfortran.dg/array_assignment_5.f90
 
3116
===================================================================
 
3117
--- a/src/gcc/testsuite/gfortran.dg/array_assignment_5.f90      (.../tags/gcc_4_8_3_release)
 
3118
+++ b/src/gcc/testsuite/gfortran.dg/array_assignment_5.f90      (.../branches/gcc-4_8-branch)
 
3119
@@ -0,0 +1,16 @@
 
3120
+! { dg-do run }
 
3121
+! { dg-options "-ffrontend-optimize" }
 
3122
+! PR 62214 - this used to give the wrong result.
 
3123
+! Original test case by Oliver Fuhrer
 
3124
+PROGRAM test
 
3125
+  IMPLICIT NONE
 
3126
+  CHARACTER(LEN=20)   :: fullNames(2)
 
3127
+  CHARACTER(LEN=255)  :: pathName
 
3128
+  CHARACTER(LEN=5)    :: fileNames(2)
 
3129
+  
 
3130
+  pathName = "/dir1/dir2/"
 
3131
+  fileNames = (/ "file1", "file2" /)
 
3132
+  fullNames = SPREAD(TRIM(pathName),1,2) // fileNames
 
3133
+  if (fullNames(1) /= '/dir1/dir2/file1' .or. &
 
3134
+       & fullnames(2) /= '/dir1/dir2/file2') call abort
 
3135
+END PROGRAM test
 
3136
Index: gcc/testsuite/gfortran.dg/pr45636.f90
 
3137
===================================================================
 
3138
--- a/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../tags/gcc_4_8_3_release)
 
3139
+++ b/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../branches/gcc-4_8-branch)
 
3140
@@ -10,5 +10,5 @@
 
3141
   b = y
 
3142
   call sub(a, b)
 
3143
 end program main
 
3144
-! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { mips*-*-* && { ! nomips16 } } } } }
 
3145
+! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { { hppa*-*-* && { ! lp64 } } || { mips*-*-* && { ! nomips16 } } } } } }
 
3146
 ! { dg-final { cleanup-tree-dump "forwprop2" } }
 
3147
Index: gcc/testsuite/gfortran.dg/allocatable_function_8.f90
 
3148
===================================================================
 
3149
--- a/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90  (.../tags/gcc_4_8_3_release)
 
3150
+++ b/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90  (.../branches/gcc-4_8-branch)
 
3151
@@ -0,0 +1,47 @@
 
3152
+! { dg-do run }
 
3153
+! Test the fix for PR61459.
 
3154
+!
 
3155
+! Contributed by John Wingate  <johnww@tds.net>
 
3156
+!
 
3157
+module a
 
3158
+
 
3159
+   implicit none
 
3160
+   private
 
3161
+   public :: f_segfault, f_segfault_plus, f_workaround
 
3162
+   integer, dimension(2,2) :: b = reshape([1,-1,1,1],[2,2])
 
3163
+
 
3164
+contains
 
3165
+
 
3166
+   function f_segfault(x)
 
3167
+      real, dimension(:), allocatable :: f_segfault
 
3168
+      real, dimension(:), intent(in)  :: x
 
3169
+      allocate(f_segfault(2))
 
3170
+      f_segfault = matmul(b,x)
 
3171
+   end function f_segfault
 
3172
+
 
3173
+! Sefaulted without the ALLOCATE as well.
 
3174
+   function f_segfault_plus(x)
 
3175
+      real, dimension(:), allocatable :: f_segfault_plus
 
3176
+      real, dimension(:), intent(in)  :: x
 
3177
+      f_segfault_plus = matmul(b,x)
 
3178
+   end function f_segfault_plus
 
3179
+
 
3180
+   function f_workaround(x)
 
3181
+      real, dimension(:), allocatable :: f_workaround
 
3182
+      real, dimension(:), intent(in)  :: x
 
3183
+      real, dimension(:), allocatable :: tmp
 
3184
+      allocate(f_workaround(2),tmp(2))
 
3185
+      tmp = matmul(b,x)
 
3186
+      f_workaround = tmp
 
3187
+   end function f_workaround
 
3188
+
 
3189
+end module a
 
3190
+
 
3191
+program main
 
3192
+   use a
 
3193
+   implicit none
 
3194
+   real, dimension(2) :: x = 1.0, y
 
3195
+   y = f_workaround (x)
 
3196
+   if (any (f_segfault (x) .ne. y)) call abort
 
3197
+   if (any (f_segfault_plus (x) .ne. y)) call abort
 
3198
+end program main
 
3199
Index: gcc/testsuite/gfortran.dg/bessel_7.f90
 
3200
===================================================================
 
3201
--- a/src/gcc/testsuite/gfortran.dg/bessel_7.f90        (.../tags/gcc_4_8_3_release)
 
3202
+++ b/src/gcc/testsuite/gfortran.dg/bessel_7.f90        (.../branches/gcc-4_8-branch)
 
3203
@@ -16,7 +16,7 @@
 
3204
 implicit none
 
3205
 real,parameter :: values(*) = [0.0, 0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78] 
 
3206
 real,parameter :: myeps(size(values)) = epsilon(0.0) &
 
3207
-                  * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ]
 
3208
+                  * [2, 3, 4, 5, 8, 2, 13, 6, 7, 6, 36, 168 ]
 
3209
 ! The following is sufficient for me - the values above are a bit
 
3210
 ! more tolerant
 
3211
 !                  * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ]
 
3212
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-1.c
 
3213
===================================================================
 
3214
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c       (.../tags/gcc_4_8_3_release)
 
3215
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c       (.../branches/gcc-4_8-branch)
 
3216
@@ -0,0 +1,39 @@
 
3217
+#ifdef __INT32_TYPE__
 
3218
+typedef __INT32_TYPE__ int32_t;
 
3219
+#else
 
3220
+typedef int int32_t;
 
3221
+#endif
 
3222
+
 
3223
+#ifdef __UINT32_TYPE__
 
3224
+typedef __UINT32_TYPE__ uint32_t;
 
3225
+#else
 
3226
+typedef unsigned uint32_t;
 
3227
+#endif
 
3228
+
 
3229
+#define __fake_const_swab32(x) ((uint32_t)(                  \
 
3230
+       (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) |    \
 
3231
+       (((uint32_t)(x) & (uint32_t)0x0000ff00UL) <<  8) |    \
 
3232
+       (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >>  8) |    \
 
3233
+       (( (int32_t)(x) &  (int32_t)0xff000000UL) >> 24)))
 
3234
+
 
3235
+/* Previous version of bswap optimization failed to consider sign extension
 
3236
+   and as a result would replace an expression *not* doing a bswap by a
 
3237
+   bswap.  */
 
3238
+
 
3239
+__attribute__ ((noinline, noclone)) uint32_t
 
3240
+fake_bswap32 (uint32_t in)
 
3241
+{
 
3242
+  return __fake_const_swab32 (in);
 
3243
+}
 
3244
+
 
3245
+int
 
3246
+main(void)
 
3247
+{
 
3248
+  if (sizeof (int32_t) * __CHAR_BIT__ != 32)
 
3249
+    return 0;
 
3250
+  if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
 
3251
+    return 0;
 
3252
+  if (fake_bswap32 (0x87654321) != 0xffffff87)
 
3253
+    __builtin_abort ();
 
3254
+  return 0;
 
3255
+}
 
3256
Index: gcc/testsuite/gcc.c-torture/execute/pr23135.x
 
3257
===================================================================
 
3258
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../tags/gcc_4_8_3_release)
 
3259
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../branches/gcc-4_8-branch)
 
3260
@@ -0,0 +1,2 @@
 
3261
+set additional_flags "-Wno-psabi"
 
3262
+return 0
 
3263
Index: gcc/testsuite/gcc.c-torture/execute/bitfld-6.c
 
3264
===================================================================
 
3265
--- a/src/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c        (.../tags/gcc_4_8_3_release)
 
3266
+++ b/src/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c        (.../branches/gcc-4_8-branch)
 
3267
@@ -0,0 +1,23 @@
 
3268
+union U
 
3269
+{
 
3270
+  const int a;
 
3271
+  unsigned b : 20;
 
3272
+};
 
3273
+
 
3274
+static union U u = { 0x12345678 };
 
3275
+
 
3276
+/* Constant folding used to fail to account for endianness when folding a
 
3277
+   union.  */
 
3278
+
 
3279
+int
 
3280
+main (void)
 
3281
+{
 
3282
+#ifdef __BYTE_ORDER__
 
3283
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 
3284
+  return u.b - 0x45678;
 
3285
+#else
 
3286
+  return u.b - 0x12345;
 
3287
+#endif
 
3288
+#endif
 
3289
+  return 0;
 
3290
+}
 
3291
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-3.c
 
3292
===================================================================
 
3293
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c       (.../tags/gcc_4_8_3_release)
 
3294
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c       (.../branches/gcc-4_8-branch)
 
3295
@@ -0,0 +1,13 @@
 
3296
+short a = -1;
 
3297
+int b;
 
3298
+char c;
 
3299
+
 
3300
+int
 
3301
+main ()
 
3302
+{
 
3303
+  c = a;
 
3304
+  b = a | c;
 
3305
+  if (b != -1)
 
3306
+    __builtin_abort ();
 
3307
+  return 0;
 
3308
+}
 
3309
Index: gcc/testsuite/gcc.c-torture/execute/20050604-1.x
 
3310
===================================================================
 
3311
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x      (.../tags/gcc_4_8_3_release)
 
3312
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x      (.../branches/gcc-4_8-branch)
 
3313
@@ -6,4 +6,5 @@
 
3314
        set additional_flags "-mno-mmx"
 
3315
 }
 
3316
 
 
3317
+set additional_flags "-Wno-psabi"
 
3318
 return 0
 
3319
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-2.c
 
3320
===================================================================
 
3321
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c       (.../tags/gcc_4_8_3_release)
 
3322
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c       (.../branches/gcc-4_8-branch)
 
3323
@@ -0,0 +1,40 @@
 
3324
+#ifdef __INT16_TYPE__
 
3325
+typedef __INT16_TYPE__ int16_t;
 
3326
+#else
 
3327
+typedef short int16_t;
 
3328
+#endif
 
3329
+
 
3330
+#ifdef __UINT32_TYPE__
 
3331
+typedef __UINT32_TYPE__ uint32_t;
 
3332
+#else
 
3333
+typedef unsigned uint32_t;
 
3334
+#endif
 
3335
+
 
3336
+#define __fake_const_swab32(x) ((uint32_t)(                          \
 
3337
+       (((uint32_t)         (x) & (uint32_t)0x000000ffUL) << 24) |   \
 
3338
+       (((uint32_t)(int16_t)(x) & (uint32_t)0x00ffff00UL) <<  8) |   \
 
3339
+       (((uint32_t)         (x) & (uint32_t)0x00ff0000UL) >>  8) |   \
 
3340
+       (((uint32_t)         (x) & (uint32_t)0xff000000UL) >> 24)))
 
3341
+
 
3342
+
 
3343
+/* Previous version of bswap optimization failed to consider sign extension
 
3344
+   and as a result would replace an expression *not* doing a bswap by a
 
3345
+   bswap.  */
 
3346
+
 
3347
+__attribute__ ((noinline, noclone)) uint32_t
 
3348
+fake_bswap32 (uint32_t in)
 
3349
+{
 
3350
+  return __fake_const_swab32 (in);
 
3351
+}
 
3352
+
 
3353
+int
 
3354
+main(void)
 
3355
+{
 
3356
+  if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
 
3357
+    return 0;
 
3358
+  if (sizeof (int16_t) * __CHAR_BIT__ != 16)
 
3359
+    return 0;
 
3360
+  if (fake_bswap32 (0x81828384) != 0xff838281)
 
3361
+    __builtin_abort ();
 
3362
+  return 0;
 
3363
+}
 
3364
Index: gcc/testsuite/gcc.c-torture/execute/pr61375.c
 
3365
===================================================================
 
3366
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../tags/gcc_4_8_3_release)
 
3367
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../branches/gcc-4_8-branch)
 
3368
@@ -0,0 +1,35 @@
 
3369
+#ifdef __UINT64_TYPE__
 
3370
+typedef __UINT64_TYPE__ uint64_t;
 
3371
+#else
 
3372
+typedef unsigned long long uint64_t;
 
3373
+#endif
 
3374
+
 
3375
+#ifndef __SIZEOF_INT128__
 
3376
+#define __int128 long long
 
3377
+#endif
 
3378
+
 
3379
+/* Some version of bswap optimization would ICE when analyzing a mask constant
 
3380
+   too big for an HOST_WIDE_INT (PR61375).  */
 
3381
+
 
3382
+__attribute__ ((noinline, noclone)) uint64_t
 
3383
+uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2)
 
3384
+{
 
3385
+  __int128 mask = (__int128)0xffff << 56;
 
3386
+  return ((in1 & mask) >> 56) | in2;
 
3387
+}
 
3388
+
 
3389
+int
 
3390
+main (int argc)
 
3391
+{
 
3392
+  __int128 in = 1;
 
3393
+#ifdef __SIZEOF_INT128__
 
3394
+  in <<= 64;
 
3395
+#endif
 
3396
+  if (sizeof (uint64_t) * __CHAR_BIT__ != 64)
 
3397
+    return 0;
 
3398
+  if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128)
 
3399
+    return 0;
 
3400
+  if (uint128_central_bitsi_ior (in, 2) != 0x102)
 
3401
+    __builtin_abort ();
 
3402
+  return 0;
 
3403
+}
 
3404
Index: gcc/testsuite/gcc.c-torture/execute/20050316-1.x
 
3405
===================================================================
 
3406
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x      (.../tags/gcc_4_8_3_release)
 
3407
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x      (.../branches/gcc-4_8-branch)
 
3408
@@ -4,4 +4,5 @@
 
3409
        return 1
 
3410
 }
 
3411
 
 
3412
+set additional_flags "-Wno-psabi"
 
3413
 return 0;
 
3414
Index: gcc/testsuite/gcc.c-torture/execute/20050316-3.x
 
3415
===================================================================
 
3416
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x      (.../tags/gcc_4_8_3_release)
 
3417
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x      (.../branches/gcc-4_8-branch)
 
3418
@@ -0,0 +1,2 @@
 
3419
+set additional_flags "-Wno-psabi"
 
3420
+return 0
 
3421
Index: gcc/testsuite/gcc.c-torture/compile/pr61684.c
 
3422
===================================================================
 
3423
--- a/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../tags/gcc_4_8_3_release)
 
3424
+++ b/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../branches/gcc-4_8-branch)
 
3425
@@ -0,0 +1,15 @@
 
3426
+/* PR tree-optimization/61684 */
 
3427
+
 
3428
+int a, c;
 
3429
+static int *b = 0;
 
3430
+short d;
 
3431
+static short **e = 0;
 
3432
+
 
3433
+void
 
3434
+foo ()
 
3435
+{
 
3436
+  for (; c < 1; c++)
 
3437
+    ;
 
3438
+  *e = &d;
 
3439
+  a = d && (c && 1) & *b;
 
3440
+}
 
3441
Index: gcc/testsuite/gcc.c-torture/compile/pr63282.c
 
3442
===================================================================
 
3443
--- a/src/gcc/testsuite/gcc.c-torture/compile/pr63282.c (.../tags/gcc_4_8_3_release)
 
3444
+++ b/src/gcc/testsuite/gcc.c-torture/compile/pr63282.c (.../branches/gcc-4_8-branch)
 
3445
@@ -0,0 +1,13 @@
 
3446
+/* PR inline-asm/63282 */
 
3447
+
 
3448
+void bar (void);
 
3449
+
 
3450
+void
 
3451
+foo (void)
 
3452
+{
 
3453
+  asm volatile goto ("" : : : : a, b);
 
3454
+a:
 
3455
+  bar ();
 
3456
+b:
 
3457
+  return;
 
3458
+}
 
3459
Index: gcc/testsuite/gnat.dg/opt39.adb
 
3460
===================================================================
 
3461
--- a/src/gcc/testsuite/gnat.dg/opt39.adb       (.../tags/gcc_4_8_3_release)
 
3462
+++ b/src/gcc/testsuite/gnat.dg/opt39.adb       (.../branches/gcc-4_8-branch)
 
3463
@@ -0,0 +1,31 @@
 
3464
+-- { dg-do compile }
 
3465
+-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" }
 
3466
+
 
3467
+procedure Opt39 (I : Integer) is
 
3468
+
 
3469
+  type Rec is record
 
3470
+    I1 : Integer;
 
3471
+    I2 : Integer;
 
3472
+    I3 : Integer;
 
3473
+    I4 : Integer;
 
3474
+    I5 : Integer;
 
3475
+  end record;
 
3476
+
 
3477
+  procedure Set (A : access Rec; I : Integer) is
 
3478
+    Tmp : Rec := A.all;
 
3479
+  begin
 
3480
+    Tmp.I1 := I;
 
3481
+    A.all := Tmp;
 
3482
+  end;
 
3483
+
 
3484
+  R : aliased Rec;
 
3485
+
 
3486
+begin
 
3487
+  Set (R'Access, I);
 
3488
+  if R.I1 /= I then
 
3489
+    raise Program_Error;
 
3490
+  end if;
 
3491
+end;
 
3492
+
 
3493
+-- { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } }
 
3494
+-- { dg-final { cleanup-tree-dump "optimized" } }
 
3495
Index: gcc/testsuite/gnat.dg/overflow_fixed.adb
 
3496
===================================================================
 
3497
--- a/src/gcc/testsuite/gnat.dg/overflow_fixed.adb      (.../tags/gcc_4_8_3_release)
 
3498
+++ b/src/gcc/testsuite/gnat.dg/overflow_fixed.adb      (.../branches/gcc-4_8-branch)
 
3499
@@ -0,0 +1,19 @@
 
3500
+-- { dg-do run }
 
3501
+-- { dg-options "-gnato -O" }
 
3502
+
 
3503
+procedure Overflow_Fixed is
 
3504
+
 
3505
+  type Unsigned_8_Bit is mod 2**8;
 
3506
+
 
3507
+  procedure Fixed_To_Eight (Value : Duration) is
 
3508
+    Item : Unsigned_8_Bit;
 
3509
+  begin
 
3510
+    Item := Unsigned_8_Bit(Value);
 
3511
+    raise Program_Error;
 
3512
+  exception
 
3513
+    when Constraint_Error => null; -- expected case
 
3514
+  end;
 
3515
+
 
3516
+begin
 
3517
+  Fixed_To_Eight (-0.5);
 
3518
+end;
 
3519
Index: gcc/testsuite/gnat.dg/aliasing1.adb
 
3520
===================================================================
 
3521
--- a/src/gcc/testsuite/gnat.dg/aliasing1.adb   (.../tags/gcc_4_8_3_release)
 
3522
+++ b/src/gcc/testsuite/gnat.dg/aliasing1.adb   (.../branches/gcc-4_8-branch)
 
3523
@@ -18,5 +18,5 @@
 
3524
 
 
3525
 end Aliasing1;
 
3526
 
 
3527
--- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } }
 
3528
+-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }
 
3529
 -- { dg-final { cleanup-tree-dump "optimized" } }
 
3530
Index: gcc/testsuite/gcc.dg/pr60866.c
 
3531
===================================================================
 
3532
--- a/src/gcc/testsuite/gcc.dg/pr60866.c        (.../tags/gcc_4_8_3_release)
 
3533
+++ b/src/gcc/testsuite/gcc.dg/pr60866.c        (.../branches/gcc-4_8-branch)
 
3534
@@ -0,0 +1,18 @@
 
3535
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
 
3536
+/* { dg-options "-O -fselective-scheduling -fno-if-conversion -fschedule-insns"  } */
 
3537
+
 
3538
+int n;
 
3539
+
 
3540
+void
 
3541
+foo (int w, int **dnroot, int **dn)
 
3542
+{
 
3543
+  int *child;
 
3544
+  int *xchild = xchild;
 
3545
+  for (; w < n; w++)
 
3546
+    if (!dnroot)
 
3547
+      {
 
3548
+       dnroot = dn;
 
3549
+       for (child = *dn; child; child = xchild)
 
3550
+         ;
 
3551
+      }
 
3552
+}
 
3553
Index: gcc/testsuite/gcc.dg/pr63284.c
 
3554
===================================================================
 
3555
--- a/src/gcc/testsuite/gcc.dg/pr63284.c        (.../tags/gcc_4_8_3_release)
 
3556
+++ b/src/gcc/testsuite/gcc.dg/pr63284.c        (.../branches/gcc-4_8-branch)
 
3557
@@ -0,0 +1,42 @@
 
3558
+/* PR debug/63284 */
 
3559
+/* { dg-do compile } */
 
3560
+/* { dg-options "-O2 -fcompare-debug" } */
 
3561
+
 
3562
+int a[10], *b, *d, c, f;
 
3563
+int fn2 (void);
 
3564
+void fn3 (void);
 
3565
+void fn4 (int);
 
3566
+
 
3567
+static int
 
3568
+fn1 (int x)
 
3569
+{
 
3570
+  int e = a[0];
 
3571
+  if (e)
 
3572
+    return 1;
 
3573
+  if (b)
 
3574
+    switch (x)
 
3575
+      {
 
3576
+      case 1:
 
3577
+        if (d)
 
3578
+          e = fn2 ();
 
3579
+        else
 
3580
+          fn3 ();
 
3581
+        break;
 
3582
+      case 0:
 
3583
+        if (d)
 
3584
+          {
 
3585
+            fn3 ();
 
3586
+            if (c)
 
3587
+              fn4 (1);
 
3588
+          }
 
3589
+        else
 
3590
+          fn4 (0);
 
3591
+      }
 
3592
+  return e;
 
3593
+}
 
3594
+
 
3595
+void
 
3596
+fn6 (void)
 
3597
+{
 
3598
+  f = fn1 (0);
 
3599
+}
 
3600
Index: gcc/testsuite/gcc.dg/pr61045.c
 
3601
===================================================================
 
3602
--- a/src/gcc/testsuite/gcc.dg/pr61045.c        (.../tags/gcc_4_8_3_release)
 
3603
+++ b/src/gcc/testsuite/gcc.dg/pr61045.c        (.../branches/gcc-4_8-branch)
 
3604
@@ -0,0 +1,12 @@
 
3605
+/* { dg-do run } */
 
3606
+/* { dg-options "-fstrict-overflow" } */
 
3607
+
 
3608
+int main ()
 
3609
+{
 
3610
+  int a = 0;
 
3611
+  int b = __INT_MAX__;
 
3612
+  int t = (a - 2) > (b - 1);
 
3613
+  if (t != 0)
 
3614
+    __builtin_abort();
 
3615
+  return 0;
 
3616
+}
 
3617
Index: gcc/testsuite/gcc.dg/pr62004.c
 
3618
===================================================================
 
3619
--- a/src/gcc/testsuite/gcc.dg/pr62004.c        (.../tags/gcc_4_8_3_release)
 
3620
+++ b/src/gcc/testsuite/gcc.dg/pr62004.c        (.../branches/gcc-4_8-branch)
 
3621
@@ -0,0 +1,47 @@
 
3622
+/* { dg-do run } */
 
3623
+/* { dg-options "-O2 -fno-tree-tail-merge" } */
 
3624
+
 
3625
+struct node
 
3626
+{
 
3627
+  struct node *next;
 
3628
+  struct node *prev;
 
3629
+};
 
3630
+
 
3631
+struct node node;
 
3632
+
 
3633
+struct head
 
3634
+{
 
3635
+  struct node *first;
 
3636
+};
 
3637
+
 
3638
+struct head heads[5];
 
3639
+
 
3640
+int k = 2;
 
3641
+
 
3642
+struct head *head = &heads[2];
 
3643
+
 
3644
+int
 
3645
+main ()
 
3646
+{
 
3647
+  struct node *p;
 
3648
+
 
3649
+  node.next = (void*)0;
 
3650
+
 
3651
+  node.prev = (void *)head;
 
3652
+
 
3653
+  head->first = &node;
 
3654
+
 
3655
+  struct node *n = head->first;
 
3656
+
 
3657
+  struct head *h = &heads[k];
 
3658
+
 
3659
+  heads[2].first = n->next;
 
3660
+
 
3661
+  if ((void*)n->prev == (void *)h)
 
3662
+    p = h->first;
 
3663
+  else
 
3664
+    /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next.  */
 
3665
+    p = n->prev->next;
 
3666
+
 
3667
+  return !(p == (void*)0);
 
3668
+}
 
3669
Index: gcc/testsuite/gcc.dg/pr51879-18.c
 
3670
===================================================================
 
3671
--- a/src/gcc/testsuite/gcc.dg/pr51879-18.c     (.../tags/gcc_4_8_3_release)
 
3672
+++ b/src/gcc/testsuite/gcc.dg/pr51879-18.c     (.../branches/gcc-4_8-branch)
 
3673
@@ -13,5 +13,5 @@
 
3674
     *q = foo ();
 
3675
 }
 
3676
 
 
3677
-/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
 
3678
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre" { xfail *-*-* } } } */
 
3679
 /* { dg-final { cleanup-tree-dump "pre" } } */
 
3680
Index: gcc/testsuite/gcc.dg/torture/pr61964.c
 
3681
===================================================================
 
3682
--- a/src/gcc/testsuite/gcc.dg/torture/pr61964.c        (.../tags/gcc_4_8_3_release)
 
3683
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61964.c        (.../branches/gcc-4_8-branch)
 
3684
@@ -0,0 +1,33 @@
 
3685
+/* { dg-do run } */
 
3686
+
 
3687
+extern void abort (void);
 
3688
+
 
3689
+struct node { struct node *next, *prev; } node;
 
3690
+struct head { struct node *first; } heads[5];
 
3691
+int k = 2;
 
3692
+struct head *head = &heads[2];
 
3693
+
 
3694
+static int __attribute__((noinline))
 
3695
+foo()
 
3696
+{
 
3697
+  node.prev = (void *)head;
 
3698
+  head->first = &node;
 
3699
+
 
3700
+  struct node *n = head->first;
 
3701
+  struct head *h = &heads[k];
 
3702
+
 
3703
+  if (n->prev == (void *)h)
 
3704
+    h->first = n->next;
 
3705
+  else
 
3706
+    n->prev->next = n->next;
 
3707
+
 
3708
+  n->next = h->first;
 
3709
+  return n->next == &node;
 
3710
+}
 
3711
+
 
3712
+int main()
 
3713
+{
 
3714
+  if (foo ())
 
3715
+    abort ();
 
3716
+  return 0;
 
3717
+}
 
3718
Index: gcc/testsuite/gcc.dg/torture/pr61010.c
 
3719
===================================================================
 
3720
--- a/src/gcc/testsuite/gcc.dg/torture/pr61010.c        (.../tags/gcc_4_8_3_release)
 
3721
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61010.c        (.../branches/gcc-4_8-branch)
 
3722
@@ -0,0 +1,8 @@
 
3723
+/* { dg-do compile } */
 
3724
+
 
3725
+int main (void)
 
3726
+{
 
3727
+  int a = 0;
 
3728
+  unsigned b = (a * 64 & 192) | 63U;
 
3729
+  return 0;
 
3730
+}
 
3731
Index: gcc/testsuite/gcc.dg/torture/pr61452.c
 
3732
===================================================================
 
3733
--- a/src/gcc/testsuite/gcc.dg/torture/pr61452.c        (.../tags/gcc_4_8_3_release)
 
3734
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61452.c        (.../branches/gcc-4_8-branch)
 
3735
@@ -0,0 +1,31 @@
 
3736
+/* { dg-do run } */
 
3737
+
 
3738
+int a, b;
 
3739
+short c, d;
 
3740
+char e, f;
 
3741
+
 
3742
+int
 
3743
+fn1 (int p1, char p2)
 
3744
+{
 
3745
+  return p1 || p2 ? 0 : p2;
 
3746
+}
 
3747
+
 
3748
+void
 
3749
+fn2 ()
 
3750
+{
 
3751
+  for (; a;)
 
3752
+    {
 
3753
+      int g;
 
3754
+      g = c = e;
 
3755
+      for (; a;)
 
3756
+       b = fn1 (g = d = e, g);
 
3757
+      f = g; 
 
3758
+    }
 
3759
+}
 
3760
+
 
3761
+int
 
3762
+main ()
 
3763
+{
 
3764
+  fn2 (); 
 
3765
+  return 0;
 
3766
+}
 
3767
Index: gcc/testsuite/gcc.dg/torture/pr61383-1.c
 
3768
===================================================================
 
3769
--- a/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c      (.../tags/gcc_4_8_3_release)
 
3770
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c      (.../branches/gcc-4_8-branch)
 
3771
@@ -0,0 +1,35 @@
 
3772
+/* { dg-do run } */
 
3773
+
 
3774
+int a, b = 1, c, d, e, f, g;
 
3775
+
 
3776
+int
 
3777
+fn1 ()
 
3778
+{
 
3779
+  int h;
 
3780
+  for (;;)
 
3781
+    {
 
3782
+      g = b;
 
3783
+      g = g ? 0 : 1 % g;
 
3784
+      e = a + 1;
 
3785
+      for (; d < 1; d = e)
 
3786
+       {
 
3787
+         if (f == 0)
 
3788
+           h = 0;
 
3789
+         else
 
3790
+           h = 1 % f;
 
3791
+         if (f < 1)
 
3792
+           c = 0;
 
3793
+         else if (h)
 
3794
+           break;
 
3795
+       }
 
3796
+      if (b)
 
3797
+       return 0;
 
3798
+    }
 
3799
+}
 
3800
+
 
3801
+int
 
3802
+main ()
 
3803
+{
 
3804
+  fn1 ();
 
3805
+  return 0;
 
3806
+}
 
3807
Index: gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c
 
3808
===================================================================
 
3809
--- a/src/gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c       (.../tags/gcc_4_8_3_release)
 
3810
+++ b/src/gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c       (.../branches/gcc-4_8-branch)
 
3811
@@ -0,0 +1,41 @@
 
3812
+/* Test that exact underflow in __float128 signals the underflow
 
3813
+   exception if trapping is enabled, but does not raise the flag
 
3814
+   otherwise.  */
 
3815
+
 
3816
+/* { dg-do run { target i?86-*-*gnu* x86_64-*-*gnu* } } */
 
3817
+/* { dg-options "-D_GNU_SOURCE" } */
 
3818
+/* { dg-require-effective-target fenv_exceptions } */
 
3819
+
 
3820
+#include <fenv.h>
 
3821
+#include <setjmp.h>
 
3822
+#include <signal.h>
 
3823
+#include <stdlib.h>
 
3824
+
 
3825
+volatile sig_atomic_t caught_sigfpe;
 
3826
+sigjmp_buf buf;
 
3827
+
 
3828
+static void
 
3829
+handle_sigfpe (int sig)
 
3830
+{
 
3831
+  caught_sigfpe = 1;
 
3832
+  siglongjmp (buf, 1);
 
3833
+}
 
3834
+
 
3835
+int
 
3836
+main (void)
 
3837
+{
 
3838
+  volatile __float128 a = 0x1p-16382q, b = 0x1p-2q;
 
3839
+  volatile __float128 r;
 
3840
+  r = a * b;
 
3841
+  if (fetestexcept (FE_UNDERFLOW))
 
3842
+    abort ();
 
3843
+  if (r != 0x1p-16384q)
 
3844
+    abort ();
 
3845
+  feenableexcept (FE_UNDERFLOW);
 
3846
+  signal (SIGFPE, handle_sigfpe);
 
3847
+  if (sigsetjmp (buf, 1) == 0)
 
3848
+    r = a * b;
 
3849
+  if (!caught_sigfpe)
 
3850
+    abort ();
 
3851
+  exit (0);
 
3852
+}
 
3853
Index: gcc/testsuite/gcc.dg/stack-usage-2.c
 
3854
===================================================================
 
3855
--- a/src/gcc/testsuite/gcc.dg/stack-usage-2.c  (.../tags/gcc_4_8_3_release)
 
3856
+++ b/src/gcc/testsuite/gcc.dg/stack-usage-2.c  (.../branches/gcc-4_8-branch)
 
3857
@@ -1,21 +1,21 @@
 
3858
 /* { dg-do compile } */
 
3859
 /* { dg-options "-Wstack-usage=512" } */
 
3860
 
 
3861
-int foo1 (void)
 
3862
+int foo1 (void)  /* { dg-bogus "stack usage" } */
 
3863
 {
 
3864
   char arr[16];
 
3865
   arr[0] = 1;
 
3866
   return 0;
 
3867
-} /* { dg-bogus "stack usage" } */
 
3868
+}
 
3869
 
 
3870
-int foo2 (void)
 
3871
+int foo2 (void)  /* { dg-warning "stack usage is \[0-9\]* bytes" } */
 
3872
 {
 
3873
   char arr[1024];
 
3874
   arr[0] = 1;
 
3875
   return 0;
 
3876
-} /* { dg-warning "stack usage is \[0-9\]* bytes" } */
 
3877
+}
 
3878
 
 
3879
-int foo3 (void)
 
3880
+int foo3 (void) /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
 
3881
 {
 
3882
   char arr[1024] __attribute__((aligned (512)));
 
3883
   arr[0] = 1;
 
3884
@@ -22,12 +22,11 @@
 
3885
   /* Force dynamic realignment of argument pointer.  */
 
3886
   __builtin_apply ((void (*)()) foo2, 0, 0);
 
3887
   return 0;
 
3888
+}
 
3889
 
 
3890
-} /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
 
3891
-
 
3892
-int foo4 (int n)
 
3893
+int foo4 (int n) /* { dg-warning "stack usage might be unbounded" } */
 
3894
 {
 
3895
   char arr[n];
 
3896
   arr[0] = 1;
 
3897
   return 0;
 
3898
-} /* { dg-warning "stack usage might be unbounded" } */
 
3899
+}
 
3900
Index: gcc/testsuite/gcc.dg/ipa/pr61986.c
 
3901
===================================================================
 
3902
--- a/src/gcc/testsuite/gcc.dg/ipa/pr61986.c    (.../tags/gcc_4_8_3_release)
 
3903
+++ b/src/gcc/testsuite/gcc.dg/ipa/pr61986.c    (.../branches/gcc-4_8-branch)
 
3904
@@ -0,0 +1,48 @@
 
3905
+/* { dg-do compile } */
 
3906
+/* { dg-options "-O3" } */
 
3907
+
 
3908
+int a, b, c;
 
3909
+
 
3910
+struct S
 
3911
+{
 
3912
+  int f0;
 
3913
+  int f1;
 
3914
+} d;
 
3915
+
 
3916
+static int fn2 (struct S);
 
3917
+void fn3 (struct S);
 
3918
+
 
3919
+void
 
3920
+fn1 (struct S p)
 
3921
+{
 
3922
+  struct S h = { 0, 0 };
 
3923
+  fn3 (p);
 
3924
+  fn2 (h);
 
3925
+}
 
3926
+
 
3927
+int
 
3928
+fn2 (struct S p)
 
3929
+{
 
3930
+  struct S j = { 0, 0 };
 
3931
+  fn3 (p);
 
3932
+  fn2 (j);
 
3933
+  return 0;
 
3934
+}
 
3935
+
 
3936
+void
 
3937
+fn3 (struct S p)
 
3938
+{
 
3939
+  for (; b; a++)
 
3940
+    c = p.f0;
 
3941
+  fn1 (d);
 
3942
+}
 
3943
+
 
3944
+void
 
3945
+fn4 ()
 
3946
+{
 
3947
+  for (;;)
 
3948
+    {
 
3949
+      struct S f = { 0, 0 };
 
3950
+      fn1 (f);
 
3951
+    }
 
3952
+}
 
3953
Index: gcc/testsuite/gcc.dg/pr62030.c
 
3954
===================================================================
 
3955
--- a/src/gcc/testsuite/gcc.dg/pr62030.c        (.../tags/gcc_4_8_3_release)
 
3956
+++ b/src/gcc/testsuite/gcc.dg/pr62030.c        (.../branches/gcc-4_8-branch)
 
3957
@@ -0,0 +1,50 @@
 
3958
+/* { dg-do run } */
 
3959
+/* { dg-options "-O2" } */
 
3960
+
 
3961
+extern void abort (void);
 
3962
+
 
3963
+struct node
 
3964
+{
 
3965
+  struct node *next;
 
3966
+  struct node *prev;
 
3967
+};
 
3968
+
 
3969
+struct node node;
 
3970
+
 
3971
+struct head
 
3972
+{
 
3973
+  struct node *first;
 
3974
+};
 
3975
+
 
3976
+struct head heads[5];
 
3977
+
 
3978
+int k = 2;
 
3979
+
 
3980
+struct head *head = &heads[2];
 
3981
+
 
3982
+static int __attribute__((noinline))
 
3983
+foo (void)
 
3984
+{
 
3985
+  node.prev = (void *)head;
 
3986
+  head->first = &node;
 
3987
+
 
3988
+  struct node *n = head->first;
 
3989
+  struct head *h = &heads[k];
 
3990
+  struct node *next = n->next;
 
3991
+
 
3992
+  if (n->prev == (void *)h)
 
3993
+    h->first = next;
 
3994
+  else
 
3995
+    n->prev->next = next;
 
3996
+
 
3997
+  n->next = h->first;
 
3998
+  return n->next == &node;
 
3999
+}
 
4000
+
 
4001
+int
 
4002
+main (void)
 
4003
+{
 
4004
+  if (foo ())
 
4005
+    abort ();
 
4006
+  return 0;
 
4007
+}
 
4008
Index: gcc/testsuite/gcc.dg/vect/pr63341-2.c
 
4009
===================================================================
 
4010
--- a/src/gcc/testsuite/gcc.dg/vect/pr63341-2.c (.../tags/gcc_4_8_3_release)
 
4011
+++ b/src/gcc/testsuite/gcc.dg/vect/pr63341-2.c (.../branches/gcc-4_8-branch)
 
4012
@@ -0,0 +1,35 @@
 
4013
+/* PR tree-optimization/63341 */
 
4014
+/* { dg-do run } */
 
4015
+
 
4016
+#include "tree-vect.h"
 
4017
+
 
4018
+typedef union U { unsigned short s; unsigned char c; } __attribute__((packed)) U;
 
4019
+struct S { char e __attribute__((aligned (64))); U s[32]; };
 
4020
+struct S t = {0, {{0x5010}, {0x5111}, {0x5212}, {0x5313}, {0x5414}, {0x5515}, {0x5616}, {0x5717},
 
4021
+                 {0x5818}, {0x5919}, {0x5a1a}, {0x5b1b}, {0x5c1c}, {0x5d1d}, {0x5e1e}, {0x5f1f},
 
4022
+                 {0x6020}, {0x6121}, {0x6222}, {0x6323}, {0x6424}, {0x6525}, {0x6626}, {0x6727},
 
4023
+                 {0x6828}, {0x6929}, {0x6a2a}, {0x6b2b}, {0x6c2c}, {0x6d2d}, {0x6e2e}, {0x6f2f}}};
 
4024
+unsigned short d[32] = { 1 };
 
4025
+
 
4026
+__attribute__((noinline, noclone)) void
 
4027
+foo ()
 
4028
+{
 
4029
+  int i;
 
4030
+  for (i = 0; i < 32; i++)
 
4031
+    d[i] = t.s[i].s + 4;
 
4032
+  for (i = 0; i < 32; i++)
 
4033
+    if (d[i] != t.s[i].s + 4)
 
4034
+      abort ();
 
4035
+    else
 
4036
+      asm volatile ("" : : : "memory");
 
4037
+}
 
4038
+
 
4039
+int
 
4040
+main ()
 
4041
+{
 
4042
+  check_vect ();
 
4043
+  foo ();
 
4044
+  return 0;
 
4045
+}
 
4046
+
 
4047
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
4048
Index: gcc/testsuite/gcc.dg/vect/pr63189.c
 
4049
===================================================================
 
4050
--- a/src/gcc/testsuite/gcc.dg/vect/pr63189.c   (.../tags/gcc_4_8_3_release)
 
4051
+++ b/src/gcc/testsuite/gcc.dg/vect/pr63189.c   (.../branches/gcc-4_8-branch)
 
4052
@@ -0,0 +1,26 @@
 
4053
+/* PR tree-optimization/63189 */
 
4054
+/* { dg-do run } */
 
4055
+
 
4056
+#include "tree-vect.h"
 
4057
+
 
4058
+short int d[16] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
 
4059
+
 
4060
+__attribute__((noinline, noclone)) void
 
4061
+foo (void)
 
4062
+{
 
4063
+  int j, s = 0;
 
4064
+  for (j = 0; j < 8; j++)
 
4065
+    s += d[j] * j;
 
4066
+  if (s != 7)
 
4067
+    abort ();
 
4068
+}
 
4069
+
 
4070
+int
 
4071
+main ()
 
4072
+{
 
4073
+  check_vect ();
 
4074
+  foo ();
 
4075
+  return 0;
 
4076
+}
 
4077
+
 
4078
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
4079
Index: gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c
 
4080
===================================================================
 
4081
--- a/src/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c       (.../tags/gcc_4_8_3_release)
 
4082
+++ b/src/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c       (.../branches/gcc-4_8-branch)
 
4083
@@ -0,0 +1,73 @@
 
4084
+/* { dg-require-effective-target vect_int } */
 
4085
+
 
4086
+#include <stdarg.h>
 
4087
+#include "tree-vect.h"
 
4088
+
 
4089
+#define N 64
 
4090
+#define DOT 43680
 
4091
+
 
4092
+signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
 
4093
+signed int   Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
 
4094
+
 
4095
+/* (short, int)->int->int dot product.
 
4096
+   Not detected as a dot-product pattern.  */
 
4097
+
 
4098
+__attribute__ ((noinline)) int
 
4099
+foo (int len)
 
4100
+{
 
4101
+  int i;
 
4102
+  int result = 0;
 
4103
+
 
4104
+  for (i = 0; i < len; i++)
 
4105
+    {
 
4106
+      result += (X[i] * Y[i]);
 
4107
+    }
 
4108
+  return result;
 
4109
+}
 
4110
+
 
4111
+
 
4112
+/* (int, short)->int->int dot product.
 
4113
+   Not detected as a dot-product pattern.  */
 
4114
+
 
4115
+__attribute__ ((noinline)) int
 
4116
+bar (int len)
 
4117
+{
 
4118
+  int i;
 
4119
+  int result = 0;
 
4120
+
 
4121
+  for (i = 0; i < len; i++)
 
4122
+    {
 
4123
+      result += (Y[i] * X[i]);
 
4124
+    }
 
4125
+  return result;
 
4126
+}
 
4127
+
 
4128
+int
 
4129
+main (void)
 
4130
+{
 
4131
+  int i;
 
4132
+  int dot;
 
4133
+
 
4134
+  check_vect ();
 
4135
+
 
4136
+  for (i = 0; i < N; i++)
 
4137
+    {
 
4138
+      X[i] = i;
 
4139
+      Y[i] = N - i;
 
4140
+      __asm__ volatile ("");
 
4141
+    }
 
4142
+
 
4143
+  dot = foo (N);
 
4144
+  if (dot != DOT)
 
4145
+    abort ();
 
4146
+
 
4147
+  dot = bar (N);
 
4148
+  if (dot != DOT)
 
4149
+    abort ();
 
4150
+
 
4151
+  return 0;
 
4152
+}
 
4153
+
 
4154
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
 
4155
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
4156
+
 
4157
Index: gcc/testsuite/gcc.dg/vect/pr62073.c
 
4158
===================================================================
 
4159
--- a/src/gcc/testsuite/gcc.dg/vect/pr62073.c   (.../tags/gcc_4_8_3_release)
 
4160
+++ b/src/gcc/testsuite/gcc.dg/vect/pr62073.c   (.../branches/gcc-4_8-branch)
 
4161
@@ -0,0 +1,40 @@
 
4162
+/* { dg-do compile } */
 
4163
+/* { dg-additional-options "-O1" } */
 
4164
+
 
4165
+struct S0
 
4166
+{
 
4167
+  int f7;
 
4168
+};
 
4169
+struct S0 g_50;
 
4170
+int g_70;
 
4171
+int g_76;
 
4172
+
 
4173
+int foo (long long p_56, int * p_57)
 
4174
+{
 
4175
+  int *l_77;
 
4176
+  int l_101;
 
4177
+
 
4178
+  for (; g_70;)
 
4179
+    {
 
4180
+      int **l_78 = &l_77;
 
4181
+      if (g_50.f7)
 
4182
+       continue;
 
4183
+      *l_78 = 0;
 
4184
+    }
 
4185
+  for (g_76 = 1; g_76 >= 0; g_76--)
 
4186
+    {
 
4187
+      int *l_90;
 
4188
+      for (l_101 = 4; l_101 >= 0; l_101--)
 
4189
+       if (l_101)
 
4190
+         *l_90 = 0;
 
4191
+       else
 
4192
+         {
 
4193
+           int **l_113 = &l_77;
 
4194
+           *l_113 = p_57;
 
4195
+         }
 
4196
+    }
 
4197
+
 
4198
+  return *l_77;
 
4199
+}
 
4200
+
 
4201
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
4202
Index: gcc/testsuite/gcc.dg/vect/pr60196-1.c
 
4203
===================================================================
 
4204
--- a/src/gcc/testsuite/gcc.dg/vect/pr60196-1.c (.../tags/gcc_4_8_3_release)
 
4205
+++ b/src/gcc/testsuite/gcc.dg/vect/pr60196-1.c (.../branches/gcc-4_8-branch)
 
4206
@@ -0,0 +1,34 @@
 
4207
+/* PR tree-optimization/63189 */
 
4208
+/* { dg-additional-options "-fwrapv" } */
 
4209
+/* { dg-do run } */
 
4210
+
 
4211
+#include "tree-vect.h"
 
4212
+
 
4213
+__attribute__((noinline, noclone)) static int
 
4214
+bar (const short *a, int len)
 
4215
+{
 
4216
+  int x;
 
4217
+  int x1 = 0;
 
4218
+
 
4219
+  for (x = 0; x < len; x++)
 
4220
+    x1 += x * a[x];
 
4221
+  return x1;
 
4222
+}
 
4223
+
 
4224
+__attribute__((noinline, noclone)) void
 
4225
+foo (void)
 
4226
+{
 
4227
+  short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 };
 
4228
+  if (bar (stuff, 9) != 36)
 
4229
+    abort ();
 
4230
+}
 
4231
+
 
4232
+int
 
4233
+main ()
 
4234
+{
 
4235
+  check_vect ();
 
4236
+  foo ();
 
4237
+  return 0;
 
4238
+}
 
4239
+
 
4240
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
4241
Index: gcc/testsuite/gcc.dg/vect/pr62075.c
 
4242
===================================================================
 
4243
--- a/src/gcc/testsuite/gcc.dg/vect/pr62075.c   (.../tags/gcc_4_8_3_release)
 
4244
+++ b/src/gcc/testsuite/gcc.dg/vect/pr62075.c   (.../branches/gcc-4_8-branch)
 
4245
@@ -0,0 +1,22 @@
 
4246
+/* { dg-do compile } */
 
4247
+
 
4248
+int a[16][2];
 
4249
+struct A
 
4250
+{
 
4251
+  int b[16][2];
 
4252
+  int c[16][1];
 
4253
+};
 
4254
+
 
4255
+void
 
4256
+foo (struct A *x)
 
4257
+{
 
4258
+  int i;
 
4259
+  for (i = 0; i < 16; ++i)
 
4260
+    {
 
4261
+      x->b[i][0] = a[i][0];
 
4262
+      x->c[i][0] = 0 != a[i][0];
 
4263
+      x->b[i][1] = a[i][1];
 
4264
+    }
 
4265
+}
 
4266
+
 
4267
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
4268
Index: gcc/testsuite/gcc.dg/vect/pr60196-2.c
 
4269
===================================================================
 
4270
--- a/src/gcc/testsuite/gcc.dg/vect/pr60196-2.c (.../tags/gcc_4_8_3_release)
 
4271
+++ b/src/gcc/testsuite/gcc.dg/vect/pr60196-2.c (.../branches/gcc-4_8-branch)
 
4272
@@ -0,0 +1,33 @@
 
4273
+/* PR tree-optimization/63189 */
 
4274
+/* { dg-do run } */
 
4275
+
 
4276
+#include "tree-vect.h"
 
4277
+
 
4278
+static const short a[8] = {1, 1, 1, 1, 1, 1, 1, 1 };
 
4279
+static const unsigned char b[8] = {0, 0, 0, 0, 0, 0, 0, 0 };
 
4280
+
 
4281
+__attribute__((noinline, noclone)) static int
 
4282
+bar (void)
 
4283
+{
 
4284
+  int sum = 0, i;
 
4285
+  for (i = 0; i < 8; ++i)
 
4286
+    sum += a[i] * b[i];
 
4287
+  return sum;
 
4288
+}
 
4289
+
 
4290
+__attribute__((noinline, noclone)) void
 
4291
+foo (void)
 
4292
+{
 
4293
+  if (bar () != 0)
 
4294
+    abort ();
 
4295
+}
 
4296
+
 
4297
+int
 
4298
+main ()
 
4299
+{
 
4300
+  check_vect ();
 
4301
+  foo ();
 
4302
+  return 0;
 
4303
+}
 
4304
+
 
4305
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
4306
Index: gcc/testsuite/gcc.dg/vect/pr63341-1.c
 
4307
===================================================================
 
4308
--- a/src/gcc/testsuite/gcc.dg/vect/pr63341-1.c (.../tags/gcc_4_8_3_release)
 
4309
+++ b/src/gcc/testsuite/gcc.dg/vect/pr63341-1.c (.../branches/gcc-4_8-branch)
 
4310
@@ -0,0 +1,32 @@
 
4311
+/* PR tree-optimization/63341 */
 
4312
+/* { dg-do run } */
 
4313
+
 
4314
+#include "tree-vect.h"
 
4315
+
 
4316
+typedef union U { unsigned short s; unsigned char c; } __attribute__((packed)) U;
 
4317
+struct S { char e __attribute__((aligned (64))); U s[32]; };
 
4318
+struct S t = {0, {{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8},
 
4319
+                 {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16},
 
4320
+                 {17}, {18}, {19}, {20}, {21}, {22}, {23}, {24},
 
4321
+                 {25}, {26}, {27}, {28}, {29}, {30}, {31}, {32}}};
 
4322
+unsigned short d[32] = { 1 };
 
4323
+
 
4324
+__attribute__((noinline, noclone)) void
 
4325
+foo ()
 
4326
+{
 
4327
+  int i;
 
4328
+  for (i = 0; i < 32; i++)
 
4329
+    d[i] = t.s[i].s;
 
4330
+  if (__builtin_memcmp (d, t.s, sizeof d))
 
4331
+    abort ();
 
4332
+}
 
4333
+
 
4334
+int
 
4335
+main ()
 
4336
+{
 
4337
+  check_vect ();
 
4338
+  foo ();
 
4339
+  return 0;
 
4340
+}
 
4341
+
 
4342
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
4343
Index: gcc/testsuite/ChangeLog
 
4344
===================================================================
 
4345
--- a/src/gcc/testsuite/ChangeLog       (.../tags/gcc_4_8_3_release)
 
4346
+++ b/src/gcc/testsuite/ChangeLog       (.../branches/gcc-4_8-branch)
 
4347
@@ -1,3 +1,368 @@
 
4348
+2014-09-30  Jakub Jelinek  <jakub@redhat.com>
 
4349
+
 
4350
+       PR inline-asm/63282
 
4351
+       * gcc.c-torture/compile/pr63282.c: New test.
 
4352
+
 
4353
+2014-09-26  Jakub Jelinek  <jakub@redhat.com>
 
4354
+
 
4355
+       * g++.dg/compat/struct-layout-1_generate.c: Add -Wno-abi
 
4356
+       to default options.
 
4357
+
 
4358
+2014-09-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
4359
+
 
4360
+       Backport from mainline r215559
 
4361
+       2014-09-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
4362
+
 
4363
+       PR target/63335
 
4364
+       * gcc.target/powerpc/pr63335.c: New test.
 
4365
+
 
4366
+2014-09-25  Jakub Jelinek  <jakub@redhat.com>
 
4367
+
 
4368
+       PR tree-optimization/63341
 
4369
+       * gcc.dg/vect/pr63341-1.c: New test.
 
4370
+       * gcc.dg/vect/pr63341-2.c: New test.
 
4371
+
 
4372
+2014-09-18  Joseph Myers  <joseph@codesourcery.com>
 
4373
+
 
4374
+       * gcc.dg/torture/float128-exact-underflow.c: New test.
 
4375
+
 
4376
+2014-09-17  Jakub Jelinek  <jakub@redhat.com>
 
4377
+
 
4378
+       PR debug/63284
 
4379
+       * gcc.dg/pr63284.c: New test.
 
4380
+
 
4381
+2014-09-09  Richard Biener  <rguenther@suse.de>
 
4382
+
 
4383
+       Backport from mainline
 
4384
+       2014-06-11  Richard Biener  <rguenther@suse.de>
 
4385
+
 
4386
+       PR tree-optimization/61452
 
4387
+       * gcc.dg/torture/pr61452.c: New testcase.
 
4388
+
 
4389
+2014-09-09  Richard Biener  <rguenther@suse.de>
 
4390
+
 
4391
+       Backport from mainline
 
4392
+       2014-05-05  Richard Biener  <rguenther@suse.de>
 
4393
+
 
4394
+       PR middle-end/61010
 
4395
+       * gcc.dg/torture/pr61010.c: New testcase.
 
4396
+
 
4397
+       2014-05-28  Richard Biener  <rguenther@suse.de>
 
4398
+
 
4399
+       PR middle-end/61045
 
4400
+       * gcc.dg/pr61045.c: New testcase.
 
4401
+
 
4402
+       2014-08-11  Richard Biener  <rguenther@suse.de>
 
4403
+
 
4404
+       PR tree-optimization/62075
 
4405
+       * gcc.dg/vect/pr62075.c: New testcase.
 
4406
+
 
4407
+2014-09-08  Jakub Jelinek  <jakub@redhat.com>
 
4408
+
 
4409
+       PR tree-optimization/60196
 
4410
+       PR tree-optimization/63189
 
4411
+       * gcc.dg/vect/pr63189.c: New test.
 
4412
+       * gcc.dg/vect/pr60196-1.c: New test.
 
4413
+       * gcc.dg/vect/pr60196-2.c: New test.
 
4414
+
 
4415
+       Backported from mainline
 
4416
+       2013-09-17  Cong Hou  <congh@google.com>
 
4417
+
 
4418
+       * gcc.dg/vect/vect-reduc-dot-s16c.c: Add a test case with dot product 
 
4419
+       on two arrays with short and int types. This should not be recognized
 
4420
+       as a dot product pattern.
 
4421
+
 
4422
+2014-09-08  Jakub Jelinek  <jakub@redhat.com>
 
4423
+
 
4424
+       Backported from mainline
 
4425
+       2014-08-06  Vladimir Makarov  <vmakarov@redhat.com>
 
4426
+
 
4427
+       PR debug/61923
 
4428
+       * gcc.target/i386/pr61923.c: New test.
 
4429
+
 
4430
+2014-09-06  John David Anglin  <danglin@gcc.gnu.org>
 
4431
+
 
4432
+       PR testsuite/56194
 
4433
+       * g++.dg/init/const9.C: Skip scan-assembler-not "rodata" on hppa*-*-*.
 
4434
+
 
4435
+2014-09-03  Marek Polacek  <polacek@redhat.com>
 
4436
+
 
4437
+       Backport from mainline
 
4438
+       2014-09-02  Marek Polacek  <polacek@redhat.com>
 
4439
+
 
4440
+       PR fortran/62270
 
4441
+       * gfortran.dg/pointer_intent_7.f90: Adjust dg-error.
 
4442
+
 
4443
+2014-09-03  Martin Jambor  <mjambor@suse.cz>
 
4444
+
 
4445
+       PR ipa/62015
 
4446
+       * g++.dg/ipa/pr62015.C: New test.
 
4447
+
 
4448
+2014-09-03  Martin Jambor  <mjambor@suse.cz>
 
4449
+
 
4450
+       PR ipa/61986
 
4451
+       * gcc.dg/ipa/pr61986.c: New test.
 
4452
+
 
4453
+2014-08-26  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
4454
+
 
4455
+       * gfortran.dg/bessel_7.f90: Bump allowed precision to avoid
 
4456
+       failure on s390*-*-linux-gnu.
 
4457
+
 
4458
+2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
 
4459
+
 
4460
+       Backport from mainline
 
4461
+       2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
 
4462
+
 
4463
+       PR target/61996
 
4464
+       * gcc.target/sh/pr61996.c: New.
 
4465
+
 
4466
+2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
4467
+
 
4468
+       Backport from trunk
 
4469
+       PR fortran/62214
 
4470
+       * gfortran.dg/array_assignment_5.f90:  New test.
 
4471
+
 
4472
+2014-08-15  Tom de Vries  <tom@codesourcery.com>
 
4473
+
 
4474
+       Backport from mainline:
 
4475
+       2014-08-14  Tom de Vries  <tom@codesourcery.com>
 
4476
+
 
4477
+       PR rtl-optimization/62004
 
4478
+       PR rtl-optimization/62030
 
4479
+       * gcc.dg/pr62004.c: New test.
 
4480
+       * gcc.dg/pr62030.c: Same.
 
4481
+       * gcc.target/mips/pr62030-octeon.c: Same.
 
4482
+
 
4483
+2014-08-13  Felix Yang  <fei.yang0953@gmail.com>
 
4484
+
 
4485
+       PR tree-optimization/62073
 
4486
+       * gcc.dg/vect/pr62073.c: New test.
 
4487
+
 
4488
+2014-08-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4489
+
 
4490
+       Backport from mainline
 
4491
+       2014-08-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4492
+
 
4493
+       PR middle-end/62103
 
4494
+       * gcc.c-torture/execute/bitfld-6.c: New test.
 
4495
+
 
4496
+2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
4497
+
 
4498
+       Backport from trunk
 
4499
+       PR fortran/61999
 
4500
+       * gfortran.dg/dot_product_3.f90:  New test case.
 
4501
+
 
4502
+2014-08-07  John David Anglin  <danglin@gcc.gnu.org>
 
4503
+
 
4504
+       PR tree-optimization/60707
 
4505
+       * gfortran.dg/pr45636.f90: xfail on 32-bit hppa*-*-*.
 
4506
+
 
4507
+2014-08-06  Jakub Jelinek  <jakub@redhat.com>
 
4508
+
 
4509
+       PR rtl-optimization/61801
 
4510
+       * gcc.target/i386/pr61801.c: Rewritten.
 
4511
+
 
4512
+2014-08-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4513
+
 
4514
+       Backport from mainline
 
4515
+       2014-06-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4516
+
 
4517
+       PR tree-optimization/61375
 
4518
+       * gcc.c-torture/execute/pr61375-1.c: New test.
 
4519
+
 
4520
+2014-08-01  Richard Biener  <rguenther@suse.de>
 
4521
+
 
4522
+       PR tree-optimization/61964
 
4523
+       * gcc.dg/torture/pr61964.c: New testcase.
 
4524
+       * gcc.dg/pr51879-18.c: XFAIL.
 
4525
+
 
4526
+2014-07-28  Richard Biener  <rguenther@suse.de>
 
4527
+
 
4528
+       PR rtl-optimization/61801
 
4529
+       * gcc.target/i386/pr61801.c: Fix testcase.
 
4530
+
 
4531
+2014-07-28  Richard Biener  <rguenther@suse.de>
 
4532
+
 
4533
+       PR rtl-optimization/61801
 
4534
+       * gcc.target/i386/pr61801.c: New testcase.
 
4535
+
 
4536
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4537
+
 
4538
+       Backport from mainline:
 
4539
+       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4540
+
 
4541
+       * gcc.target/powerpc/ppc64-abi-warn-3.c: New test.
 
4542
+
 
4543
+       * gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
 
4544
+       * gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
 
4545
+       * gcc.c-torture/execute/20050316-3.x: New file.  Add -Wno-psabi.
 
4546
+       * gcc.c-torture/execute/pr23135.x: Likewise.
 
4547
+
 
4548
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4549
+
 
4550
+       Backport from mainline:
 
4551
+       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4552
+
 
4553
+       * gcc.target/powerpc/ppc64-abi-warn-2.c: New test.
 
4554
+
 
4555
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4556
+
 
4557
+       Backport from mainline:
 
4558
+       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4559
+
 
4560
+       * gcc.target/powerpc/ppc64-abi-warn-1.c: New test.
 
4561
+
 
4562
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4563
+
 
4564
+       Backport from mainline:
 
4565
+       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4566
+
 
4567
+       * g++.dg/compat/struct-layout-1.exp: Load g++-dg.exp.
 
4568
+
 
4569
+2014-07-19  Eric Botcazou  <ebotcazou@adacore.com>
 
4570
+
 
4571
+       * gcc.dg/stack-usage-2.c: Adjust.
 
4572
+
 
4573
+2014-07-19  Paul Thomas  <pault@gcc.gnu.org>
 
4574
+
 
4575
+       Backport from trunk.
 
4576
+       PR fortran/61780
 
4577
+       * gfortran.dg/dependency_44.f90 : New test
 
4578
+
 
4579
+2014-07-10  Eric Botcazou  <ebotcazou@adacore.com>
 
4580
+
 
4581
+       * gnat.dg/opt39.adb: New test.
 
4582
+
 
4583
+2014-07-08  Paul Thomas  <pault@gcc.gnu.org>
 
4584
+
 
4585
+       PR fortran/61459
 
4586
+       PR fortran/58883
 
4587
+       * gfortran.dg/allocatable_function_8.f90 : New test
 
4588
+
 
4589
+2014-07-04  Jakub Jelinek  <jakub@redhat.com>
 
4590
+
 
4591
+       PR tree-optimization/61684
 
4592
+       * gcc.c-torture/compile/pr61684.c: New test.
 
4593
+
 
4594
+2014-07-02  Jakub Jelinek  <jakub@redhat.com>
 
4595
+           Fritz Reese  <Reese-Fritz@zai.com>
 
4596
+
 
4597
+       * gfortran.dg/oldstyle_5.f: New test.
 
4598
+
 
4599
+2014-06-30  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4600
+
 
4601
+       Backport from mainline
 
4602
+       2014-06-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4603
+
 
4604
+       PR tree-optimization/61306
 
4605
+       * gcc.c-torture/execute/pr61306-1.c: New test.
 
4606
+       * gcc.c-torture/execute/pr61306-2.c: Likewise.
 
4607
+       * gcc.c-torture/execute/pr61306-3.c: Likewise.
 
4608
+
 
4609
+2014-06-27  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
4610
+
 
4611
+       * gfortran.dg/nint_2.f90: Don't XFAIL for powerpc64le-*-linux*.
 
4612
+
 
4613
+2014-06-27  Uros Bizjak  <ubizjak@gmail.com>
 
4614
+
 
4615
+       Backport from mainline
 
4616
+       2014-06-26  Uros Bizjak  <ubizjak@gmail.com>
 
4617
+
 
4618
+       PR target/61586
 
4619
+       * gcc.target/alpha/pr61586.c: New test.
 
4620
+
 
4621
+2014-06-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
4622
+
 
4623
+       * gfortran.dg/default_format_denormal_2.f90:  Remove xfail for
 
4624
+       powerpc*-*-linux*.
 
4625
+
 
4626
+2014-06-18  Uros Bizjak  <ubizjak@gmail.com>
 
4627
+
 
4628
+       Backport from mainline
 
4629
+       2014-06-13  Ilya Enkovich  <ilya.enkovich@intel.com>
 
4630
+
 
4631
+       PR rtl-optimization/61094
 
4632
+       PR rtl-optimization/61446
 
4633
+       * gcc.target/i386/pr61446.c : New.
 
4634
+
 
4635
+       Backport from mainline
 
4636
+       2014-06-06  Uros Bizjak  <ubizjak@gmail.com>
 
4637
+
 
4638
+       PR target/61423
 
4639
+       * gcc.target/i386/pr61423.c: New test.
 
4640
+
 
4641
+2014-06-17  Yufeng Zhang  <yufeng.zhang@arm.com>
 
4642
+
 
4643
+       Backport from mainline
 
4644
+
 
4645
+       PR target/61483
 
4646
+       * gcc.target/aarch64/aapcs64/type-def.h (struct hfa_fx2_t): New type.
 
4647
+       * gcc.target/aarch64/aapcs64/va_arg-13.c: New test.
 
4648
+       * gcc.target/aarch64/aapcs64/va_arg-14.c: Ditto.
 
4649
+       * gcc.target/aarch64/aapcs64/va_arg-15.c: Ditto.
 
4650
+
 
4651
+2014-06-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
4652
+
 
4653
+       Backport from trunk.
 
4654
+       PR fortran/45187
 
4655
+       * gfortran.dg/cray_pointers_10.f90: New file.
 
4656
+
 
4657
+2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
 
4658
+
 
4659
+       Backport from mainline
 
4660
+
 
4661
+       2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
 
4662
+       PR target/61415
 
4663
+       * lib/target-supports.exp (check_effective_target_longdouble128): New.
 
4664
+       * gcc.target/powerpc/pack02.c: Use it.
 
4665
+       * gcc.target/powerpc/tfmode_off.c: Likewise.
 
4666
+
 
4667
+2014-06-12  Georg-Johann Lay  <avr@gjlay.de>
 
4668
+
 
4669
+       Backport from 2014-06-12 trunk r211491
 
4670
+
 
4671
+       PR target/61443
 
4672
+       * gcc.target/avr/torture/pr61443.c: New test.
 
4673
+
 
4674
+2014-06-04  Richard Biener  <rguenther@suse.de>
 
4675
+
 
4676
+       PR tree-optimization/61383
 
4677
+       * gcc.dg/torture/pr61383-1.c: New testcase.
 
4678
+
 
4679
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
4680
+
 
4681
+       Backport from mainline
 
4682
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
4683
+
 
4684
+       PR rtl-optimization/60866
 
4685
+       * gcc.dg/pr60866.c: New test.
 
4686
+
 
4687
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
4688
+
 
4689
+       Backport from mainline
 
4690
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
4691
+
 
4692
+       PR rtl-optimization/60901
 
4693
+       * gcc.target/i386/pr60901.c: New test.
 
4694
+
 
4695
+2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
 
4696
+
 
4697
+       Backport from mainline
 
4698
+       2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
4699
+
 
4700
+       * gnat.dg/overflow_fixed.adb: New test.
 
4701
+
 
4702
+2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
4703
+
 
4704
+       * gnat.dg/aliasing1.adb (dg-final): Robustify pattern matching.
 
4705
+
 
4706
+2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
4707
+
 
4708
+       Backport from mainline
 
4709
+       2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
4710
+
 
4711
+       * gcc.target/powerpc/htm-ttest.c: New test.
 
4712
+
 
4713
 2014-05-22  Release Manager
 
4714
 
 
4715
        * GCC 4.8.3 released.
 
4716
Index: gcc/testsuite/g++.dg/expr/cond12.C
 
4717
===================================================================
 
4718
--- a/src/gcc/testsuite/g++.dg/expr/cond12.C    (.../tags/gcc_4_8_3_release)
 
4719
+++ b/src/gcc/testsuite/g++.dg/expr/cond12.C    (.../branches/gcc-4_8-branch)
 
4720
@@ -0,0 +1,12 @@
 
4721
+// PR c++/58714
 
4722
+// { dg-do run }
 
4723
+
 
4724
+struct X {
 
4725
+    X& operator=(const X&){}
 
4726
+    X& operator=(X&){__builtin_abort();}
 
4727
+};
 
4728
+
 
4729
+int main(int argv,char**) {
 
4730
+  X a, b;
 
4731
+  ((argv > 2) ? a : b) = X();
 
4732
+}
 
4733
Index: gcc/testsuite/g++.dg/init/const9.C
 
4734
===================================================================
 
4735
--- a/src/gcc/testsuite/g++.dg/init/const9.C    (.../tags/gcc_4_8_3_release)
 
4736
+++ b/src/gcc/testsuite/g++.dg/init/const9.C    (.../branches/gcc-4_8-branch)
 
4737
@@ -1,5 +1,5 @@
 
4738
 // PR c++/55893
 
4739
-// { dg-final { scan-assembler-not "rodata" } }
 
4740
+// { dg-final { scan-assembler-not "rodata" { target { ! hppa*-*-* } } } }
 
4741
 
 
4742
 struct foo
 
4743
 {
 
4744
Index: gcc/testsuite/g++.dg/parse/typename7.C
 
4745
===================================================================
 
4746
--- a/src/gcc/testsuite/g++.dg/parse/typename7.C        (.../tags/gcc_4_8_3_release)
 
4747
+++ b/src/gcc/testsuite/g++.dg/parse/typename7.C        (.../branches/gcc-4_8-branch)
 
4748
@@ -7,10 +7,9 @@
 
4749
 
 
4750
 struct A
 
4751
 {
 
4752
-  template<typename>   void foo(int); // { dg-message "note" }
 
4753
-  template<typename T> void bar(T t) { // { dg-message "note" }
 
4754
+  template<typename>   void foo(int);
 
4755
+  template<typename T> void bar(T t) {
 
4756
     this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
 
4757
-  // { dg-message "candidate" "candidate note" { target *-*-* } 12 }
 
4758
   template<typename T> void bad(T t) {
 
4759
     foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
 
4760
 };
 
4761
@@ -20,7 +19,6 @@
 
4762
 {
 
4763
   void bar(T t) {
 
4764
     A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
 
4765
-  // { dg-message "candidate" "candidate note" { target *-*-* } 22 }
 
4766
   void bad(T t) {
 
4767
     B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
 
4768
 };
 
4769
Index: gcc/testsuite/g++.dg/parse/parameter-declaration-2.C
 
4770
===================================================================
 
4771
--- a/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C  (.../tags/gcc_4_8_3_release)
 
4772
+++ b/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C  (.../branches/gcc-4_8-branch)
 
4773
@@ -1,2 +1,2 @@
 
4774
-void f (int i, int p[i]); // { dg-error "use of parameter .i. outside function body" }
 
4775
+void f (int i, int p[i]); // { dg-error "use of parameter.*outside function body" }
 
4776
 // { dg-prune-output "array bound" }
 
4777
Index: gcc/testsuite/g++.dg/parse/ambig7.C
 
4778
===================================================================
 
4779
--- a/src/gcc/testsuite/g++.dg/parse/ambig7.C   (.../tags/gcc_4_8_3_release)
 
4780
+++ b/src/gcc/testsuite/g++.dg/parse/ambig7.C   (.../branches/gcc-4_8-branch)
 
4781
@@ -0,0 +1,16 @@
 
4782
+// PR c++/60361
 
4783
+
 
4784
+struct Helper
 
4785
+{
 
4786
+  Helper(int a, void (*pfunc)());
 
4787
+};
 
4788
+
 
4789
+template <int I> void function();
 
4790
+
 
4791
+const int A = 1;
 
4792
+const int B = 2;
 
4793
+
 
4794
+Helper testOk(A, function<A>);
 
4795
+Helper testOk2(int(A), function<B>);
 
4796
+Helper testOk3((int(A)), function<A>);
 
4797
+Helper testFail(int(A), function<A>);
 
4798
Index: gcc/testsuite/g++.dg/compat/struct-layout-1.exp
 
4799
===================================================================
 
4800
--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp       (.../tags/gcc_4_8_3_release)
 
4801
+++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp       (.../branches/gcc-4_8-branch)
 
4802
@@ -89,6 +89,9 @@
 
4803
 # This must be done after the compat-use-*-compiler definitions.
 
4804
 load_lib compat.exp
 
4805
 
 
4806
+# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
 
4807
+load_lib g++-dg.exp
 
4808
+
 
4809
 g++_init
 
4810
 
 
4811
 # Save variables for the C++ compiler under test, which each test will
 
4812
Index: gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
 
4813
===================================================================
 
4814
--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c        (.../tags/gcc_4_8_3_release)
 
4815
+++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c        (.../branches/gcc-4_8-branch)
 
4816
@@ -1,5 +1,5 @@
 
4817
 /* Structure layout test generator.
 
4818
-   Copyright (C) 2004, 2005, 2007, 2008, 2009, 2011, 2012
 
4819
+   Copyright (C) 2004-2014
 
4820
    Free Software Foundation, Inc.
 
4821
    Contributed by Jakub Jelinek <jakub@redhat.com>.
 
4822
 
 
4823
@@ -44,7 +44,7 @@
 
4824
 #endif
 
4825
 
 
4826
 const char *dg_options[] = {
 
4827
-"/* { dg-options \"%s-I%s\" } */\n",
 
4828
+"/* { dg-options \"%s-I%s -Wno-abi\" } */\n",
 
4829
 "/* { dg-options \"%s-I%s -mno-mmx -Wno-abi\" { target i?86-*-* x86_64-*-* } } */\n",
 
4830
 "/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* powerpc*-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n",
 
4831
 "/* { dg-options \"%s-I%s -mno-mmx -fno-common -Wno-abi\" { target i?86-*-darwin* x86_64-*-darwin* i?86-*-mingw32* x86_64-*-mingw32* i?86-*-cygwin* } } */\n",
 
4832
Index: gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C
 
4833
===================================================================
 
4834
--- a/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../tags/gcc_4_8_3_release)
 
4835
+++ b/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../branches/gcc-4_8-branch)
 
4836
@@ -0,0 +1,28 @@
 
4837
+// PR c++/61959
 
4838
+// { dg-do compile { target c++11 } }
 
4839
+
 
4840
+template <class Coord> struct BasePoint
 
4841
+{
 
4842
+  Coord x, y;
 
4843
+  constexpr BasePoint (Coord, Coord) : x (0), y (0) {}
 
4844
+};
 
4845
+template <class T> struct BaseCoord
 
4846
+{
 
4847
+  int value;
 
4848
+  constexpr BaseCoord (T) : value (1) {}
 
4849
+};
 
4850
+template <class units> struct IntCoordTyped : BaseCoord<int>, units
 
4851
+{
 
4852
+  typedef BaseCoord Super;
 
4853
+  constexpr IntCoordTyped (int) : Super (0) {}
 
4854
+};
 
4855
+template <class units>
 
4856
+struct IntPointTyped : BasePoint<IntCoordTyped<units> >, units
 
4857
+{
 
4858
+  typedef BasePoint<IntCoordTyped<units> > Super;
 
4859
+  constexpr IntPointTyped (int, int) : Super (0, 0) {}
 
4860
+};
 
4861
+struct A
 
4862
+{
 
4863
+};
 
4864
+IntPointTyped<A> a (0, 0);
 
4865
Index: gcc/testsuite/g++.dg/cpp0x/variadic158.C
 
4866
===================================================================
 
4867
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C      (.../tags/gcc_4_8_3_release)
 
4868
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C      (.../branches/gcc-4_8-branch)
 
4869
@@ -0,0 +1,24 @@
 
4870
+// PR c++/61134
 
4871
+// { dg-do compile { target c++11 } }
 
4872
+
 
4873
+struct Base { };
 
4874
+
 
4875
+template <typename>
 
4876
+struct Fixed {
 
4877
+  typedef const char* name;
 
4878
+};
 
4879
+
 
4880
+template <typename VT, typename... Fields>
 
4881
+void New(const char* name,
 
4882
+         typename Fixed<Fields>::name... field_names);
 
4883
+
 
4884
+template <typename VT, typename... Fields>
 
4885
+void CreateMetric(const char* name,
 
4886
+                  typename Fixed<Fields>::name... field_names,
 
4887
+                  const Base&) { }
 
4888
+
 
4889
+
 
4890
+void Fn()
 
4891
+{
 
4892
+  CreateMetric<int, const char*>("abcd", "def", Base());
 
4893
+}
 
4894
Index: gcc/testsuite/g++.dg/cpp0x/variadic160.C
 
4895
===================================================================
 
4896
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C      (.../tags/gcc_4_8_3_release)
 
4897
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C      (.../branches/gcc-4_8-branch)
 
4898
@@ -0,0 +1,49 @@
 
4899
+// PR c++/61539
 
4900
+// { dg-do compile { target c++11 } }
 
4901
+
 
4902
+template <typename _CharT> class A;
 
4903
+template <typename> class B;
 
4904
+template <class charT> class C;
 
4905
+template <> class C<char>
 
4906
+{
 
4907
+  virtual void xparse (int &, const B<A<char> > &) const;
 
4908
+};
 
4909
+template <class T, class charT = char> class G : C<charT>
 
4910
+{
 
4911
+public:
 
4912
+  G (void *) {}
 
4913
+  void default_value (const T &);
 
4914
+  void xparse (int &, const B<A<charT> > &) const;
 
4915
+};
 
4916
+template <class T, class charT>
 
4917
+void validate (int &, const B<A<charT> > &, T *, int);
 
4918
+template <class T, class charT>
 
4919
+void G<T, charT>::xparse (int &p1, const B<A<charT> > &p2) const
 
4920
+{
 
4921
+  validate (p1, p2, (T *)0, 0);
 
4922
+}
 
4923
+template <class T> G<T> *value (T *) { return new G<T>(0); }
 
4924
+namespace Eigen
 
4925
+{
 
4926
+template <typename T> struct D;
 
4927
+template <typename, int, int, int = 0, int = 0, int = 0 > class F;
 
4928
+template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
 
4929
+          int _MaxCols>
 
4930
+struct D<F<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
 
4931
+{
 
4932
+  typedef _Scalar Scalar;
 
4933
+};
 
4934
+template <typename, int, int, int, int, int _MaxCols> class F
 
4935
+{
 
4936
+public:
 
4937
+  typedef typename Eigen::D<F>::Scalar Scalar;
 
4938
+  F (const Scalar &, const Scalar &, const Scalar &);
 
4939
+};
 
4940
+template <class... T>
 
4941
+void validate (int &, const B<A<char> > &, Eigen::F<T...> *);
 
4942
+}
 
4943
+int main (int, char *[])
 
4944
+{
 
4945
+  Eigen::F<double, 3, 1> a (0, 0, 0);
 
4946
+  value (&a)->default_value (Eigen::F<double, 3, 1>(0, 0, 0));
 
4947
+}
 
4948
Index: gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
 
4949
===================================================================
 
4950
--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../tags/gcc_4_8_3_release)
 
4951
+++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../branches/gcc-4_8-branch)
 
4952
@@ -0,0 +1,13 @@
 
4953
+// PR c++/58714
 
4954
+// { dg-do compile { target c++11 } }
 
4955
+
 
4956
+struct X {
 
4957
+  X& operator=(const X&) = delete;
 
4958
+  X& operator=(X&& ) = default;
 
4959
+};
 
4960
+
 
4961
+void f(bool t) {
 
4962
+  X a, b;
 
4963
+  *(t ? &a : &b) = X();
 
4964
+  (t ? a : b) = X();
 
4965
+}
 
4966
Index: gcc/testsuite/g++.dg/cpp0x/overload3.C
 
4967
===================================================================
 
4968
--- a/src/gcc/testsuite/g++.dg/cpp0x/overload3.C        (.../tags/gcc_4_8_3_release)
 
4969
+++ b/src/gcc/testsuite/g++.dg/cpp0x/overload3.C        (.../branches/gcc-4_8-branch)
 
4970
@@ -0,0 +1,17 @@
 
4971
+// PR c++/59823
 
4972
+// { dg-options "-std=c++11" }
 
4973
+
 
4974
+struct X { };
 
4975
+
 
4976
+void f(X&&);                   // { dg-message "void f" }
 
4977
+
 
4978
+struct wrap
 
4979
+{
 
4980
+  operator const X&() const;
 
4981
+};
 
4982
+
 
4983
+int main()
 
4984
+{
 
4985
+  wrap w;
 
4986
+  f(w);                                // { dg-error "lvalue" }
 
4987
+}
 
4988
Index: gcc/testsuite/g++.dg/ipa/pr62015.C
 
4989
===================================================================
 
4990
--- a/src/gcc/testsuite/g++.dg/ipa/pr62015.C    (.../tags/gcc_4_8_3_release)
 
4991
+++ b/src/gcc/testsuite/g++.dg/ipa/pr62015.C    (.../branches/gcc-4_8-branch)
 
4992
@@ -0,0 +1,55 @@
 
4993
+/* { dg-do run } */
 
4994
+/* { dg-options "-O3 -std=c++11"  } */
 
4995
+
 
4996
+
 
4997
+extern "C" int printf(const char *fmt, ...);
 
4998
+extern "C" void abort(void);
 
4999
+
 
5000
+struct Side {
 
5001
+    enum _Value { Left, Right, Invalid };
 
5002
+
 
5003
+    constexpr Side() : _value(Invalid) {}
 
5004
+    constexpr Side(_Value value) : _value(value) {}
 
5005
+    operator _Value() const { return (_Value)_value; }
 
5006
+
 
5007
+  private:
 
5008
+    char _value;
 
5009
+};
 
5010
+
 
5011
+struct A {
 
5012
+    void init();
 
5013
+    void adjust(Side side, bool final);
 
5014
+    void move(Side side);
 
5015
+};
 
5016
+
 
5017
+void A::init()
 
5018
+{
 
5019
+    adjust(Side::Invalid, false);
 
5020
+}
 
5021
+
 
5022
+static void __attribute__((noinline))
 
5023
+check (int v, int final)
 
5024
+{
 
5025
+    if (v != 0)
 
5026
+      abort();
 
5027
+}
 
5028
+
 
5029
+
 
5030
+__attribute__((noinline))
 
5031
+void A::adjust(Side side, bool final)
 
5032
+{
 
5033
+  check ((int)side, final);
 
5034
+}
 
5035
+
 
5036
+void A::move(Side side)
 
5037
+{
 
5038
+    adjust(side, false);
 
5039
+    adjust(side, true);
 
5040
+}
 
5041
+
 
5042
+int main()
 
5043
+{
 
5044
+    A t;
 
5045
+    t.move(Side::Left);
 
5046
+    return 0;
 
5047
+}
 
5048
Index: gcc/testsuite/g++.dg/template/local-fn1.C
 
5049
===================================================================
 
5050
--- a/src/gcc/testsuite/g++.dg/template/local-fn1.C     (.../tags/gcc_4_8_3_release)
 
5051
+++ b/src/gcc/testsuite/g++.dg/template/local-fn1.C     (.../branches/gcc-4_8-branch)
 
5052
@@ -0,0 +1,8 @@
 
5053
+// PR c++/60605
 
5054
+
 
5055
+template <typename T = int>
 
5056
+struct Foo {
 
5057
+    void bar() {
 
5058
+        void bug();
 
5059
+    }
 
5060
+};
 
5061
Index: gcc/testsuite/g++.dg/template/conv14.C
 
5062
===================================================================
 
5063
--- a/src/gcc/testsuite/g++.dg/template/conv14.C        (.../tags/gcc_4_8_3_release)
 
5064
+++ b/src/gcc/testsuite/g++.dg/template/conv14.C        (.../branches/gcc-4_8-branch)
 
5065
@@ -0,0 +1,30 @@
 
5066
+// PR c++/61647
 
5067
+
 
5068
+class XX;
 
5069
+
 
5070
+template<typename Container, typename Key>
 
5071
+struct Accessor;
 
5072
+
 
5073
+template<typename Container, typename Key, typename KeyStore = Key>
 
5074
+class Variant {
 
5075
+protected:
 
5076
+    KeyStore index;
 
5077
+    Container state;
 
5078
+public:
 
5079
+    Variant(Container st, const Key& i) : index(i), state(st) {}
 
5080
+
 
5081
+    template<typename T>
 
5082
+    operator T() const {
 
5083
+        return Accessor<Container, KeyStore>::template get<T>(state, index);
 
5084
+    }
 
5085
+};
 
5086
+
 
5087
+class AutoCleanVariant : public Variant<XX*, int> {
 
5088
+public:
 
5089
+    AutoCleanVariant(XX* st, int i) : Variant<XX*,int>(st,i) {}
 
5090
+
 
5091
+    template<typename T>
 
5092
+    operator T() const {
 
5093
+         return Variant<XX*, int>::operator T();
 
5094
+    }
 
5095
+};
 
5096
Index: gcc/testsuite/g++.dg/template/friend55.C
 
5097
===================================================================
 
5098
--- a/src/gcc/testsuite/g++.dg/template/friend55.C      (.../tags/gcc_4_8_3_release)
 
5099
+++ b/src/gcc/testsuite/g++.dg/template/friend55.C      (.../branches/gcc-4_8-branch)
 
5100
@@ -0,0 +1,18 @@
 
5101
+// PR c++/59956
 
5102
+
 
5103
+template <int I> struct A;
 
5104
+template <int I> class B {
 
5105
+  int i;
 
5106
+  template <int A_S> friend void A<A_S>::impl();
 
5107
+};
 
5108
+
 
5109
+B<0> b1;
 
5110
+template<int I>struct A { void impl(); };
 
5111
+B<1> b2;
 
5112
+
 
5113
+template<int I> void A<I>::impl() { ++b1.i; ++b2.i; }
 
5114
+
 
5115
+int main()
 
5116
+{
 
5117
+  A<0>().impl();
 
5118
+}
 
5119
Index: gcc/testsuite/g++.dg/template/memclass5.C
 
5120
===================================================================
 
5121
--- a/src/gcc/testsuite/g++.dg/template/memclass5.C     (.../tags/gcc_4_8_3_release)
 
5122
+++ b/src/gcc/testsuite/g++.dg/template/memclass5.C     (.../branches/gcc-4_8-branch)
 
5123
@@ -0,0 +1,26 @@
 
5124
+// PR c++/60241
 
5125
+
 
5126
+template <typename T>
 
5127
+struct x
 
5128
+{
 
5129
+    template <typename U>
 
5130
+    struct y
 
5131
+    {
 
5132
+        typedef T result2;
 
5133
+    };
 
5134
+
 
5135
+    typedef y<int> zy;
 
5136
+};
 
5137
+
 
5138
+template<>
 
5139
+template<class T>
 
5140
+struct x<int>::y
 
5141
+{
 
5142
+    typedef double result2;
 
5143
+};
 
5144
+
 
5145
+int main()
 
5146
+{
 
5147
+    x<int>::zy::result2 xxx;
 
5148
+    x<int>::y<int>::result2 xxx2;
 
5149
+}
 
5150
Index: gcc/testsuite/g++.dg/template/ptrmem27.C
 
5151
===================================================================
 
5152
--- a/src/gcc/testsuite/g++.dg/template/ptrmem27.C      (.../tags/gcc_4_8_3_release)
 
5153
+++ b/src/gcc/testsuite/g++.dg/template/ptrmem27.C      (.../branches/gcc-4_8-branch)
 
5154
@@ -0,0 +1,22 @@
 
5155
+// PR c++/61500
 
5156
+
 
5157
+struct X {
 
5158
+  int i;
 
5159
+  int j;
 
5160
+
 
5161
+  int foo(int X::* ptr);
 
5162
+
 
5163
+  template <int X::* ptr>
 
5164
+  int bar();
 
5165
+};
 
5166
+
 
5167
+int X::foo(int X::* ptr) {
 
5168
+  int* p = &(this->*ptr);  // OK.
 
5169
+  return *p;
 
5170
+}
 
5171
+
 
5172
+template <int X::* ptr>
 
5173
+int X::bar() {
 
5174
+  int* p = &(this->*ptr);  // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
 
5175
+  return *p;
 
5176
+}
 
5177
Index: gcc/cp/tree.c
 
5178
===================================================================
 
5179
--- a/src/gcc/cp/tree.c (.../tags/gcc_4_8_3_release)
 
5180
+++ b/src/gcc/cp/tree.c (.../branches/gcc-4_8-branch)
 
5181
@@ -97,6 +97,16 @@
 
5182
     case IMAGPART_EXPR:
 
5183
       return lvalue_kind (TREE_OPERAND (ref, 0));
 
5184
 
 
5185
+    case MEMBER_REF:
 
5186
+    case DOTSTAR_EXPR:
 
5187
+      if (TREE_CODE (ref) == MEMBER_REF)
 
5188
+       op1_lvalue_kind = clk_ordinary;
 
5189
+      else
 
5190
+       op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
 
5191
+      if (TYPE_PTRMEMFUNC_P (TREE_TYPE (TREE_OPERAND (ref, 1))))
 
5192
+       op1_lvalue_kind = clk_none;
 
5193
+      return op1_lvalue_kind;
 
5194
+
 
5195
     case COMPONENT_REF:
 
5196
       op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
 
5197
       /* Look at the member designator.  */
 
5198
@@ -3738,6 +3748,10 @@
 
5199
     {
 
5200
       init_expr = get_target_expr (exp);
 
5201
       exp = TARGET_EXPR_SLOT (init_expr);
 
5202
+      if (CLASS_TYPE_P (TREE_TYPE (exp)))
 
5203
+       exp = move (exp);
 
5204
+      else
 
5205
+       exp = rvalue (exp);
 
5206
     }
 
5207
   else
 
5208
     {
 
5209
Index: gcc/cp/ChangeLog
 
5210
===================================================================
 
5211
--- a/src/gcc/cp/ChangeLog      (.../tags/gcc_4_8_3_release)
 
5212
+++ b/src/gcc/cp/ChangeLog      (.../branches/gcc-4_8-branch)
 
5213
@@ -1,3 +1,67 @@
 
5214
+2014-08-07  Jason Merrill  <jason@redhat.com>
 
5215
+
 
5216
+       PR c++/61959
 
5217
+       * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
 
5218
+
 
5219
+       PR c++/58714
 
5220
+       * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
 
5221
+
 
5222
+2014-01-27  Jason Merrill  <jason@redhat.com>
 
5223
+
 
5224
+       PR c++/59823
 
5225
+       Core DR 1138
 
5226
+       * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
 
5227
+       list-initialization.  A conversion to rvalue ref that involves
 
5228
+       an lvalue-rvalue conversion is bad.
 
5229
+       (convert_like_real): Give helpful error message.
 
5230
+
 
5231
+2014-01-29  Jason Merrill  <jason@redhat.com>
 
5232
+
 
5233
+       PR c++/59956
 
5234
+       * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
 
5235
+       have a friend template in a class template.
 
5236
+       * pt.c (tsubst_friend_function): Look through it.
 
5237
+       (push_template_decl_real): A friend member template is
 
5238
+       primary.
 
5239
+
 
5240
+2014-02-21  Jason Merrill  <jason@redhat.com>
 
5241
+
 
5242
+       PR c++/60241
 
5243
+       * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
 
5244
+       of the partial instantiation, not the most general template.
 
5245
+       (maybe_process_partial_specialization): Reassign everything on
 
5246
+       that list.
 
5247
+
 
5248
+2014-03-05  Jason Merrill  <jason@redhat.com>
 
5249
+
 
5250
+       PR c++/60361
 
5251
+       * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
 
5252
+       if re-parsing might succeed.
 
5253
+       * semantics.c (finish_id_expression): Use of a parameter outside
 
5254
+       the function body is a parse error.
 
5255
+
 
5256
+2014-06-30  Jason Merrill  <jason@redhat.com>
 
5257
+
 
5258
+       PR c++/61647
 
5259
+       * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
 
5260
+
 
5261
+       PR c++/61539
 
5262
+       * pt.c (unify_one_argument): Type/expression mismatch just causes
 
5263
+       deduction failure.
 
5264
+
 
5265
+       PR c++/61500
 
5266
+       * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
 
5267
+
 
5268
+2014-06-17  Jason Merrill  <jason@redhat.com>
 
5269
+
 
5270
+       PR c++/60605
 
5271
+       * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
 
5272
+
 
5273
+2014-06-02  Jason Merrill  <jason@redhat.com>
 
5274
+
 
5275
+       PR c++/61134
 
5276
+       * pt.c (pack_deducible_p): Handle canonicalization.
 
5277
+
 
5278
 2014-05-22  Release Manager
 
5279
 
 
5280
        * GCC 4.8.3 released.
 
5281
Index: gcc/cp/pt.c
 
5282
===================================================================
 
5283
--- a/src/gcc/cp/pt.c   (.../tags/gcc_4_8_3_release)
 
5284
+++ b/src/gcc/cp/pt.c   (.../branches/gcc-4_8-branch)
 
5285
@@ -907,11 +907,13 @@
 
5286
               t; t = TREE_CHAIN (t))
 
5287
            {
 
5288
              tree inst = TREE_VALUE (t);
 
5289
-             if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst))
 
5290
+             if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)
 
5291
+                 || !COMPLETE_OR_OPEN_TYPE_P (inst))
 
5292
                {
 
5293
                  /* We already have a full specialization of this partial
 
5294
-                    instantiation.  Reassign it to the new member
 
5295
-                    specialization template.  */
 
5296
+                    instantiation, or a full specialization has been
 
5297
+                    looked up but not instantiated.  Reassign it to the
 
5298
+                    new member specialization template.  */
 
5299
                  spec_entry elt;
 
5300
                  spec_entry *entry;
 
5301
                  void **slot;
 
5302
@@ -930,7 +932,7 @@
 
5303
                  *entry = elt;
 
5304
                  *slot = entry;
 
5305
                }
 
5306
-             else if (COMPLETE_OR_OPEN_TYPE_P (inst))
 
5307
+             else
 
5308
                /* But if we've had an implicit instantiation, that's a
 
5309
                   problem ([temp.expl.spec]/6).  */
 
5310
                error ("specialization %qT after instantiation %qT",
 
5311
@@ -4308,7 +4310,8 @@
 
5312
      in the template-parameter-list of the definition of a member of a
 
5313
      class template.  */
 
5314
 
 
5315
-  if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL)
 
5316
+  if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL
 
5317
+      || (TREE_CODE (decl) == FUNCTION_DECL && DECL_LOCAL_FUNCTION_P (decl)))
 
5318
     /* You can't have a function template declaration in a local
 
5319
        scope, nor you can you define a member of a class template in a
 
5320
        local scope.  */
 
5321
@@ -4572,7 +4575,8 @@
 
5322
     DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
 
5323
 
 
5324
   /* See if this is a primary template.  */
 
5325
-  if (is_friend && ctx)
 
5326
+  if (is_friend && ctx
 
5327
+      && uses_template_parms_level (ctx, processing_template_decl))
 
5328
     /* A friend template that specifies a class context, i.e.
 
5329
          template <typename T> friend void A<T>::f();
 
5330
        is not primary.  */
 
5331
@@ -7454,7 +7458,7 @@
 
5332
        }
 
5333
 
 
5334
       /* Let's consider the explicit specialization of a member
 
5335
-         of a class template specialization that is implicitely instantiated,
 
5336
+         of a class template specialization that is implicitly instantiated,
 
5337
         e.g.:
 
5338
             template<class T>
 
5339
             struct S
 
5340
@@ -7552,9 +7556,9 @@
 
5341
 
 
5342
       /* Note this use of the partial instantiation so we can check it
 
5343
         later in maybe_process_partial_specialization.  */
 
5344
-      DECL_TEMPLATE_INSTANTIATIONS (templ)
 
5345
+      DECL_TEMPLATE_INSTANTIATIONS (found)
 
5346
        = tree_cons (arglist, t,
 
5347
-                    DECL_TEMPLATE_INSTANTIATIONS (templ));
 
5348
+                    DECL_TEMPLATE_INSTANTIATIONS (found));
 
5349
 
 
5350
       if (TREE_CODE (template_type) == ENUMERAL_TYPE && !is_dependent_type)
 
5351
        /* Now that the type has been registered on the instantiations
 
5352
@@ -8289,10 +8293,17 @@
 
5353
 
 
5354
       if (COMPLETE_TYPE_P (context))
 
5355
        {
 
5356
+         tree fn = new_friend;
 
5357
+         /* do_friend adds the TEMPLATE_DECL for any member friend
 
5358
+            template even if it isn't a member template, i.e.
 
5359
+              template <class T> friend A<T>::f();
 
5360
+            Look through it in that case.  */
 
5361
+         if (TREE_CODE (fn) == TEMPLATE_DECL
 
5362
+             && !PRIMARY_TEMPLATE_P (fn))
 
5363
+           fn = DECL_TEMPLATE_RESULT (fn);
 
5364
          /* Check to see that the declaration is really present, and,
 
5365
             possibly obtain an improved declaration.  */
 
5366
-         tree fn = check_classfn (context,
 
5367
-                                  new_friend, NULL_TREE);
 
5368
+         fn = check_classfn (context, fn, NULL_TREE);
 
5369
 
 
5370
          if (fn)
 
5371
            new_friend = fn;
 
5372
@@ -14934,7 +14945,7 @@
 
5373
        continue;
 
5374
       for (packs = PACK_EXPANSION_PARAMETER_PACKS (type);
 
5375
           packs; packs = TREE_CHAIN (packs))
 
5376
-       if (TREE_VALUE (packs) == parm)
 
5377
+       if (template_args_equal (TREE_VALUE (packs), parm))
 
5378
          {
 
5379
            /* The template parameter pack is used in a function parameter
 
5380
               pack.  If this is the end of the parameter list, the
 
5381
@@ -15502,8 +15513,9 @@
 
5382
        maybe_adjust_types_for_deduction (strict, &parm, &arg, arg_expr);
 
5383
     }
 
5384
   else
 
5385
-    gcc_assert ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
 
5386
-               == (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL));
 
5387
+    if ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
 
5388
+       != (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL))
 
5389
+      return unify_template_argument_mismatch (explain_p, parm, arg);
 
5390
 
 
5391
   /* For deduction from an init-list we need the actual list.  */
 
5392
   if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr))
 
5393
@@ -20009,7 +20021,12 @@
 
5394
        return true;
 
5395
 
 
5396
       if (BASELINK_P (expression))
 
5397
-       expression = BASELINK_FUNCTIONS (expression);
 
5398
+       {
 
5399
+         if (BASELINK_OPTYPE (expression)
 
5400
+             && dependent_type_p (BASELINK_OPTYPE (expression)))
 
5401
+           return true;
 
5402
+         expression = BASELINK_FUNCTIONS (expression);
 
5403
+       }
 
5404
 
 
5405
       if (TREE_CODE (expression) == TEMPLATE_ID_EXPR)
 
5406
        {
 
5407
Index: gcc/cp/semantics.c
 
5408
===================================================================
 
5409
--- a/src/gcc/cp/semantics.c    (.../tags/gcc_4_8_3_release)
 
5410
+++ b/src/gcc/cp/semantics.c    (.../branches/gcc-4_8-branch)
 
5411
@@ -3108,7 +3108,7 @@
 
5412
          && DECL_CONTEXT (decl) == NULL_TREE
 
5413
          && !cp_unevaluated_operand)
 
5414
        {
 
5415
-         error ("use of parameter %qD outside function body", decl);
 
5416
+         *error_msg = "use of parameter outside function body";
 
5417
          return error_mark_node;
 
5418
        }
 
5419
     }
 
5420
@@ -7296,7 +7296,9 @@
 
5421
          constructor_elt *inner = base_field_constructor_elt (n, ce->index);
 
5422
          inner->value = elt;
 
5423
        }
 
5424
-      else if (ce->index && TREE_CODE (ce->index) == NOP_EXPR)
 
5425
+      else if (ce->index
 
5426
+              && (TREE_CODE (ce->index) == NOP_EXPR
 
5427
+                  || TREE_CODE (ce->index) == POINTER_PLUS_EXPR))
 
5428
        {
 
5429
          /* This is an initializer for an empty base; now that we've
 
5430
             checked that it's constant, we can ignore it.  */
 
5431
Index: gcc/cp/parser.c
 
5432
===================================================================
 
5433
--- a/src/gcc/cp/parser.c       (.../tags/gcc_4_8_3_release)
 
5434
+++ b/src/gcc/cp/parser.c       (.../branches/gcc-4_8-branch)
 
5435
@@ -12831,7 +12831,12 @@
 
5436
      the effort required to do the parse, nor will we issue duplicate
 
5437
      error messages about problems during instantiation of the
 
5438
      template.  */
 
5439
-  if (start_of_id)
 
5440
+  if (start_of_id
 
5441
+      /* Don't do this if we had a parse error in a declarator; re-parsing
 
5442
+        might succeed if a name changes meaning (60361).  */
 
5443
+      && !(cp_parser_error_occurred (parser)
 
5444
+          && cp_parser_parsing_tentatively (parser)
 
5445
+          && parser->in_declarator_p))
 
5446
     {
 
5447
       cp_token *token = cp_lexer_token_at (parser->lexer, start_of_id);
 
5448
 
 
5449
Index: gcc/cp/call.c
 
5450
===================================================================
 
5451
--- a/src/gcc/cp/call.c (.../tags/gcc_4_8_3_release)
 
5452
+++ b/src/gcc/cp/call.c (.../branches/gcc-4_8-branch)
 
5453
@@ -1464,7 +1464,7 @@
 
5454
     {
 
5455
       maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
 
5456
       conv = implicit_conversion (to, from, expr, c_cast_p,
 
5457
-                                 flags, complain);
 
5458
+                                 flags|LOOKUP_NO_TEMP_BIND, complain);
 
5459
       if (!CLASS_TYPE_P (to)
 
5460
          && CONSTRUCTOR_NELTS (expr) == 1)
 
5461
        {
 
5462
@@ -1624,9 +1624,9 @@
 
5463
 
 
5464
   /* [dcl.init.ref]
 
5465
 
 
5466
-     Otherwise, the reference shall be to a non-volatile const type.
 
5467
-
 
5468
-     Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */
 
5469
+     Otherwise, the reference shall be an lvalue reference to a
 
5470
+     non-volatile const type, or the reference shall be an rvalue
 
5471
+     reference.  */
 
5472
   if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto))
 
5473
     return NULL;
 
5474
 
 
5475
@@ -1664,7 +1664,16 @@
 
5476
   /* This reference binding, unlike those above, requires the
 
5477
      creation of a temporary.  */
 
5478
   conv->need_temporary_p = true;
 
5479
-  conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto);
 
5480
+  if (TYPE_REF_IS_RVALUE (rto))
 
5481
+    {
 
5482
+      conv->rvaluedness_matches_p = 1;
 
5483
+      /* In the second case, if the reference is an rvalue reference and
 
5484
+        the second standard conversion sequence of the user-defined
 
5485
+        conversion sequence includes an lvalue-to-rvalue conversion, the
 
5486
+        program is ill-formed.  */
 
5487
+      if (conv->user_conv_p && next_conversion (conv)->kind == ck_rvalue)
 
5488
+       conv->bad_p = 1;
 
5489
+    }
 
5490
 
 
5491
   return conv;
 
5492
 }
 
5493
@@ -5811,7 +5820,7 @@
 
5494
       && convs->kind != ck_list
 
5495
       && convs->kind != ck_ambig
 
5496
       && (convs->kind != ck_ref_bind
 
5497
-         || convs->user_conv_p)
 
5498
+         || (convs->user_conv_p && next_conversion (convs)->bad_p))
 
5499
       && (convs->kind != ck_rvalue
 
5500
          || SCALAR_TYPE_P (totype))
 
5501
       && convs->kind != ck_base)
 
5502
@@ -6110,7 +6119,8 @@
 
5503
        if (convs->bad_p && !next_conversion (convs)->bad_p)
 
5504
          {
 
5505
            gcc_assert (TYPE_REF_IS_RVALUE (ref_type)
 
5506
-                       && real_lvalue_p (expr));
 
5507
+                       && (real_lvalue_p (expr)
 
5508
+                           || next_conversion(convs)->kind == ck_rvalue));
 
5509
 
 
5510
            error_at (loc, "cannot bind %qT lvalue to %qT",
 
5511
                      TREE_TYPE (expr), totype);
 
5512
Index: gcc/cp/friend.c
 
5513
===================================================================
 
5514
--- a/src/gcc/cp/friend.c       (.../tags/gcc_4_8_3_release)
 
5515
+++ b/src/gcc/cp/friend.c       (.../branches/gcc-4_8-branch)
 
5516
@@ -502,7 +502,13 @@
 
5517
                                  ? current_template_parms
 
5518
                                  : NULL_TREE);
 
5519
 
 
5520
-         if (template_member_p && decl && TREE_CODE (decl) == FUNCTION_DECL)
 
5521
+         if ((template_member_p
 
5522
+              /* Always pull out the TEMPLATE_DECL if we have a friend
 
5523
+                 template in a class template so that it gets tsubsted
 
5524
+                 properly later on (59956).  tsubst_friend_function knows
 
5525
+                 how to tell this apart from a member template.  */
 
5526
+              || (class_template_depth && friend_depth))
 
5527
+             && decl && TREE_CODE (decl) == FUNCTION_DECL)
 
5528
            decl = DECL_TI_TEMPLATE (decl);
 
5529
 
 
5530
          if (decl)
 
5531
Index: gcc/haifa-sched.c
 
5532
===================================================================
 
5533
--- a/src/gcc/haifa-sched.c     (.../tags/gcc_4_8_3_release)
 
5534
+++ b/src/gcc/haifa-sched.c     (.../branches/gcc-4_8-branch)
 
5535
@@ -2931,7 +2931,7 @@
 
5536
 {
 
5537
   advance_state (curr_state);
 
5538
   if (sched_verbose >= 6)
 
5539
-    fprintf (sched_dump, ";;\tAdvanced a state.\n");
 
5540
+    fprintf (sched_dump, ";;\tAdvance the current state.\n");
 
5541
 }
 
5542
 
 
5543
 /* Update register pressure after scheduling INSN.  */
 
5544
@@ -5964,6 +5964,7 @@
 
5545
   modulo_insns_scheduled = 0;
 
5546
 
 
5547
   ls.modulo_epilogue = false;
 
5548
+  ls.first_cycle_insn_p = true;
 
5549
 
 
5550
   /* Loop until all the insns in BB are scheduled.  */
 
5551
   while ((*current_sched_info->schedule_more_p) ())
 
5552
@@ -6034,7 +6035,6 @@
 
5553
       if (must_backtrack)
 
5554
        goto do_backtrack;
 
5555
 
 
5556
-      ls.first_cycle_insn_p = true;
 
5557
       ls.shadows_only_p = false;
 
5558
       cycle_issued_insns = 0;
 
5559
       ls.can_issue_more = issue_rate;
 
5560
@@ -6321,11 +6321,13 @@
 
5561
              break;
 
5562
            }
 
5563
        }
 
5564
+      ls.first_cycle_insn_p = true;
 
5565
     }
 
5566
   if (ls.modulo_epilogue)
 
5567
     success = true;
 
5568
  end_schedule:
 
5569
-  advance_one_cycle ();
 
5570
+  if (!ls.first_cycle_insn_p)
 
5571
+    advance_one_cycle ();
 
5572
   perform_replacements_new_cycle ();
 
5573
   if (modulo_ii > 0)
 
5574
     {
 
5575
Index: gcc/double-int.c
 
5576
===================================================================
 
5577
--- a/src/gcc/double-int.c      (.../tags/gcc_4_8_3_release)
 
5578
+++ b/src/gcc/double-int.c      (.../branches/gcc-4_8-branch)
 
5579
@@ -616,7 +616,7 @@
 
5580
                 == (unsigned HOST_WIDE_INT) htwice)
 
5581
                && (labs_den <= ltwice)))
 
5582
          {
 
5583
-           if (*hquo < 0)
 
5584
+           if (quo_neg)
 
5585
              /* quo = quo - 1;  */
 
5586
              add_double (*lquo, *hquo,
 
5587
                          (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
 
5588
Index: gcc/tree-ssa-math-opts.c
 
5589
===================================================================
 
5590
--- a/src/gcc/tree-ssa-math-opts.c      (.../tags/gcc_4_8_3_release)
 
5591
+++ b/src/gcc/tree-ssa-math-opts.c      (.../branches/gcc-4_8-branch)
 
5592
@@ -1537,7 +1537,7 @@
 
5593
 
 
5594
 struct symbolic_number {
 
5595
   unsigned HOST_WIDEST_INT n;
 
5596
-  int size;
 
5597
+  tree type;
 
5598
 };
 
5599
 
 
5600
 /* Perform a SHIFT or ROTATE operation by COUNT bits on symbolic
 
5601
@@ -1549,13 +1549,15 @@
 
5602
                 struct symbolic_number *n,
 
5603
                 int count)
 
5604
 {
 
5605
+  int bitsize = TYPE_PRECISION (n->type);
 
5606
+
 
5607
   if (count % 8 != 0)
 
5608
     return false;
 
5609
 
 
5610
   /* Zero out the extra bits of N in order to avoid them being shifted
 
5611
      into the significant bits.  */
 
5612
-  if (n->size < (int)sizeof (HOST_WIDEST_INT))
 
5613
-    n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
 
5614
+  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
 
5615
+    n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
 
5616
 
 
5617
   switch (code)
 
5618
     {
 
5619
@@ -1563,20 +1565,24 @@
 
5620
       n->n <<= count;
 
5621
       break;
 
5622
     case RSHIFT_EXPR:
 
5623
+      /* Arithmetic shift of signed type: result is dependent on the value.  */
 
5624
+      if (!TYPE_UNSIGNED (n->type)
 
5625
+         && (n->n & ((unsigned HOST_WIDEST_INT) 0xff << (bitsize - 8))))
 
5626
+       return false;
 
5627
       n->n >>= count;
 
5628
       break;
 
5629
     case LROTATE_EXPR:
 
5630
-      n->n = (n->n << count) | (n->n >> ((n->size * BITS_PER_UNIT) - count));
 
5631
+      n->n = (n->n << count) | (n->n >> (bitsize - count));
 
5632
       break;
 
5633
     case RROTATE_EXPR:
 
5634
-      n->n = (n->n >> count) | (n->n << ((n->size * BITS_PER_UNIT) - count));
 
5635
+      n->n = (n->n >> count) | (n->n << (bitsize - count));
 
5636
       break;
 
5637
     default:
 
5638
       return false;
 
5639
     }
 
5640
   /* Zero unused bits for size.  */
 
5641
-  if (n->size < (int)sizeof (HOST_WIDEST_INT))
 
5642
-    n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
 
5643
+  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
 
5644
+    n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
 
5645
   return true;
 
5646
 }
 
5647
 
 
5648
@@ -1593,7 +1599,7 @@
 
5649
   if (TREE_CODE (lhs_type) != INTEGER_TYPE)
 
5650
     return false;
 
5651
 
 
5652
-  if (TYPE_PRECISION (lhs_type) != n->size * BITS_PER_UNIT)
 
5653
+  if (TYPE_PRECISION (lhs_type) != TYPE_PRECISION (n->type))
 
5654
     return false;
 
5655
 
 
5656
   return true;
 
5657
@@ -1650,20 +1656,25 @@
 
5658
         to initialize the symbolic number.  */
 
5659
       if (!source_expr1)
 
5660
        {
 
5661
+         int size;
 
5662
+
 
5663
          /* Set up the symbolic number N by setting each byte to a
 
5664
             value between 1 and the byte size of rhs1.  The highest
 
5665
             order byte is set to n->size and the lowest order
 
5666
             byte to 1.  */
 
5667
-         n->size = TYPE_PRECISION (TREE_TYPE (rhs1));
 
5668
-         if (n->size % BITS_PER_UNIT != 0)
 
5669
+         n->type = TREE_TYPE (rhs1);
 
5670
+         size = TYPE_PRECISION (n->type);
 
5671
+         if (size % BITS_PER_UNIT != 0)
 
5672
            return NULL_TREE;
 
5673
-         n->size /= BITS_PER_UNIT;
 
5674
+         if (size > HOST_BITS_PER_WIDEST_INT)
 
5675
+           return NULL_TREE;
 
5676
+         size /= BITS_PER_UNIT;
 
5677
          n->n = (sizeof (HOST_WIDEST_INT) < 8 ? 0 :
 
5678
                  (unsigned HOST_WIDEST_INT)0x08070605 << 32 | 0x04030201);
 
5679
 
 
5680
-         if (n->size < (int)sizeof (HOST_WIDEST_INT))
 
5681
+         if (size < (int)sizeof (HOST_WIDEST_INT))
 
5682
            n->n &= ((unsigned HOST_WIDEST_INT)1 <<
 
5683
-                    (n->size * BITS_PER_UNIT)) - 1;
 
5684
+                    (size * BITS_PER_UNIT)) - 1;
 
5685
 
 
5686
          source_expr1 = rhs1;
 
5687
        }
 
5688
@@ -1672,12 +1683,12 @@
 
5689
        {
 
5690
        case BIT_AND_EXPR:
 
5691
          {
 
5692
-           int i;
 
5693
+           int i, size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
 
5694
            unsigned HOST_WIDEST_INT val = widest_int_cst_value (rhs2);
 
5695
            unsigned HOST_WIDEST_INT tmp = val;
 
5696
 
 
5697
            /* Only constants masking full bytes are allowed.  */
 
5698
-           for (i = 0; i < n->size; i++, tmp >>= BITS_PER_UNIT)
 
5699
+           for (i = 0; i < size; i++, tmp >>= BITS_PER_UNIT)
 
5700
              if ((tmp & 0xff) != 0 && (tmp & 0xff) != 0xff)
 
5701
                return NULL_TREE;
 
5702
 
 
5703
@@ -1693,12 +1704,24 @@
 
5704
          break;
 
5705
        CASE_CONVERT:
 
5706
          {
 
5707
-           int type_size;
 
5708
+           int type_size, old_type_size;
 
5709
+           tree type;
 
5710
 
 
5711
-           type_size = TYPE_PRECISION (gimple_expr_type (stmt));
 
5712
+           type = gimple_expr_type (stmt);
 
5713
+           type_size = TYPE_PRECISION (type);
 
5714
            if (type_size % BITS_PER_UNIT != 0)
 
5715
              return NULL_TREE;
 
5716
+           if (type_size > (int) HOST_BITS_PER_WIDEST_INT)
 
5717
+             return NULL_TREE;
 
5718
 
 
5719
+           /* Sign extension: result is dependent on the value.  */
 
5720
+           old_type_size = TYPE_PRECISION (n->type);
 
5721
+           if (!TYPE_UNSIGNED (n->type)
 
5722
+               && type_size > old_type_size
 
5723
+               && n->n &
 
5724
+                  ((unsigned HOST_WIDEST_INT) 0xff << (old_type_size - 8)))
 
5725
+             return NULL_TREE;
 
5726
+
 
5727
            if (type_size / BITS_PER_UNIT < (int)(sizeof (HOST_WIDEST_INT)))
 
5728
              {
 
5729
                /* If STMT casts to a smaller type mask out the bits not
 
5730
@@ -1705,7 +1728,7 @@
 
5731
                   belonging to the target type.  */
 
5732
                n->n &= ((unsigned HOST_WIDEST_INT)1 << type_size) - 1;
 
5733
              }
 
5734
-           n->size = type_size / BITS_PER_UNIT;
 
5735
+           n->type = type;
 
5736
          }
 
5737
          break;
 
5738
        default:
 
5739
@@ -1718,7 +1741,7 @@
 
5740
 
 
5741
   if (rhs_class == GIMPLE_BINARY_RHS)
 
5742
     {
 
5743
-      int i;
 
5744
+      int i, size;
 
5745
       struct symbolic_number n1, n2;
 
5746
       unsigned HOST_WIDEST_INT mask;
 
5747
       tree source_expr2;
 
5748
@@ -1742,11 +1765,12 @@
 
5749
          source_expr2 = find_bswap_1 (rhs2_stmt, &n2, limit - 1);
 
5750
 
 
5751
          if (source_expr1 != source_expr2
 
5752
-             || n1.size != n2.size)
 
5753
+             || TYPE_PRECISION (n1.type) != TYPE_PRECISION (n2.type))
 
5754
            return NULL_TREE;
 
5755
 
 
5756
-         n->size = n1.size;
 
5757
-         for (i = 0, mask = 0xff; i < n->size; i++, mask <<= BITS_PER_UNIT)
 
5758
+         n->type = n1.type;
 
5759
+         size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
 
5760
+         for (i = 0, mask = 0xff; i < size; i++, mask <<= BITS_PER_UNIT)
 
5761
            {
 
5762
              unsigned HOST_WIDEST_INT masked1, masked2;
 
5763
 
 
5764
@@ -1785,7 +1809,7 @@
 
5765
 
 
5766
   struct symbolic_number n;
 
5767
   tree source_expr;
 
5768
-  int limit;
 
5769
+  int limit, bitsize;
 
5770
 
 
5771
   /* The last parameter determines the depth search limit.  It usually
 
5772
      correlates directly to the number of bytes to be touched.  We
 
5773
@@ -1800,13 +1824,14 @@
 
5774
     return NULL_TREE;
 
5775
 
 
5776
   /* Zero out the extra bits of N and CMP.  */
 
5777
-  if (n.size < (int)sizeof (HOST_WIDEST_INT))
 
5778
+  bitsize = TYPE_PRECISION (n.type);
 
5779
+  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
 
5780
     {
 
5781
       unsigned HOST_WIDEST_INT mask =
 
5782
-       ((unsigned HOST_WIDEST_INT)1 << (n.size * BITS_PER_UNIT)) - 1;
 
5783
+       ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
 
5784
 
 
5785
       n.n &= mask;
 
5786
-      cmp >>= (sizeof (HOST_WIDEST_INT) - n.size) * BITS_PER_UNIT;
 
5787
+      cmp >>= sizeof (HOST_WIDEST_INT) * BITS_PER_UNIT - bitsize;
 
5788
     }
 
5789
 
 
5790
   /* A complete byte swap should make the symbolic number to start
 
5791
@@ -1828,7 +1853,7 @@
 
5792
   bool changed = false;
 
5793
   tree bswap16_type = NULL_TREE, bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
 
5794
 
 
5795
-  if (BITS_PER_UNIT != 8)
 
5796
+  if (BITS_PER_UNIT != 8 || CHAR_BIT != 8)
 
5797
     return 0;
 
5798
 
 
5799
   if (sizeof (HOST_WIDEST_INT) < 8)
 
5800
Index: gcc/ifcvt.c
 
5801
===================================================================
 
5802
--- a/src/gcc/ifcvt.c   (.../tags/gcc_4_8_3_release)
 
5803
+++ b/src/gcc/ifcvt.c   (.../branches/gcc-4_8-branch)
 
5804
@@ -294,6 +294,28 @@
 
5805
 
 
5806
   return (e) ? e->dest : NULL_BLOCK;
 
5807
 }
 
5808
+
 
5809
+/* Return true if RTXs A and B can be safely interchanged.  */
 
5810
+
 
5811
+static bool
 
5812
+rtx_interchangeable_p (const_rtx a, const_rtx b)
 
5813
+{
 
5814
+  if (!rtx_equal_p (a, b))
 
5815
+    return false;
 
5816
+
 
5817
+  if (GET_CODE (a) != MEM)
 
5818
+    return true;
 
5819
+
 
5820
+  /* A dead type-unsafe memory reference is legal, but a live type-unsafe memory
 
5821
+     reference is not.  Interchanging a dead type-unsafe memory reference with
 
5822
+     a live type-safe one creates a live type-unsafe memory reference, in other
 
5823
+     words, it makes the program illegal.
 
5824
+     We check here conservatively whether the two memory references have equal
 
5825
+     memory attributes.  */
 
5826
+
 
5827
+  return mem_attrs_eq_p (get_mem_attrs (a), get_mem_attrs (b));
 
5828
+}
 
5829
+
 
5830
 
 
5831
 /* Go through a bunch of insns, converting them to conditional
 
5832
    execution format if possible.  Return TRUE if all of the non-note
 
5833
@@ -1014,6 +1036,9 @@
 
5834
       || (rtx_equal_p (if_info->a, XEXP (cond, 1))
 
5835
          && rtx_equal_p (if_info->b, XEXP (cond, 0))))
 
5836
     {
 
5837
+      if (!rtx_interchangeable_p (if_info->a, if_info->b))
 
5838
+       return FALSE;
 
5839
+
 
5840
       y = (code == EQ) ? if_info->a : if_info->b;
 
5841
 
 
5842
       /* Avoid generating the move if the source is the destination.  */
 
5843
@@ -2483,7 +2508,7 @@
 
5844
       if (! insn_b
 
5845
          || insn_b != last_active_insn (else_bb, FALSE)
 
5846
          || (set_b = single_set (insn_b)) == NULL_RTX
 
5847
-         || ! rtx_equal_p (x, SET_DEST (set_b)))
 
5848
+         || ! rtx_interchangeable_p (x, SET_DEST (set_b)))
 
5849
        return FALSE;
 
5850
     }
 
5851
   else
 
5852
@@ -2496,7 +2521,7 @@
 
5853
          || BLOCK_FOR_INSN (insn_b) != BLOCK_FOR_INSN (if_info->cond_earliest)
 
5854
          || !NONJUMP_INSN_P (insn_b)
 
5855
          || (set_b = single_set (insn_b)) == NULL_RTX
 
5856
-         || ! rtx_equal_p (x, SET_DEST (set_b))
 
5857
+         || ! rtx_interchangeable_p (x, SET_DEST (set_b))
 
5858
          || ! noce_operand_ok (SET_SRC (set_b))
 
5859
          || reg_overlap_mentioned_p (x, SET_SRC (set_b))
 
5860
          || modified_between_p (SET_SRC (set_b), insn_b, jump)
 
5861
@@ -2562,7 +2587,7 @@
 
5862
 
 
5863
   /* Look and see if A and B are really the same.  Avoid creating silly
 
5864
      cmove constructs that no one will fix up later.  */
 
5865
-  if (rtx_equal_p (a, b))
 
5866
+  if (rtx_interchangeable_p (a, b))
 
5867
     {
 
5868
       /* If we have an INSN_B, we don't have to create any new rtl.  Just
 
5869
         move the instruction that we already have.  If we don't have an
 
5870
@@ -4246,6 +4271,9 @@
 
5871
   old_dest = JUMP_LABEL (jump);
 
5872
   if (other_bb != new_dest)
 
5873
     {
 
5874
+      if (!any_condjump_p (jump))
 
5875
+       goto cancel;
 
5876
+
 
5877
       if (JUMP_P (BB_END (dest_edge->src)))
 
5878
        new_dest_label = JUMP_LABEL (BB_END (dest_edge->src));
 
5879
       else if (new_dest == EXIT_BLOCK_PTR)
 
5880
Index: gcc/dwarf2out.c
 
5881
===================================================================
 
5882
--- a/src/gcc/dwarf2out.c       (.../tags/gcc_4_8_3_release)
 
5883
+++ b/src/gcc/dwarf2out.c       (.../branches/gcc-4_8-branch)
 
5884
@@ -12234,7 +12234,7 @@
 
5885
              op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
 
5886
                                        VAR_INIT_STATUS_INITIALIZED);
 
5887
              if (op1 == 0)
 
5888
-               break;
 
5889
+               return NULL;
 
5890
              add_loc_descr (&mem_loc_result, op1);
 
5891
              add_loc_descr (&mem_loc_result,
 
5892
                             new_loc_descr (DW_OP_plus, 0, 0));
 
5893
Index: gcc/expr.c
 
5894
===================================================================
 
5895
--- a/src/gcc/expr.c    (.../tags/gcc_4_8_3_release)
 
5896
+++ b/src/gcc/expr.c    (.../branches/gcc-4_8-branch)
 
5897
@@ -10603,7 +10603,7 @@
 
5898
       || !host_integerp (TREE_OPERAND (offset, 1), 1)
 
5899
       || compare_tree_int (TREE_OPERAND (offset, 1),
 
5900
                           BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0
 
5901
-      || !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
 
5902
+      || exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
 
5903
     return 0;
 
5904
 
 
5905
   /* Look at the first operand of BIT_AND_EXPR and strip any conversion.
 
5906
Index: gcc/ada/socket.c
 
5907
===================================================================
 
5908
--- a/src/gcc/ada/socket.c      (.../tags/gcc_4_8_3_release)
 
5909
+++ b/src/gcc/ada/socket.c      (.../branches/gcc-4_8-branch)
 
5910
@@ -212,7 +212,7 @@
 
5911
   struct hostent *rh;
 
5912
   int ri;
 
5913
 
 
5914
-#if defined(__linux__) || defined(__GLIBC__)
 
5915
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
 
5916
   (void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
 
5917
 #else
 
5918
   rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);
 
5919
Index: gcc/ada/ChangeLog
 
5920
===================================================================
 
5921
--- a/src/gcc/ada/ChangeLog     (.../tags/gcc_4_8_3_release)
 
5922
+++ b/src/gcc/ada/ChangeLog     (.../branches/gcc-4_8-branch)
 
5923
@@ -1,3 +1,12 @@
 
5924
+2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
 
5925
+
 
5926
+       * socket.c: For RTEMS, use correct prototype of gethostbyname_r().
 
5927
+       * gsocket.h Add include of <unistd.h> on RTEMS.
 
5928
+
 
5929
+2014-08-11  Joel Sherrill <joel.sherrill@oarcorp.com>
 
5930
+
 
5931
+       * s-osinte-rtems.adb: Correct formatting of line in license block.
 
5932
+
 
5933
 2014-05-22  Release Manager
 
5934
 
 
5935
        * GCC 4.8.3 released.
 
5936
Index: gcc/ada/s-osinte-rtems.adb
 
5937
===================================================================
 
5938
--- a/src/gcc/ada/s-osinte-rtems.adb    (.../tags/gcc_4_8_3_release)
 
5939
+++ b/src/gcc/ada/s-osinte-rtems.adb    (.../branches/gcc-4_8-branch)
 
5940
@@ -22,7 +22,7 @@
 
5941
 -- You should have received a copy of the GNU General Public License and    --
 
5942
 -- a copy of the GCC Runtime Library Exception along with this program;     --
 
5943
 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
 
5944
--- <http://www.gnu.org/licenses/>.                                         
 
5945
+-- <http://www.gnu.org/licenses/>.                                          --
 
5946
 --                                                                          --
 
5947
 -- GNARL was developed by the GNARL team at Florida State University. It is --
 
5948
 -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
 
5949
Index: gcc/ada/gsocket.h
 
5950
===================================================================
 
5951
--- a/src/gcc/ada/gsocket.h     (.../tags/gcc_4_8_3_release)
 
5952
+++ b/src/gcc/ada/gsocket.h     (.../branches/gcc-4_8-branch)
 
5953
@@ -183,6 +183,11 @@
 
5954
 #include <sys/time.h>
 
5955
 #endif
 
5956
 
 
5957
+#if defined(__rtems__)
 
5958
+#include <unistd.h>
 
5959
+/* Required, for read(), write(), and close() */
 
5960
+#endif
 
5961
+
 
5962
 /*
 
5963
  * RTEMS has these .h files but not until you have built and installed RTEMS.
 
5964
  * When building a C/C++ toolset, you also build the newlib C library, so the
 
5965
Index: gcc/tree-ssa-ifcombine.c
 
5966
===================================================================
 
5967
--- a/src/gcc/tree-ssa-ifcombine.c      (.../tags/gcc_4_8_3_release)
 
5968
+++ b/src/gcc/tree-ssa-ifcombine.c      (.../branches/gcc-4_8-branch)
 
5969
@@ -105,7 +105,11 @@
 
5970
     {
 
5971
       gimple stmt = gsi_stmt (gsi);
 
5972
 
 
5973
+      if (is_gimple_debug (stmt))
 
5974
+       continue;
 
5975
+
 
5976
       if (gimple_has_side_effects (stmt)
 
5977
+         || gimple_could_trap_p (stmt)
 
5978
          || gimple_vuse (stmt))
 
5979
        return false;
 
5980
     }
 
5981
@@ -197,7 +201,8 @@
 
5982
       while (is_gimple_assign (stmt)
 
5983
             && ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
 
5984
                  && (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (stmt)))
 
5985
-                     <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
 
5986
+                     <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt))))
 
5987
+                 && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
 
5988
                 || gimple_assign_ssa_name_copy_p (stmt)))
 
5989
        stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
 
5990
 
 
5991
Index: gcc/sel-sched-ir.c
 
5992
===================================================================
 
5993
--- a/src/gcc/sel-sched-ir.c    (.../tags/gcc_4_8_3_release)
 
5994
+++ b/src/gcc/sel-sched-ir.c    (.../branches/gcc-4_8-branch)
 
5995
@@ -162,7 +162,7 @@
 
5996
 static void free_av_set (basic_block);
 
5997
 static void invalidate_av_set (basic_block);
 
5998
 static void extend_insn_data (void);
 
5999
-static void sel_init_new_insn (insn_t, int);
 
6000
+static void sel_init_new_insn (insn_t, int, int = -1);
 
6001
 static void finish_insns (void);
 
6002
 
 
6003
 /* Various list functions.  */
 
6004
@@ -4011,9 +4011,10 @@
 
6005
   return seqno;
 
6006
 }
 
6007
 
 
6008
-/* Compute seqno for INSN by its preds or succs.  */
 
6009
+/* Compute seqno for INSN by its preds or succs.  Use OLD_SEQNO to compute
 
6010
+   seqno in corner cases.  */
 
6011
 static int
 
6012
-get_seqno_for_a_jump (insn_t insn)
 
6013
+get_seqno_for_a_jump (insn_t insn, int old_seqno)
 
6014
 {
 
6015
   int seqno;
 
6016
 
 
6017
@@ -4069,8 +4070,16 @@
 
6018
   if (seqno < 0)
 
6019
     seqno = get_seqno_by_succs (insn);
 
6020
 
 
6021
+  if (seqno < 0)
 
6022
+    {
 
6023
+      /* The only case where this could be here legally is that the only
 
6024
+        unscheduled insn was a conditional jump that got removed and turned
 
6025
+        into this unconditional one.  Initialize from the old seqno
 
6026
+        of that jump passed down to here.  */
 
6027
+      seqno = old_seqno;
 
6028
+    }
 
6029
+
 
6030
   gcc_assert (seqno >= 0);
 
6031
-
 
6032
   return seqno;
 
6033
 }
 
6034
 
 
6035
@@ -4250,22 +4259,24 @@
 
6036
 }
 
6037
 
 
6038
 /* This is used to initialize spurious jumps generated by
 
6039
-   sel_redirect_edge ().  */
 
6040
+   sel_redirect_edge ().  OLD_SEQNO is used for initializing seqnos
 
6041
+   in corner cases within get_seqno_for_a_jump.  */
 
6042
 static void
 
6043
-init_simplejump_data (insn_t insn)
 
6044
+init_simplejump_data (insn_t insn, int old_seqno)
 
6045
 {
 
6046
   init_expr (INSN_EXPR (insn), vinsn_create (insn, false), 0,
 
6047
             REG_BR_PROB_BASE, 0, 0, 0, 0, 0, 0,
 
6048
             vNULL, true, false, false,
 
6049
             false, true);
 
6050
-  INSN_SEQNO (insn) = get_seqno_for_a_jump (insn);
 
6051
+  INSN_SEQNO (insn) = get_seqno_for_a_jump (insn, old_seqno);
 
6052
   init_first_time_insn_data (insn);
 
6053
 }
 
6054
 
 
6055
 /* Perform deferred initialization of insns.  This is used to process
 
6056
-   a new jump that may be created by redirect_edge.  */
 
6057
-void
 
6058
-sel_init_new_insn (insn_t insn, int flags)
 
6059
+   a new jump that may be created by redirect_edge.  OLD_SEQNO is used
 
6060
+   for initializing simplejumps in init_simplejump_data.  */
 
6061
+static void
 
6062
+sel_init_new_insn (insn_t insn, int flags, int old_seqno)
 
6063
 {
 
6064
   /* We create data structures for bb when the first insn is emitted in it.  */
 
6065
   if (INSN_P (insn)
 
6066
@@ -4292,7 +4303,7 @@
 
6067
   if (flags & INSN_INIT_TODO_SIMPLEJUMP)
 
6068
     {
 
6069
       extend_insn_data ();
 
6070
-      init_simplejump_data (insn);
 
6071
+      init_simplejump_data (insn, old_seqno);
 
6072
     }
 
6073
 
 
6074
   gcc_assert (CONTAINING_RGN (BLOCK_NUM (insn))
 
6075
@@ -5578,8 +5589,7 @@
 
6076
 }
 
6077
 
 
6078
 /* A wrapper for redirect_edge_and_branch_force, which also initializes
 
6079
-   data structures for possibly created bb and insns.  Returns the newly
 
6080
-   added bb or NULL, when a bb was not needed.  */
 
6081
+   data structures for possibly created bb and insns.  */
 
6082
 void
 
6083
 sel_redirect_edge_and_branch_force (edge e, basic_block to)
 
6084
 {
 
6085
@@ -5586,6 +5596,7 @@
 
6086
   basic_block jump_bb, src, orig_dest = e->dest;
 
6087
   int prev_max_uid;
 
6088
   rtx jump;
 
6089
+  int old_seqno = -1;
 
6090
 
 
6091
   /* This function is now used only for bookkeeping code creation, where
 
6092
      we'll never get the single pred of orig_dest block and thus will not
 
6093
@@ -5594,8 +5605,13 @@
 
6094
               && !single_pred_p (orig_dest));
 
6095
   src = e->src;
 
6096
   prev_max_uid = get_max_uid ();
 
6097
+  /* Compute and pass old_seqno down to sel_init_new_insn only for the case
 
6098
+     when the conditional jump being redirected may become unconditional.  */
 
6099
+  if (any_condjump_p (BB_END (src))
 
6100
+      && INSN_SEQNO (BB_END (src)) >= 0)
 
6101
+    old_seqno = INSN_SEQNO (BB_END (src));
 
6102
+
 
6103
   jump_bb = redirect_edge_and_branch_force (e, to);
 
6104
-
 
6105
   if (jump_bb != NULL)
 
6106
     sel_add_bb (jump_bb);
 
6107
 
 
6108
@@ -5607,7 +5623,8 @@
 
6109
 
 
6110
   jump = find_new_jump (src, jump_bb, prev_max_uid);
 
6111
   if (jump)
 
6112
-    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
 
6113
+    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP,
 
6114
+                      old_seqno);
 
6115
   set_immediate_dominator (CDI_DOMINATORS, to,
 
6116
                           recompute_dominator (CDI_DOMINATORS, to));
 
6117
   set_immediate_dominator (CDI_DOMINATORS, orig_dest,
 
6118
@@ -5626,6 +5643,7 @@
 
6119
   edge redirected;
 
6120
   bool recompute_toporder_p = false;
 
6121
   bool maybe_unreachable = single_pred_p (orig_dest);
 
6122
+  int old_seqno = -1;
 
6123
 
 
6124
   latch_edge_p = (pipelining_p
 
6125
                   && current_loop_nest
 
6126
@@ -5634,6 +5652,12 @@
 
6127
   src = e->src;
 
6128
   prev_max_uid = get_max_uid ();
 
6129
 
 
6130
+  /* Compute and pass old_seqno down to sel_init_new_insn only for the case
 
6131
+     when the conditional jump being redirected may become unconditional.  */
 
6132
+  if (any_condjump_p (BB_END (src))
 
6133
+      && INSN_SEQNO (BB_END (src)) >= 0)
 
6134
+    old_seqno = INSN_SEQNO (BB_END (src));
 
6135
+
 
6136
   redirected = redirect_edge_and_branch (e, to);
 
6137
 
 
6138
   gcc_assert (redirected && !last_added_blocks.exists ());
 
6139
@@ -5654,7 +5678,7 @@
 
6140
 
 
6141
   jump = find_new_jump (src, NULL, prev_max_uid);
 
6142
   if (jump)
 
6143
-    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
 
6144
+    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP, old_seqno);
 
6145
 
 
6146
   /* Only update dominator info when we don't have unreachable blocks.
 
6147
      Otherwise we'll update in maybe_tidy_empty_bb.  */
 
6148
Index: gcc/fortran/interface.c
 
6149
===================================================================
 
6150
--- a/src/gcc/fortran/interface.c       (.../tags/gcc_4_8_3_release)
 
6151
+++ b/src/gcc/fortran/interface.c       (.../branches/gcc-4_8-branch)
 
6152
@@ -1923,7 +1923,7 @@
 
6153
   /* F2008, 12.5.2.5; IR F08/0073.  */
 
6154
   if (formal->ts.type == BT_CLASS && actual->expr_type != EXPR_NULL
 
6155
       && ((CLASS_DATA (formal)->attr.class_pointer
 
6156
-          && !formal->attr.intent == INTENT_IN)
 
6157
+          && formal->attr.intent != INTENT_IN)
 
6158
           || CLASS_DATA (formal)->attr.allocatable))
 
6159
     {
 
6160
       if (actual->ts.type != BT_CLASS)
 
6161
Index: gcc/fortran/trans-expr.c
 
6162
===================================================================
 
6163
--- a/src/gcc/fortran/trans-expr.c      (.../tags/gcc_4_8_3_release)
 
6164
+++ b/src/gcc/fortran/trans-expr.c      (.../branches/gcc-4_8-branch)
 
6165
@@ -7096,7 +7096,7 @@
 
6166
 
 
6167
   res_desc = gfc_evaluate_now (desc, &se->pre);
 
6168
   gfc_conv_descriptor_data_set (&se->pre, res_desc, null_pointer_node);
 
6169
-  se->expr = gfc_build_addr_expr (TREE_TYPE (se->expr), res_desc);
 
6170
+  se->expr = gfc_build_addr_expr (NULL_TREE, res_desc);
 
6171
 
 
6172
   /* Free the lhs after the function call and copy the result data to
 
6173
      the lhs descriptor.  */
 
6174
Index: gcc/fortran/decl.c
 
6175
===================================================================
 
6176
--- a/src/gcc/fortran/decl.c    (.../tags/gcc_4_8_3_release)
 
6177
+++ b/src/gcc/fortran/decl.c    (.../branches/gcc-4_8-branch)
 
6178
@@ -1996,6 +1996,13 @@
 
6179
       if (gfc_notify_std (GFC_STD_GNU, "Old-style "
 
6180
                          "initialization at %C") == FAILURE)
 
6181
        return MATCH_ERROR;
 
6182
+      else if (gfc_current_state () == COMP_DERIVED)
 
6183
+       {
 
6184
+         gfc_error ("Invalid old style initialization for derived type "
 
6185
+                    "component at %C");
 
6186
+         m = MATCH_ERROR;
 
6187
+         goto cleanup;
 
6188
+       }
 
6189
 
 
6190
       return match_old_style_init (name);
 
6191
     }
 
6192
Index: gcc/fortran/ChangeLog
 
6193
===================================================================
 
6194
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_8_3_release)
 
6195
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch)
 
6196
@@ -1,3 +1,57 @@
 
6197
+2014-09-03  Marek Polacek  <polacek@redhat.com>
 
6198
+
 
6199
+       Backport from trunk
 
6200
+       PR fortran/62270
 
6201
+       * interface.c (compare_parameter): Fix condition.
 
6202
+
 
6203
+2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
6204
+
 
6205
+       Backport from trunk
 
6206
+       PR fortran/62214
 
6207
+       * gfortran.dg/array_assignment_5.f90:  New test.
 
6208
+
 
6209
+2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
6210
+
 
6211
+       Backport from trunk
 
6212
+       PR fortran/61999
 
6213
+       * simplify.c (gfc_simplify_dot_product): Convert types of
 
6214
+       vectors before calculating the result.
 
6215
+
 
6216
+2014-07-19  Paul Thomas  <pault@gcc.gnu.org>
 
6217
+
 
6218
+       Backport from trunk.
 
6219
+       PR fortran/61780
 
6220
+       * dependency.c (gfc_dep_resolver): Index the 'reverse' array so
 
6221
+       that elements are skipped. This then correctly aligns 'reverse'
 
6222
+       with the scalarizer loops.
 
6223
+
 
6224
+2014-07-08  Paul Thomas  <pault@gcc.gnu.org>
 
6225
+
 
6226
+       PR fortran/61459
 
6227
+       PR fortran/58883
 
6228
+       * trans-expr.c (fcncall_realloc_result): Use the natural type
 
6229
+       for the address expression of 'res_desc'.
 
6230
+
 
6231
+2014-07-02  Jakub Jelinek  <jakub@redhat.com>
 
6232
+           Fritz Reese  <Reese-Fritz@zai.com>
 
6233
+
 
6234
+       * decl.c (variable_decl): Reject old style initialization
 
6235
+       for derived type components.
 
6236
+
 
6237
+2014-06-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
6238
+
 
6239
+       Backport from trunk.
 
6240
+       PR fortran/45187
 
6241
+       * trans-decl.c (gfc_create_module_variable): Don't create
 
6242
+       Cray-pointee decls twice.
 
6243
+
 
6244
+2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
 
6245
+
 
6246
+       Backport from mainline
 
6247
+       PR libfortran/61310
 
6248
+       * intrinsics.texi (CTIME): Remove mention of locale-dependent
 
6249
+       behavior.
 
6250
+
 
6251
 2014-05-22  Release Manager
 
6252
 
 
6253
        * GCC 4.8.3 released.
 
6254
Index: gcc/fortran/frontend-passes.c
 
6255
===================================================================
 
6256
--- a/src/gcc/fortran/frontend-passes.c (.../tags/gcc_4_8_3_release)
 
6257
+++ b/src/gcc/fortran/frontend-passes.c (.../branches/gcc-4_8-branch)
 
6258
@@ -874,6 +874,10 @@
 
6259
            return true;
 
6260
          break;
 
6261
 
 
6262
+       case INTRINSIC_CONCAT:
 
6263
+         /* Do not do string concatenations.  */
 
6264
+         break;
 
6265
+
 
6266
        default:
 
6267
          /* Binary operators.  */
 
6268
          if (optimize_binop_array_assignment (c, &e->value.op.op1, true))
 
6269
Index: gcc/fortran/trans-decl.c
 
6270
===================================================================
 
6271
--- a/src/gcc/fortran/trans-decl.c      (.../tags/gcc_4_8_3_release)
 
6272
+++ b/src/gcc/fortran/trans-decl.c      (.../branches/gcc-4_8-branch)
 
6273
@@ -4084,8 +4084,8 @@
 
6274
     }
 
6275
 
 
6276
   /* Don't generate variables from other modules. Variables from
 
6277
-     COMMONs will already have been generated.  */
 
6278
-  if (sym->attr.use_assoc || sym->attr.in_common)
 
6279
+     COMMONs and Cray pointees will already have been generated.  */
 
6280
+  if (sym->attr.use_assoc || sym->attr.in_common || sym->attr.cray_pointee)
 
6281
     return;
 
6282
 
 
6283
   /* Equivalenced variables arrive here after creation.  */
 
6284
Index: gcc/fortran/dependency.c
 
6285
===================================================================
 
6286
--- a/src/gcc/fortran/dependency.c      (.../tags/gcc_4_8_3_release)
 
6287
+++ b/src/gcc/fortran/dependency.c      (.../branches/gcc-4_8-branch)
 
6288
@@ -1779,6 +1779,7 @@
 
6289
 gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
 
6290
 {
 
6291
   int n;
 
6292
+  int m;
 
6293
   gfc_dependency fin_dep;
 
6294
   gfc_dependency this_dep;
 
6295
 
 
6296
@@ -1828,6 +1829,8 @@
 
6297
              break;
 
6298
            }
 
6299
 
 
6300
+         /* Index for the reverse array.  */
 
6301
+         m = -1;
 
6302
          for (n=0; n < lref->u.ar.dimen; n++)
 
6303
            {
 
6304
              /* Assume dependency when either of array reference is vector
 
6305
@@ -1862,31 +1865,37 @@
 
6306
                 The ability to reverse or not is set by previous conditions
 
6307
                 in this dimension.  If reversal is not activated, the
 
6308
                 value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP.  */
 
6309
+
 
6310
+             /* Get the indexing right for the scalarizing loop. If this
 
6311
+                is an element, there is no corresponding loop.  */
 
6312
+             if (lref->u.ar.dimen_type[n] != DIMEN_ELEMENT)
 
6313
+               m++;
 
6314
+
 
6315
              if (rref->u.ar.dimen_type[n] == DIMEN_RANGE
 
6316
                    && lref->u.ar.dimen_type[n] == DIMEN_RANGE)
 
6317
                {
 
6318
                  /* Set reverse if backward dependence and not inhibited.  */
 
6319
-                 if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
 
6320
-                   reverse[n] = (this_dep == GFC_DEP_BACKWARD) ?
 
6321
-                                GFC_REVERSE_SET : reverse[n];
 
6322
+                 if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
 
6323
+                   reverse[m] = (this_dep == GFC_DEP_BACKWARD) ?
 
6324
+                                GFC_REVERSE_SET : reverse[m];
 
6325
 
 
6326
                  /* Set forward if forward dependence and not inhibited.  */
 
6327
-                 if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
 
6328
-                   reverse[n] = (this_dep == GFC_DEP_FORWARD) ?
 
6329
-                                GFC_FORWARD_SET : reverse[n];
 
6330
+                 if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
 
6331
+                   reverse[m] = (this_dep == GFC_DEP_FORWARD) ?
 
6332
+                                GFC_FORWARD_SET : reverse[m];
 
6333
 
 
6334
                  /* Flag up overlap if dependence not compatible with
 
6335
                     the overall state of the expression.  */
 
6336
-                 if (reverse && reverse[n] == GFC_REVERSE_SET
 
6337
+                 if (reverse && reverse[m] == GFC_REVERSE_SET
 
6338
                        && this_dep == GFC_DEP_FORWARD)
 
6339
                    {
 
6340
-                     reverse[n] = GFC_INHIBIT_REVERSE;
 
6341
+                     reverse[m] = GFC_INHIBIT_REVERSE;
 
6342
                      this_dep = GFC_DEP_OVERLAP;
 
6343
                    }
 
6344
-                 else if (reverse && reverse[n] == GFC_FORWARD_SET
 
6345
+                 else if (reverse && reverse[m] == GFC_FORWARD_SET
 
6346
                        && this_dep == GFC_DEP_BACKWARD)
 
6347
                    {
 
6348
-                     reverse[n] = GFC_INHIBIT_REVERSE;
 
6349
+                     reverse[m] = GFC_INHIBIT_REVERSE;
 
6350
                      this_dep = GFC_DEP_OVERLAP;
 
6351
                    }
 
6352
 
 
6353
@@ -1893,7 +1902,7 @@
 
6354
                  /* If no intention of reversing or reversing is explicitly
 
6355
                     inhibited, convert backward dependence to overlap.  */
 
6356
                  if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
 
6357
-                     || (reverse != NULL && reverse[n] == GFC_INHIBIT_REVERSE))
 
6358
+                     || (reverse != NULL && reverse[m] == GFC_INHIBIT_REVERSE))
 
6359
                    this_dep = GFC_DEP_OVERLAP;
 
6360
                }
 
6361
 
 
6362
Index: gcc/fortran/simplify.c
 
6363
===================================================================
 
6364
--- a/src/gcc/fortran/simplify.c        (.../tags/gcc_4_8_3_release)
 
6365
+++ b/src/gcc/fortran/simplify.c        (.../branches/gcc-4_8-branch)
 
6366
@@ -1877,6 +1877,9 @@
 
6367
 gfc_expr*
 
6368
 gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
 
6369
 {
 
6370
+
 
6371
+  gfc_expr temp;
 
6372
+
 
6373
   if (!is_constant_array_expr (vector_a)
 
6374
       || !is_constant_array_expr (vector_b))
 
6375
     return NULL;
 
6376
@@ -1883,8 +1886,14 @@
 
6377
 
 
6378
   gcc_assert (vector_a->rank == 1);
 
6379
   gcc_assert (vector_b->rank == 1);
 
6380
-  gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts));
 
6381
 
 
6382
+  temp.expr_type = EXPR_OP;
 
6383
+  gfc_clear_ts (&temp.ts);
 
6384
+  temp.value.op.op = INTRINSIC_NONE;
 
6385
+  temp.value.op.op1 = vector_a;
 
6386
+  temp.value.op.op2 = vector_b;
 
6387
+  gfc_type_convert_binary (&temp, 1);
 
6388
+
 
6389
   return compute_dot_product (vector_a, 1, 0, vector_b, 1, 0, true);
 
6390
 }
 
6391
 
 
6392
Index: gcc/function.c
 
6393
===================================================================
 
6394
--- a/src/gcc/function.c        (.../tags/gcc_4_8_3_release)
 
6395
+++ b/src/gcc/function.c        (.../branches/gcc-4_8-branch)
 
6396
@@ -1354,9 +1354,13 @@
 
6397
 #define STACK_POINTER_OFFSET   0
 
6398
 #endif
 
6399
 
 
6400
+#if defined (REG_PARM_STACK_SPACE) && !defined (INCOMING_REG_PARM_STACK_SPACE)
 
6401
+#define INCOMING_REG_PARM_STACK_SPACE REG_PARM_STACK_SPACE
 
6402
+#endif
 
6403
+
 
6404
 /* If not defined, pick an appropriate default for the offset of dynamically
 
6405
    allocated memory depending on the value of ACCUMULATE_OUTGOING_ARGS,
 
6406
-   REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE.  */
 
6407
+   INCOMING_REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE.  */
 
6408
 
 
6409
 #ifndef STACK_DYNAMIC_OFFSET
 
6410
 
 
6411
@@ -1368,12 +1372,12 @@
 
6412
    `crtl->outgoing_args_size'.  Nevertheless, we must allow
 
6413
    for it when allocating stack dynamic objects.  */
 
6414
 
 
6415
-#if defined(REG_PARM_STACK_SPACE)
 
6416
+#ifdef INCOMING_REG_PARM_STACK_SPACE
 
6417
 #define STACK_DYNAMIC_OFFSET(FNDECL)   \
 
6418
 ((ACCUMULATE_OUTGOING_ARGS                                                   \
 
6419
   ? (crtl->outgoing_args_size                                \
 
6420
      + (OUTGOING_REG_PARM_STACK_SPACE ((!(FNDECL) ? NULL_TREE : TREE_TYPE (FNDECL))) ? 0 \
 
6421
-                                              : REG_PARM_STACK_SPACE (FNDECL))) \
 
6422
+                                              : INCOMING_REG_PARM_STACK_SPACE (FNDECL))) \
 
6423
   : 0) + (STACK_POINTER_OFFSET))
 
6424
 #else
 
6425
 #define STACK_DYNAMIC_OFFSET(FNDECL)   \
 
6426
@@ -2211,8 +2215,9 @@
 
6427
 #endif
 
6428
   all->args_so_far = pack_cumulative_args (&all->args_so_far_v);
 
6429
 
 
6430
-#ifdef REG_PARM_STACK_SPACE
 
6431
-  all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl);
 
6432
+#ifdef INCOMING_REG_PARM_STACK_SPACE
 
6433
+  all->reg_parm_stack_space
 
6434
+    = INCOMING_REG_PARM_STACK_SPACE (current_function_decl);
 
6435
 #endif
 
6436
 }
 
6437
 
 
6438
@@ -4518,6 +4523,7 @@
 
6439
       /* ??? This could be set on a per-function basis by the front-end
 
6440
          but is this worth the hassle?  */
 
6441
       cfun->can_throw_non_call_exceptions = flag_non_call_exceptions;
 
6442
+      cfun->can_delete_dead_exceptions = flag_delete_dead_exceptions;
 
6443
     }
 
6444
 }
 
6445
 
 
6446
Index: gcc/tree-vectorizer.h
 
6447
===================================================================
 
6448
--- a/src/gcc/tree-vectorizer.h (.../tags/gcc_4_8_3_release)
 
6449
+++ b/src/gcc/tree-vectorizer.h (.../branches/gcc-4_8-branch)
 
6450
@@ -324,9 +324,9 @@
 
6451
 #define LOOP_VINFO_OPERANDS_SWAPPED(L)     (L)->operands_swapped
 
6452
 
 
6453
 #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
 
6454
-(L)->may_misalign_stmts.length () > 0
 
6455
+((L)->may_misalign_stmts.length () > 0)
 
6456
 #define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L)     \
 
6457
-(L)->may_alias_ddrs.length () > 0
 
6458
+((L)->may_alias_ddrs.length () > 0)
 
6459
 
 
6460
 #define NITERS_KNOWN_P(n)                     \
 
6461
 (host_integerp ((n),0)                        \
 
6462
@@ -931,7 +931,8 @@
 
6463
 extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *);
 
6464
 extern tree vect_create_data_ref_ptr (gimple, tree, struct loop *, tree,
 
6465
                                      tree *, gimple_stmt_iterator *,
 
6466
-                                     gimple *, bool, bool *);
 
6467
+                                     gimple *, bool, bool *,
 
6468
+                                     tree = NULL_TREE);
 
6469
 extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree);
 
6470
 extern tree vect_create_destination_var (tree, tree);
 
6471
 extern bool vect_grouped_store_supported (tree, unsigned HOST_WIDE_INT);
 
6472
@@ -949,7 +950,8 @@
 
6473
 extern int vect_get_place_in_interleaving_chain (gimple, gimple);
 
6474
 extern tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
 
6475
 extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *,
 
6476
-                                                  tree, struct loop *);
 
6477
+                                                 tree, struct loop *,
 
6478
+                                                 tree = NULL_TREE);
 
6479
 
 
6480
 /* In tree-vect-loop.c.  */
 
6481
 /* FORNOW: Used in tree-parloops.c.  */
 
6482
Index: gcc/tree-vect-loop.c
 
6483
===================================================================
 
6484
--- a/src/gcc/tree-vect-loop.c  (.../tags/gcc_4_8_3_release)
 
6485
+++ b/src/gcc/tree-vect-loop.c  (.../branches/gcc-4_8-branch)
 
6486
@@ -2205,7 +2205,8 @@
 
6487
         }
 
6488
 
 
6489
       def1 = SSA_NAME_DEF_STMT (op1);
 
6490
-      if (flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
 
6491
+      if (gimple_bb (def1)
 
6492
+         && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
 
6493
           && loop->inner
 
6494
           && flow_bb_inside_loop_p (loop->inner, gimple_bb (def1))
 
6495
           && is_gimple_assign (def1))
 
6496
Index: gcc/tree-vect-data-refs.c
 
6497
===================================================================
 
6498
--- a/src/gcc/tree-vect-data-refs.c     (.../tags/gcc_4_8_3_release)
 
6499
+++ b/src/gcc/tree-vect-data-refs.c     (.../branches/gcc-4_8-branch)
 
6500
@@ -3553,6 +3553,9 @@
 
6501
            is as follows:
 
6502
            if LOOP=i_loop:     &in             (relative to i_loop)
 
6503
            if LOOP=j_loop:     &in+i*2B        (relative to j_loop)
 
6504
+   BYTE_OFFSET: Optional, defaulted to NULL.  If supplied, it is added to the
 
6505
+           initial address.  Unlike OFFSET, which is number of elements to
 
6506
+           be added, BYTE_OFFSET is measured in bytes.
 
6507
 
 
6508
    Output:
 
6509
    1. Return an SSA_NAME whose value is the address of the memory location of
 
6510
@@ -3566,7 +3569,8 @@
 
6511
 vect_create_addr_base_for_vector_ref (gimple stmt,
 
6512
                                      gimple_seq *new_stmt_list,
 
6513
                                      tree offset,
 
6514
-                                     struct loop *loop)
 
6515
+                                     struct loop *loop,
 
6516
+                                     tree byte_offset)
 
6517
 {
 
6518
   stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
 
6519
   struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
 
6520
@@ -3628,7 +3632,17 @@
 
6521
       base_offset = force_gimple_operand (base_offset, &seq, false, tmp);
 
6522
       gimple_seq_add_seq (new_stmt_list, seq);
 
6523
     }
 
6524
+  if (byte_offset)
 
6525
+    {
 
6526
+      tree tmp = create_tmp_var (sizetype, "offset");
 
6527
 
 
6528
+      byte_offset = fold_convert (sizetype, byte_offset);
 
6529
+      base_offset = fold_build2 (PLUS_EXPR, sizetype,
 
6530
+                                base_offset, byte_offset);
 
6531
+      base_offset = force_gimple_operand (base_offset, &seq, false, tmp);
 
6532
+      gimple_seq_add_seq (new_stmt_list, seq);
 
6533
+    }
 
6534
+
 
6535
   /* base + base_offset */
 
6536
   if (loop_vinfo)
 
6537
     addr_base = fold_build_pointer_plus (data_ref_base, base_offset);
 
6538
@@ -3692,6 +3706,10 @@
 
6539
    5. BSI: location where the new stmts are to be placed if there is no loop
 
6540
    6. ONLY_INIT: indicate if ap is to be updated in the loop, or remain
 
6541
         pointing to the initial address.
 
6542
+   7. BYTE_OFFSET (optional, defaults to NULL): a byte offset to be added
 
6543
+       to the initial address accessed by the data-ref in STMT.  This is
 
6544
+       similar to OFFSET, but OFFSET is counted in elements, while BYTE_OFFSET
 
6545
+       in bytes.
 
6546
 
 
6547
    Output:
 
6548
    1. Declare a new ptr to vector_type, and have it point to the base of the
 
6549
@@ -3705,6 +3723,8 @@
 
6550
          initial_address = &a[init];
 
6551
       if OFFSET is supplied:
 
6552
          initial_address = &a[init + OFFSET];
 
6553
+      if BYTE_OFFSET is supplied:
 
6554
+        initial_address = &a[init] + BYTE_OFFSET;
 
6555
 
 
6556
       Return the initial_address in INITIAL_ADDRESS.
 
6557
 
 
6558
@@ -3722,7 +3742,7 @@
 
6559
 vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop,
 
6560
                          tree offset, tree *initial_address,
 
6561
                          gimple_stmt_iterator *gsi, gimple *ptr_incr,
 
6562
-                         bool only_init, bool *inv_p)
 
6563
+                         bool only_init, bool *inv_p, tree byte_offset)
 
6564
 {
 
6565
   const char *base_name;
 
6566
   stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
 
6567
@@ -3881,10 +3901,10 @@
 
6568
   /* (2) Calculate the initial address of the aggregate-pointer, and set
 
6569
      the aggregate-pointer to point to it before the loop.  */
 
6570
 
 
6571
-  /* Create: (&(base[init_val+offset]) in the loop preheader.  */
 
6572
+  /* Create: (&(base[init_val+offset]+byte_offset) in the loop preheader.  */
 
6573
 
 
6574
   new_temp = vect_create_addr_base_for_vector_ref (stmt, &new_stmt_list,
 
6575
-                                                   offset, loop);
 
6576
+                                                  offset, loop, byte_offset);
 
6577
   if (new_stmt_list)
 
6578
     {
 
6579
       if (pe)
 
6580
Index: gcc/emit-rtl.c
 
6581
===================================================================
 
6582
--- a/src/gcc/emit-rtl.c        (.../tags/gcc_4_8_3_release)
 
6583
+++ b/src/gcc/emit-rtl.c        (.../branches/gcc-4_8-branch)
 
6584
@@ -263,7 +263,7 @@
 
6585
 
 
6586
 /* Return true if the given memory attributes are equal.  */
 
6587
 
 
6588
-static bool
 
6589
+bool
 
6590
 mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
 
6591
 {
 
6592
   return (p->alias == q->alias
 
6593
Index: gcc/gimple-fold.c
 
6594
===================================================================
 
6595
--- a/src/gcc/gimple-fold.c     (.../tags/gcc_4_8_3_release)
 
6596
+++ b/src/gcc/gimple-fold.c     (.../branches/gcc-4_8-branch)
 
6597
@@ -2955,8 +2955,8 @@
 
6598
      result.  */
 
6599
   if (!AGGREGATE_TYPE_P (TREE_TYPE (ctor)) && !offset
 
6600
       /* VIEW_CONVERT_EXPR is defined only for matching sizes.  */
 
6601
-      && operand_equal_p (TYPE_SIZE (type),
 
6602
-                         TYPE_SIZE (TREE_TYPE (ctor)), 0))
 
6603
+      && !compare_tree_int (TYPE_SIZE (type), size)
 
6604
+      && !compare_tree_int (TYPE_SIZE (TREE_TYPE (ctor)), size))
 
6605
     {
 
6606
       ret = canonicalize_constructor_val (unshare_expr (ctor), from_decl);
 
6607
       ret = fold_unary (VIEW_CONVERT_EXPR, type, ret);
 
6608
Index: gcc/emit-rtl.h
 
6609
===================================================================
 
6610
--- a/src/gcc/emit-rtl.h        (.../tags/gcc_4_8_3_release)
 
6611
+++ b/src/gcc/emit-rtl.h        (.../branches/gcc-4_8-branch)
 
6612
@@ -20,6 +20,9 @@
 
6613
 #ifndef GCC_EMIT_RTL_H
 
6614
 #define GCC_EMIT_RTL_H
 
6615
 
 
6616
+/* Return whether two MEM_ATTRs are equal.  */
 
6617
+bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
 
6618
+
 
6619
 /* Set the alias set of MEM to SET.  */
 
6620
 extern void set_mem_alias_set (rtx, alias_set_type);
 
6621
 
 
6622
Index: gcc/tree-cfgcleanup.c
 
6623
===================================================================
 
6624
--- a/src/gcc/tree-cfgcleanup.c (.../tags/gcc_4_8_3_release)
 
6625
+++ b/src/gcc/tree-cfgcleanup.c (.../branches/gcc-4_8-branch)
 
6626
@@ -498,7 +498,20 @@
 
6627
 
 
6628
   /* First split basic block if stmt is not last.  */
 
6629
   if (stmt != gsi_stmt (gsi_last_bb (bb)))
 
6630
-    split_block (bb, stmt);
 
6631
+    {
 
6632
+      if (stmt == gsi_stmt (gsi_last_nondebug_bb (bb)))
 
6633
+       {
 
6634
+         /* Don't split if there are only debug stmts
 
6635
+            after stmt, that can result in -fcompare-debug
 
6636
+            failures.  Remove the debug stmts instead,
 
6637
+            they should be all unreachable anyway.  */
 
6638
+         gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
 
6639
+         for (gsi_next (&gsi); !gsi_end_p (gsi); )
 
6640
+           gsi_remove (&gsi, true);
 
6641
+       }
 
6642
+      else
 
6643
+       split_block (bb, stmt);
 
6644
+    }
 
6645
 
 
6646
   changed |= remove_fallthru_edge (bb->succs);
 
6647
 
 
6648
Index: gcc/common.opt
 
6649
===================================================================
 
6650
--- a/src/gcc/common.opt        (.../tags/gcc_4_8_3_release)
 
6651
+++ b/src/gcc/common.opt        (.../branches/gcc-4_8-branch)
 
6652
@@ -1226,6 +1226,10 @@
 
6653
 Common Report Var(flag_tm)
 
6654
 Enable support for GNU transactional memory
 
6655
 
 
6656
+fgnu-unique
 
6657
+Common Report Var(flag_gnu_unique) Init(1)
 
6658
+Use STB_GNU_UNIQUE if supported by the assembler
 
6659
+
 
6660
 floop-flatten
 
6661
 Common Ignore
 
6662
 Does nothing. Preserved for backward compatibility.
 
6663
Index: gcc/tree-vect-patterns.c
 
6664
===================================================================
 
6665
--- a/src/gcc/tree-vect-patterns.c      (.../tags/gcc_4_8_3_release)
 
6666
+++ b/src/gcc/tree-vect-patterns.c      (.../branches/gcc-4_8-branch)
 
6667
@@ -395,7 +395,7 @@
 
6668
           || !promotion)
 
6669
         return NULL;
 
6670
       oprnd00 = gimple_assign_rhs1 (def_stmt);
 
6671
-      if (!type_conversion_p (oprnd0, stmt, true, &half_type1, &def_stmt,
 
6672
+      if (!type_conversion_p (oprnd1, stmt, true, &half_type1, &def_stmt,
 
6673
                                 &promotion)
 
6674
           || !promotion)
 
6675
         return NULL;
 
6676
Index: gcc/sched-deps.c
 
6677
===================================================================
 
6678
--- a/src/gcc/sched-deps.c      (.../tags/gcc_4_8_3_release)
 
6679
+++ b/src/gcc/sched-deps.c      (.../branches/gcc-4_8-branch)
 
6680
@@ -2744,7 +2744,8 @@
 
6681
           Consider for instance a volatile asm that changes the fpu rounding
 
6682
           mode.  An insn should not be moved across this even if it only uses
 
6683
           pseudo-regs because it might give an incorrectly rounded result.  */
 
6684
-       if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
 
6685
+       if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
 
6686
+           && !DEBUG_INSN_P (insn))
 
6687
          reg_pending_barrier = TRUE_BARRIER;
 
6688
 
 
6689
        /* For all ASM_OPERANDS, we must traverse the vector of input operands.
 
6690
Index: gcc/tree-vect-stmts.c
 
6691
===================================================================
 
6692
--- a/src/gcc/tree-vect-stmts.c (.../tags/gcc_4_8_3_release)
 
6693
+++ b/src/gcc/tree-vect-stmts.c (.../branches/gcc-4_8-branch)
 
6694
@@ -4319,6 +4319,7 @@
 
6695
   int i, j, group_size;
 
6696
   tree msq = NULL_TREE, lsq;
 
6697
   tree offset = NULL_TREE;
 
6698
+  tree byte_offset = NULL_TREE;
 
6699
   tree realignment_token = NULL_TREE;
 
6700
   gimple phi = NULL;
 
6701
   vec<tree> dr_chain = vNULL;
 
6702
@@ -4934,7 +4935,8 @@
 
6703
       if (alignment_support_scheme == dr_explicit_realign_optimized)
 
6704
        {
 
6705
          phi = SSA_NAME_DEF_STMT (msq);
 
6706
-         offset = size_int (TYPE_VECTOR_SUBPARTS (vectype) - 1);
 
6707
+         byte_offset = size_binop (MINUS_EXPR, TYPE_SIZE_UNIT (vectype),
 
6708
+                                   size_one_node);
 
6709
        }
 
6710
     }
 
6711
   else
 
6712
@@ -4955,7 +4957,8 @@
 
6713
       if (j == 0)
 
6714
         dataref_ptr = vect_create_data_ref_ptr (first_stmt, aggr_type, at_loop,
 
6715
                                                offset, &dummy, gsi,
 
6716
-                                               &ptr_incr, false, &inv_p);
 
6717
+                                               &ptr_incr, false, &inv_p,
 
6718
+                                               byte_offset);
 
6719
       else
 
6720
         dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
 
6721
                                       TYPE_SIZE_UNIT (aggr_type));
 
6722
Index: gcc/config/alpha/elf.h
 
6723
===================================================================
 
6724
--- a/src/gcc/config/alpha/elf.h        (.../tags/gcc_4_8_3_release)
 
6725
+++ b/src/gcc/config/alpha/elf.h        (.../branches/gcc-4_8-branch)
 
6726
@@ -126,6 +126,10 @@
 
6727
   "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
 
6728
    %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
6729
 
 
6730
+/* This variable should be set to 'true' if the target ABI requires
 
6731
+   unwinding tables even when exceptions are not used.  */
 
6732
+#define TARGET_UNWIND_TABLES_DEFAULT true
 
6733
+
 
6734
 /* Select a format to encode pointers in exception handling data.  CODE
 
6735
    is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
 
6736
    true if the symbol may be affected by dynamic relocations.
 
6737
Index: gcc/config/alpha/alpha.c
 
6738
===================================================================
 
6739
--- a/src/gcc/config/alpha/alpha.c      (.../tags/gcc_4_8_3_release)
 
6740
+++ b/src/gcc/config/alpha/alpha.c      (.../branches/gcc-4_8-branch)
 
6741
@@ -8658,6 +8658,11 @@
 
6742
                        }
 
6743
                      break;
 
6744
 
 
6745
+                   case BARRIER:
 
6746
+                     /* __builtin_unreachable can expand to no code at all,
 
6747
+                        leaving (barrier) RTXes in the instruction stream.  */
 
6748
+                     goto close_shadow_notrapb;
 
6749
+
 
6750
                    case JUMP_INSN:
 
6751
                    case CALL_INSN:
 
6752
                    case CODE_LABEL:
 
6753
@@ -8673,6 +8678,7 @@
 
6754
                  n = emit_insn_before (gen_trapb (), i);
 
6755
                  PUT_MODE (n, TImode);
 
6756
                  PUT_MODE (i, TImode);
 
6757
+               close_shadow_notrapb:
 
6758
                  trap_pending = 0;
 
6759
                  shadow.used.i = 0;
 
6760
                  shadow.used.fp = 0;
 
6761
Index: gcc/config/elfos.h
 
6762
===================================================================
 
6763
--- a/src/gcc/config/elfos.h    (.../tags/gcc_4_8_3_release)
 
6764
+++ b/src/gcc/config/elfos.h    (.../branches/gcc-4_8-branch)
 
6765
@@ -287,7 +287,7 @@
 
6766
 /* Write the extra assembler code needed to declare an object properly.  */
 
6767
 
 
6768
 #ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
 
6769
-#define USE_GNU_UNIQUE_OBJECT 1
 
6770
+#define USE_GNU_UNIQUE_OBJECT flag_gnu_unique
 
6771
 #else
 
6772
 #define USE_GNU_UNIQUE_OBJECT 0
 
6773
 #endif
 
6774
Index: gcc/config/sparc/sync.md
 
6775
===================================================================
 
6776
--- a/src/gcc/config/sparc/sync.md      (.../tags/gcc_4_8_3_release)
 
6777
+++ b/src/gcc/config/sparc/sync.md      (.../branches/gcc-4_8-branch)
 
6778
@@ -64,11 +64,19 @@
 
6779
   "stbar"
 
6780
   [(set_attr "type" "multi")])
 
6781
 
 
6782
+;; For LEON3, STB has the effect of membar #StoreLoad.
 
6783
+(define_insn "*membar_storeload_leon3"
 
6784
+  [(set (match_operand:BLK 0 "" "")
 
6785
+       (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
 
6786
+  "TARGET_LEON3"
 
6787
+  "stb\t%%g0, [%%sp-1]"
 
6788
+  [(set_attr "type" "store")])
 
6789
+
 
6790
 ;; For V8, LDSTUB has the effect of membar #StoreLoad.
 
6791
 (define_insn "*membar_storeload"
 
6792
   [(set (match_operand:BLK 0 "" "")
 
6793
        (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
 
6794
-  "TARGET_V8"
 
6795
+  "TARGET_V8 && !TARGET_LEON3"
 
6796
   "ldstub\t[%%sp-1], %%g0"
 
6797
   [(set_attr "type" "multi")])
 
6798
 
 
6799
Index: gcc/config/i386/i386.md
 
6800
===================================================================
 
6801
--- a/src/gcc/config/i386/i386.md       (.../tags/gcc_4_8_3_release)
 
6802
+++ b/src/gcc/config/i386/i386.md       (.../branches/gcc-4_8-branch)
 
6803
@@ -5339,66 +5339,37 @@
 
6804
 
 
6805
 ;; Avoid store forwarding (partial memory) stall penalty by extending
 
6806
 ;; SImode value to DImode through XMM register instead of pushing two
 
6807
-;; SImode values to stack. Note that even !TARGET_INTER_UNIT_MOVES
 
6808
-;; targets benefit from this optimization. Also note that fild
 
6809
-;; loads from memory only.
 
6810
+;; SImode values to stack. Also note that fild loads from memory only.
 
6811
 
 
6812
-(define_insn "*floatunssi<mode>2_1"
 
6813
-  [(set (match_operand:X87MODEF 0 "register_operand" "=f,f")
 
6814
+(define_insn_and_split "*floatunssi<mode>2_i387_with_xmm"
 
6815
+  [(set (match_operand:X87MODEF 0 "register_operand" "=f")
 
6816
        (unsigned_float:X87MODEF
 
6817
-         (match_operand:SI 1 "nonimmediate_operand" "x,m")))
 
6818
-   (clobber (match_operand:DI 2 "memory_operand" "=m,m"))
 
6819
-   (clobber (match_scratch:SI 3 "=X,x"))]
 
6820
+         (match_operand:SI 1 "nonimmediate_operand" "rm")))
 
6821
+   (clobber (match_scratch:DI 3 "=x"))
 
6822
+   (clobber (match_operand:DI 2 "memory_operand" "=m"))]
 
6823
   "!TARGET_64BIT
 
6824
    && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
 
6825
-   && TARGET_SSE"
 
6826
+   && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES"
 
6827
   "#"
 
6828
+  "&& reload_completed"
 
6829
+  [(set (match_dup 3) (zero_extend:DI (match_dup 1)))
 
6830
+   (set (match_dup 2) (match_dup 3))
 
6831
+   (set (match_dup 0)
 
6832
+       (float:X87MODEF (match_dup 2)))]
 
6833
+  ""
 
6834
   [(set_attr "type" "multi")
 
6835
    (set_attr "mode" "<MODE>")])
 
6836
 
 
6837
-(define_split
 
6838
-  [(set (match_operand:X87MODEF 0 "register_operand")
 
6839
-       (unsigned_float:X87MODEF
 
6840
-         (match_operand:SI 1 "register_operand")))
 
6841
-   (clobber (match_operand:DI 2 "memory_operand"))
 
6842
-   (clobber (match_scratch:SI 3))]
 
6843
-  "!TARGET_64BIT
 
6844
-   && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
 
6845
-   && TARGET_SSE
 
6846
-   && reload_completed"
 
6847
-  [(set (match_dup 2) (match_dup 1))
 
6848
-   (set (match_dup 0)
 
6849
-       (float:X87MODEF (match_dup 2)))]
 
6850
-  "operands[1] = simplify_gen_subreg (DImode, operands[1], SImode, 0);")
 
6851
-
 
6852
-(define_split
 
6853
-  [(set (match_operand:X87MODEF 0 "register_operand")
 
6854
-       (unsigned_float:X87MODEF
 
6855
-         (match_operand:SI 1 "memory_operand")))
 
6856
-   (clobber (match_operand:DI 2 "memory_operand"))
 
6857
-   (clobber (match_scratch:SI 3))]
 
6858
-  "!TARGET_64BIT
 
6859
-   && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
 
6860
-   && TARGET_SSE
 
6861
-   && reload_completed"
 
6862
-  [(set (match_dup 2) (match_dup 3))
 
6863
-   (set (match_dup 0)
 
6864
-       (float:X87MODEF (match_dup 2)))]
 
6865
-{
 
6866
-  emit_move_insn (operands[3], operands[1]);
 
6867
-  operands[3] = simplify_gen_subreg (DImode, operands[3], SImode, 0);
 
6868
-})
 
6869
-
 
6870
 (define_expand "floatunssi<mode>2"
 
6871
   [(parallel
 
6872
      [(set (match_operand:X87MODEF 0 "register_operand")
 
6873
           (unsigned_float:X87MODEF
 
6874
             (match_operand:SI 1 "nonimmediate_operand")))
 
6875
-      (clobber (match_dup 2))
 
6876
-      (clobber (match_scratch:SI 3))])]
 
6877
+      (clobber (match_scratch:DI 3))
 
6878
+      (clobber (match_dup 2))])]
 
6879
   "!TARGET_64BIT
 
6880
    && ((TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
 
6881
-       && TARGET_SSE)
 
6882
+       && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES)
 
6883
        || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))"
 
6884
 {
 
6885
   if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
 
6886
Index: gcc/config/i386/driver-i386.c
 
6887
===================================================================
 
6888
--- a/src/gcc/config/i386/driver-i386.c (.../tags/gcc_4_8_3_release)
 
6889
+++ b/src/gcc/config/i386/driver-i386.c (.../branches/gcc-4_8-branch)
 
6890
@@ -713,6 +713,11 @@
 
6891
                    /* Assume Core 2.  */
 
6892
                    cpu = "core2";
 
6893
                }
 
6894
+             else if (has_longmode)
 
6895
+               /* Perhaps some emulator?  Assume x86-64, otherwise gcc
 
6896
+                  -march=native would be unusable for 64-bit compilations,
 
6897
+                  as all the CPUs below are 32-bit only.  */
 
6898
+               cpu = "x86-64";
 
6899
              else if (has_sse3)
 
6900
                /* It is Core Duo.  */
 
6901
                cpu = "pentium-m";
 
6902
Index: gcc/config/i386/i386.c
 
6903
===================================================================
 
6904
--- a/src/gcc/config/i386/i386.c        (.../tags/gcc_4_8_3_release)
 
6905
+++ b/src/gcc/config/i386/i386.c        (.../branches/gcc-4_8-branch)
 
6906
@@ -20505,7 +20505,7 @@
 
6907
          t1 = gen_reg_rtx (V32QImode);
 
6908
          t2 = gen_reg_rtx (V32QImode);
 
6909
          t3 = gen_reg_rtx (V32QImode);
 
6910
-         vt2 = GEN_INT (128);
 
6911
+         vt2 = GEN_INT (-128);
 
6912
          for (i = 0; i < 32; i++)
 
6913
            vec[i] = vt2;
 
6914
          vt = gen_rtx_CONST_VECTOR (V32QImode, gen_rtvec_v (32, vec));
 
6915
@@ -24640,13 +24640,17 @@
 
6916
              {
 
6917
                edge e;
 
6918
                edge_iterator ei;
 
6919
-               /* Assume that region is SCC, i.e. all immediate predecessors
 
6920
-                  of non-head block are in the same region.  */
 
6921
+
 
6922
+               /* Regions are SCCs with the exception of selective
 
6923
+                  scheduling with pipelining of outer blocks enabled.
 
6924
+                  So also check that immediate predecessors of a non-head
 
6925
+                  block are in the same region.  */
 
6926
                FOR_EACH_EDGE (e, ei, bb->preds)
 
6927
                  {
 
6928
                    /* Avoid creating of loop-carried dependencies through
 
6929
-                      using topological odering in region.  */
 
6930
-                   if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
 
6931
+                      using topological ordering in the region.  */
 
6932
+                   if (rgn == CONTAINING_RGN (e->src->index)
 
6933
+                       && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
 
6934
                      add_dependee_for_func_arg (first_arg, e->src); 
 
6935
                  }
 
6936
              }
 
6937
Index: gcc/config/sh/sh.c
 
6938
===================================================================
 
6939
--- a/src/gcc/config/sh/sh.c    (.../tags/gcc_4_8_3_release)
 
6940
+++ b/src/gcc/config/sh/sh.c    (.../branches/gcc-4_8-branch)
 
6941
@@ -808,6 +808,12 @@
 
6942
        targetm.asm_out.aligned_op.di = NULL;
 
6943
        targetm.asm_out.unaligned_op.di = NULL;
 
6944
     }
 
6945
+
 
6946
+  /* User/priviledged mode is supported only on SH3*, SH4* and SH5*.
 
6947
+     Disable it for everything else.  */
 
6948
+  if (! (TARGET_SH3 || TARGET_SH5) && TARGET_USERMODE)
 
6949
+    TARGET_USERMODE = false;
 
6950
+
 
6951
   if (TARGET_SH1)
 
6952
     {
 
6953
       if (! strcmp (sh_div_str, "call-div1"))
 
6954
Index: gcc/config/sh/sync.md
 
6955
===================================================================
 
6956
--- a/src/gcc/config/sh/sync.md (.../tags/gcc_4_8_3_release)
 
6957
+++ b/src/gcc/config/sh/sync.md (.../branches/gcc-4_8-branch)
 
6958
@@ -903,7 +903,7 @@
 
6959
         "      and     %0,%3"                  "\n"
 
6960
         "      not     %3,%3"                  "\n"
 
6961
         "      mov.<bwl>       %3,@%1"         "\n"
 
6962
-        "      stc     %4,sr";
 
6963
+        "      ldc     %4,sr";
 
6964
 }
 
6965
   [(set_attr "length" "20")])
 
6966
 
 
6967
@@ -1353,7 +1353,7 @@
 
6968
         "      ldc     r0,sr"          "\n"
 
6969
         "      mov.b   @%0,r0"         "\n"
 
6970
         "      mov.b   %1,@%0"         "\n"
 
6971
-        "      stc     %2,sr"          "\n"
 
6972
+        "      ldc     %2,sr"          "\n"
 
6973
         "      tst     r0,r0";
 
6974
 }
 
6975
   [(set_attr "length" "16")])
 
6976
Index: gcc/config/sh/sh.opt
 
6977
===================================================================
 
6978
--- a/src/gcc/config/sh/sh.opt  (.../tags/gcc_4_8_3_release)
 
6979
+++ b/src/gcc/config/sh/sh.opt  (.../branches/gcc-4_8-branch)
 
6980
@@ -343,7 +343,7 @@
 
6981
 Cost to assume for a multiply insn
 
6982
 
 
6983
 musermode
 
6984
-Target Report RejectNegative Var(TARGET_USERMODE)
 
6985
+Target Var(TARGET_USERMODE)
 
6986
 Don't generate privileged-mode only code; implies -mno-inline-ic_invalidate if the inline code would not work in user mode.
 
6987
 
 
6988
 ;; We might want to enable this by default for TARGET_HARD_SH4, because
 
6989
Index: gcc/config/microblaze/predicates.md
 
6990
===================================================================
 
6991
--- a/src/gcc/config/microblaze/predicates.md   (.../tags/gcc_4_8_3_release)
 
6992
+++ b/src/gcc/config/microblaze/predicates.md   (.../branches/gcc-4_8-branch)
 
6993
@@ -85,10 +85,6 @@
 
6994
   (ior (match_operand 0 "const_0_operand")
 
6995
        (match_operand 0 "register_operand")))
 
6996
 
 
6997
-(define_predicate "reg_or_mem_operand"
 
6998
-  (ior (match_operand 0 "memory_operand")
 
6999
-       (match_operand 0 "register_operand")))
 
7000
-
 
7001
 ;;  Return if the operand is either the PC or a label_ref.  
 
7002
 (define_special_predicate "pc_or_label_operand"
 
7003
   (ior (match_code "pc,label_ref")
 
7004
Index: gcc/config/microblaze/microblaze.md
 
7005
===================================================================
 
7006
--- a/src/gcc/config/microblaze/microblaze.md   (.../tags/gcc_4_8_3_release)
 
7007
+++ b/src/gcc/config/microblaze/microblaze.md   (.../branches/gcc-4_8-branch)
 
7008
@@ -1119,18 +1119,6 @@
 
7009
   }
 
7010
 )
 
7011
 
 
7012
-;;Load and store reverse
 
7013
-(define_insn "movsi4_rev"
 
7014
-  [(set (match_operand:SI 0 "reg_or_mem_operand" "=r,Q")
 
7015
-        (bswap:SI (match_operand:SF 1 "reg_or_mem_operand" "Q,r")))]
 
7016
-  "TARGET_REORDER"
 
7017
-  "@
 
7018
-   lwr\t%0,%y1,r0
 
7019
-   swr\t%1,%y0,r0"
 
7020
-  [(set_attr "type"     "load,store")
 
7021
-  (set_attr "mode"      "SI")
 
7022
-  (set_attr "length"    "4,4")])
 
7023
-
 
7024
 ;; 32-bit floating point moves
 
7025
 
 
7026
 (define_expand "movsf"
 
7027
Index: gcc/config/avr/avr-fixed.md
 
7028
===================================================================
 
7029
--- a/src/gcc/config/avr/avr-fixed.md   (.../tags/gcc_4_8_3_release)
 
7030
+++ b/src/gcc/config/avr/avr-fixed.md   (.../branches/gcc-4_8-branch)
 
7031
@@ -430,8 +430,8 @@
 
7032
       }
 
7033
 
 
7034
     // Input and output of the libgcc function
 
7035
-    const unsigned int regno_in[]  = { -1, 22, 22, -1, 18 };
 
7036
-    const unsigned int regno_out[] = { -1, 24, 24, -1, 22 };
 
7037
+    const unsigned int regno_in[]  = { -1U, 22, 22, -1U, 18 };
 
7038
+    const unsigned int regno_out[] = { -1U, 24, 24, -1U, 22 };
 
7039
 
 
7040
     operands[3] = gen_rtx_REG (<MODE>mode, regno_out[(size_t) GET_MODE_SIZE (<MODE>mode)]);
 
7041
     operands[4] = gen_rtx_REG (<MODE>mode,  regno_in[(size_t) GET_MODE_SIZE (<MODE>mode)]);
 
7042
Index: gcc/config/avr/avr.md
 
7043
===================================================================
 
7044
--- a/src/gcc/config/avr/avr.md (.../tags/gcc_4_8_3_release)
 
7045
+++ b/src/gcc/config/avr/avr.md (.../branches/gcc-4_8-branch)
 
7046
@@ -367,6 +367,15 @@
 
7047
   ""
 
7048
   {
 
7049
     int i;
 
7050
+
 
7051
+    // Avoid (subreg (mem)) for non-generic address spaces below.  Because
 
7052
+    // of the poor addressing capabilities of these spaces it's better to
 
7053
+    // load them in one chunk.  And it avoids PR61443.
 
7054
+
 
7055
+    if (MEM_P (operands[0])
 
7056
+        && !ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[0])))
 
7057
+      operands[0] = copy_to_mode_reg (<MODE>mode, operands[0]);
 
7058
+
 
7059
     for (i = GET_MODE_SIZE (<MODE>mode) - 1; i >= 0; --i)
 
7060
       {
 
7061
         rtx part = simplify_gen_subreg (QImode, operands[0], <MODE>mode, i);
 
7062
Index: gcc/config/avr/avr.h
 
7063
===================================================================
 
7064
--- a/src/gcc/config/avr/avr.h  (.../tags/gcc_4_8_3_release)
 
7065
+++ b/src/gcc/config/avr/avr.h  (.../branches/gcc-4_8-branch)
 
7066
@@ -250,18 +250,18 @@
 
7067
 #define REG_CLASS_CONTENTS {                                           \
 
7068
   {0x00000000,0x00000000},     /* NO_REGS */                           \
 
7069
   {0x00000001,0x00000000},     /* R0_REG */                            \
 
7070
-  {3 << REG_X,0x00000000},      /* POINTER_X_REGS, r26 - r27 */                \
 
7071
-  {3 << REG_Y,0x00000000},      /* POINTER_Y_REGS, r28 - r29 */                \
 
7072
-  {3 << REG_Z,0x00000000},      /* POINTER_Z_REGS, r30 - r31 */                \
 
7073
+  {3u << REG_X,0x00000000},     /* POINTER_X_REGS, r26 - r27 */                \
 
7074
+  {3u << REG_Y,0x00000000},     /* POINTER_Y_REGS, r28 - r29 */                \
 
7075
+  {3u << REG_Z,0x00000000},     /* POINTER_Z_REGS, r30 - r31 */                \
 
7076
   {0x00000000,0x00000003},     /* STACK_REG, STACK */                  \
 
7077
-  {(3 << REG_Y) | (3 << REG_Z),                                                \
 
7078
+  {(3u << REG_Y) | (3u << REG_Z),                                      \
 
7079
      0x00000000},              /* BASE_POINTER_REGS, r28 - r31 */      \
 
7080
-  {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z),                         \
 
7081
+  {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z),                      \
 
7082
      0x00000000},              /* POINTER_REGS, r26 - r31 */           \
 
7083
-  {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W),          \
 
7084
+  {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z) | (3u << REG_W),      \
 
7085
      0x00000000},              /* ADDW_REGS, r24 - r31 */              \
 
7086
   {0x00ff0000,0x00000000},     /* SIMPLE_LD_REGS r16 - r23 */          \
 
7087
-  {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16),   \
 
7088
+  {(3u << REG_X)|(3u << REG_Y)|(3u << REG_Z)|(3u << REG_W)|(0xffu << 16),\
 
7089
      0x00000000},      /* LD_REGS, r16 - r31 */                        \
 
7090
   {0x0000ffff,0x00000000},     /* NO_LD_REGS  r0 - r15 */              \
 
7091
   {0xffffffff,0x00000000},     /* GENERAL_REGS, r0 - r31 */            \
 
7092
Index: gcc/config/aarch64/arm_neon.h
 
7093
===================================================================
 
7094
--- a/src/gcc/config/aarch64/arm_neon.h (.../tags/gcc_4_8_3_release)
 
7095
+++ b/src/gcc/config/aarch64/arm_neon.h (.../branches/gcc-4_8-branch)
 
7096
@@ -13815,7 +13815,7 @@
 
7097
   int16x4_t result;
 
7098
   __asm__ ("sqdmulh %0.4h,%1.4h,%2.h[0]"
 
7099
            : "=w"(result)
 
7100
-           : "w"(a), "w"(b)
 
7101
+           : "w"(a), "x"(b)
 
7102
            : /* No clobbers */);
 
7103
   return result;
 
7104
 }
 
7105
@@ -13837,7 +13837,7 @@
 
7106
   int16x8_t result;
 
7107
   __asm__ ("sqdmulh %0.8h,%1.8h,%2.h[0]"
 
7108
            : "=w"(result)
 
7109
-           : "w"(a), "w"(b)
 
7110
+           : "w"(a), "x"(b)
 
7111
            : /* No clobbers */);
 
7112
   return result;
 
7113
 }
 
7114
Index: gcc/config/aarch64/aarch64.md
 
7115
===================================================================
 
7116
--- a/src/gcc/config/aarch64/aarch64.md (.../tags/gcc_4_8_3_release)
 
7117
+++ b/src/gcc/config/aarch64/aarch64.md (.../branches/gcc-4_8-branch)
 
7118
@@ -3292,6 +3292,7 @@
 
7119
         (unspec:DI [(match_operand:DI 0 "aarch64_valid_symref" "S")]
 
7120
                   UNSPEC_TLSDESC))
 
7121
    (clobber (reg:DI LR_REGNUM))
 
7122
+   (clobber (reg:CC CC_REGNUM))
 
7123
    (clobber (match_scratch:DI 1 "=r"))]
 
7124
   "TARGET_TLS_DESC"
 
7125
   "adrp\\tx0, %A0\;ldr\\t%1, [x0, #%L0]\;add\\tx0, x0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"
 
7126
Index: gcc/config/aarch64/aarch64.c
 
7127
===================================================================
 
7128
--- a/src/gcc/config/aarch64/aarch64.c  (.../tags/gcc_4_8_3_release)
 
7129
+++ b/src/gcc/config/aarch64/aarch64.c  (.../branches/gcc-4_8-branch)
 
7130
@@ -1201,6 +1201,7 @@
 
7131
   CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v);
 
7132
   int ncrn, nvrn, nregs;
 
7133
   bool allocate_ncrn, allocate_nvrn;
 
7134
+  HOST_WIDE_INT size;
 
7135
 
 
7136
   /* We need to do this once per argument.  */
 
7137
   if (pcum->aapcs_arg_processed)
 
7138
@@ -1208,6 +1209,11 @@
 
7139
 
 
7140
   pcum->aapcs_arg_processed = true;
 
7141
 
 
7142
+  /* Size in bytes, rounded to the nearest multiple of 8 bytes.  */
 
7143
+  size
 
7144
+    = AARCH64_ROUND_UP (type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode),
 
7145
+                       UNITS_PER_WORD);
 
7146
+
 
7147
   allocate_ncrn = (type) ? !(FLOAT_TYPE_P (type)) : !FLOAT_MODE_P (mode);
 
7148
   allocate_nvrn = aarch64_vfp_is_call_candidate (pcum_v,
 
7149
                                                 mode,
 
7150
@@ -1258,10 +1264,8 @@
 
7151
     }
 
7152
 
 
7153
   ncrn = pcum->aapcs_ncrn;
 
7154
-  nregs = ((type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode))
 
7155
-          + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 
7156
+  nregs = size / UNITS_PER_WORD;
 
7157
 
 
7158
-
 
7159
   /* C6 - C9.  though the sign and zero extension semantics are
 
7160
      handled elsewhere.  This is the case where the argument fits
 
7161
      entirely general registers.  */
 
7162
@@ -1309,13 +1313,12 @@
 
7163
   pcum->aapcs_nextncrn = NUM_ARG_REGS;
 
7164
 
 
7165
   /* The argument is passed on stack; record the needed number of words for
 
7166
-     this argument (we can re-use NREGS) and align the total size if
 
7167
-     necessary.  */
 
7168
+     this argument and align the total size if necessary.  */
 
7169
 on_stack:
 
7170
-  pcum->aapcs_stack_words = nregs;
 
7171
+  pcum->aapcs_stack_words = size / UNITS_PER_WORD;
 
7172
   if (aarch64_function_arg_alignment (mode, type) == 16 * BITS_PER_UNIT)
 
7173
     pcum->aapcs_stack_size = AARCH64_ROUND_UP (pcum->aapcs_stack_size,
 
7174
-                                              16 / UNITS_PER_WORD) + 1;
 
7175
+                                              16 / UNITS_PER_WORD);
 
7176
   return;
 
7177
 }
 
7178
 
 
7179
Index: gcc/config/aarch64/aarch64-linux.h
 
7180
===================================================================
 
7181
--- a/src/gcc/config/aarch64/aarch64-linux.h    (.../tags/gcc_4_8_3_release)
 
7182
+++ b/src/gcc/config/aarch64/aarch64-linux.h    (.../branches/gcc-4_8-branch)
 
7183
@@ -43,4 +43,6 @@
 
7184
     }                                          \
 
7185
   while (0)
 
7186
 
 
7187
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
7188
+
 
7189
 #endif  /* GCC_AARCH64_LINUX_H */
 
7190
Index: gcc/config/rs6000/constraints.md
 
7191
===================================================================
 
7192
--- a/src/gcc/config/rs6000/constraints.md      (.../tags/gcc_4_8_3_release)
 
7193
+++ b/src/gcc/config/rs6000/constraints.md      (.../branches/gcc-4_8-branch)
 
7194
@@ -65,6 +65,20 @@
 
7195
 (define_register_constraint "wg" "rs6000_constraints[RS6000_CONSTRAINT_wg]"
 
7196
   "If -mmfpgpr was used, a floating point register or NO_REGS.")
 
7197
 
 
7198
+(define_register_constraint "wh" "rs6000_constraints[RS6000_CONSTRAINT_wh]"
 
7199
+  "Floating point register if direct moves are available, or NO_REGS.")
 
7200
+
 
7201
+;; At present, DImode is not allowed in the Altivec registers.  If in the
 
7202
+;; future it is allowed, wi/wj can be set to VSX_REGS instead of FLOAT_REGS.
 
7203
+(define_register_constraint "wi" "rs6000_constraints[RS6000_CONSTRAINT_wi]"
 
7204
+  "FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS.")
 
7205
+
 
7206
+(define_register_constraint "wj" "rs6000_constraints[RS6000_CONSTRAINT_wj]"
 
7207
+  "FP or VSX register to hold 64-bit integers for direct moves or NO_REGS.")
 
7208
+
 
7209
+(define_register_constraint "wk" "rs6000_constraints[RS6000_CONSTRAINT_wk]"
 
7210
+  "FP or VSX register to hold 64-bit doubles for direct moves or NO_REGS.")
 
7211
+
 
7212
 (define_register_constraint "wl" "rs6000_constraints[RS6000_CONSTRAINT_wl]"
 
7213
   "Floating point register if the LFIWAX instruction is enabled or NO_REGS.")
 
7214
 
 
7215
@@ -98,7 +112,7 @@
 
7216
   "Floating point register if the STFIWX instruction is enabled or NO_REGS.")
 
7217
 
 
7218
 (define_register_constraint "wy" "rs6000_constraints[RS6000_CONSTRAINT_wy]"
 
7219
-  "VSX vector register to hold scalar float values or NO_REGS.")
 
7220
+  "FP or VSX register to perform ISA 2.07 float ops or NO_REGS.")
 
7221
 
 
7222
 (define_register_constraint "wz" "rs6000_constraints[RS6000_CONSTRAINT_wz]"
 
7223
   "Floating point register if the LFIWZX instruction is enabled or NO_REGS.")
 
7224
Index: gcc/config/rs6000/predicates.md
 
7225
===================================================================
 
7226
--- a/src/gcc/config/rs6000/predicates.md       (.../tags/gcc_4_8_3_release)
 
7227
+++ b/src/gcc/config/rs6000/predicates.md       (.../branches/gcc-4_8-branch)
 
7228
@@ -1795,7 +1795,7 @@
 
7229
 (define_predicate "fusion_gpr_mem_load"
 
7230
   (match_code "mem,sign_extend,zero_extend")
 
7231
 {
 
7232
-  rtx addr;
 
7233
+  rtx addr, base, offset;
 
7234
 
 
7235
   /* Handle sign/zero extend.  */
 
7236
   if (GET_CODE (op) == ZERO_EXTEND
 
7237
@@ -1825,24 +1825,79 @@
 
7238
     }
 
7239
 
 
7240
   addr = XEXP (op, 0);
 
7241
+  if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
 
7242
+    return 0;
 
7243
+
 
7244
+  base = XEXP (addr, 0);
 
7245
+  if (!base_reg_operand (base, GET_MODE (base)))
 
7246
+    return 0;
 
7247
+
 
7248
+  offset = XEXP (addr, 1);
 
7249
+
 
7250
   if (GET_CODE (addr) == PLUS)
 
7251
+    return satisfies_constraint_I (offset);
 
7252
+
 
7253
+  else if (GET_CODE (addr) == LO_SUM)
 
7254
     {
 
7255
-      rtx base = XEXP (addr, 0);
 
7256
-      rtx offset = XEXP (addr, 1);
 
7257
+      if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
 
7258
+       return small_toc_ref (offset, GET_MODE (offset));
 
7259
 
 
7260
-      return (base_reg_operand (base, GET_MODE (base))
 
7261
-             && satisfies_constraint_I (offset));
 
7262
+      else if (TARGET_ELF && !TARGET_POWERPC64)
 
7263
+       return CONSTANT_P (offset);
 
7264
     }
 
7265
 
 
7266
-  else if (GET_CODE (addr) == LO_SUM)
 
7267
+  return 0;
 
7268
+})
 
7269
+
 
7270
+;; Match a GPR load (lbz, lhz, lwz, ld) that uses a combined address in the
 
7271
+;; memory field with both the addis and the memory offset.  Sign extension
 
7272
+;; is not handled here, since lha and lwa are not fused.
 
7273
+(define_predicate "fusion_gpr_mem_combo"
 
7274
+  (match_code "mem,zero_extend")
 
7275
+{
 
7276
+  rtx addr, base, offset;
 
7277
+
 
7278
+  /* Handle zero extend.  */
 
7279
+  if (GET_CODE (op) == ZERO_EXTEND)
 
7280
     {
 
7281
-      rtx base = XEXP (addr, 0);
 
7282
-      rtx offset = XEXP (addr, 1);
 
7283
+      op = XEXP (op, 0);
 
7284
+      mode = GET_MODE (op);
 
7285
+    }
 
7286
 
 
7287
-      if (!base_reg_operand (base, GET_MODE (base)))
 
7288
+  if (!MEM_P (op))
 
7289
+    return 0;
 
7290
+
 
7291
+  switch (mode)
 
7292
+    {
 
7293
+    case QImode:
 
7294
+    case HImode:
 
7295
+    case SImode:
 
7296
+      break;
 
7297
+
 
7298
+    case DImode:
 
7299
+      if (!TARGET_POWERPC64)
 
7300
        return 0;
 
7301
+      break;
 
7302
 
 
7303
-      else if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
 
7304
+    default:
 
7305
+      return 0;
 
7306
+    }
 
7307
+
 
7308
+  addr = XEXP (op, 0);
 
7309
+  if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
 
7310
+    return 0;
 
7311
+
 
7312
+  base = XEXP (addr, 0);
 
7313
+  if (!fusion_gpr_addis (base, GET_MODE (base)))
 
7314
+    return 0;
 
7315
+
 
7316
+  offset = XEXP (addr, 1);
 
7317
+  if (GET_CODE (addr) == PLUS)
 
7318
+    return satisfies_constraint_I (offset);
 
7319
+
 
7320
+  else if (GET_CODE (addr) == LO_SUM)
 
7321
+    {
 
7322
+      if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
 
7323
        return small_toc_ref (offset, GET_MODE (offset));
 
7324
 
 
7325
       else if (TARGET_ELF && !TARGET_POWERPC64)
 
7326
Index: gcc/config/rs6000/htm.md
 
7327
===================================================================
 
7328
--- a/src/gcc/config/rs6000/htm.md      (.../tags/gcc_4_8_3_release)
 
7329
+++ b/src/gcc/config/rs6000/htm.md      (.../branches/gcc-4_8-branch)
 
7330
@@ -179,7 +179,7 @@
 
7331
                             (const_int 0)]
 
7332
                            UNSPECV_HTM_TABORTWCI))
 
7333
    (set (subreg:CC (match_dup 2) 0) (match_dup 1))
 
7334
-   (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 24)))
 
7335
+   (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 28)))
 
7336
    (parallel [(set (match_operand:SI 0 "int_reg_operand" "")
 
7337
                   (and:SI (match_dup 3) (const_int 15)))
 
7338
               (clobber (scratch:CC))])]
 
7339
Index: gcc/config/rs6000/freebsd64.h
 
7340
===================================================================
 
7341
--- a/src/gcc/config/rs6000/freebsd64.h (.../tags/gcc_4_8_3_release)
 
7342
+++ b/src/gcc/config/rs6000/freebsd64.h (.../branches/gcc-4_8-branch)
 
7343
@@ -367,7 +367,7 @@
 
7344
 /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given.  */
 
7345
 #undef  ADJUST_FIELD_ALIGN
 
7346
 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
 
7347
-  ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
 
7348
+  (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))           \
 
7349
    ? 128                                                                \
 
7350
    : (TARGET_64BIT                                                      \
 
7351
       && TARGET_ALIGN_NATURAL == 0                                      \
 
7352
Index: gcc/config/rs6000/rs6000-protos.h
 
7353
===================================================================
 
7354
--- a/src/gcc/config/rs6000/rs6000-protos.h     (.../tags/gcc_4_8_3_release)
 
7355
+++ b/src/gcc/config/rs6000/rs6000-protos.h     (.../branches/gcc-4_8-branch)
 
7356
@@ -79,9 +79,9 @@
 
7357
 extern bool gpr_or_gpr_p (rtx, rtx);
 
7358
 extern bool direct_move_p (rtx, rtx);
 
7359
 extern bool quad_load_store_p (rtx, rtx);
 
7360
-extern bool fusion_gpr_load_p (rtx *, bool);
 
7361
+extern bool fusion_gpr_load_p (rtx, rtx, rtx, rtx);
 
7362
 extern void expand_fusion_gpr_load (rtx *);
 
7363
-extern const char *emit_fusion_gpr_load (rtx *);
 
7364
+extern const char *emit_fusion_gpr_load (rtx, rtx);
 
7365
 extern enum reg_class (*rs6000_preferred_reload_class_ptr) (rtx,
 
7366
                                                            enum reg_class);
 
7367
 extern enum reg_class (*rs6000_secondary_reload_class_ptr) (enum reg_class,
 
7368
@@ -153,6 +153,7 @@
 
7369
 
 
7370
 #ifdef TREE_CODE
 
7371
 extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
 
7372
+extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
 
7373
 extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
 
7374
                                                     unsigned int);
 
7375
 extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
 
7376
@@ -161,7 +162,7 @@
 
7377
 extern rtx rs6000_libcall_value (enum machine_mode);
 
7378
 extern rtx rs6000_va_arg (tree, tree);
 
7379
 extern int function_ok_for_sibcall (tree);
 
7380
-extern int rs6000_reg_parm_stack_space (tree);
 
7381
+extern int rs6000_reg_parm_stack_space (tree, bool);
 
7382
 extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
 
7383
 extern bool rs6000_elf_in_small_data_p (const_tree);
 
7384
 #ifdef ARGS_SIZE_RTX
 
7385
Index: gcc/config/rs6000/rs6000-builtin.def
 
7386
===================================================================
 
7387
--- a/src/gcc/config/rs6000/rs6000-builtin.def  (.../tags/gcc_4_8_3_release)
 
7388
+++ b/src/gcc/config/rs6000/rs6000-builtin.def  (.../branches/gcc-4_8-branch)
 
7389
@@ -622,20 +622,13 @@
 
7390
                     | RS6000_BTC_TERNARY),                             \
 
7391
                    CODE_FOR_ ## ICODE)                 /* ICODE */
 
7392
 
 
7393
-/* Miscellaneous builtins.  */
 
7394
-#define BU_MISC_1(ENUM, NAME, ATTR, ICODE)                             \
 
7395
+/* 128-bit long double floating point builtins.  */
 
7396
+#define BU_LDBL128_2(ENUM, NAME, ATTR, ICODE)                          \
 
7397
   RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM,             /* ENUM */      \
 
7398
                    "__builtin_" NAME,                  /* NAME */      \
 
7399
-                   RS6000_BTM_HARD_FLOAT,              /* MASK */      \
 
7400
+                   (RS6000_BTM_HARD_FLOAT              /* MASK */      \
 
7401
+                    | RS6000_BTM_LDBL128),                             \
 
7402
                    (RS6000_BTC_ ## ATTR                /* ATTR */      \
 
7403
-                    | RS6000_BTC_UNARY),                               \
 
7404
-                   CODE_FOR_ ## ICODE)                 /* ICODE */
 
7405
-
 
7406
-#define BU_MISC_2(ENUM, NAME, ATTR, ICODE)                             \
 
7407
-  RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM,             /* ENUM */      \
 
7408
-                   "__builtin_" NAME,                  /* NAME */      \
 
7409
-                   RS6000_BTM_HARD_FLOAT,              /* MASK */      \
 
7410
-                   (RS6000_BTC_ ## ATTR                /* ATTR */      \
 
7411
                     | RS6000_BTC_BINARY),                              \
 
7412
                    CODE_FOR_ ## ICODE)                 /* ICODE */
 
7413
 
 
7414
@@ -1593,10 +1586,8 @@
 
7415
 BU_DFP_MISC_2 (PACK_TD,                "pack_dec128",          CONST,  packtd)
 
7416
 BU_DFP_MISC_2 (UNPACK_TD,      "unpack_dec128",        CONST,  unpacktd)
 
7417
 
 
7418
-BU_MISC_2 (PACK_TF,            "pack_longdouble",      CONST,  packtf)
 
7419
-BU_MISC_2 (UNPACK_TF,          "unpack_longdouble",    CONST,  unpacktf)
 
7420
-BU_MISC_1 (UNPACK_TF_0,                "longdouble_dw0",       CONST,  unpacktf_0)
 
7421
-BU_MISC_1 (UNPACK_TF_1,                "longdouble_dw1",       CONST,  unpacktf_1)
 
7422
+BU_LDBL128_2 (PACK_TF,         "pack_longdouble",      CONST,  packtf)
 
7423
+BU_LDBL128_2 (UNPACK_TF,       "unpack_longdouble",    CONST,  unpacktf)
 
7424
 
 
7425
 BU_P7_MISC_2 (PACK_V1TI,       "pack_vector_int128",   CONST,  packv1ti)
 
7426
 BU_P7_MISC_2 (UNPACK_V1TI,     "unpack_vector_int128", CONST,  unpackv1ti)
 
7427
Index: gcc/config/rs6000/rs6000-c.c
 
7428
===================================================================
 
7429
--- a/src/gcc/config/rs6000/rs6000-c.c  (.../tags/gcc_4_8_3_release)
 
7430
+++ b/src/gcc/config/rs6000/rs6000-c.c  (.../branches/gcc-4_8-branch)
 
7431
@@ -4126,7 +4126,8 @@
 
7432
      argument) is reversed.  Patch the arguments here before building
 
7433
      the resolved CALL_EXPR.  */
 
7434
   if (desc->code == ALTIVEC_BUILTIN_VEC_VCMPGE_P
 
7435
-      && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P)
 
7436
+      && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P
 
7437
+      && desc->overloaded_code != VSX_BUILTIN_XVCMPGEDP_P)
 
7438
     {
 
7439
       tree t;
 
7440
       t = args[2], args[2] = args[1], args[1] = t;
 
7441
Index: gcc/config/rs6000/linux64.h
 
7442
===================================================================
 
7443
--- a/src/gcc/config/rs6000/linux64.h   (.../tags/gcc_4_8_3_release)
 
7444
+++ b/src/gcc/config/rs6000/linux64.h   (.../branches/gcc-4_8-branch)
 
7445
@@ -246,7 +246,7 @@
 
7446
 /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given.  */
 
7447
 #undef  ADJUST_FIELD_ALIGN
 
7448
 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
 
7449
-  ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)    \
 
7450
+  (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))           \
 
7451
    ? 128                                                               \
 
7452
    : (TARGET_64BIT                                                     \
 
7453
       && TARGET_ALIGN_NATURAL == 0                                     \
 
7454
Index: gcc/config/rs6000/rs6000.c
 
7455
===================================================================
 
7456
--- a/src/gcc/config/rs6000/rs6000.c    (.../tags/gcc_4_8_3_release)
 
7457
+++ b/src/gcc/config/rs6000/rs6000.c    (.../branches/gcc-4_8-branch)
 
7458
@@ -369,6 +369,7 @@
 
7459
   enum insn_code reload_gpr_vsx;       /* INSN to move from GPR to VSX.  */
 
7460
   enum insn_code reload_vsx_gpr;       /* INSN to move from VSX to GPR.  */
 
7461
   addr_mask_type addr_mask[(int)N_RELOAD_REG]; /* Valid address masks.  */
 
7462
+  bool scalar_in_vmx_p;                        /* Scalar value can go in VMX.  */
 
7463
 };
 
7464
 
 
7465
 static struct rs6000_reg_addr reg_addr[NUM_MACHINE_MODES];
 
7466
@@ -1704,8 +1705,7 @@
 
7467
      asked for it.  */
 
7468
   if (TARGET_VSX && VSX_REGNO_P (regno)
 
7469
       && (VECTOR_MEM_VSX_P (mode)
 
7470
-         || (TARGET_VSX_SCALAR_FLOAT && mode == SFmode)
 
7471
-         || (TARGET_VSX_SCALAR_DOUBLE && (mode == DFmode || mode == DImode))
 
7472
+         || reg_addr[mode].scalar_in_vmx_p
 
7473
          || (TARGET_VSX_TIMODE && mode == TImode)
 
7474
          || (TARGET_VADDUQM && mode == V1TImode)))
 
7475
     {
 
7476
@@ -1714,12 +1714,9 @@
 
7477
 
 
7478
       if (ALTIVEC_REGNO_P (regno))
 
7479
        {
 
7480
-         if (mode == SFmode && !TARGET_UPPER_REGS_SF)
 
7481
+         if (GET_MODE_SIZE (mode) != 16 && !reg_addr[mode].scalar_in_vmx_p)
 
7482
            return 0;
 
7483
 
 
7484
-         if ((mode == DFmode || mode == DImode) && !TARGET_UPPER_REGS_DF)
 
7485
-           return 0;
 
7486
-
 
7487
          return ALTIVEC_REGNO_P (last_regno);
 
7488
        }
 
7489
     }
 
7490
@@ -1897,14 +1894,16 @@
 
7491
   if (rs6000_vector_unit[m] != VECTOR_NONE
 
7492
       || rs6000_vector_mem[m] != VECTOR_NONE
 
7493
       || (reg_addr[m].reload_store != CODE_FOR_nothing)
 
7494
-      || (reg_addr[m].reload_load != CODE_FOR_nothing))
 
7495
+      || (reg_addr[m].reload_load != CODE_FOR_nothing)
 
7496
+      || reg_addr[m].scalar_in_vmx_p)
 
7497
     {
 
7498
       fprintf (stderr,
 
7499
-              "  Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c",
 
7500
+              "  Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c Upper=%c",
 
7501
               rs6000_debug_vector_unit (rs6000_vector_unit[m]),
 
7502
               rs6000_debug_vector_unit (rs6000_vector_mem[m]),
 
7503
               (reg_addr[m].reload_store != CODE_FOR_nothing) ? 's' : '*',
 
7504
-              (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*');
 
7505
+              (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*',
 
7506
+              (reg_addr[m].scalar_in_vmx_p) ? 'y' : 'n');
 
7507
     }
 
7508
 
 
7509
   fputs ("\n", stderr);
 
7510
@@ -2021,6 +2020,10 @@
 
7511
           "wd reg_class = %s\n"
 
7512
           "wf reg_class = %s\n"
 
7513
           "wg reg_class = %s\n"
 
7514
+          "wh reg_class = %s\n"
 
7515
+          "wi reg_class = %s\n"
 
7516
+          "wj reg_class = %s\n"
 
7517
+          "wk reg_class = %s\n"
 
7518
           "wl reg_class = %s\n"
 
7519
           "wm reg_class = %s\n"
 
7520
           "wr reg_class = %s\n"
 
7521
@@ -2040,6 +2043,10 @@
 
7522
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wd]],
 
7523
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wf]],
 
7524
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wg]],
 
7525
+          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wh]],
 
7526
+          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wi]],
 
7527
+          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wj]],
 
7528
+          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wk]],
 
7529
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wl]],
 
7530
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wm]],
 
7531
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wr]],
 
7532
@@ -2324,6 +2331,8 @@
 
7533
 
 
7534
   for (m = 0; m < NUM_MACHINE_MODES; ++m)
 
7535
     {
 
7536
+      enum machine_mode m2 = (enum machine_mode)m;
 
7537
+
 
7538
       /* SDmode is special in that we want to access it only via REG+REG
 
7539
         addressing on power7 and above, since we want to use the LFIWZX and
 
7540
         STFIWZX instructions to load it.  */
 
7541
@@ -2358,13 +2367,12 @@
 
7542
 
 
7543
              if (TARGET_UPDATE
 
7544
                  && (rc == RELOAD_REG_GPR || rc == RELOAD_REG_FPR)
 
7545
-                 && GET_MODE_SIZE (m) <= 8
 
7546
-                 && !VECTOR_MODE_P (m)
 
7547
-                 && !COMPLEX_MODE_P (m)
 
7548
+                 && GET_MODE_SIZE (m2) <= 8
 
7549
+                 && !VECTOR_MODE_P (m2)
 
7550
+                 && !COMPLEX_MODE_P (m2)
 
7551
                  && !indexed_only_p
 
7552
-                 && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m) == 8)
 
7553
-                 && !(m == DFmode && TARGET_UPPER_REGS_DF)
 
7554
-                 && !(m == SFmode && TARGET_UPPER_REGS_SF))
 
7555
+                 && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m2) == 8)
 
7556
+                 && !reg_addr[m2].scalar_in_vmx_p)
 
7557
                {
 
7558
                  addr_mask |= RELOAD_REG_PRE_INCDEC;
 
7559
 
 
7560
@@ -2595,16 +2603,22 @@
 
7561
        f  - Register class to use with traditional SFmode instructions.
 
7562
        v  - Altivec register.
 
7563
        wa - Any VSX register.
 
7564
+       wc - Reserved to represent individual CR bits (used in LLVM).
 
7565
        wd - Preferred register class for V2DFmode.
 
7566
        wf - Preferred register class for V4SFmode.
 
7567
        wg - Float register for power6x move insns.
 
7568
+       wh - FP register for direct move instructions.
 
7569
+       wi - FP or VSX register to hold 64-bit integers for VSX insns.
 
7570
+       wj - FP or VSX register to hold 64-bit integers for direct moves.
 
7571
+       wk - FP or VSX register to hold 64-bit doubles for direct moves.
 
7572
        wl - Float register if we can do 32-bit signed int loads.
 
7573
        wm - VSX register for ISA 2.07 direct move operations.
 
7574
+       wn - always NO_REGS.
 
7575
        wr - GPR if 64-bit mode is permitted.
 
7576
        ws - Register class to do ISA 2.06 DF operations.
 
7577
+       wt - VSX register for TImode in VSX registers.
 
7578
        wu - Altivec register for ISA 2.07 VSX SF/SI load/stores.
 
7579
        wv - Altivec register for ISA 2.06 VSX DF/DI load/stores.
 
7580
-       wt - VSX register for TImode in VSX registers.
 
7581
        ww - Register class to do SF conversions in with VSX operations.
 
7582
        wx - Float register if we can do 32-bit int stores.
 
7583
        wy - Register class to do ISA 2.07 SF operations.
 
7584
@@ -2611,21 +2625,22 @@
 
7585
        wz - Float register if we can do 32-bit unsigned int loads.  */
 
7586
 
 
7587
   if (TARGET_HARD_FLOAT && TARGET_FPRS)
 
7588
-    rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;
 
7589
+    rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;      /* SFmode  */
 
7590
 
 
7591
   if (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT)
 
7592
-    rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS;
 
7593
+    rs6000_constraints[RS6000_CONSTRAINT_d]  = FLOAT_REGS;     /* DFmode  */
 
7594
 
 
7595
   if (TARGET_VSX)
 
7596
     {
 
7597
       rs6000_constraints[RS6000_CONSTRAINT_wa] = VSX_REGS;
 
7598
-      rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;
 
7599
-      rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;
 
7600
+      rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;     /* V2DFmode  */
 
7601
+      rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;     /* V4SFmode  */
 
7602
+      rs6000_constraints[RS6000_CONSTRAINT_wi] = FLOAT_REGS;   /* DImode  */
 
7603
 
 
7604
       if (TARGET_VSX_TIMODE)
 
7605
-       rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;
 
7606
+       rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;    /* TImode  */
 
7607
 
 
7608
-      if (TARGET_UPPER_REGS_DF)
 
7609
+      if (TARGET_UPPER_REGS_DF)                                        /* DFmode  */
 
7610
        {
 
7611
          rs6000_constraints[RS6000_CONSTRAINT_ws] = VSX_REGS;
 
7612
          rs6000_constraints[RS6000_CONSTRAINT_wv] = ALTIVEC_REGS;
 
7613
@@ -2639,19 +2654,26 @@
 
7614
   if (TARGET_ALTIVEC)
 
7615
     rs6000_constraints[RS6000_CONSTRAINT_v] = ALTIVEC_REGS;
 
7616
 
 
7617
-  if (TARGET_MFPGPR)
 
7618
+  if (TARGET_MFPGPR)                                           /* DFmode  */
 
7619
     rs6000_constraints[RS6000_CONSTRAINT_wg] = FLOAT_REGS;
 
7620
 
 
7621
   if (TARGET_LFIWAX)
 
7622
-    rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;
 
7623
+    rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;     /* DImode  */
 
7624
 
 
7625
   if (TARGET_DIRECT_MOVE)
 
7626
-    rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
 
7627
+    {
 
7628
+      rs6000_constraints[RS6000_CONSTRAINT_wh] = FLOAT_REGS;
 
7629
+      rs6000_constraints[RS6000_CONSTRAINT_wj]                 /* DImode  */
 
7630
+       = rs6000_constraints[RS6000_CONSTRAINT_wi];
 
7631
+      rs6000_constraints[RS6000_CONSTRAINT_wk]                 /* DFmode  */
 
7632
+       = rs6000_constraints[RS6000_CONSTRAINT_ws];
 
7633
+      rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
 
7634
+    }
 
7635
 
 
7636
   if (TARGET_POWERPC64)
 
7637
     rs6000_constraints[RS6000_CONSTRAINT_wr] = GENERAL_REGS;
 
7638
 
 
7639
-  if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)
 
7640
+  if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)                        /* SFmode  */
 
7641
     {
 
7642
       rs6000_constraints[RS6000_CONSTRAINT_wu] = ALTIVEC_REGS;
 
7643
       rs6000_constraints[RS6000_CONSTRAINT_wy] = VSX_REGS;
 
7644
@@ -2666,10 +2688,10 @@
 
7645
     rs6000_constraints[RS6000_CONSTRAINT_ww] = FLOAT_REGS;
 
7646
 
 
7647
   if (TARGET_STFIWX)
 
7648
-    rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;
 
7649
+    rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;     /* DImode  */
 
7650
 
 
7651
   if (TARGET_LFIWZX)
 
7652
-    rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;
 
7653
+    rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;     /* DImode  */
 
7654
 
 
7655
   /* Set up the reload helper and direct move functions.  */
 
7656
   if (TARGET_VSX || TARGET_ALTIVEC)
 
7657
@@ -2692,10 +2714,11 @@
 
7658
          reg_addr[V2DFmode].reload_load   = CODE_FOR_reload_v2df_di_load;
 
7659
          if (TARGET_VSX && TARGET_UPPER_REGS_DF)
 
7660
            {
 
7661
-             reg_addr[DFmode].reload_store  = CODE_FOR_reload_df_di_store;
 
7662
-             reg_addr[DFmode].reload_load   = CODE_FOR_reload_df_di_load;
 
7663
-             reg_addr[DDmode].reload_store  = CODE_FOR_reload_dd_di_store;
 
7664
-             reg_addr[DDmode].reload_load   = CODE_FOR_reload_dd_di_load;
 
7665
+             reg_addr[DFmode].reload_store    = CODE_FOR_reload_df_di_store;
 
7666
+             reg_addr[DFmode].reload_load     = CODE_FOR_reload_df_di_load;
 
7667
+             reg_addr[DFmode].scalar_in_vmx_p = true;
 
7668
+             reg_addr[DDmode].reload_store    = CODE_FOR_reload_dd_di_store;
 
7669
+             reg_addr[DDmode].reload_load     = CODE_FOR_reload_dd_di_load;
 
7670
            }
 
7671
          if (TARGET_P8_VECTOR)
 
7672
            {
 
7673
@@ -2703,6 +2726,8 @@
 
7674
              reg_addr[SFmode].reload_load   = CODE_FOR_reload_sf_di_load;
 
7675
              reg_addr[SDmode].reload_store  = CODE_FOR_reload_sd_di_store;
 
7676
              reg_addr[SDmode].reload_load   = CODE_FOR_reload_sd_di_load;
 
7677
+             if (TARGET_UPPER_REGS_SF)
 
7678
+               reg_addr[SFmode].scalar_in_vmx_p = true;
 
7679
            }
 
7680
          if (TARGET_VSX_TIMODE)
 
7681
            {
 
7682
@@ -2759,10 +2784,11 @@
 
7683
          reg_addr[V2DFmode].reload_load   = CODE_FOR_reload_v2df_si_load;
 
7684
          if (TARGET_VSX && TARGET_UPPER_REGS_DF)
 
7685
            {
 
7686
-             reg_addr[DFmode].reload_store  = CODE_FOR_reload_df_si_store;
 
7687
-             reg_addr[DFmode].reload_load   = CODE_FOR_reload_df_si_load;
 
7688
-             reg_addr[DDmode].reload_store  = CODE_FOR_reload_dd_si_store;
 
7689
-             reg_addr[DDmode].reload_load   = CODE_FOR_reload_dd_si_load;
 
7690
+             reg_addr[DFmode].reload_store    = CODE_FOR_reload_df_si_store;
 
7691
+             reg_addr[DFmode].reload_load     = CODE_FOR_reload_df_si_load;
 
7692
+             reg_addr[DFmode].scalar_in_vmx_p = true;
 
7693
+             reg_addr[DDmode].reload_store    = CODE_FOR_reload_dd_si_store;
 
7694
+             reg_addr[DDmode].reload_load     = CODE_FOR_reload_dd_si_load;
 
7695
            }
 
7696
          if (TARGET_P8_VECTOR)
 
7697
            {
 
7698
@@ -2770,6 +2796,8 @@
 
7699
              reg_addr[SFmode].reload_load   = CODE_FOR_reload_sf_si_load;
 
7700
              reg_addr[SDmode].reload_store  = CODE_FOR_reload_sd_si_store;
 
7701
              reg_addr[SDmode].reload_load   = CODE_FOR_reload_sd_si_load;
 
7702
+             if (TARGET_UPPER_REGS_SF)
 
7703
+               reg_addr[SFmode].scalar_in_vmx_p = true;
 
7704
            }
 
7705
          if (TARGET_VSX_TIMODE)
 
7706
            {
 
7707
@@ -2810,6 +2838,7 @@
 
7708
 
 
7709
       for (m = 0; m < NUM_MACHINE_MODES; ++m)
 
7710
        {
 
7711
+         enum machine_mode m2 = (enum machine_mode)m;
 
7712
          int reg_size2 = reg_size;
 
7713
 
 
7714
          /* TFmode/TDmode always takes 2 registers, even in VSX.  */
 
7715
@@ -2818,7 +2847,7 @@
 
7716
            reg_size2 = UNITS_PER_FP_WORD;
 
7717
 
 
7718
          rs6000_class_max_nregs[m][c]
 
7719
-           = (GET_MODE_SIZE (m) + reg_size2 - 1) / reg_size2;
 
7720
+           = (GET_MODE_SIZE (m2) + reg_size2 - 1) / reg_size2;
 
7721
        }
 
7722
     }
 
7723
 
 
7724
@@ -3014,7 +3043,8 @@
 
7725
          | ((TARGET_CRYPTO)                ? RS6000_BTM_CRYPTO    : 0)
 
7726
          | ((TARGET_HTM)                   ? RS6000_BTM_HTM       : 0)
 
7727
          | ((TARGET_DFP)                   ? RS6000_BTM_DFP       : 0)
 
7728
-         | ((TARGET_HARD_FLOAT)            ? RS6000_BTM_HARD_FLOAT : 0));
 
7729
+         | ((TARGET_HARD_FLOAT)            ? RS6000_BTM_HARD_FLOAT : 0)
 
7730
+         | ((TARGET_LONG_DOUBLE_128)       ? RS6000_BTM_LDBL128 : 0));
 
7731
 }
 
7732
 
 
7733
 /* Override command line options.  Mostly we process the processor type and
 
7734
@@ -5861,6 +5891,34 @@
 
7735
   return align;
 
7736
 }
 
7737
 
 
7738
+/* Previous GCC releases forced all vector types to have 16-byte alignment.  */
 
7739
+
 
7740
+bool
 
7741
+rs6000_special_adjust_field_align_p (tree field, unsigned int computed)
 
7742
+{
 
7743
+  if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE)
 
7744
+    {
 
7745
+      if (computed != 128)
 
7746
+       {
 
7747
+         static bool warned;
 
7748
+         if (!warned && warn_psabi)
 
7749
+           {
 
7750
+             warned = true;
 
7751
+             inform (input_location,
 
7752
+                     "the layout of aggregates containing vectors with"
 
7753
+                     " %d-byte alignment will change in a future GCC release",
 
7754
+                     computed / BITS_PER_UNIT);
 
7755
+           }
 
7756
+       }
 
7757
+      /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
 
7758
+        keep the special treatment of vector types, but warn if there will
 
7759
+        be differences in future GCC releases.  */
 
7760
+      return true;
 
7761
+    }
 
7762
+
 
7763
+  return false;
 
7764
+}
 
7765
+
 
7766
 /* AIX increases natural record alignment to doubleword if the first
 
7767
    field is an FP double while the FP fields remain word aligned.  */
 
7768
 
 
7769
@@ -6109,7 +6167,8 @@
 
7770
     return false;
 
7771
 
 
7772
   extra = GET_MODE_SIZE (mode) - UNITS_PER_WORD;
 
7773
-  gcc_assert (extra >= 0);
 
7774
+  if (extra < 0)
 
7775
+    extra = 0;
 
7776
 
 
7777
   if (GET_CODE (addr) == LO_SUM)
 
7778
     /* For lo_sum addresses, we must allow any offset except one that
 
7779
@@ -9198,14 +9257,51 @@
 
7780
           || (type && TREE_CODE (type) == VECTOR_TYPE
 
7781
               && int_size_in_bytes (type) >= 16))
 
7782
     return 128;
 
7783
-  else if (((TARGET_MACHO && rs6000_darwin64_abi)
 
7784
-           || DEFAULT_ABI == ABI_ELFv2
 
7785
-            || (DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm))
 
7786
-          && mode == BLKmode
 
7787
-          && type && TYPE_ALIGN (type) > 64)
 
7788
+
 
7789
+  /* Aggregate types that need > 8 byte alignment are quadword-aligned
 
7790
+     in the parameter area in the ELFv2 ABI, and in the AIX ABI unless
 
7791
+     -mcompat-align-parm is used.  */
 
7792
+  if (((DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm)
 
7793
+       || DEFAULT_ABI == ABI_ELFv2)
 
7794
+      && type && TYPE_ALIGN (type) > 64)
 
7795
+    {
 
7796
+      /* "Aggregate" means any AGGREGATE_TYPE except for single-element
 
7797
+         or homogeneous float/vector aggregates here.  We already handled
 
7798
+         vector aggregates above, but still need to check for float here. */
 
7799
+      bool aggregate_p = (AGGREGATE_TYPE_P (type)
 
7800
+                         && !SCALAR_FLOAT_MODE_P (elt_mode));
 
7801
+
 
7802
+      /* We used to check for BLKmode instead of the above aggregate type
 
7803
+        check.  Warn when this results in any difference to the ABI.  */
 
7804
+      if (aggregate_p != (mode == BLKmode))
 
7805
+       {
 
7806
+         static bool warned;
 
7807
+         if (!warned && warn_psabi)
 
7808
+           {
 
7809
+             warned = true;
 
7810
+             inform (input_location,
 
7811
+                     "the ABI of passing aggregates with %d-byte alignment"
 
7812
+                     " will change in a future GCC release",
 
7813
+                     (int) TYPE_ALIGN (type) / BITS_PER_UNIT);
 
7814
+           }
 
7815
+       }
 
7816
+
 
7817
+      /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
 
7818
+        keep using the BLKmode check, but warn if there will be differences
 
7819
+        in future GCC releases.  */
 
7820
+      if (mode == BLKmode)
 
7821
+       return 128;
 
7822
+    }
 
7823
+
 
7824
+  /* Similar for the Darwin64 ABI.  Note that for historical reasons we
 
7825
+     implement the "aggregate type" check as a BLKmode check here; this
 
7826
+     means certain aggregate types are in fact not aligned.  */
 
7827
+  if (TARGET_MACHO && rs6000_darwin64_abi
 
7828
+      && mode == BLKmode
 
7829
+      && type && TYPE_ALIGN (type) > 64)
 
7830
     return 128;
 
7831
-  else
 
7832
-    return PARM_BOUNDARY;
 
7833
+
 
7834
+  return PARM_BOUNDARY;
 
7835
 }
 
7836
 
 
7837
 /* The offset in words to the start of the parameter save area.  */
 
7838
@@ -10243,6 +10339,7 @@
 
7839
          rtx r, off;
 
7840
          int i, k = 0;
 
7841
          unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
 
7842
+         int fpr_words;
 
7843
 
 
7844
          /* Do we also need to pass this argument in the parameter
 
7845
             save area?  */
 
7846
@@ -10271,6 +10368,37 @@
 
7847
              rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off);
 
7848
            }
 
7849
 
 
7850
+         /* If there were not enough FPRs to hold the argument, the rest
 
7851
+            usually goes into memory.  However, if the current position
 
7852
+            is still within the register parameter area, a portion may
 
7853
+            actually have to go into GPRs.
 
7854
+
 
7855
+            Note that it may happen that the portion of the argument
 
7856
+            passed in the first "half" of the first GPR was already
 
7857
+            passed in the last FPR as well.
 
7858
+
 
7859
+            For unnamed arguments, we already set up GPRs to cover the
 
7860
+            whole argument in rs6000_psave_function_arg, so there is
 
7861
+            nothing further to do at this point.
 
7862
+
 
7863
+            GCC 4.8/4.9 Note: This was implemented incorrectly in earlier
 
7864
+            GCC releases.  To avoid any ABI change on the release branch,
 
7865
+            we retain that original implementation here, but warn if we
 
7866
+            encounter a case where the ABI will change in the future.  */
 
7867
+         fpr_words = (i * GET_MODE_SIZE (elt_mode)) / (TARGET_32BIT ? 4 : 8);
 
7868
+         if (i < n_elts && align_words + fpr_words < GP_ARG_NUM_REG
 
7869
+             && cum->nargs_prototype > 0)
 
7870
+            {
 
7871
+             static bool warned;
 
7872
+             if (!warned && warn_psabi)
 
7873
+               {
 
7874
+                 warned = true;
 
7875
+                 inform (input_location,
 
7876
+                         "the ABI of passing homogeneous float aggregates"
 
7877
+                         " will change in a future GCC release");
 
7878
+               }
 
7879
+           }
 
7880
+
 
7881
          return rs6000_finish_function_arg (mode, rvec, k);
 
7882
        }
 
7883
       else if (align_words < GP_ARG_NUM_REG)
 
7884
@@ -10497,10 +10625,9 @@
 
7885
    list, or passes any parameter in memory.  */
 
7886
 
 
7887
 static bool
 
7888
-rs6000_function_parms_need_stack (tree fun)
 
7889
+rs6000_function_parms_need_stack (tree fun, bool incoming)
 
7890
 {
 
7891
-  function_args_iterator args_iter;
 
7892
-  tree arg_type;
 
7893
+  tree fntype, result;
 
7894
   CUMULATIVE_ARGS args_so_far_v;
 
7895
   cumulative_args_t args_so_far;
 
7896
 
 
7897
@@ -10507,26 +10634,57 @@
 
7898
   if (!fun)
 
7899
     /* Must be a libcall, all of which only use reg parms.  */
 
7900
     return false;
 
7901
+
 
7902
+  fntype = fun;
 
7903
   if (!TYPE_P (fun))
 
7904
-    fun = TREE_TYPE (fun);
 
7905
+    fntype = TREE_TYPE (fun);
 
7906
 
 
7907
   /* Varargs functions need the parameter save area.  */
 
7908
-  if (!prototype_p (fun) || stdarg_p (fun))
 
7909
+  if ((!incoming && !prototype_p (fntype)) || stdarg_p (fntype))
 
7910
     return true;
 
7911
 
 
7912
-  INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fun, NULL_RTX);
 
7913
+  INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fntype, NULL_RTX);
 
7914
   args_so_far = pack_cumulative_args (&args_so_far_v);
 
7915
 
 
7916
-  if (aggregate_value_p (TREE_TYPE (fun), fun))
 
7917
+  /* When incoming, we will have been passed the function decl.
 
7918
+     It is necessary to use the decl to handle K&R style functions,
 
7919
+     where TYPE_ARG_TYPES may not be available.  */
 
7920
+  if (incoming)
 
7921
     {
 
7922
-      tree type = build_pointer_type (TREE_TYPE (fun));
 
7923
-      rs6000_parm_needs_stack (args_so_far, type);
 
7924
+      gcc_assert (DECL_P (fun));
 
7925
+      result = DECL_RESULT (fun);
 
7926
     }
 
7927
+  else
 
7928
+    result = TREE_TYPE (fntype);
 
7929
 
 
7930
-  FOREACH_FUNCTION_ARGS (fun, arg_type, args_iter)
 
7931
-    if (rs6000_parm_needs_stack (args_so_far, arg_type))
 
7932
-      return true;
 
7933
+  if (result && aggregate_value_p (result, fntype))
 
7934
+    {
 
7935
+      if (!TYPE_P (result))
 
7936
+       result = TREE_TYPE (result);
 
7937
+      result = build_pointer_type (result);
 
7938
+      rs6000_parm_needs_stack (args_so_far, result);
 
7939
+    }
 
7940
 
 
7941
+  if (incoming)
 
7942
+    {
 
7943
+      tree parm;
 
7944
+
 
7945
+      for (parm = DECL_ARGUMENTS (fun);
 
7946
+          parm && parm != void_list_node;
 
7947
+          parm = TREE_CHAIN (parm))
 
7948
+       if (rs6000_parm_needs_stack (args_so_far, TREE_TYPE (parm)))
 
7949
+         return true;
 
7950
+    }
 
7951
+  else
 
7952
+    {
 
7953
+      function_args_iterator args_iter;
 
7954
+      tree arg_type;
 
7955
+
 
7956
+      FOREACH_FUNCTION_ARGS (fntype, arg_type, args_iter)
 
7957
+       if (rs6000_parm_needs_stack (args_so_far, arg_type))
 
7958
+         return true;
 
7959
+    }
 
7960
+
 
7961
   return false;
 
7962
 }
 
7963
 
 
7964
@@ -10537,7 +10695,7 @@
 
7965
    all parameters in registers.  */
 
7966
 
 
7967
 int
 
7968
-rs6000_reg_parm_stack_space (tree fun)
 
7969
+rs6000_reg_parm_stack_space (tree fun, bool incoming)
 
7970
 {
 
7971
   int reg_parm_stack_space;
 
7972
 
 
7973
@@ -10555,7 +10713,7 @@
 
7974
     case ABI_ELFv2:
 
7975
       /* ??? Recomputing this every time is a bit expensive.  Is there
 
7976
         a place to cache this information?  */
 
7977
-      if (rs6000_function_parms_need_stack (fun))
 
7978
+      if (rs6000_function_parms_need_stack (fun, incoming))
 
7979
        reg_parm_stack_space = TARGET_64BIT ? 64 : 32;
 
7980
       else
 
7981
        reg_parm_stack_space = 0;
 
7982
@@ -13544,11 +13702,15 @@
 
7983
   else if ((fnmask & (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
 
7984
           == (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
 
7985
     error ("Builtin function %s requires the -mhard-dfp and"
 
7986
-          "-mpower8-vector options", name);
 
7987
+          " -mpower8-vector options", name);
 
7988
   else if ((fnmask & RS6000_BTM_DFP) != 0)
 
7989
     error ("Builtin function %s requires the -mhard-dfp option", name);
 
7990
   else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
 
7991
     error ("Builtin function %s requires the -mpower8-vector option", name);
 
7992
+  else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
 
7993
+          == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
 
7994
+    error ("Builtin function %s requires the -mhard-float and"
 
7995
+          " -mlong-double-128 options", name);
 
7996
   else if ((fnmask & RS6000_BTM_HARD_FLOAT) != 0)
 
7997
     error ("Builtin function %s requires the -mhard-float option", name);
 
7998
   else
 
7999
@@ -17099,7 +17261,14 @@
 
8000
      prefer Altivec loads..  */
 
8001
   if (rclass == VSX_REGS)
 
8002
     {
 
8003
-      if (GET_MODE_SIZE (mode) <= 8)
 
8004
+      if (MEM_P (x) && reg_addr[mode].scalar_in_vmx_p)
 
8005
+       {
 
8006
+         rtx addr = XEXP (x, 0);
 
8007
+         if (rs6000_legitimate_offset_address_p (mode, addr, false, true)
 
8008
+             || legitimate_lo_sum_address_p (mode, addr, false))
 
8009
+           return FLOAT_REGS;
 
8010
+       }
 
8011
+      else if (GET_MODE_SIZE (mode) <= 8 && !reg_addr[mode].scalar_in_vmx_p)
 
8012
        return FLOAT_REGS;
 
8013
 
 
8014
       if (VECTOR_UNIT_ALTIVEC_P (mode) || VECTOR_MEM_ALTIVEC_P (mode)
 
8015
@@ -31413,6 +31582,7 @@
 
8016
   { "htm",              RS6000_BTM_HTM,        false, false },
 
8017
   { "hard-dfp",                 RS6000_BTM_DFP,        false, false },
 
8018
   { "hard-float",       RS6000_BTM_HARD_FLOAT, false, false },
 
8019
+  { "long-double-128",  RS6000_BTM_LDBL128,    false, false },
 
8020
 };
 
8021
 
 
8022
 /* Option variables that we want to support inside attribute((target)) and
 
8023
@@ -32663,25 +32833,14 @@
 
8024
 
 
8025
 /* Return true if the peephole2 can combine a load involving a combination of
 
8026
    an addis instruction and a load with an offset that can be fused together on
 
8027
-   a power8.
 
8028
+   a power8.  */
 
8029
 
 
8030
-   The operands are:
 
8031
-       operands[0]     register set with addis
 
8032
-       operands[1]     value set via addis
 
8033
-       operands[2]     target register being loaded
 
8034
-       operands[3]     D-form memory reference using operands[0].
 
8035
-
 
8036
-   In addition, we are passed a boolean that is true if this is a peephole2,
 
8037
-   and we can use see if the addis_reg is dead after the insn and can be
 
8038
-   replaced by the target register.  */
 
8039
-
 
8040
 bool
 
8041
-fusion_gpr_load_p (rtx *operands, bool peep2_p)
 
8042
+fusion_gpr_load_p (rtx addis_reg,      /* register set via addis.  */
 
8043
+                  rtx addis_value,     /* addis value.  */
 
8044
+                  rtx target,          /* target register that is loaded.  */
 
8045
+                  rtx mem)             /* bottom part of the memory addr. */
 
8046
 {
 
8047
-  rtx addis_reg = operands[0];
 
8048
-  rtx addis_value = operands[1];
 
8049
-  rtx target = operands[2];
 
8050
-  rtx mem = operands[3];
 
8051
   rtx addr;
 
8052
   rtx base_reg;
 
8053
 
 
8054
@@ -32695,9 +32854,6 @@
 
8055
   if (!fusion_gpr_addis (addis_value, GET_MODE (addis_value)))
 
8056
     return false;
 
8057
 
 
8058
-  if (!fusion_gpr_mem_load (mem, GET_MODE (mem)))
 
8059
-    return false;
 
8060
-
 
8061
   /* Allow sign/zero extension.  */
 
8062
   if (GET_CODE (mem) == ZERO_EXTEND
 
8063
       || (GET_CODE (mem) == SIGN_EXTEND && TARGET_P8_FUSION_SIGN))
 
8064
@@ -32706,22 +32862,22 @@
 
8065
   if (!MEM_P (mem))
 
8066
     return false;
 
8067
 
 
8068
+  if (!fusion_gpr_mem_load (mem, GET_MODE (mem)))
 
8069
+    return false;
 
8070
+
 
8071
   addr = XEXP (mem, 0);                        /* either PLUS or LO_SUM.  */
 
8072
   if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
 
8073
     return false;
 
8074
 
 
8075
   /* Validate that the register used to load the high value is either the
 
8076
-     register being loaded, or we can safely replace its use in a peephole2.
 
8077
+     register being loaded, or we can safely replace its use.
 
8078
 
 
8079
-     If this is a peephole2, we assume that there are 2 instructions in the
 
8080
-     peephole (addis and load), so we want to check if the target register was
 
8081
-     not used in the memory address and the register to hold the addis result
 
8082
-     is dead after the peephole.  */
 
8083
+     This function is only called from the peephole2 pass and we assume that
 
8084
+     there are 2 instructions in the peephole (addis and load), so we want to
 
8085
+     check if the target register was not used in the memory address and the
 
8086
+     register to hold the addis result is dead after the peephole.  */
 
8087
   if (REGNO (addis_reg) != REGNO (target))
 
8088
     {
 
8089
-      if (!peep2_p)
 
8090
-       return false;
 
8091
-
 
8092
       if (reg_mentioned_p (target, mem))
 
8093
        return false;
 
8094
 
 
8095
@@ -32762,9 +32918,6 @@
 
8096
   enum machine_mode extend_mode = target_mode;
 
8097
   enum machine_mode ptr_mode = Pmode;
 
8098
   enum rtx_code extend = UNKNOWN;
 
8099
-  rtx addis_reg = ((ptr_mode == target_mode)
 
8100
-                  ? target
 
8101
-                  : simplify_subreg (ptr_mode, target, target_mode, 0));
 
8102
 
 
8103
   if (GET_CODE (orig_mem) == ZERO_EXTEND
 
8104
       || (TARGET_P8_FUSION_SIGN && GET_CODE (orig_mem) == SIGN_EXTEND))
 
8105
@@ -32781,13 +32934,14 @@
 
8106
   gcc_assert (plus_or_lo_sum == PLUS || plus_or_lo_sum == LO_SUM);
 
8107
 
 
8108
   offset = XEXP (orig_addr, 1);
 
8109
-  new_addr = gen_rtx_fmt_ee (plus_or_lo_sum, ptr_mode, addis_reg, offset);
 
8110
-  new_mem = change_address (orig_mem, target_mode, new_addr);
 
8111
+  new_addr = gen_rtx_fmt_ee (plus_or_lo_sum, ptr_mode, addis_value, offset);
 
8112
+  new_mem = replace_equiv_address_nv (orig_mem, new_addr);
 
8113
 
 
8114
   if (extend != UNKNOWN)
 
8115
     new_mem = gen_rtx_fmt_e (ZERO_EXTEND, extend_mode, new_mem);
 
8116
 
 
8117
-  emit_insn (gen_rtx_SET (VOIDmode, addis_reg, addis_value));
 
8118
+  new_mem = gen_rtx_UNSPEC (extend_mode, gen_rtvec (1, new_mem),
 
8119
+                           UNSPEC_FUSION_GPR);
 
8120
   emit_insn (gen_rtx_SET (VOIDmode, target, new_mem));
 
8121
 
 
8122
   if (extend == SIGN_EXTEND)
 
8123
@@ -32806,55 +32960,40 @@
 
8124
 }
 
8125
 
 
8126
 /* Return a string to fuse an addis instruction with a gpr load to the same
 
8127
-   register that we loaded up the addis instruction.  The code is complicated,
 
8128
-   so we call output_asm_insn directly, and just return "".
 
8129
+   register that we loaded up the addis instruction.  The address that is used
 
8130
+   is the logical address that was formed during peephole2:
 
8131
+       (lo_sum (high) (low-part))
 
8132
 
 
8133
-   The operands are:
 
8134
-       operands[0]     register set with addis (must be same reg as target).
 
8135
-       operands[1]     value set via addis
 
8136
-       operands[2]     target register being loaded
 
8137
-       operands[3]     D-form memory reference using operands[0].  */
 
8138
+   The code is complicated, so we call output_asm_insn directly, and just
 
8139
+   return "".  */
 
8140
 
 
8141
 const char *
 
8142
-emit_fusion_gpr_load (rtx *operands)
 
8143
+emit_fusion_gpr_load (rtx target, rtx mem)
 
8144
 {
 
8145
-  rtx addis_reg = operands[0];
 
8146
-  rtx addis_value = operands[1];
 
8147
-  rtx target = operands[2];
 
8148
-  rtx mem = operands[3];
 
8149
+  rtx addis_value;
 
8150
   rtx fuse_ops[10];
 
8151
   rtx addr;
 
8152
   rtx load_offset;
 
8153
   const char *addis_str = NULL;
 
8154
   const char *load_str = NULL;
 
8155
-  const char *extend_insn = NULL;
 
8156
   const char *mode_name = NULL;
 
8157
   char insn_template[80];
 
8158
   enum machine_mode mode;
 
8159
   const char *comment_str = ASM_COMMENT_START;
 
8160
-  bool sign_p = false;
 
8161
 
 
8162
-  gcc_assert (REG_P (addis_reg) && REG_P (target));
 
8163
-  gcc_assert (REGNO (addis_reg) == REGNO (target));
 
8164
+  if (GET_CODE (mem) == ZERO_EXTEND)
 
8165
+    mem = XEXP (mem, 0);
 
8166
 
 
8167
+  gcc_assert (REG_P (target) && MEM_P (mem));
 
8168
+
 
8169
   if (*comment_str == ' ')
 
8170
     comment_str++;
 
8171
 
 
8172
-  /* Allow sign/zero extension.  */
 
8173
-  if (GET_CODE (mem) == ZERO_EXTEND)
 
8174
-    mem = XEXP (mem, 0);
 
8175
-
 
8176
-  else if (GET_CODE (mem) == SIGN_EXTEND && TARGET_P8_FUSION_SIGN)
 
8177
-    {
 
8178
-      sign_p = true;
 
8179
-      mem = XEXP (mem, 0);
 
8180
-    }
 
8181
-
 
8182
-  gcc_assert (MEM_P (mem));
 
8183
   addr = XEXP (mem, 0);
 
8184
   if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
 
8185
     gcc_unreachable ();
 
8186
 
 
8187
+  addis_value = XEXP (addr, 0);
 
8188
   load_offset = XEXP (addr, 1);
 
8189
 
 
8190
   /* Now emit the load instruction to the same register.  */
 
8191
@@ -32864,29 +33003,22 @@
 
8192
     case QImode:
 
8193
       mode_name = "char";
 
8194
       load_str = "lbz";
 
8195
-      extend_insn = "extsb %0,%0";
 
8196
       break;
 
8197
 
 
8198
     case HImode:
 
8199
       mode_name = "short";
 
8200
       load_str = "lhz";
 
8201
-      extend_insn = "extsh %0,%0";
 
8202
       break;
 
8203
 
 
8204
     case SImode:
 
8205
       mode_name = "int";
 
8206
       load_str = "lwz";
 
8207
-      extend_insn = "extsw %0,%0";
 
8208
       break;
 
8209
 
 
8210
     case DImode:
 
8211
-      if (TARGET_POWERPC64)
 
8212
-       {
 
8213
-         mode_name = "long";
 
8214
-         load_str = "ld";
 
8215
-       }
 
8216
-      else
 
8217
-       gcc_unreachable ();
 
8218
+      gcc_assert (TARGET_POWERPC64);
 
8219
+      mode_name = "long";
 
8220
+      load_str = "ld";
 
8221
       break;
 
8222
 
 
8223
     default:
 
8224
@@ -33030,14 +33162,6 @@
 
8225
   else
 
8226
     fatal_insn ("Unable to generate load offset for fusion", load_offset);
 
8227
 
 
8228
-  /* Handle sign extension.  The peephole2 pass generates this as a separate
 
8229
-     insn, but we handle it just in case it got reattached.  */
 
8230
-  if (sign_p)
 
8231
-    {
 
8232
-      gcc_assert (extend_insn != NULL);
 
8233
-      output_asm_insn (extend_insn, fuse_ops);
 
8234
-    }
 
8235
-
 
8236
   return "";
 
8237
 }
 
8238
 
 
8239
Index: gcc/config/rs6000/vsx.md
 
8240
===================================================================
 
8241
--- a/src/gcc/config/rs6000/vsx.md      (.../tags/gcc_4_8_3_release)
 
8242
+++ b/src/gcc/config/rs6000/vsx.md      (.../branches/gcc-4_8-branch)
 
8243
@@ -24,6 +24,13 @@
 
8244
 ;; Iterator for the 2 64-bit vector types
 
8245
 (define_mode_iterator VSX_D [V2DF V2DI])
 
8246
 
 
8247
+;; Iterator for the 2 64-bit vector types + 128-bit types that are loaded with
 
8248
+;; lxvd2x to properly handle swapping words on little endian
 
8249
+(define_mode_iterator VSX_LE [V2DF
 
8250
+                             V2DI
 
8251
+                             V1TI
 
8252
+                             (TI       "VECTOR_MEM_VSX_P (TImode)")])
 
8253
+
 
8254
 ;; Iterator for the 2 32-bit vector types
 
8255
 (define_mode_iterator VSX_W [V4SF V4SI])
 
8256
 
 
8257
@@ -79,19 +86,26 @@
 
8258
                         (V4SF  "wf")
 
8259
                         (V2DI  "wd")
 
8260
                         (V2DF  "wd")
 
8261
+                        (DI    "wi")
 
8262
                         (DF    "ws")
 
8263
-                        (SF    "d")
 
8264
+                        (SF    "ww")
 
8265
                         (V1TI  "v")
 
8266
                         (TI    "wt")])
 
8267
 
 
8268
-;; Map the register class used for float<->int conversions
 
8269
+;; Map the register class used for float<->int conversions (floating point side)
 
8270
+;; VSr2 is the preferred register class, VSr3 is any register class that will
 
8271
+;; hold the data
 
8272
 (define_mode_attr VSr2 [(V2DF  "wd")
 
8273
                         (V4SF  "wf")
 
8274
-                        (DF    "ws")])
 
8275
+                        (DF    "ws")
 
8276
+                        (SF    "ww")
 
8277
+                        (DI    "wi")])
 
8278
 
 
8279
 (define_mode_attr VSr3 [(V2DF  "wa")
 
8280
                         (V4SF  "wa")
 
8281
-                        (DF    "ws")])
 
8282
+                        (DF    "ws")
 
8283
+                        (SF    "ww")
 
8284
+                        (DI    "wi")])
 
8285
 
 
8286
 ;; Map the register class for sp<->dp float conversions, destination
 
8287
 (define_mode_attr VSr4 [(SF    "ws")
 
8288
@@ -99,12 +113,27 @@
 
8289
                         (V2DF  "wd")
 
8290
                         (V4SF  "v")])
 
8291
 
 
8292
-;; Map the register class for sp<->dp float conversions, destination
 
8293
+;; Map the register class for sp<->dp float conversions, source
 
8294
 (define_mode_attr VSr5 [(SF    "ws")
 
8295
                         (DF    "f")
 
8296
                         (V2DF  "v")
 
8297
                         (V4SF  "wd")])
 
8298
 
 
8299
+;; The VSX register class that a type can occupy, even if it is not the
 
8300
+;; preferred register class (VSr is the preferred register class that will get
 
8301
+;; allocated first).
 
8302
+(define_mode_attr VSa  [(V16QI "wa")
 
8303
+                        (V8HI  "wa")
 
8304
+                        (V4SI  "wa")
 
8305
+                        (V4SF  "wa")
 
8306
+                        (V2DI  "wa")
 
8307
+                        (V2DF  "wa")
 
8308
+                        (DI    "wi")
 
8309
+                        (DF    "ws")
 
8310
+                        (SF    "ww")
 
8311
+                        (V1TI  "wa")
 
8312
+                        (TI    "wt")])
 
8313
+
 
8314
 ;; Same size integer type for floating point data
 
8315
 (define_mode_attr VSi [(V4SF  "v4si")
 
8316
                       (V2DF  "v2di")
 
8317
@@ -200,6 +229,16 @@
 
8318
                             (V2DF      "V4DF")
 
8319
                             (V1TI      "V2TI")])
 
8320
 
 
8321
+;; Map register class for 64-bit element in 128-bit vector for direct moves
 
8322
+;; to/from gprs
 
8323
+(define_mode_attr VS_64dm [(V2DF       "wk")
 
8324
+                          (V2DI        "wj")])
 
8325
+
 
8326
+;; Map register class for 64-bit element in 128-bit vector for normal register
 
8327
+;; to register moves
 
8328
+(define_mode_attr VS_64reg [(V2DF      "ws")
 
8329
+                           (V2DI       "wi")])
 
8330
+
 
8331
 ;; Constants for creating unspecs
 
8332
 (define_c_enum "unspec"
 
8333
   [UNSPEC_VSX_CONCAT
 
8334
@@ -228,8 +267,8 @@
 
8335
 ;; The patterns for LE permuted loads and stores come before the general
 
8336
 ;; VSX moves so they match first.
 
8337
 (define_insn_and_split "*vsx_le_perm_load_<mode>"
 
8338
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
8339
-        (match_operand:VSX_D 1 "memory_operand" "Z"))]
 
8340
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
 
8341
+        (match_operand:VSX_LE 1 "memory_operand" "Z"))]
 
8342
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
8343
   "#"
 
8344
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
8345
@@ -251,7 +290,7 @@
 
8346
    (set_attr "length" "8")])
 
8347
 
 
8348
 (define_insn_and_split "*vsx_le_perm_load_<mode>"
 
8349
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
 
8350
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
 
8351
         (match_operand:VSX_W 1 "memory_operand" "Z"))]
 
8352
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
8353
   "#"
 
8354
@@ -342,8 +381,8 @@
 
8355
    (set_attr "length" "8")])
 
8356
 
 
8357
 (define_insn "*vsx_le_perm_store_<mode>"
 
8358
-  [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
 
8359
-        (match_operand:VSX_D 1 "vsx_register_operand" "+wa"))]
 
8360
+  [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
 
8361
+        (match_operand:VSX_LE 1 "vsx_register_operand" "+<VSa>"))]
 
8362
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
8363
   "#"
 
8364
   [(set_attr "type" "vecstore")
 
8365
@@ -350,8 +389,8 @@
 
8366
    (set_attr "length" "12")])
 
8367
 
 
8368
 (define_split
 
8369
-  [(set (match_operand:VSX_D 0 "memory_operand" "")
 
8370
-        (match_operand:VSX_D 1 "vsx_register_operand" ""))]
 
8371
+  [(set (match_operand:VSX_LE 0 "memory_operand" "")
 
8372
+        (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
 
8373
   "!BYTES_BIG_ENDIAN && TARGET_VSX && !reload_completed"
 
8374
   [(set (match_dup 2)
 
8375
         (vec_select:<MODE>
 
8376
@@ -369,8 +408,8 @@
 
8377
 ;; The post-reload split requires that we re-permute the source
 
8378
 ;; register in case it is still live.
 
8379
 (define_split
 
8380
-  [(set (match_operand:VSX_D 0 "memory_operand" "")
 
8381
-        (match_operand:VSX_D 1 "vsx_register_operand" ""))]
 
8382
+  [(set (match_operand:VSX_LE 0 "memory_operand" "")
 
8383
+        (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
 
8384
   "!BYTES_BIG_ENDIAN && TARGET_VSX && reload_completed"
 
8385
   [(set (match_dup 1)
 
8386
         (vec_select:<MODE>
 
8387
@@ -388,7 +427,7 @@
 
8388
 
 
8389
 (define_insn "*vsx_le_perm_store_<mode>"
 
8390
   [(set (match_operand:VSX_W 0 "memory_operand" "=Z")
 
8391
-        (match_operand:VSX_W 1 "vsx_register_operand" "+wa"))]
 
8392
+        (match_operand:VSX_W 1 "vsx_register_operand" "+<VSa>"))]
 
8393
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
8394
   "#"
 
8395
   [(set_attr "type" "vecstore")
 
8396
@@ -578,8 +617,8 @@
 
8397
 
 
8398
 
 
8399
 (define_insn "*vsx_mov<mode>"
 
8400
-  [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?wa,?wa,wQ,?&r,??Y,??r,??r,<VSr>,?wa,*r,v,wZ, v")
 
8401
-       (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
 
8402
+  [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?<VSa>,?<VSa>,wQ,?&r,??Y,??r,??r,<VSr>,?<VSa>,*r,v,wZ, v")
 
8403
+       (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,<VSa>,Z,<VSa>,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
 
8404
   "VECTOR_MEM_VSX_P (<MODE>mode)
 
8405
    && (register_operand (operands[0], <MODE>mode) 
 
8406
        || register_operand (operands[1], <MODE>mode))"
 
8407
@@ -681,9 +720,9 @@
 
8408
 ;; instructions are now combined with the insn for the traditional floating
 
8409
 ;; point unit.
 
8410
 (define_insn "*vsx_add<mode>3"
 
8411
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8412
-        (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8413
-                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8414
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8415
+        (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8416
+                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8417
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8418
   "xvadd<VSs> %x0,%x1,%x2"
 
8419
   [(set_attr "type" "<VStype_simple>")
 
8420
@@ -690,9 +729,9 @@
 
8421
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8422
 
 
8423
 (define_insn "*vsx_sub<mode>3"
 
8424
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8425
-        (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8426
-                    (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8427
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8428
+        (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8429
+                    (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8430
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8431
   "xvsub<VSs> %x0,%x1,%x2"
 
8432
   [(set_attr "type" "<VStype_simple>")
 
8433
@@ -699,9 +738,9 @@
 
8434
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8435
 
 
8436
 (define_insn "*vsx_mul<mode>3"
 
8437
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8438
-        (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8439
-                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8440
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8441
+        (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8442
+                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8443
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8444
   "xvmul<VSs> %x0,%x1,%x2"
 
8445
   [(set_attr "type" "<VStype_simple>")
 
8446
@@ -708,9 +747,9 @@
 
8447
    (set_attr "fp_type" "<VSfptype_mul>")])
 
8448
 
 
8449
 (define_insn "*vsx_div<mode>3"
 
8450
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8451
-        (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8452
-                  (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8453
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8454
+        (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8455
+                  (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8456
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8457
   "xvdiv<VSs> %x0,%x1,%x2"
 
8458
   [(set_attr "type" "<VStype_div>")
 
8459
@@ -746,8 +785,8 @@
 
8460
 
 
8461
 (define_insn "*vsx_tdiv<mode>3_internal"
 
8462
   [(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
 
8463
-       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")
 
8464
-                     (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,wa")]
 
8465
+       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8466
+                     (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,<VSa>")]
 
8467
                   UNSPEC_VSX_TDIV))]
 
8468
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8469
   "x<VSv>tdiv<VSs> %0,%x1,%x2"
 
8470
@@ -755,8 +794,8 @@
 
8471
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8472
 
 
8473
 (define_insn "vsx_fre<mode>2"
 
8474
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8475
-       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
 
8476
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8477
+       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
8478
                      UNSPEC_FRES))]
 
8479
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8480
   "xvre<VSs> %x0,%x1"
 
8481
@@ -764,8 +803,8 @@
 
8482
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8483
 
 
8484
 (define_insn "*vsx_neg<mode>2"
 
8485
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8486
-        (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
 
8487
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8488
+        (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8489
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8490
   "xvneg<VSs> %x0,%x1"
 
8491
   [(set_attr "type" "<VStype_simple>")
 
8492
@@ -772,8 +811,8 @@
 
8493
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8494
 
 
8495
 (define_insn "*vsx_abs<mode>2"
 
8496
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8497
-        (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
 
8498
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8499
+        (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8500
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8501
   "xvabs<VSs> %x0,%x1"
 
8502
   [(set_attr "type" "<VStype_simple>")
 
8503
@@ -780,10 +819,10 @@
 
8504
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8505
 
 
8506
 (define_insn "vsx_nabs<mode>2"
 
8507
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8508
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8509
         (neg:VSX_F
 
8510
         (abs:VSX_F
 
8511
-         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa"))))]
 
8512
+         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>"))))]
 
8513
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8514
   "xvnabs<VSs> %x0,%x1"
 
8515
   [(set_attr "type" "<VStype_simple>")
 
8516
@@ -790,9 +829,9 @@
 
8517
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8518
 
 
8519
 (define_insn "vsx_smax<mode>3"
 
8520
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8521
-        (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8522
-                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8523
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8524
+        (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8525
+                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8526
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8527
   "xvmax<VSs> %x0,%x1,%x2"
 
8528
   [(set_attr "type" "<VStype_simple>")
 
8529
@@ -799,9 +838,9 @@
 
8530
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8531
 
 
8532
 (define_insn "*vsx_smin<mode>3"
 
8533
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8534
-        (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8535
-                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8536
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8537
+        (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8538
+                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8539
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8540
   "xvmin<VSs> %x0,%x1,%x2"
 
8541
   [(set_attr "type" "<VStype_simple>")
 
8542
@@ -808,8 +847,8 @@
 
8543
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8544
 
 
8545
 (define_insn "*vsx_sqrt<mode>2"
 
8546
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8547
-        (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
 
8548
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8549
+        (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8550
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8551
   "xvsqrt<VSs> %x0,%x1"
 
8552
   [(set_attr "type" "<VStype_sqrt>")
 
8553
@@ -816,8 +855,8 @@
 
8554
    (set_attr "fp_type" "<VSfptype_sqrt>")])
 
8555
 
 
8556
 (define_insn "*vsx_rsqrte<mode>2"
 
8557
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8558
-       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
 
8559
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8560
+       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
8561
                      UNSPEC_RSQRT))]
 
8562
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8563
   "xvrsqrte<VSs> %x0,%x1"
 
8564
@@ -852,7 +891,7 @@
 
8565
 
 
8566
 (define_insn "*vsx_tsqrt<mode>2_internal"
 
8567
   [(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
 
8568
-       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
 
8569
+       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
8570
                     UNSPEC_VSX_TSQRT))]
 
8571
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8572
   "x<VSv>tsqrt<VSs> %0,%x1"
 
8573
@@ -865,11 +904,11 @@
 
8574
 ;; multiply.
 
8575
 
 
8576
 (define_insn "*vsx_fmav4sf4"
 
8577
-  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,v")
 
8578
+  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,wf,?wa,?wa,v")
 
8579
        (fma:V4SF
 
8580
-         (match_operand:V4SF 1 "vsx_register_operand" "%ws,ws,wa,wa,v")
 
8581
-         (match_operand:V4SF 2 "vsx_register_operand" "ws,0,wa,0,v")
 
8582
-         (match_operand:V4SF 3 "vsx_register_operand" "0,ws,0,wa,v")))]
 
8583
+         (match_operand:V4SF 1 "vsx_register_operand" "%wf,wf,wa,wa,v")
 
8584
+         (match_operand:V4SF 2 "vsx_register_operand" "wf,0,wa,0,v")
 
8585
+         (match_operand:V4SF 3 "vsx_register_operand" "0,wf,0,wa,v")))]
 
8586
   "VECTOR_UNIT_VSX_P (V4SFmode)"
 
8587
   "@
 
8588
    xvmaddasp %x0,%x1,%x2
 
8589
@@ -880,11 +919,11 @@
 
8590
   [(set_attr "type" "vecfloat")])
 
8591
 
 
8592
 (define_insn "*vsx_fmav2df4"
 
8593
-  [(set (match_operand:V2DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa")
 
8594
+  [(set (match_operand:V2DF 0 "vsx_register_operand" "=wd,wd,?wa,?wa")
 
8595
        (fma:V2DF
 
8596
-         (match_operand:V2DF 1 "vsx_register_operand" "%ws,ws,wa,wa")
 
8597
-         (match_operand:V2DF 2 "vsx_register_operand" "ws,0,wa,0")
 
8598
-         (match_operand:V2DF 3 "vsx_register_operand" "0,ws,0,wa")))]
 
8599
+         (match_operand:V2DF 1 "vsx_register_operand" "%wd,wd,wa,wa")
 
8600
+         (match_operand:V2DF 2 "vsx_register_operand" "wd,0,wa,0")
 
8601
+         (match_operand:V2DF 3 "vsx_register_operand" "0,wd,0,wa")))]
 
8602
   "VECTOR_UNIT_VSX_P (V2DFmode)"
 
8603
   "@
 
8604
    xvmaddadp %x0,%x1,%x2
 
8605
@@ -894,12 +933,12 @@
 
8606
   [(set_attr "type" "vecdouble")])
 
8607
 
 
8608
 (define_insn "*vsx_fms<mode>4"
 
8609
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
 
8610
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
 
8611
        (fma:VSX_F
 
8612
-         (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
 
8613
-         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
 
8614
+         (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,<VSa>,<VSa>")
 
8615
+         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
 
8616
          (neg:VSX_F
 
8617
-           (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
 
8618
+           (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
 
8619
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8620
   "@
 
8621
    xvmsuba<VSs> %x0,%x1,%x2
 
8622
@@ -909,12 +948,12 @@
 
8623
   [(set_attr "type" "<VStype_mul>")])
 
8624
 
 
8625
 (define_insn "*vsx_nfma<mode>4"
 
8626
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
 
8627
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
 
8628
        (neg:VSX_F
 
8629
         (fma:VSX_F
 
8630
-         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,wa,wa")
 
8631
-         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
 
8632
-         (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
 
8633
+         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,<VSa>,<VSa>")
 
8634
+         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
 
8635
+         (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
 
8636
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8637
   "@
 
8638
    xvnmadda<VSs> %x0,%x1,%x2
 
8639
@@ -959,9 +998,9 @@
 
8640
 
 
8641
 ;; Vector conditional expressions (no scalar version for these instructions)
 
8642
 (define_insn "vsx_eq<mode>"
 
8643
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8644
-       (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8645
-                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8646
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8647
+       (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8648
+                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8649
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8650
   "xvcmpeq<VSs> %x0,%x1,%x2"
 
8651
   [(set_attr "type" "<VStype_simple>")
 
8652
@@ -968,9 +1007,9 @@
 
8653
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8654
 
 
8655
 (define_insn "vsx_gt<mode>"
 
8656
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8657
-       (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8658
-                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8659
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8660
+       (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8661
+                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8662
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8663
   "xvcmpgt<VSs> %x0,%x1,%x2"
 
8664
   [(set_attr "type" "<VStype_simple>")
 
8665
@@ -977,9 +1016,9 @@
 
8666
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8667
 
 
8668
 (define_insn "*vsx_ge<mode>"
 
8669
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8670
-       (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8671
-                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
8672
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8673
+       (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8674
+                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8675
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8676
   "xvcmpge<VSs> %x0,%x1,%x2"
 
8677
   [(set_attr "type" "<VStype_simple>")
 
8678
@@ -990,10 +1029,10 @@
 
8679
 (define_insn "*vsx_eq_<mode>_p"
 
8680
   [(set (reg:CC 74)
 
8681
        (unspec:CC
 
8682
-        [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
 
8683
-                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
 
8684
+        [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
 
8685
+                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
 
8686
         UNSPEC_PREDICATE))
 
8687
-   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8688
+   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8689
        (eq:VSX_F (match_dup 1)
 
8690
                  (match_dup 2)))]
 
8691
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8692
@@ -1003,10 +1042,10 @@
 
8693
 (define_insn "*vsx_gt_<mode>_p"
 
8694
   [(set (reg:CC 74)
 
8695
        (unspec:CC
 
8696
-        [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
 
8697
-                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
 
8698
+        [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
 
8699
+                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
 
8700
         UNSPEC_PREDICATE))
 
8701
-   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8702
+   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8703
        (gt:VSX_F (match_dup 1)
 
8704
                  (match_dup 2)))]
 
8705
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8706
@@ -1016,10 +1055,10 @@
 
8707
 (define_insn "*vsx_ge_<mode>_p"
 
8708
   [(set (reg:CC 74)
 
8709
        (unspec:CC
 
8710
-        [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
 
8711
-                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
 
8712
+        [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
 
8713
+                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
 
8714
         UNSPEC_PREDICATE))
 
8715
-   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8716
+   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8717
        (ge:VSX_F (match_dup 1)
 
8718
                  (match_dup 2)))]
 
8719
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8720
@@ -1028,23 +1067,23 @@
 
8721
 
 
8722
 ;; Vector select
 
8723
 (define_insn "*vsx_xxsel<mode>"
 
8724
-  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
 
8725
+  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8726
        (if_then_else:VSX_L
 
8727
-        (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
 
8728
+        (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8729
                (match_operand:VSX_L 4 "zero_constant" ""))
 
8730
-        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
 
8731
-        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
 
8732
+        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
 
8733
+        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8734
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8735
   "xxsel %x0,%x3,%x2,%x1"
 
8736
   [(set_attr "type" "vecperm")])
 
8737
 
 
8738
 (define_insn "*vsx_xxsel<mode>_uns"
 
8739
-  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
 
8740
+  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8741
        (if_then_else:VSX_L
 
8742
-        (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
 
8743
+        (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8744
                   (match_operand:VSX_L 4 "zero_constant" ""))
 
8745
-        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
 
8746
-        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
 
8747
+        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
 
8748
+        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8749
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8750
   "xxsel %x0,%x3,%x2,%x1"
 
8751
   [(set_attr "type" "vecperm")])
 
8752
@@ -1051,10 +1090,10 @@
 
8753
 
 
8754
 ;; Copy sign
 
8755
 (define_insn "vsx_copysign<mode>3"
 
8756
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8757
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8758
        (unspec:VSX_F
 
8759
-        [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
8760
-         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")]
 
8761
+        [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
8762
+         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")]
 
8763
         UNSPEC_COPYSIGN))]
 
8764
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8765
   "xvcpsgn<VSs> %x0,%x2,%x1"
 
8766
@@ -1067,7 +1106,7 @@
 
8767
 ;; in rs6000.md so don't test VECTOR_UNIT_VSX_P, just test against VSX.
 
8768
 ;; Don't use vsx_register_operand here, use gpc_reg_operand to match rs6000.md.
 
8769
 (define_insn "vsx_float<VSi><mode>2"
 
8770
-  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
 
8771
+  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
 
8772
        (float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
 
8773
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8774
   "x<VSv>cvsx<VSc><VSs> %x0,%x1"
 
8775
@@ -1075,7 +1114,7 @@
 
8776
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8777
 
 
8778
 (define_insn "vsx_floatuns<VSi><mode>2"
 
8779
-  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
 
8780
+  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
 
8781
        (unsigned_float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
 
8782
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8783
   "x<VSv>cvux<VSc><VSs> %x0,%x1"
 
8784
@@ -1084,7 +1123,7 @@
 
8785
 
 
8786
 (define_insn "vsx_fix_trunc<mode><VSi>2"
 
8787
   [(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
 
8788
-       (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
 
8789
+       (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
 
8790
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8791
   "x<VSv>cv<VSs>sx<VSc>s %x0,%x1"
 
8792
   [(set_attr "type" "<VStype_simple>")
 
8793
@@ -1092,7 +1131,7 @@
 
8794
 
 
8795
 (define_insn "vsx_fixuns_trunc<mode><VSi>2"
 
8796
   [(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
 
8797
-       (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
 
8798
+       (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
 
8799
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8800
   "x<VSv>cv<VSs>ux<VSc>s %x0,%x1"
 
8801
   [(set_attr "type" "<VStype_simple>")
 
8802
@@ -1100,8 +1139,8 @@
 
8803
 
 
8804
 ;; Math rounding functions
 
8805
 (define_insn "vsx_x<VSv>r<VSs>i"
 
8806
-  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
 
8807
-       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
 
8808
+  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8809
+       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
8810
                      UNSPEC_VSX_ROUND_I))]
 
8811
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8812
   "x<VSv>r<VSs>i %x0,%x1"
 
8813
@@ -1109,8 +1148,8 @@
 
8814
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8815
 
 
8816
 (define_insn "vsx_x<VSv>r<VSs>ic"
 
8817
-  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
 
8818
-       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
 
8819
+  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8820
+       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
8821
                      UNSPEC_VSX_ROUND_IC))]
 
8822
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8823
   "x<VSv>r<VSs>ic %x0,%x1"
 
8824
@@ -1118,8 +1157,8 @@
 
8825
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8826
 
 
8827
 (define_insn "vsx_btrunc<mode>2"
 
8828
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8829
-       (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
 
8830
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8831
+       (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
 
8832
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8833
   "xvr<VSs>iz %x0,%x1"
 
8834
   [(set_attr "type" "<VStype_simple>")
 
8835
@@ -1126,8 +1165,8 @@
 
8836
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8837
 
 
8838
 (define_insn "*vsx_b2trunc<mode>2"
 
8839
-  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
 
8840
-       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
 
8841
+  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8842
+       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
8843
                      UNSPEC_FRIZ))]
 
8844
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8845
   "x<VSv>r<VSs>iz %x0,%x1"
 
8846
@@ -1135,8 +1174,8 @@
 
8847
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8848
 
 
8849
 (define_insn "vsx_floor<mode>2"
 
8850
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8851
-       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
 
8852
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8853
+       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
8854
                      UNSPEC_FRIM))]
 
8855
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8856
   "xvr<VSs>im %x0,%x1"
 
8857
@@ -1144,8 +1183,8 @@
 
8858
    (set_attr "fp_type" "<VSfptype_simple>")])
 
8859
 
 
8860
 (define_insn "vsx_ceil<mode>2"
 
8861
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
8862
-       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
 
8863
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8864
+       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
8865
                      UNSPEC_FRIP))]
 
8866
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8867
   "xvr<VSs>ip %x0,%x1"
 
8868
@@ -1160,8 +1199,8 @@
 
8869
 ;; scalar single precision instructions internally use the double format.
 
8870
 ;; Prefer the altivec registers, since we likely will need to do a vperm
 
8871
 (define_insn "vsx_<VS_spdp_insn>"
 
8872
-  [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?wa")
 
8873
-       (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,wa")]
 
8874
+  [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?<VSa>")
 
8875
+       (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,<VSa>")]
 
8876
                              UNSPEC_VSX_CVSPDP))]
 
8877
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
8878
   "<VS_spdp_insn> %x0,%x1"
 
8879
@@ -1169,8 +1208,8 @@
 
8880
 
 
8881
 ;; xscvspdp, represent the scalar SF type as V4SF
 
8882
 (define_insn "vsx_xscvspdp"
 
8883
-  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
 
8884
-       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
 
8885
+  [(set (match_operand:DF 0 "vsx_register_operand" "=ws")
 
8886
+       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa")]
 
8887
                   UNSPEC_VSX_CVSPDP))]
 
8888
   "VECTOR_UNIT_VSX_P (V4SFmode)"
 
8889
   "xscvspdp %x0,%x1"
 
8890
@@ -1197,7 +1236,7 @@
 
8891
 
 
8892
 ;; ISA 2.07 xscvdpspn/xscvspdpn that does not raise an error on signalling NaNs
 
8893
 (define_insn "vsx_xscvdpspn"
 
8894
-  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,?wa")
 
8895
+  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ww,?ww")
 
8896
        (unspec:V4SF [(match_operand:DF 1 "vsx_register_operand" "wd,wa")]
 
8897
                     UNSPEC_VSX_CVDPSPN))]
 
8898
   "TARGET_XSCVDPSPN"
 
8899
@@ -1205,8 +1244,8 @@
 
8900
   [(set_attr "type" "fp")])
 
8901
 
 
8902
 (define_insn "vsx_xscvspdpn"
 
8903
-  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
 
8904
-       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
 
8905
+  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?ws")
 
8906
+       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wf,wa")]
 
8907
                   UNSPEC_VSX_CVSPDPN))]
 
8908
   "TARGET_XSCVSPDPN"
 
8909
   "xscvspdpn %x0,%x1"
 
8910
@@ -1213,8 +1252,8 @@
 
8911
   [(set_attr "type" "fp")])
 
8912
 
 
8913
 (define_insn "vsx_xscvdpspn_scalar"
 
8914
-  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa")
 
8915
-       (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "f")]
 
8916
+  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,?wa")
 
8917
+       (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "ww,ww")]
 
8918
                     UNSPEC_VSX_CVDPSPN))]
 
8919
   "TARGET_XSCVDPSPN"
 
8920
   "xscvdpspn %x0,%x1"
 
8921
@@ -1302,10 +1341,10 @@
 
8922
 ;; since the xsrdpiz instruction does not truncate the value if the floating
 
8923
 ;; point value is < LONG_MIN or > LONG_MAX.
 
8924
 (define_insn "*vsx_float_fix_<mode>2"
 
8925
-  [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?wa")
 
8926
+  [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8927
        (float:VSX_DF
 
8928
         (fix:<VSI>
 
8929
-         (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?wa"))))]
 
8930
+         (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?<VSa>"))))]
 
8931
   "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
 
8932
    && VECTOR_UNIT_VSX_P (<MODE>mode) && flag_unsafe_math_optimizations
 
8933
    && !flag_trapping_math && TARGET_FRIZ"
 
8934
@@ -1318,10 +1357,10 @@
 
8935
 
 
8936
 ;; Build a V2DF/V2DI vector from two scalars
 
8937
 (define_insn "vsx_concat_<mode>"
 
8938
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?wa")
 
8939
+  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
8940
        (vec_concat:VSX_D
 
8941
-        (match_operand:<VS_scalar> 1 "vsx_register_operand" "ws,wa")
 
8942
-        (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")))]
 
8943
+        (match_operand:<VS_scalar> 1 "vsx_register_operand" "<VS_64reg>,<VSa>")
 
8944
+        (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")))]
 
8945
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8946
 {
 
8947
   if (BYTES_BIG_ENDIAN)
 
8948
@@ -1352,9 +1391,9 @@
 
8949
 ;; xxpermdi for little endian loads and stores.  We need several of
 
8950
 ;; these since the form of the PARALLEL differs by mode.
 
8951
 (define_insn "*vsx_xxpermdi2_le_<mode>"
 
8952
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
8953
-        (vec_select:VSX_D
 
8954
-          (match_operand:VSX_D 1 "vsx_register_operand" "wa")
 
8955
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
 
8956
+        (vec_select:VSX_LE
 
8957
+          (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
 
8958
           (parallel [(const_int 1) (const_int 0)])))]
 
8959
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
8960
   "xxpermdi %x0,%x1,%x1,2"
 
8961
@@ -1361,9 +1400,9 @@
 
8962
   [(set_attr "type" "vecperm")])
 
8963
 
 
8964
 (define_insn "*vsx_xxpermdi4_le_<mode>"
 
8965
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
 
8966
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
 
8967
         (vec_select:VSX_W
 
8968
-          (match_operand:VSX_W 1 "vsx_register_operand" "wa")
 
8969
+          (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
 
8970
           (parallel [(const_int 2) (const_int 3)
 
8971
                      (const_int 0) (const_int 1)])))]
 
8972
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
8973
@@ -1401,9 +1440,9 @@
 
8974
 ;; lxvd2x for little endian loads.  We need several of
 
8975
 ;; these since the form of the PARALLEL differs by mode.
 
8976
 (define_insn "*vsx_lxvd2x2_le_<mode>"
 
8977
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
8978
-        (vec_select:VSX_D
 
8979
-          (match_operand:VSX_D 1 "memory_operand" "Z")
 
8980
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
 
8981
+        (vec_select:VSX_LE
 
8982
+          (match_operand:VSX_LE 1 "memory_operand" "Z")
 
8983
           (parallel [(const_int 1) (const_int 0)])))]
 
8984
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
8985
   "lxvd2x %x0,%y1"
 
8986
@@ -1410,7 +1449,7 @@
 
8987
   [(set_attr "type" "vecload")])
 
8988
 
 
8989
 (define_insn "*vsx_lxvd2x4_le_<mode>"
 
8990
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
 
8991
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
 
8992
         (vec_select:VSX_W
 
8993
           (match_operand:VSX_W 1 "memory_operand" "Z")
 
8994
           (parallel [(const_int 2) (const_int 3)
 
8995
@@ -1450,9 +1489,9 @@
 
8996
 ;; stxvd2x for little endian stores.  We need several of
 
8997
 ;; these since the form of the PARALLEL differs by mode.
 
8998
 (define_insn "*vsx_stxvd2x2_le_<mode>"
 
8999
-  [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
 
9000
-        (vec_select:VSX_D
 
9001
-          (match_operand:VSX_D 1 "vsx_register_operand" "wa")
 
9002
+  [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
 
9003
+        (vec_select:VSX_LE
 
9004
+          (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
 
9005
           (parallel [(const_int 1) (const_int 0)])))]
 
9006
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
9007
   "stxvd2x %x1,%y0"
 
9008
@@ -1461,7 +1500,7 @@
 
9009
 (define_insn "*vsx_stxvd2x4_le_<mode>"
 
9010
   [(set (match_operand:VSX_W 0 "memory_operand" "=Z")
 
9011
         (vec_select:VSX_W
 
9012
-          (match_operand:VSX_W 1 "vsx_register_operand" "wa")
 
9013
+          (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
 
9014
           (parallel [(const_int 2) (const_int 3)
 
9015
                      (const_int 0) (const_int 1)])))]
 
9016
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
9017
@@ -1513,11 +1552,12 @@
 
9018
 
 
9019
 ;; Set the element of a V2DI/VD2F mode
 
9020
 (define_insn "vsx_set_<mode>"
 
9021
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?wa")
 
9022
-       (unspec:VSX_D [(match_operand:VSX_D 1 "vsx_register_operand" "wd,wa")
 
9023
-                      (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")
 
9024
-                      (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
 
9025
-                     UNSPEC_VSX_SET))]
 
9026
+  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?<VSa>")
 
9027
+       (unspec:VSX_D
 
9028
+        [(match_operand:VSX_D 1 "vsx_register_operand" "wd,<VSa>")
 
9029
+         (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")
 
9030
+         (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
 
9031
+        UNSPEC_VSX_SET))]
 
9032
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
9033
 {
 
9034
   int idx_first = BYTES_BIG_ENDIAN ? 0 : 1;
 
9035
@@ -1582,7 +1622,7 @@
 
9036
 (define_insn_and_split "vsx_extract_v4sf"
 
9037
   [(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
 
9038
        (vec_select:SF
 
9039
-        (match_operand:V4SF 1 "vsx_register_operand" "wa,wa")
 
9040
+        (match_operand:V4SF 1 "vsx_register_operand" "<VSa>,<VSa>")
 
9041
         (parallel [(match_operand:QI 2 "u5bit_cint_operand" "O,i")])))
 
9042
    (clobber (match_scratch:V4SF 3 "=X,0"))]
 
9043
   "VECTOR_UNIT_VSX_P (V4SFmode)"
 
9044
@@ -1606,7 +1646,7 @@
 
9045
     {
 
9046
       if (GET_CODE (op3) == SCRATCH)
 
9047
        op3 = gen_reg_rtx (V4SFmode);
 
9048
-      emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, op2));
 
9049
+      emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, GEN_INT (ele)));
 
9050
       tmp = op3;
 
9051
     }
 
9052
   emit_insn (gen_vsx_xscvspdp_scalar2 (op0, tmp));
 
9053
@@ -1765,9 +1805,9 @@
 
9054
 
 
9055
 ;; V2DF/V2DI splat
 
9056
 (define_insn "vsx_splat_<mode>"
 
9057
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?wa,?wa,?wa")
 
9058
+  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?<VSa>,?<VSa>,?<VSa>")
 
9059
        (vec_duplicate:VSX_D
 
9060
-        (match_operand:<VS_scalar> 1 "splat_input_operand" "ws,f,Z,wa,wa,Z")))]
 
9061
+        (match_operand:<VS_scalar> 1 "splat_input_operand" "<VS_64reg>,f,Z,<VSa>,<VSa>,Z")))]
 
9062
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
9063
   "@
 
9064
    xxpermdi %x0,%x1,%x1,0
 
9065
@@ -1780,10 +1820,10 @@
 
9066
 
 
9067
 ;; V4SF/V4SI splat
 
9068
 (define_insn "vsx_xxspltw_<mode>"
 
9069
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
 
9070
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
 
9071
        (vec_duplicate:VSX_W
 
9072
         (vec_select:<VS_scalar>
 
9073
-         (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
 
9074
+         (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
 
9075
          (parallel
 
9076
           [(match_operand:QI 2 "u5bit_cint_operand" "i,i")]))))]
 
9077
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
9078
@@ -1796,8 +1836,8 @@
 
9079
   [(set_attr "type" "vecperm")])
 
9080
 
 
9081
 (define_insn "vsx_xxspltw_<mode>_direct"
 
9082
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
 
9083
-        (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
 
9084
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
 
9085
+        (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
 
9086
                        (match_operand:QI 2 "u5bit_cint_operand" "i,i")]
 
9087
                       UNSPEC_VSX_XXSPLTW))]
 
9088
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
9089
@@ -1806,11 +1846,11 @@
 
9090
 
 
9091
 ;; V4SF/V4SI interleave
 
9092
 (define_insn "vsx_xxmrghw_<mode>"
 
9093
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
 
9094
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
 
9095
         (vec_select:VSX_W
 
9096
          (vec_concat:<VS_double>
 
9097
-           (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
 
9098
-           (match_operand:VSX_W 2 "vsx_register_operand" "wf,wa"))
 
9099
+           (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
 
9100
+           (match_operand:VSX_W 2 "vsx_register_operand" "wf,<VSa>"))
 
9101
          (parallel [(const_int 0) (const_int 4)
 
9102
                     (const_int 1) (const_int 5)])))]
 
9103
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
9104
@@ -1823,11 +1863,11 @@
 
9105
   [(set_attr "type" "vecperm")])
 
9106
 
 
9107
 (define_insn "vsx_xxmrglw_<mode>"
 
9108
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
 
9109
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
 
9110
        (vec_select:VSX_W
 
9111
          (vec_concat:<VS_double>
 
9112
-           (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
 
9113
-           (match_operand:VSX_W 2 "vsx_register_operand" "wf,?wa"))
 
9114
+           (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
 
9115
+           (match_operand:VSX_W 2 "vsx_register_operand" "wf,?<VSa>"))
 
9116
          (parallel [(const_int 2) (const_int 6)
 
9117
                     (const_int 3) (const_int 7)])))]
 
9118
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
9119
@@ -1841,9 +1881,9 @@
 
9120
 
 
9121
 ;; Shift left double by word immediate
 
9122
 (define_insn "vsx_xxsldwi_<mode>"
 
9123
-  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=wa")
 
9124
-       (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "wa")
 
9125
-                      (match_operand:VSX_L 2 "vsx_register_operand" "wa")
 
9126
+  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSa>")
 
9127
+       (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "<VSa>")
 
9128
+                      (match_operand:VSX_L 2 "vsx_register_operand" "<VSa>")
 
9129
                       (match_operand:QI 3 "u5bit_cint_operand" "i")]
 
9130
                      UNSPEC_VSX_SLDWI))]
 
9131
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
9132
@@ -1924,7 +1964,7 @@
 
9133
 ;; to the top element of the V2DF array without doing an extract.
 
9134
 
 
9135
 (define_insn_and_split "*vsx_reduc_<VEC_reduc_name>_v2df_scalar"
 
9136
-  [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?wa,ws,?wa")
 
9137
+  [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?ws,ws,?ws")
 
9138
        (vec_select:DF
 
9139
         (VEC_reduc:V2DF
 
9140
          (vec_concat:V2DF
 
9141
Index: gcc/config/rs6000/rs6000.h
 
9142
===================================================================
 
9143
--- a/src/gcc/config/rs6000/rs6000.h    (.../tags/gcc_4_8_3_release)
 
9144
+++ b/src/gcc/config/rs6000/rs6000.h    (.../branches/gcc-4_8-branch)
 
9145
@@ -1438,6 +1438,10 @@
 
9146
   RS6000_CONSTRAINT_wd,                /* VSX register for V2DF */
 
9147
   RS6000_CONSTRAINT_wf,                /* VSX register for V4SF */
 
9148
   RS6000_CONSTRAINT_wg,                /* FPR register for -mmfpgpr */
 
9149
+  RS6000_CONSTRAINT_wh,                /* FPR register for direct moves.  */
 
9150
+  RS6000_CONSTRAINT_wi,                /* FPR/VSX register to hold DImode */
 
9151
+  RS6000_CONSTRAINT_wj,                /* FPR/VSX register for DImode direct moves. */
 
9152
+  RS6000_CONSTRAINT_wk,                /* FPR/VSX register for DFmode direct moves. */
 
9153
   RS6000_CONSTRAINT_wl,                /* FPR register for LFIWAX */
 
9154
   RS6000_CONSTRAINT_wm,                /* VSX register for direct move */
 
9155
   RS6000_CONSTRAINT_wr,                /* GPR register if 64-bit  */
 
9156
@@ -1462,6 +1466,9 @@
 
9157
 #define VSX_REG_CLASS_P(CLASS)                 \
 
9158
   ((CLASS) == VSX_REGS || (CLASS) == FLOAT_REGS || (CLASS) == ALTIVEC_REGS)
 
9159
 
 
9160
+/* Return whether a given register class targets general purpose registers.  */
 
9161
+#define GPR_REG_CLASS_P(CLASS) ((CLASS) == GENERAL_REGS || (CLASS) == BASE_REGS)
 
9162
+
 
9163
 /* Given an rtx X being reloaded into a reg required to be
 
9164
    in class CLASS, return the class of reg to actually use.
 
9165
    In general this is just CLASS; but on some machines
 
9166
@@ -1593,8 +1600,15 @@
 
9167
 /* Define this if stack space is still allocated for a parameter passed
 
9168
    in a register.  The value is the number of bytes allocated to this
 
9169
    area.  */
 
9170
-#define REG_PARM_STACK_SPACE(FNDECL) rs6000_reg_parm_stack_space((FNDECL))
 
9171
+#define REG_PARM_STACK_SPACE(FNDECL) \
 
9172
+  rs6000_reg_parm_stack_space ((FNDECL), false)
 
9173
 
 
9174
+/* Define this macro if space guaranteed when compiling a function body
 
9175
+   is different to space required when making a call, a situation that
 
9176
+   can arise with K&R style function definitions.  */
 
9177
+#define INCOMING_REG_PARM_STACK_SPACE(FNDECL) \
 
9178
+  rs6000_reg_parm_stack_space ((FNDECL), true)
 
9179
+
 
9180
 /* Define this if the above stack space is to be considered part of the
 
9181
    space allocated by the caller.  */
 
9182
 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
 
9183
@@ -2483,8 +2497,8 @@
 
9184
 #define RS6000_BTC_SAT         RS6000_BTC_MISC /* saturate sets VSCR.  */
 
9185
 
 
9186
 /* Builtin targets.  For now, we reuse the masks for those options that are in
 
9187
-   target flags, and pick two random bits for SPE and paired which aren't in
 
9188
-   target_flags.  */
 
9189
+   target flags, and pick three random bits for SPE, paired and ldbl128 which
 
9190
+   aren't in target_flags.  */
 
9191
 #define RS6000_BTM_ALWAYS      0               /* Always enabled.  */
 
9192
 #define RS6000_BTM_ALTIVEC     MASK_ALTIVEC    /* VMX/altivec vectors.  */
 
9193
 #define RS6000_BTM_VSX         MASK_VSX        /* VSX (vector/scalar).  */
 
9194
@@ -2501,6 +2515,7 @@
 
9195
 #define RS6000_BTM_CELL                MASK_FPRND      /* Target is cell powerpc.  */
 
9196
 #define RS6000_BTM_DFP         MASK_DFP        /* Decimal floating point.  */
 
9197
 #define RS6000_BTM_HARD_FLOAT  MASK_SOFT_FLOAT /* Hardware floating point.  */
 
9198
+#define RS6000_BTM_LDBL128     MASK_MULTIPLE   /* 128-bit long double.  */
 
9199
 
 
9200
 #define RS6000_BTM_COMMON      (RS6000_BTM_ALTIVEC                     \
 
9201
                                 | RS6000_BTM_VSX                       \
 
9202
@@ -2514,7 +2529,8 @@
 
9203
                                 | RS6000_BTM_POPCNTD                   \
 
9204
                                 | RS6000_BTM_CELL                      \
 
9205
                                 | RS6000_BTM_DFP                       \
 
9206
-                                | RS6000_BTM_HARD_FLOAT)
 
9207
+                                | RS6000_BTM_HARD_FLOAT                \
 
9208
+                                | RS6000_BTM_LDBL128)
 
9209
 
 
9210
 /* Define builtin enum index.  */
 
9211
 
 
9212
Index: gcc/config/rs6000/rs6000.md
 
9213
===================================================================
 
9214
--- a/src/gcc/config/rs6000/rs6000.md   (.../tags/gcc_4_8_3_release)
 
9215
+++ b/src/gcc/config/rs6000/rs6000.md   (.../branches/gcc-4_8-branch)
 
9216
@@ -134,6 +134,7 @@
 
9217
    UNSPEC_UNPACK_128BIT
 
9218
    UNSPEC_PACK_128BIT
 
9219
    UNSPEC_LSQ
 
9220
+   UNSPEC_FUSION_GPR
 
9221
   ])
 
9222
 
 
9223
 ;;
 
9224
@@ -317,8 +318,25 @@
 
9225
 (define_mode_attr f32_sv [(SF "stxsspx %x1,%y0")  (SD "stxsiwzx %x1,%y0")])
 
9226
 
 
9227
 ; Definitions for 32-bit fpr direct move
 
9228
-(define_mode_attr f32_dm [(SF "wn") (SD "wm")])
 
9229
+; At present, the decimal modes are not allowed in the traditional altivec
 
9230
+; registers, so restrict the constraints to just the traditional FPRs.
 
9231
+(define_mode_attr f32_dm [(SF "wn") (SD "wh")])
 
9232
 
 
9233
+; Definitions for 32-bit VSX
 
9234
+(define_mode_attr f32_vsx [(SF "ww") (SD "wn")])
 
9235
+
 
9236
+; Definitions for 32-bit use of altivec registers
 
9237
+(define_mode_attr f32_av  [(SF "wu") (SD "wn")])
 
9238
+
 
9239
+; Definitions for 64-bit VSX
 
9240
+(define_mode_attr f64_vsx [(DF "ws") (DD "wn")])
 
9241
+
 
9242
+; Definitions for 64-bit direct move
 
9243
+(define_mode_attr f64_dm  [(DF "wk") (DD "wh")])
 
9244
+
 
9245
+; Definitions for 64-bit use of altivec registers
 
9246
+(define_mode_attr f64_av  [(DF "wv") (DD "wn")])
 
9247
+
 
9248
 ; These modes do not fit in integer registers in 32-bit mode.
 
9249
 ; but on e500v2, the gpr are 64 bit registers
 
9250
 (define_mode_iterator DIFD [DI (DF "!TARGET_E500_DOUBLE") DD])
 
9251
@@ -424,7 +442,7 @@
 
9252
 ;; either.
 
9253
 
 
9254
 ;; Mode attribute for boolean operation register constraints for output
 
9255
-(define_mode_attr BOOL_REGS_OUTPUT     [(TI    "&r,r,r,wa,v")
 
9256
+(define_mode_attr BOOL_REGS_OUTPUT     [(TI    "&r,r,r,wt,v")
 
9257
                                         (PTI   "&r,r,r")
 
9258
                                         (V16QI "wa,v,&?r,?r,?r")
 
9259
                                         (V8HI  "wa,v,&?r,?r,?r")
 
9260
@@ -435,7 +453,7 @@
 
9261
                                         (V1TI  "wa,v,&?r,?r,?r")])
 
9262
 
 
9263
 ;; Mode attribute for boolean operation register constraints for operand1
 
9264
-(define_mode_attr BOOL_REGS_OP1                [(TI    "r,0,r,wa,v")
 
9265
+(define_mode_attr BOOL_REGS_OP1                [(TI    "r,0,r,wt,v")
 
9266
                                         (PTI   "r,0,r")
 
9267
                                         (V16QI "wa,v,r,0,r")
 
9268
                                         (V8HI  "wa,v,r,0,r")
 
9269
@@ -446,7 +464,7 @@
 
9270
                                         (V1TI  "wa,v,r,0,r")])
 
9271
 
 
9272
 ;; Mode attribute for boolean operation register constraints for operand2
 
9273
-(define_mode_attr BOOL_REGS_OP2                [(TI    "r,r,0,wa,v")
 
9274
+(define_mode_attr BOOL_REGS_OP2                [(TI    "r,r,0,wt,v")
 
9275
                                         (PTI   "r,r,0")
 
9276
                                         (V16QI "wa,v,r,r,0")
 
9277
                                         (V8HI  "wa,v,r,r,0")
 
9278
@@ -459,7 +477,7 @@
 
9279
 ;; Mode attribute for boolean operation register constraints for operand1
 
9280
 ;; for one_cmpl.  To simplify things, we repeat the constraint where 0
 
9281
 ;; is used for operand1 or operand2
 
9282
-(define_mode_attr BOOL_REGS_UNARY      [(TI    "r,0,0,wa,v")
 
9283
+(define_mode_attr BOOL_REGS_UNARY      [(TI    "r,0,0,wt,v")
 
9284
                                         (PTI   "r,0,0")
 
9285
                                         (V16QI "wa,v,r,0,0")
 
9286
                                         (V8HI  "wa,v,r,0,0")
 
9287
@@ -566,7 +584,7 @@
 
9288
   "")
 
9289
 
 
9290
 (define_insn "*zero_extendsidi2_lfiwzx"
 
9291
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wz,!wu")
 
9292
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wz,!wu")
 
9293
        (zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r,r,Z,Z")))]
 
9294
   "TARGET_POWERPC64 && TARGET_LFIWZX"
 
9295
   "@
 
9296
@@ -736,8 +754,8 @@
 
9297
   "")
 
9298
 
 
9299
 (define_insn "*extendsidi2_lfiwax"
 
9300
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
 
9301
-       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
 
9302
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wl,!wu")
 
9303
+       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
 
9304
   "TARGET_POWERPC64 && TARGET_LFIWAX"
 
9305
   "@
 
9306
    lwa%U1%X1 %0,%1
 
9307
@@ -760,7 +778,7 @@
 
9308
 
 
9309
 (define_insn "*extendsidi2_nocell"
 
9310
   [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
 
9311
-       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
 
9312
+       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r")))]
 
9313
   "TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
 
9314
   "@
 
9315
    lwa%U1%X1 %0,%1
 
9316
@@ -5614,7 +5632,7 @@
 
9317
 ; We don't define lfiwax/lfiwzx with the normal definition, because we
 
9318
 ; don't want to support putting SImode in FPR registers.
 
9319
 (define_insn "lfiwax"
 
9320
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
 
9321
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
 
9322
        (unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
 
9323
                   UNSPEC_LFIWAX))]
 
9324
   "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWAX"
 
9325
@@ -5694,7 +5712,7 @@
 
9326
    (set_attr "type" "fpload")])
 
9327
 
 
9328
 (define_insn "lfiwzx"
 
9329
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
 
9330
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
 
9331
        (unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
 
9332
                   UNSPEC_LFIWZX))]
 
9333
   "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWZX"
 
9334
@@ -9210,8 +9228,8 @@
 
9335
 }")
 
9336
 
 
9337
 (define_insn "mov<mode>_hardfloat"
 
9338
-  [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,wa,wa,<f32_lr>,<f32_sm>,wu,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
 
9339
-       (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,wa,j,<f32_lm>,<f32_sr>,Z,wu,r,<f32_dm>,r,h,0,G,Fn"))]
 
9340
+  [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,<f32_vsx>,<f32_vsx>,<f32_lr>,<f32_sm>,<f32_av>,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
 
9341
+       (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,<f32_vsx>,j,<f32_lm>,<f32_sr>,Z,<f32_av>,r,<f32_dm>,r, h, 0, G,Fn"))]
 
9342
   "(gpc_reg_operand (operands[0], <MODE>mode)
 
9343
    || gpc_reg_operand (operands[1], <MODE>mode))
 
9344
    && (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT)"
 
9345
@@ -9422,8 +9440,8 @@
 
9346
 ;; reloading.
 
9347
 
 
9348
 (define_insn "*mov<mode>_hardfloat32"
 
9349
-  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,!r,!r,!r")
 
9350
-       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,G,H,F"))]
 
9351
+  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_vsx>,<f64_vsx>,Y,r,!r,!r,!r,!r")
 
9352
+       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,<f64_vsx>,j,r,Y,r,G,H,F"))]
 
9353
   "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT 
 
9354
    && (gpc_reg_operand (operands[0], <MODE>mode)
 
9355
        || gpc_reg_operand (operands[1], <MODE>mode))"
 
9356
@@ -9491,8 +9509,8 @@
 
9357
 ; ld/std require word-aligned displacements -> 'Y' constraint.
 
9358
 ; List Y->r and r->Y before r->r for reload.
 
9359
 (define_insn "*mov<mode>_hardfloat64"
 
9360
-  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,wm")
 
9361
-       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,r,h,0,G,H,F,wg,r,wm,r"))]
 
9362
+  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_vsx>,<f64_vsx>,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,<f64_dm>")
 
9363
+       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,<f64_vsx>,j,r,Y,r,r,h,0,G,H,F,wg,r,<f64_dm>,r"))]
 
9364
   "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
 
9365
    && (gpc_reg_operand (operands[0], <MODE>mode)
 
9366
        || gpc_reg_operand (operands[1], <MODE>mode))"
 
9367
@@ -10272,8 +10290,8 @@
 
9368
 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
 
9369
 
 
9370
 (define_insn "*movdi_internal64"
 
9371
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wm")
 
9372
-       (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wm,r"))]
 
9373
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wj,?*wi")
 
9374
+       (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wj,r,O"))]
 
9375
   "TARGET_POWERPC64
 
9376
    && (gpc_reg_operand (operands[0], DImode)
 
9377
        || gpc_reg_operand (operands[1], DImode))"
 
9378
@@ -10293,7 +10311,8 @@
 
9379
    mftgpr %0,%1
 
9380
    mffgpr %0,%1
 
9381
    mfvsrd %0,%x1
 
9382
-   mtvsrd %x0,%1"
 
9383
+   mtvsrd %x0,%1
 
9384
+   xxlxor %x0,%x0,%x0"
 
9385
   [(set_attr_alternative "type"
 
9386
       [(if_then_else
 
9387
         (match_test "update_indexed_address_mem (operands[0], VOIDmode)")
 
9388
@@ -10334,8 +10353,9 @@
 
9389
        (const_string "mftgpr")
 
9390
        (const_string "mffgpr")
 
9391
        (const_string "mftgpr")
 
9392
-       (const_string "mffgpr")])
 
9393
-   (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4")])
 
9394
+       (const_string "mffgpr")
 
9395
+       (const_string "vecsimple")])
 
9396
+   (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4,4")])
 
9397
 
 
9398
 ;; immediate value valid for a single instruction hiding in a const_double
 
9399
 (define_insn ""
 
9400
@@ -15751,23 +15771,10 @@
 
9401
 ;; a GPR.  The addis instruction must be adjacent to the load, and use the same
 
9402
 ;; register that is being loaded.  The fused ops must be physically adjacent.
 
9403
 
 
9404
-;; We use define_peephole for the actual addis/load, and the register used to
 
9405
-;; hold the addis value must be the same as the register being loaded.  We use
 
9406
-;; define_peephole2 to change the register used for addis to be the register
 
9407
-;; being loaded, since we can look at whether it is dead after the load insn.
 
9408
+;; Find cases where the addis that feeds into a load instruction is either used
 
9409
+;; once or is the same as the target register, and replace it with the fusion
 
9410
+;; insn
 
9411
 
 
9412
-(define_peephole
 
9413
-  [(set (match_operand:P 0 "base_reg_operand" "")
 
9414
-       (match_operand:P 1 "fusion_gpr_addis" ""))
 
9415
-   (set (match_operand:INT1 2 "base_reg_operand" "")
 
9416
-       (match_operand:INT1 3 "fusion_gpr_mem_load" ""))]
 
9417
-  "TARGET_P8_FUSION && fusion_gpr_load_p (operands, false)"
 
9418
-{
 
9419
-  return emit_fusion_gpr_load (operands);
 
9420
-}
 
9421
-  [(set_attr "type" "load")
 
9422
-   (set_attr "length" "8")])
 
9423
-
 
9424
 (define_peephole2
 
9425
   [(set (match_operand:P 0 "base_reg_operand" "")
 
9426
        (match_operand:P 1 "fusion_gpr_addis" ""))
 
9427
@@ -15774,9 +15781,8 @@
 
9428
    (set (match_operand:INT1 2 "base_reg_operand" "")
 
9429
        (match_operand:INT1 3 "fusion_gpr_mem_load" ""))]
 
9430
   "TARGET_P8_FUSION
 
9431
-   && (REGNO (operands[0]) != REGNO (operands[2])
 
9432
-       || GET_CODE (operands[3]) == SIGN_EXTEND)
 
9433
-   && fusion_gpr_load_p (operands, true)"
 
9434
+   && fusion_gpr_load_p (operands[0], operands[1], operands[2],
 
9435
+                        operands[3])"
 
9436
   [(const_int 0)]
 
9437
 {
 
9438
   expand_fusion_gpr_load (operands);
 
9439
@@ -15783,6 +15789,20 @@
 
9440
   DONE;
 
9441
 })
 
9442
 
 
9443
+;; Fusion insn, created by the define_peephole2 above (and eventually by
 
9444
+;; reload)
 
9445
+
 
9446
+(define_insn "fusion_gpr_load_<mode>"
 
9447
+  [(set (match_operand:INT1 0 "base_reg_operand" "=&b")
 
9448
+       (unspec:INT1 [(match_operand:INT1 1 "fusion_gpr_mem_combo" "")]
 
9449
+                    UNSPEC_FUSION_GPR))]
 
9450
+  "TARGET_P8_FUSION"
 
9451
+{
 
9452
+  return emit_fusion_gpr_load (operands[0], operands[1]);
 
9453
+}
 
9454
+  [(set_attr "type" "load")
 
9455
+   (set_attr "length" "8")])
 
9456
+
 
9457
 
 
9458
 ;; Miscellaneous ISA 2.06 (power7) instructions
 
9459
 (define_insn "addg6s"
 
9460
@@ -15847,26 +15867,6 @@
 
9461
   ""
 
9462
   "")
 
9463
 
 
9464
-;; The Advance Toolchain 7.0-3 added private builtins: __builtin_longdouble_dw0
 
9465
-;; and __builtin_longdouble_dw1 to optimize glibc.  Add support for these
 
9466
-;; builtins here.
 
9467
-
 
9468
-(define_expand "unpacktf_0"
 
9469
-  [(set (match_operand:DF 0 "nonimmediate_operand" "")
 
9470
-       (unspec:DF [(match_operand:TF 1 "register_operand" "")
 
9471
-                   (const_int 0)]
 
9472
-        UNSPEC_UNPACK_128BIT))]
 
9473
-  ""
 
9474
-  "")
 
9475
-
 
9476
-(define_expand "unpacktf_1"
 
9477
-  [(set (match_operand:DF 0 "nonimmediate_operand" "")
 
9478
-       (unspec:DF [(match_operand:TF 1 "register_operand" "")
 
9479
-                   (const_int 1)]
 
9480
-        UNSPEC_UNPACK_128BIT))]
 
9481
-  ""
 
9482
-  "")
 
9483
-
 
9484
 (define_insn_and_split "unpack<mode>_dm"
 
9485
   [(set (match_operand:<FP128_64> 0 "nonimmediate_operand" "=d,m,d,r,m")
 
9486
        (unspec:<FP128_64>
 
9487
Index: gcc/config/rs6000/sysv4.h
 
9488
===================================================================
 
9489
--- a/src/gcc/config/rs6000/sysv4.h     (.../tags/gcc_4_8_3_release)
 
9490
+++ b/src/gcc/config/rs6000/sysv4.h     (.../branches/gcc-4_8-branch)
 
9491
@@ -292,7 +292,7 @@
 
9492
 /* An expression for the alignment of a structure field FIELD if the
 
9493
    alignment computed in the usual way is COMPUTED.  */
 
9494
 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                                  \
 
9495
-       ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
 
9496
+       (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))            \
 
9497
         ? 128 : COMPUTED)
 
9498
 
 
9499
 #undef  BIGGEST_FIELD_ALIGNMENT
 
9500
@@ -949,3 +949,27 @@
 
9501
 #define TARGET_USES_SYSV4_OPT 1
 
9502
 
 
9503
 #undef DBX_REGISTER_NUMBER
 
9504
+
 
9505
+/* Link -lasan early on the command line.  For -static-libasan, don't link
 
9506
+   it for -shared link, the executable should be compiled with -static-libasan
 
9507
+   in that case, and for executable link link with --{,no-}whole-archive around
 
9508
+   it to force everything into the executable.  And similarly for -ltsan.  */
 
9509
+#if defined(HAVE_LD_STATIC_DYNAMIC)
 
9510
+#undef LIBASAN_EARLY_SPEC
 
9511
+#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
 
9512
+  "%{static-libasan:%{!shared:" \
 
9513
+  LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
 
9514
+  LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
 
9515
+#undef LIBTSAN_EARLY_SPEC
 
9516
+#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
 
9517
+  LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
 
9518
+  LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
 
9519
+#endif
 
9520
+
 
9521
+/* Additional libraries needed by -static-libasan.  */
 
9522
+#undef STATIC_LIBASAN_LIBS
 
9523
+#define STATIC_LIBASAN_LIBS "-ldl -lpthread"
 
9524
+
 
9525
+/* Additional libraries needed by -static-libtsan.  */
 
9526
+#undef STATIC_LIBTSAN_LIBS
 
9527
+#define STATIC_LIBTSAN_LIBS "-ldl -lpthread"
 
9528
Index: gcc/config/arm/arm.c
 
9529
===================================================================
 
9530
--- a/src/gcc/config/arm/arm.c  (.../tags/gcc_4_8_3_release)
 
9531
+++ b/src/gcc/config/arm/arm.c  (.../branches/gcc-4_8-branch)
 
9532
@@ -82,7 +82,6 @@
 
9533
 static reg_class_t arm_preferred_reload_class (rtx, reg_class_t);
 
9534
 static rtx thumb_legitimize_address (rtx, rtx, enum machine_mode);
 
9535
 inline static int thumb1_index_register_rtx_p (rtx, int);
 
9536
-static bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
 
9537
 static int thumb_far_jump_used_p (void);
 
9538
 static bool thumb_force_lr_save (void);
 
9539
 static unsigned arm_size_return_regs (void);
 
9540
@@ -24476,9 +24475,13 @@
 
9541
       fputs (":\n", file);
 
9542
       if (flag_pic)
 
9543
        {
 
9544
-         /* Output ".word .LTHUNKn-7-.LTHUNKPCn".  */
 
9545
+         /* Output ".word .LTHUNKn-[3,7]-.LTHUNKPCn".  */
 
9546
          rtx tem = XEXP (DECL_RTL (function), 0);
 
9547
-         tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
 
9548
+         /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC
 
9549
+            pipeline offset is four rather than eight.  Adjust the offset
 
9550
+            accordingly.  */
 
9551
+         tem = plus_constant (GET_MODE (tem), tem,
 
9552
+                              TARGET_THUMB1_ONLY ? -3 : -7);
 
9553
          tem = gen_rtx_MINUS (GET_MODE (tem),
 
9554
                               tem,
 
9555
                               gen_rtx_SYMBOL_REF (Pmode,
 
9556
@@ -27462,4 +27465,13 @@
 
9557
 
 
9558
 }
 
9559
 
 
9560
+/* return TRUE if x is a reference to a value in a constant pool */
 
9561
+extern bool
 
9562
+arm_is_constant_pool_ref (rtx x)
 
9563
+{
 
9564
+  return (MEM_P (x)
 
9565
+         && GET_CODE (XEXP (x, 0)) == SYMBOL_REF
 
9566
+         && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
 
9567
+}
 
9568
+
 
9569
 #include "gt-arm.h"
 
9570
Index: gcc/config/arm/arm-protos.h
 
9571
===================================================================
 
9572
--- a/src/gcc/config/arm/arm-protos.h   (.../tags/gcc_4_8_3_release)
 
9573
+++ b/src/gcc/config/arm/arm-protos.h   (.../branches/gcc-4_8-branch)
 
9574
@@ -55,6 +55,7 @@
 
9575
 extern int legitimate_pic_operand_p (rtx);
 
9576
 extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
 
9577
 extern rtx legitimize_tls_address (rtx, rtx);
 
9578
+extern bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
 
9579
 extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int);
 
9580
 extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
 
9581
 extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int,
 
9582
@@ -286,4 +287,6 @@
 
9583
 
 
9584
 extern void arm_emit_eabi_attribute (const char *, int, int);
 
9585
 
 
9586
+extern bool arm_is_constant_pool_ref (rtx);
 
9587
+
 
9588
 #endif /* ! GCC_ARM_PROTOS_H */
 
9589
Index: gcc/config/arm/constraints.md
 
9590
===================================================================
 
9591
--- a/src/gcc/config/arm/constraints.md (.../tags/gcc_4_8_3_release)
 
9592
+++ b/src/gcc/config/arm/constraints.md (.../branches/gcc-4_8-branch)
 
9593
@@ -36,7 +36,7 @@
 
9594
 ;; in Thumb-2 state: Pj, PJ, Ps, Pt, Pu, Pv, Pw, Px, Py
 
9595
 
 
9596
 ;; The following memory constraints have been used:
 
9597
-;; in ARM/Thumb-2 state: Q, Ut, Uv, Uy, Un, Um, Us
 
9598
+;; in ARM/Thumb-2 state: Q, Uh, Ut, Uv, Uy, Un, Um, Us
 
9599
 ;; in ARM state: Uq
 
9600
 ;; in Thumb state: Uu, Uw
 
9601
 
 
9602
@@ -310,6 +310,12 @@
 
9603
   An address valid for loading/storing register exclusive"
 
9604
  (match_operand 0 "mem_noofs_operand"))
 
9605
 
 
9606
+(define_memory_constraint "Uh"
 
9607
+ "@internal
 
9608
+  An address suitable for byte and half-word loads which does not point inside a constant pool"
 
9609
+ (and (match_code "mem")
 
9610
+      (match_test "arm_legitimate_address_p (GET_MODE (op), XEXP (op, 0), false) && !arm_is_constant_pool_ref (op)")))
 
9611
+
 
9612
 (define_memory_constraint "Ut"
 
9613
  "@internal
 
9614
   In ARM/Thumb-2 state an address valid for loading/storing opaque structure
 
9615
@@ -356,7 +362,8 @@
 
9616
  (and (match_code "mem")
 
9617
       (match_test "TARGET_ARM
 
9618
                   && arm_legitimate_address_outer_p (GET_MODE (op), XEXP (op, 0),
 
9619
-                                                     SIGN_EXTEND, 0)")))
 
9620
+                                                     SIGN_EXTEND, 0)
 
9621
+                  && !arm_is_constant_pool_ref (op)")))
 
9622
 
 
9623
 (define_memory_constraint "Q"
 
9624
  "@internal
 
9625
Index: gcc/config/arm/arm.md
 
9626
===================================================================
 
9627
--- a/src/gcc/config/arm/arm.md (.../tags/gcc_4_8_3_release)
 
9628
+++ b/src/gcc/config/arm/arm.md (.../branches/gcc-4_8-branch)
 
9629
@@ -4047,7 +4047,7 @@
 
9630
 (define_insn "unaligned_loadhis"
 
9631
   [(set (match_operand:SI 0 "s_register_operand" "=l,r")
 
9632
        (sign_extend:SI
 
9633
-         (unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,m")]
 
9634
+         (unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,Uh")]
 
9635
                     UNSPEC_UNALIGNED_LOAD)))]
 
9636
   "unaligned_access && TARGET_32BIT"
 
9637
   "ldr%(sh%)\t%0, %1\t@ unaligned"
 
9638
@@ -4655,7 +4655,7 @@
 
9639
 
 
9640
 (define_insn "*arm_zero_extendhisi2_v6"
 
9641
   [(set (match_operand:SI 0 "s_register_operand" "=r,r")
 
9642
-       (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
 
9643
+       (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
 
9644
   "TARGET_ARM && arm_arch6"
 
9645
   "@
 
9646
    uxth%?\\t%0, %1
 
9647
@@ -4748,7 +4748,7 @@
 
9648
 
 
9649
 (define_insn "*arm_zero_extendqisi2_v6"
 
9650
   [(set (match_operand:SI 0 "s_register_operand" "=r,r")
 
9651
-       (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
 
9652
+       (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uh")))]
 
9653
   "TARGET_ARM && arm_arch6"
 
9654
   "@
 
9655
    uxtb%(%)\\t%0, %1
 
9656
@@ -4980,7 +4980,7 @@
 
9657
 
 
9658
 (define_insn "*arm_extendhisi2"
 
9659
   [(set (match_operand:SI 0 "s_register_operand" "=r,r")
 
9660
-       (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
 
9661
+       (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
 
9662
   "TARGET_ARM && arm_arch4 && !arm_arch6"
 
9663
   "@
 
9664
    #
 
9665
@@ -4987,23 +4987,19 @@
 
9666
    ldr%(sh%)\\t%0, %1"
 
9667
   [(set_attr "length" "8,4")
 
9668
    (set_attr "type" "alu_shift,load_byte")
 
9669
-   (set_attr "predicable" "yes")
 
9670
-   (set_attr "pool_range" "*,256")
 
9671
-   (set_attr "neg_pool_range" "*,244")]
 
9672
+   (set_attr "predicable" "yes")]
 
9673
 )
 
9674
 
 
9675
 ;; ??? Check Thumb-2 pool range
 
9676
 (define_insn "*arm_extendhisi2_v6"
 
9677
   [(set (match_operand:SI 0 "s_register_operand" "=r,r")
 
9678
-       (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
 
9679
+       (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
 
9680
   "TARGET_32BIT && arm_arch6"
 
9681
   "@
 
9682
    sxth%?\\t%0, %1
 
9683
    ldr%(sh%)\\t%0, %1"
 
9684
   [(set_attr "type" "simple_alu_shift,load_byte")
 
9685
-   (set_attr "predicable" "yes")
 
9686
-   (set_attr "pool_range" "*,256")
 
9687
-   (set_attr "neg_pool_range" "*,244")]
 
9688
+   (set_attr "predicable" "yes")]
 
9689
 )
 
9690
 
 
9691
 (define_insn "*arm_extendhisi2addsi"
 
9692
@@ -5045,9 +5041,7 @@
 
9693
   "TARGET_ARM && arm_arch4"
 
9694
   "ldr%(sb%)\\t%0, %1"
 
9695
   [(set_attr "type" "load_byte")
 
9696
-   (set_attr "predicable" "yes")
 
9697
-   (set_attr "pool_range" "256")
 
9698
-   (set_attr "neg_pool_range" "244")]
 
9699
+   (set_attr "predicable" "yes")]
 
9700
 )
 
9701
 
 
9702
 (define_expand "extendqisi2"
 
9703
@@ -5087,9 +5081,7 @@
 
9704
    ldr%(sb%)\\t%0, %1"
 
9705
   [(set_attr "length" "8,4")
 
9706
    (set_attr "type" "alu_shift,load_byte")
 
9707
-   (set_attr "predicable" "yes")
 
9708
-   (set_attr "pool_range" "*,256")
 
9709
-   (set_attr "neg_pool_range" "*,244")]
 
9710
+   (set_attr "predicable" "yes")]
 
9711
 )
 
9712
 
 
9713
 (define_insn "*arm_extendqisi_v6"
 
9714
@@ -5101,9 +5093,7 @@
 
9715
    sxtb%?\\t%0, %1
 
9716
    ldr%(sb%)\\t%0, %1"
 
9717
   [(set_attr "type" "simple_alu_shift,load_byte")
 
9718
-   (set_attr "predicable" "yes")
 
9719
-   (set_attr "pool_range" "*,256")
 
9720
-   (set_attr "neg_pool_range" "*,244")]
 
9721
+   (set_attr "predicable" "yes")]
 
9722
 )
 
9723
 
 
9724
 (define_insn "*arm_extendqisi2addsi"
 
9725
@@ -7630,12 +7620,13 @@
 
9726
 
 
9727
 (define_insn "*arm_cmpdi_unsigned"
 
9728
   [(set (reg:CC_CZ CC_REGNUM)
 
9729
-       (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
 
9730
-                      (match_operand:DI 1 "arm_di_operand"     "rDi")))]
 
9731
+       (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r,r")
 
9732
+                      (match_operand:DI 1 "arm_di_operand"     "rDi,rDi")))]
 
9733
   "TARGET_32BIT"
 
9734
   "cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
 
9735
   [(set_attr "conds" "set")
 
9736
-   (set_attr "length" "8")]
 
9737
+   (set_attr "arch" "a,t2")
 
9738
+   (set_attr "length" "8,10")]
 
9739
 )
 
9740
 
 
9741
 (define_insn "*arm_cmpdi_zero"
 
9742
Index: gcc/config/arm/t-rtems-eabi
 
9743
===================================================================
 
9744
--- a/src/gcc/config/arm/t-rtems-eabi   (.../tags/gcc_4_8_3_release)
 
9745
+++ b/src/gcc/config/arm/t-rtems-eabi   (.../branches/gcc-4_8-branch)
 
9746
@@ -1,47 +1,167 @@
 
9747
 # Custom RTEMS EABI multilibs
 
9748
 
 
9749
-MULTILIB_OPTIONS  = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard
 
9750
-MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard
 
9751
+MULTILIB_OPTIONS  = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16 mfloat-abi=hard
 
9752
+MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard
 
9753
 
 
9754
 # Enumeration of multilibs
 
9755
 
 
9756
 MULTILIB_EXCEPTIONS =
 
9757
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
 
9758
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon
 
9759
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
9760
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16
 
9761
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9762
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16
 
9763
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard
 
9764
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m
 
9765
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
 
9766
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon
 
9767
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
 
9768
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16
 
9769
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9770
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16
 
9771
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard
 
9772
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a
 
9773
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
 
9774
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon
 
9775
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
9776
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16
 
9777
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9778
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16
 
9779
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard
 
9780
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r
 
9781
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
 
9782
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon
 
9783
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
9784
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16
 
9785
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9786
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16
 
9787
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard
 
9788
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m
 
9789
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard
 
9790
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon
 
9791
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
 
9792
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16
 
9793
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9794
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16
 
9795
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard
 
9796
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb
 
9797
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard
 
9798
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon
 
9799
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
9800
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16
 
9801
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9802
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16
 
9803
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard
 
9804
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m
 
9805
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard
 
9806
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon
 
9807
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
 
9808
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16
 
9809
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9810
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16
 
9811
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfloat-abi=hard
 
9812
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a
 
9813
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon/mfloat-abi=hard
 
9814
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon
 
9815
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
9816
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16
 
9817
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9818
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16
 
9819
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfloat-abi=hard
 
9820
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r
 
9821
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon/mfloat-abi=hard
 
9822
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon
 
9823
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
9824
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16
 
9825
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9826
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16
 
9827
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfloat-abi=hard
 
9828
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m
 
9829
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon/mfloat-abi=hard
 
9830
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon
 
9831
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16/mfloat-abi=hard
 
9832
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16
 
9833
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9834
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16
 
9835
+MULTILIB_EXCEPTIONS += mbig-endian/mfloat-abi=hard
 
9836
+MULTILIB_EXCEPTIONS += mbig-endian
 
9837
 MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
 
9838
 MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon
 
9839
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
9840
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16
 
9841
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9842
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16
 
9843
 MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfloat-abi=hard
 
9844
 # MULTILIB_EXCEPTIONS += mthumb/march=armv6-m
 
9845
 # MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
 
9846
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon
 
9847
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
 
9848
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16
 
9849
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9850
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16
 
9851
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfloat-abi=hard
 
9852
 # MULTILIB_EXCEPTIONS += mthumb/march=armv7-a
 
9853
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
 
9854
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon
 
9855
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
9856
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16
 
9857
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9858
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16
 
9859
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfloat-abi=hard
 
9860
 # MULTILIB_EXCEPTIONS += mthumb/march=armv7-r
 
9861
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
 
9862
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon
 
9863
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
9864
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16
 
9865
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9866
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16
 
9867
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfloat-abi=hard
 
9868
 # MULTILIB_EXCEPTIONS += mthumb/march=armv7-m
 
9869
 MULTILIB_EXCEPTIONS += mthumb/mfpu=neon/mfloat-abi=hard
 
9870
 MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
 
9871
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
 
9872
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16
 
9873
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9874
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16
 
9875
 MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard
 
9876
 # MULTILIB_EXCEPTIONS += mthumb
 
9877
 MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon/mfloat-abi=hard
 
9878
 MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon
 
9879
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
9880
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16
 
9881
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9882
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16
 
9883
 MULTILIB_EXCEPTIONS += march=armv6-m/mfloat-abi=hard
 
9884
 MULTILIB_EXCEPTIONS += march=armv6-m
 
9885
 MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon/mfloat-abi=hard
 
9886
 MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon
 
9887
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
 
9888
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16
 
9889
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9890
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16
 
9891
 MULTILIB_EXCEPTIONS += march=armv7-a/mfloat-abi=hard
 
9892
 MULTILIB_EXCEPTIONS += march=armv7-a
 
9893
 MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon/mfloat-abi=hard
 
9894
 MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon
 
9895
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
9896
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16
 
9897
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9898
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16
 
9899
 MULTILIB_EXCEPTIONS += march=armv7-r/mfloat-abi=hard
 
9900
 MULTILIB_EXCEPTIONS += march=armv7-r
 
9901
 MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon/mfloat-abi=hard
 
9902
 MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon
 
9903
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
9904
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16
 
9905
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9906
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16
 
9907
 MULTILIB_EXCEPTIONS += march=armv7-m/mfloat-abi=hard
 
9908
 MULTILIB_EXCEPTIONS += march=armv7-m
 
9909
 MULTILIB_EXCEPTIONS += mfpu=neon/mfloat-abi=hard
 
9910
 MULTILIB_EXCEPTIONS += mfpu=neon
 
9911
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16/mfloat-abi=hard
 
9912
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16
 
9913
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16/mfloat-abi=hard
 
9914
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16
 
9915
 MULTILIB_EXCEPTIONS += mfloat-abi=hard
 
9916
Index: gcc/config/pa/pa.c
 
9917
===================================================================
 
9918
--- a/src/gcc/config/pa/pa.c    (.../tags/gcc_4_8_3_release)
 
9919
+++ b/src/gcc/config/pa/pa.c    (.../branches/gcc-4_8-branch)
 
9920
@@ -3237,7 +3237,12 @@
 
9921
       && aligned_p
 
9922
       && function_label_operand (x, VOIDmode))
 
9923
     {
 
9924
-      fputs (size == 8? "\t.dword\tP%" : "\t.word\tP%", asm_out_file);
 
9925
+      fputs (size == 8? "\t.dword\t" : "\t.word\t", asm_out_file);
 
9926
+
 
9927
+      /* We don't want an OPD when generating fast indirect calls.  */
 
9928
+      if (!TARGET_FAST_INDIRECT_CALLS)
 
9929
+       fputs ("P%", asm_out_file);
 
9930
+
 
9931
       output_addr_const (asm_out_file, x);
 
9932
       fputc ('\n', asm_out_file);
 
9933
       return true;
 
9934
@@ -4160,9 +4165,8 @@
 
9935
 pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
 
9936
 {
 
9937
   rtx insn = get_last_insn ();
 
9938
+  bool extra_nop;
 
9939
 
 
9940
-  last_address = 0;
 
9941
-
 
9942
   /* pa_expand_epilogue does the dirty work now.  We just need
 
9943
      to output the assembler directives which denote the end
 
9944
      of a function.
 
9945
@@ -4185,14 +4189,16 @@
 
9946
   if (insn && GET_CODE (insn) == CALL_INSN)
 
9947
     {
 
9948
       fputs ("\tnop\n", file);
 
9949
-      last_address += 4;
 
9950
+      extra_nop = true;
 
9951
     }
 
9952
+  else
 
9953
+    extra_nop = false;
 
9954
 
 
9955
   fputs ("\t.EXIT\n\t.PROCEND\n", file);
 
9956
 
 
9957
   if (TARGET_SOM && TARGET_GAS)
 
9958
     {
 
9959
-      /* We done with this subspace except possibly for some additional
 
9960
+      /* We are done with this subspace except possibly for some additional
 
9961
         debug information.  Forget that we are in this subspace to ensure
 
9962
         that the next function is output in its own subspace.  */
 
9963
       in_section = NULL;
 
9964
@@ -4199,12 +4205,20 @@
 
9965
       cfun->machine->in_nsubspa = 2;
 
9966
     }
 
9967
 
 
9968
+  /* Thunks do their own insn accounting.  */
 
9969
+  if (cfun->is_thunk)
 
9970
+    return;
 
9971
+
 
9972
   if (INSN_ADDRESSES_SET_P ())
 
9973
     {
 
9974
+      last_address = extra_nop ? 4 : 0;
 
9975
       insn = get_last_nonnote_insn ();
 
9976
-      last_address += INSN_ADDRESSES (INSN_UID (insn));
 
9977
-      if (INSN_P (insn))
 
9978
-       last_address += insn_default_length (insn);
 
9979
+      if (insn)
 
9980
+       {
 
9981
+         last_address += INSN_ADDRESSES (INSN_UID (insn));
 
9982
+         if (INSN_P (insn))
 
9983
+           last_address += insn_default_length (insn);
 
9984
+       }
 
9985
       last_address = ((last_address + FUNCTION_BOUNDARY / BITS_PER_UNIT - 1)
 
9986
                      & ~(FUNCTION_BOUNDARY / BITS_PER_UNIT - 1));
 
9987
     }
 
9988
@@ -8270,8 +8284,7 @@
 
9989
   xoperands[1] = XEXP (DECL_RTL (thunk_fndecl), 0);
 
9990
   xoperands[2] = GEN_INT (delta);
 
9991
 
 
9992
-  ASM_OUTPUT_LABEL (file, XSTR (xoperands[1], 0));
 
9993
-  fprintf (file, "\t.PROC\n\t.CALLINFO FRAME=0,NO_CALLS\n\t.ENTRY\n");
 
9994
+  final_start_function (emit_barrier (), file, 1);
 
9995
 
 
9996
   /* Output the thunk.  We know that the function is in the same
 
9997
      translation unit (i.e., the same space) as the thunk, and that
 
9998
@@ -8301,12 +8314,16 @@
 
9999
                   || ((DECL_SECTION_NAME (thunk_fndecl)
 
10000
                        == DECL_SECTION_NAME (function))
 
10001
                       && last_address < 262132)))
 
10002
+             /* In this case, we need to be able to reach the start of
 
10003
+                the stub table even though the function is likely closer
 
10004
+                and can be jumped to directly.  */
 
10005
              || (targetm_common.have_named_sections
 
10006
                  && DECL_SECTION_NAME (thunk_fndecl) == NULL
 
10007
                  && DECL_SECTION_NAME (function) == NULL
 
10008
-                 && last_address < 262132)
 
10009
+                 && total_code_bytes < MAX_PCREL17F_OFFSET)
 
10010
+             /* Likewise.  */
 
10011
              || (!targetm_common.have_named_sections
 
10012
-                 && last_address < 262132))))
 
10013
+                 && total_code_bytes < MAX_PCREL17F_OFFSET))))
 
10014
     {
 
10015
       if (!val_14)
 
10016
        output_asm_insn ("addil L'%2,%%r26", xoperands);
 
10017
@@ -8477,17 +8494,8 @@
 
10018
        }
 
10019
     }
 
10020
 
 
10021
-  fprintf (file, "\t.EXIT\n\t.PROCEND\n");
 
10022
+  final_end_function ();
 
10023
 
 
10024
-  if (TARGET_SOM && TARGET_GAS)
 
10025
-    {
 
10026
-      /* We done with this subspace except possibly for some additional
 
10027
-        debug information.  Forget that we are in this subspace to ensure
 
10028
-        that the next function is output in its own subspace.  */
 
10029
-      in_section = NULL;
 
10030
-      cfun->machine->in_nsubspa = 2;
 
10031
-    }
 
10032
-
 
10033
   if (TARGET_SOM && flag_pic && TREE_PUBLIC (function))
 
10034
     {
 
10035
       switch_to_section (data_section);
 
10036
Index: gcc/tree-vect-slp.c
 
10037
===================================================================
 
10038
--- a/src/gcc/tree-vect-slp.c   (.../tags/gcc_4_8_3_release)
 
10039
+++ b/src/gcc/tree-vect-slp.c   (.../branches/gcc-4_8-branch)
 
10040
@@ -1837,7 +1837,10 @@
 
10041
            && (stmt_vinfo = vinfo_for_stmt (use_stmt))
 
10042
            && !STMT_SLP_TYPE (stmt_vinfo)
 
10043
             && (STMT_VINFO_RELEVANT (stmt_vinfo)
 
10044
-                || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo)))
 
10045
+                || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo))
 
10046
+               || (STMT_VINFO_IN_PATTERN_P (stmt_vinfo)
 
10047
+                   && STMT_VINFO_RELATED_STMT (stmt_vinfo)
 
10048
+                   && !STMT_SLP_TYPE (vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_vinfo)))))
 
10049
            && !(gimple_code (use_stmt) == GIMPLE_PHI
 
10050
                  && STMT_VINFO_DEF_TYPE (stmt_vinfo)
 
10051
                   == vect_reduction_def))
 
10052
Index: libobjc/encoding.c
 
10053
===================================================================
 
10054
--- a/src/libobjc/encoding.c    (.../tags/gcc_4_8_3_release)
 
10055
+++ b/src/libobjc/encoding.c    (.../branches/gcc-4_8-branch)
 
10056
@@ -192,6 +192,8 @@
 
10057
    ? MAX (MAX (COMPUTED, SPECIFIED), 64)                               \
 
10058
    : MAX (COMPUTED, SPECIFIED));})
 
10059
 
 
10060
+#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
 
10061
+ (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
 
10062
 
 
10063
 /* Skip a variable name, enclosed in quotes (").  */
 
10064
 static inline
 
10065
Index: libobjc/ChangeLog
 
10066
===================================================================
 
10067
--- a/src/libobjc/ChangeLog     (.../tags/gcc_4_8_3_release)
 
10068
+++ b/src/libobjc/ChangeLog     (.../branches/gcc-4_8-branch)
 
10069
@@ -1,3 +1,16 @@
 
10070
+2014-07-27  Ulrich Weigand  <uweigand@de.ibm.com>
 
10071
+
 
10072
+       PR libobjc/61920
 
10073
+       * encoding.c (rs6000_special_adjust_field_align_p): Use definition
 
10074
+       that matches the 4.8 branch ABI.
 
10075
+
 
10076
+2014-07-27  Alan Modra  <amodra@gmail.com>
 
10077
+           Matthias Klose  <doko@ubuntu.com>
 
10078
+
 
10079
+       PR libobjc/61920
 
10080
+
 
10081
+       * encoding.c: Define rs6000_special_adjust_field_align_p.
 
10082
+
 
10083
 2014-05-22  Release Manager
 
10084
 
 
10085
        * GCC 4.8.3 released.
 
10086
Index: libgfortran/m4/in_pack.m4
 
10087
===================================================================
 
10088
--- a/src/libgfortran/m4/in_pack.m4     (.../tags/gcc_4_8_3_release)
 
10089
+++ b/src/libgfortran/m4/in_pack.m4     (.../branches/gcc-4_8-branch)
 
10090
@@ -79,7 +79,7 @@
 
10091
     return source->base_addr;
 
10092
 
 
10093
   /* Allocate storage for the destination.  */
 
10094
-  destptr = ('rtype_name` *)xmalloc (ssize * sizeof ('rtype_name`));
 
10095
+  destptr = xmallocarray (ssize, sizeof ('rtype_name`));
 
10096
   dest = destptr;
 
10097
   src = source->base_addr;
 
10098
   stride0 = stride[0];
 
10099
Index: libgfortran/m4/pack.m4
 
10100
===================================================================
 
10101
--- a/src/libgfortran/m4/pack.m4        (.../tags/gcc_4_8_3_release)
 
10102
+++ b/src/libgfortran/m4/pack.m4        (.../branches/gcc-4_8-branch)
 
10103
@@ -168,8 +168,8 @@
 
10104
 
 
10105
          ret->offset = 0;
 
10106
 
 
10107
-         /* xmalloc allocates a single byte for zero size.  */
 
10108
-         ret->base_addr = xmalloc (sizeof ('rtype_name`) * total);
 
10109
+         /* xmallocarray allocates a single byte for zero size.  */
 
10110
+         ret->base_addr = xmallocarray (total, sizeof ('rtype_name`));
 
10111
 
 
10112
          if (total == 0)
 
10113
            return;
 
10114
Index: libgfortran/m4/spread.m4
 
10115
===================================================================
 
10116
--- a/src/libgfortran/m4/spread.m4      (.../tags/gcc_4_8_3_release)
 
10117
+++ b/src/libgfortran/m4/spread.m4      (.../branches/gcc-4_8-branch)
 
10118
@@ -102,8 +102,8 @@
 
10119
        }
 
10120
       ret->offset = 0;
 
10121
 
 
10122
-      /* xmalloc allocates a single byte for zero size.  */
 
10123
-      ret->base_addr = xmalloc (rs * sizeof('rtype_name`));
 
10124
+      /* xmallocarray allocates a single byte for zero size.  */
 
10125
+      ret->base_addr = xmallocarray (rs, sizeof('rtype_name`));
 
10126
       if (rs <= 0)
 
10127
         return;
 
10128
     }
 
10129
@@ -245,7 +245,7 @@
 
10130
 
 
10131
   if (ret->base_addr == NULL)
 
10132
     {
 
10133
-      ret->base_addr = xmalloc (ncopies * sizeof ('rtype_name`));
 
10134
+      ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`));
 
10135
       ret->offset = 0;
 
10136
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
10137
     }
 
10138
Index: libgfortran/m4/transpose.m4
 
10139
===================================================================
 
10140
--- a/src/libgfortran/m4/transpose.m4   (.../tags/gcc_4_8_3_release)
 
10141
+++ b/src/libgfortran/m4/transpose.m4   (.../branches/gcc-4_8-branch)
 
10142
@@ -61,7 +61,8 @@
 
10143
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
10144
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
10145
 
 
10146
-      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) ret));
 
10147
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
10148
+                                     sizeof ('rtype_name`));
 
10149
       ret->offset = 0;
 
10150
     } else if (unlikely (compile_options.bounds_check))
 
10151
     {
 
10152
Index: libgfortran/m4/iforeach.m4
 
10153
===================================================================
 
10154
--- a/src/libgfortran/m4/iforeach.m4    (.../tags/gcc_4_8_3_release)
 
10155
+++ b/src/libgfortran/m4/iforeach.m4    (.../branches/gcc-4_8-branch)
 
10156
@@ -30,7 +30,7 @@
 
10157
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10158
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10159
       retarray->offset = 0;
 
10160
-      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
 
10161
+      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
 
10162
     }
 
10163
   else
 
10164
     {
 
10165
@@ -133,7 +133,7 @@
 
10166
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
10167
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10168
       retarray->offset = 0;
 
10169
-      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
 
10170
+      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
 
10171
     }
 
10172
   else
 
10173
     {
 
10174
@@ -264,7 +264,7 @@
 
10175
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10176
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10177
       retarray->offset = 0;
 
10178
-      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
 
10179
+      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
 
10180
     }
 
10181
   else if (unlikely (compile_options.bounds_check))
 
10182
     {
 
10183
Index: libgfortran/m4/eoshift1.m4
 
10184
===================================================================
 
10185
--- a/src/libgfortran/m4/eoshift1.m4    (.../tags/gcc_4_8_3_release)
 
10186
+++ b/src/libgfortran/m4/eoshift1.m4    (.../branches/gcc-4_8-branch)
 
10187
@@ -106,8 +106,8 @@
 
10188
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
10189
 
 
10190
         }
 
10191
-      /* xmalloc allocates a single byte for zero size.  */
 
10192
-      ret->base_addr = xmalloc (size * arraysize);
 
10193
+      /* xmallocarray allocates a single byte for zero size.  */
 
10194
+      ret->base_addr = xmallocarray (arraysize, size);
 
10195
 
 
10196
     }
 
10197
   else if (unlikely (compile_options.bounds_check))
 
10198
Index: libgfortran/m4/eoshift3.m4
 
10199
===================================================================
 
10200
--- a/src/libgfortran/m4/eoshift3.m4    (.../tags/gcc_4_8_3_release)
 
10201
+++ b/src/libgfortran/m4/eoshift3.m4    (.../branches/gcc-4_8-branch)
 
10202
@@ -90,7 +90,7 @@
 
10203
     {
 
10204
       int i;
 
10205
 
 
10206
-      ret->base_addr = xmalloc (size * arraysize);
 
10207
+      ret->base_addr = xmallocarray (arraysize, size);
 
10208
       ret->offset = 0;
 
10209
       ret->dtype = array->dtype;
 
10210
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
10211
@@ -108,8 +108,8 @@
 
10212
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
10213
 
 
10214
         }
 
10215
-      /* xmalloc allocates a single byte for zero size.  */
 
10216
-      ret->base_addr = xmalloc (size * arraysize);
 
10217
+      /* xmallocarray allocates a single byte for zero size.  */
 
10218
+      ret->base_addr = xmallocarray (arraysize, size);
 
10219
 
 
10220
     }
 
10221
   else if (unlikely (compile_options.bounds_check))
 
10222
Index: libgfortran/m4/shape.m4
 
10223
===================================================================
 
10224
--- a/src/libgfortran/m4/shape.m4       (.../tags/gcc_4_8_3_release)
 
10225
+++ b/src/libgfortran/m4/shape.m4       (.../branches/gcc-4_8-branch)
 
10226
@@ -50,7 +50,7 @@
 
10227
     {
 
10228
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
 
10229
       ret->offset = 0;
 
10230
-      ret->base_addr = xmalloc (sizeof ('rtype_name`) * rank);
 
10231
+      ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`));
 
10232
     }
 
10233
 
 
10234
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
10235
Index: libgfortran/m4/cshift1.m4
 
10236
===================================================================
 
10237
--- a/src/libgfortran/m4/cshift1.m4     (.../tags/gcc_4_8_3_release)
 
10238
+++ b/src/libgfortran/m4/cshift1.m4     (.../branches/gcc-4_8-branch)
 
10239
@@ -81,7 +81,7 @@
 
10240
     {
 
10241
       int i;
 
10242
 
 
10243
-      ret->base_addr = xmalloc (size * arraysize);
 
10244
+      ret->base_addr = xmallocarray (arraysize, size);
 
10245
       ret->offset = 0;
 
10246
       ret->dtype = array->dtype;
 
10247
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
10248
Index: libgfortran/m4/matmull.m4
 
10249
===================================================================
 
10250
--- a/src/libgfortran/m4/matmull.m4     (.../tags/gcc_4_8_3_release)
 
10251
+++ b/src/libgfortran/m4/matmull.m4     (.../branches/gcc-4_8-branch)
 
10252
@@ -89,7 +89,7 @@
 
10253
         }
 
10254
           
 
10255
       retarray->base_addr
 
10256
-       = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
 
10257
+       = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
 
10258
       retarray->offset = 0;
 
10259
     }
 
10260
     else if (unlikely (compile_options.bounds_check))
 
10261
Index: libgfortran/m4/bessel.m4
 
10262
===================================================================
 
10263
--- a/src/libgfortran/m4/bessel.m4      (.../tags/gcc_4_8_3_release)
 
10264
+++ b/src/libgfortran/m4/bessel.m4      (.../branches/gcc-4_8-branch)
 
10265
@@ -56,7 +56,7 @@
 
10266
     {
 
10267
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
10268
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
10269
-      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
 
10270
+      ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
 
10271
       ret->offset = 0;
 
10272
     }
 
10273
 
 
10274
@@ -123,7 +123,7 @@
 
10275
     {
 
10276
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
10277
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
10278
-      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
 
10279
+      ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
 
10280
       ret->offset = 0;
 
10281
     }
 
10282
 
 
10283
@@ -163,7 +163,7 @@
 
10284
 
 
10285
   x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
 
10286
 
 
10287
-  for (i = 2; i <= n1+n2; i++)
 
10288
+  for (i = 2; i <= n2 - n1; i++)
 
10289
     {
 
10290
 #if defined('rtype_name`_INFINITY)
 
10291
       if (unlikely (last2 == -'rtype_name`_INFINITY))
 
10292
Index: libgfortran/m4/unpack.m4
 
10293
===================================================================
 
10294
--- a/src/libgfortran/m4/unpack.m4      (.../tags/gcc_4_8_3_release)
 
10295
+++ b/src/libgfortran/m4/unpack.m4      (.../branches/gcc-4_8-branch)
 
10296
@@ -100,7 +100,7 @@
 
10297
          rs *= extent[n];
 
10298
        }
 
10299
       ret->offset = 0;
 
10300
-      ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
 
10301
+      ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
 
10302
     }
 
10303
   else
 
10304
     {
 
10305
@@ -245,7 +245,7 @@
 
10306
          rs *= extent[n];
 
10307
        }
 
10308
       ret->offset = 0;
 
10309
-      ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
 
10310
+      ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
 
10311
     }
 
10312
   else
 
10313
     {
 
10314
Index: libgfortran/m4/reshape.m4
 
10315
===================================================================
 
10316
--- a/src/libgfortran/m4/reshape.m4     (.../tags/gcc_4_8_3_release)
 
10317
+++ b/src/libgfortran/m4/reshape.m4     (.../branches/gcc-4_8-branch)
 
10318
@@ -115,11 +115,11 @@
 
10319
       ret->offset = 0;
 
10320
 
 
10321
       if (unlikely (rs < 1))
 
10322
-        alloc_size = 1;
 
10323
+        alloc_size = 0;
 
10324
       else
 
10325
-        alloc_size = rs * sizeof ('rtype_name`);
 
10326
+        alloc_size = rs;
 
10327
 
 
10328
-      ret->base_addr = xmalloc (alloc_size);
 
10329
+      ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`));
 
10330
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
10331
     }
 
10332
 
 
10333
Index: libgfortran/m4/ifunction_logical.m4
 
10334
===================================================================
 
10335
--- a/src/libgfortran/m4/ifunction_logical.m4   (.../tags/gcc_4_8_3_release)
 
10336
+++ b/src/libgfortran/m4/ifunction_logical.m4   (.../branches/gcc-4_8-branch)
 
10337
@@ -89,8 +89,7 @@
 
10338
       retarray->offset = 0;
 
10339
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10340
 
 
10341
-      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10342
-                  * extent[rank-1];
 
10343
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10344
 
 
10345
       if (alloc_size == 0)
 
10346
        {
 
10347
@@ -99,7 +98,7 @@
 
10348
          return;
 
10349
        }
 
10350
       else
 
10351
-       retarray->base_addr = xmalloc (alloc_size);
 
10352
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
10353
     }
 
10354
   else
 
10355
     {
 
10356
Index: libgfortran/m4/ifunction.m4
 
10357
===================================================================
 
10358
--- a/src/libgfortran/m4/ifunction.m4   (.../tags/gcc_4_8_3_release)
 
10359
+++ b/src/libgfortran/m4/ifunction.m4   (.../branches/gcc-4_8-branch)
 
10360
@@ -85,10 +85,9 @@
 
10361
       retarray->offset = 0;
 
10362
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10363
 
 
10364
-      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10365
-                  * extent[rank-1];
 
10366
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10367
 
 
10368
-      retarray->base_addr = xmalloc (alloc_size);
 
10369
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
10370
       if (alloc_size == 0)
 
10371
        {
 
10372
          /* Make sure we have a zero-sized array.  */
 
10373
@@ -260,8 +259,7 @@
 
10374
 
 
10375
        }
 
10376
 
 
10377
-      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10378
-                  * extent[rank-1];
 
10379
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10380
 
 
10381
       retarray->offset = 0;
 
10382
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10383
@@ -273,7 +271,7 @@
 
10384
          return;
 
10385
        }
 
10386
       else
 
10387
-       retarray->base_addr = xmalloc (alloc_size);
 
10388
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
10389
 
 
10390
     }
 
10391
   else
 
10392
@@ -417,8 +415,7 @@
 
10393
       retarray->offset = 0;
 
10394
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10395
 
 
10396
-      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10397
-                  * extent[rank-1];
 
10398
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10399
 
 
10400
       if (alloc_size == 0)
 
10401
        {
 
10402
@@ -427,7 +424,7 @@
 
10403
          return;
 
10404
        }
 
10405
       else
 
10406
-       retarray->base_addr = xmalloc (alloc_size);
 
10407
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
10408
     }
 
10409
   else
 
10410
     {
 
10411
Index: libgfortran/m4/matmul.m4
 
10412
===================================================================
 
10413
--- a/src/libgfortran/m4/matmul.m4      (.../tags/gcc_4_8_3_release)
 
10414
+++ b/src/libgfortran/m4/matmul.m4      (.../branches/gcc-4_8-branch)
 
10415
@@ -125,7 +125,7 @@
 
10416
         }
 
10417
 
 
10418
       retarray->base_addr
 
10419
-       = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
 
10420
+       = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
 
10421
       retarray->offset = 0;
 
10422
     }
 
10423
     else if (unlikely (compile_options.bounds_check))
 
10424
Index: libgfortran/runtime/in_pack_generic.c
 
10425
===================================================================
 
10426
--- a/src/libgfortran/runtime/in_pack_generic.c (.../tags/gcc_4_8_3_release)
 
10427
+++ b/src/libgfortran/runtime/in_pack_generic.c (.../branches/gcc-4_8-branch)
 
10428
@@ -180,7 +180,7 @@
 
10429
     return source->base_addr;
 
10430
 
 
10431
    /* Allocate storage for the destination.  */
 
10432
-  destptr = xmalloc (ssize * size);
 
10433
+  destptr = xmallocarray (ssize, size);
 
10434
   dest = (char *)destptr;
 
10435
   src = source->base_addr;
 
10436
   stride0 = stride[0] * size;
 
10437
Index: libgfortran/runtime/memory.c
 
10438
===================================================================
 
10439
--- a/src/libgfortran/runtime/memory.c  (.../tags/gcc_4_8_3_release)
 
10440
+++ b/src/libgfortran/runtime/memory.c  (.../branches/gcc-4_8-branch)
 
10441
@@ -25,8 +25,13 @@
 
10442
 
 
10443
 #include "libgfortran.h"
 
10444
 #include <stdlib.h>
 
10445
+#include <errno.h>
 
10446
 
 
10447
+#ifndef SIZE_MAX
 
10448
+#define SIZE_MAX ((size_t)-1)
 
10449
+#endif
 
10450
 
 
10451
+
 
10452
 void *
 
10453
 xmalloc (size_t n)
 
10454
 {
 
10455
@@ -44,12 +49,34 @@
 
10456
 }
 
10457
 
 
10458
 
 
10459
+void *
 
10460
+xmallocarray (size_t nmemb, size_t size)
 
10461
+{
 
10462
+  void *p;
 
10463
+
 
10464
+  if (!nmemb || !size)
 
10465
+    size = nmemb = 1;
 
10466
+  else if (nmemb > SIZE_MAX / size)
 
10467
+    {
 
10468
+      errno = ENOMEM;
 
10469
+      os_error ("Integer overflow in xmallocarray");
 
10470
+    }
 
10471
+
 
10472
+  p = malloc (nmemb * size);
 
10473
+
 
10474
+  if (!p)
 
10475
+    os_error ("Memory allocation failed in xmallocarray");
 
10476
+
 
10477
+  return p;
 
10478
+}
 
10479
+
 
10480
+
 
10481
 /* calloc wrapper that aborts on error.  */
 
10482
 
 
10483
 void *
 
10484
 xcalloc (size_t nmemb, size_t size)
 
10485
 {
 
10486
-  if (nmemb * size == 0)
 
10487
+  if (!nmemb || !size)
 
10488
     nmemb = size = 1;
 
10489
 
 
10490
   void *p = calloc (nmemb, size);
 
10491
Index: libgfortran/runtime/convert_char.c
 
10492
===================================================================
 
10493
--- a/src/libgfortran/runtime/convert_char.c    (.../tags/gcc_4_8_3_release)
 
10494
+++ b/src/libgfortran/runtime/convert_char.c    (.../branches/gcc-4_8-branch)
 
10495
@@ -44,7 +44,7 @@
 
10496
   gfc_charlen_type i, l;
 
10497
 
 
10498
   l = len > 0 ? len : 0;
 
10499
-  *dst = xmalloc ((l + 1) * sizeof (gfc_char4_t));
 
10500
+  *dst = xmallocarray ((l + 1), sizeof (gfc_char4_t));
 
10501
 
 
10502
   for (i = 0; i < l; i++)
 
10503
     (*dst)[i] = src[i];
 
10504
@@ -60,7 +60,7 @@
 
10505
   gfc_charlen_type i, l;
 
10506
 
 
10507
   l = len > 0 ? len : 0;
 
10508
-  *dst = xmalloc ((l + 1) * sizeof (unsigned char));
 
10509
+  *dst = xmalloc (l + 1);
 
10510
 
 
10511
   for (i = 0; i < l; i++)
 
10512
     (*dst)[i] = src[i];
 
10513
Index: libgfortran/runtime/environ.c
 
10514
===================================================================
 
10515
--- a/src/libgfortran/runtime/environ.c (.../tags/gcc_4_8_3_release)
 
10516
+++ b/src/libgfortran/runtime/environ.c (.../branches/gcc-4_8-branch)
 
10517
@@ -833,7 +833,7 @@
 
10518
     }
 
10519
   else
 
10520
     {
 
10521
-      elist = xmalloc (unit_count * sizeof (exception_t));
 
10522
+      elist = xmallocarray (unit_count, sizeof (exception_t));
 
10523
       do_count = 0;
 
10524
       p = val;
 
10525
       do_parse ();
 
10526
Index: libgfortran/intrinsics/string_intrinsics_inc.c
 
10527
===================================================================
 
10528
--- a/src/libgfortran/intrinsics/string_intrinsics_inc.c        (.../tags/gcc_4_8_3_release)
 
10529
+++ b/src/libgfortran/intrinsics/string_intrinsics_inc.c        (.../branches/gcc-4_8-branch)
 
10530
@@ -164,7 +164,7 @@
 
10531
   else
 
10532
     {
 
10533
       /* Allocate space for result string.  */
 
10534
-      *dest = xmalloc (*len * sizeof (CHARTYPE));
 
10535
+      *dest = xmallocarray (*len, sizeof (CHARTYPE));
 
10536
 
 
10537
       /* Copy string if necessary.  */
 
10538
       memcpy (*dest, src, *len * sizeof (CHARTYPE));
 
10539
@@ -442,7 +442,7 @@
 
10540
     *dest = &zero_length_string;
 
10541
   else
 
10542
     {
 
10543
-      CHARTYPE *tmp = xmalloc (*rlen * sizeof (CHARTYPE));
 
10544
+      CHARTYPE *tmp = xmallocarray (*rlen, sizeof (CHARTYPE));
 
10545
       memcpy (tmp, res, reslen * sizeof (CHARTYPE));
 
10546
       MEMSET (&tmp[reslen], ' ', *rlen - reslen);
 
10547
       *dest = tmp;
 
10548
Index: libgfortran/intrinsics/pack_generic.c
 
10549
===================================================================
 
10550
--- a/src/libgfortran/intrinsics/pack_generic.c (.../tags/gcc_4_8_3_release)
 
10551
+++ b/src/libgfortran/intrinsics/pack_generic.c (.../branches/gcc-4_8-branch)
 
10552
@@ -152,8 +152,8 @@
 
10553
          GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
 
10554
 
 
10555
          ret->offset = 0;
 
10556
-         /* xmalloc allocates a single byte for zero size.  */
 
10557
-         ret->base_addr = xmalloc (size * total);
 
10558
+         /* xmallocarray allocates a single byte for zero size.  */
 
10559
+         ret->base_addr = xmallocarray (total, size);
 
10560
 
 
10561
          if (total == 0)
 
10562
            return;      /* In this case, nothing remains to be done.  */
 
10563
@@ -519,7 +519,7 @@
 
10564
 
 
10565
       ret->offset = 0;
 
10566
 
 
10567
-      ret->base_addr = xmalloc (size * total);
 
10568
+      ret->base_addr = xmallocarray (total, size);
 
10569
 
 
10570
       if (total == 0)
 
10571
        return;
 
10572
Index: libgfortran/intrinsics/transpose_generic.c
 
10573
===================================================================
 
10574
--- a/src/libgfortran/intrinsics/transpose_generic.c    (.../tags/gcc_4_8_3_release)
 
10575
+++ b/src/libgfortran/intrinsics/transpose_generic.c    (.../branches/gcc-4_8-branch)
 
10576
@@ -60,7 +60,7 @@
 
10577
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
10578
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
10579
 
 
10580
-      ret->base_addr = xmalloc (size * size0 ((array_t*)ret));
 
10581
+      ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
 
10582
       ret->offset = 0;
 
10583
     }
 
10584
   else if (unlikely (compile_options.bounds_check))
 
10585
Index: libgfortran/intrinsics/cshift0.c
 
10586
===================================================================
 
10587
--- a/src/libgfortran/intrinsics/cshift0.c      (.../tags/gcc_4_8_3_release)
 
10588
+++ b/src/libgfortran/intrinsics/cshift0.c      (.../branches/gcc-4_8-branch)
 
10589
@@ -79,8 +79,8 @@
 
10590
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
10591
         }
 
10592
 
 
10593
-      /* xmalloc allocates a single byte for zero size.  */
 
10594
-      ret->base_addr = xmalloc (size * arraysize);
 
10595
+      /* xmallocarray allocates a single byte for zero size.  */
 
10596
+      ret->base_addr = xmallocarray (arraysize, size);
 
10597
     }
 
10598
   else if (unlikely (compile_options.bounds_check))
 
10599
     {
 
10600
Index: libgfortran/intrinsics/ctime.c
 
10601
===================================================================
 
10602
--- a/src/libgfortran/intrinsics/ctime.c        (.../tags/gcc_4_8_3_release)
 
10603
+++ b/src/libgfortran/intrinsics/ctime.c        (.../branches/gcc-4_8-branch)
 
10604
@@ -31,31 +31,53 @@
 
10605
 #include <string.h>
 
10606
 
 
10607
 
 
10608
-/* strftime-like function that fills a C string with %c format which
 
10609
-   is identical to ctime in the default locale. As ctime and ctime_r
 
10610
-   are poorly specified and their usage not recommended, the
 
10611
-   implementation instead uses strftime.  */
 
10612
+/* Maximum space a ctime-like string might need. A "normal" ctime
 
10613
+   string is 26 bytes, and in our case 24 bytes as we don't include
 
10614
+   the trailing newline and null. However, the longest possible year
 
10615
+   number is -2,147,481,748 (1900 - 2,147,483,648, since tm_year is a
 
10616
+   32-bit signed integer) so an extra 7 bytes are needed. */
 
10617
+#define CTIME_BUFSZ 31
 
10618
 
 
10619
-static size_t
 
10620
-strctime (char *s, size_t max, const time_t *timep)
 
10621
+
 
10622
+/* Thread-safe ctime-like function that fills a Fortran
 
10623
+   string. ctime_r is a portability headache and marked as obsolescent
 
10624
+   in POSIX 2008, which recommends strftime in its place. However,
 
10625
+   strftime(..., "%c",...)  doesn't produce ctime-like output on
 
10626
+   MinGW, so do it manually with snprintf.  */
 
10627
+
 
10628
+static int
 
10629
+gf_ctime (char *s, size_t max, const time_t timev)
 
10630
 {
 
10631
   struct tm ltm;
 
10632
   int failed;
 
10633
+  char buf[CTIME_BUFSZ + 1];
 
10634
   /* Some targets provide a localtime_r based on a draft of the POSIX
 
10635
      standard where the return type is int rather than the
 
10636
      standardized struct tm*.  */
 
10637
-  __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, &ltm)) 
 
10638
+  __builtin_choose_expr (__builtin_classify_type (localtime_r (&timev, &ltm)) 
 
10639
                         == 5,
 
10640
-                        failed = localtime_r (timep, &ltm) == NULL,
 
10641
-                        failed = localtime_r (timep, &ltm) != 0);
 
10642
+                        failed = localtime_r (&timev, &ltm) == NULL,
 
10643
+                        failed = localtime_r (&timev, &ltm) != 0);
 
10644
   if (failed)
 
10645
-    return 0;
 
10646
-  return strftime (s, max, "%c", &ltm);
 
10647
+    goto blank;
 
10648
+  int n = snprintf (buf, sizeof (buf), 
 
10649
+                   "%3.3s %3.3s%3d %.2d:%.2d:%.2d %d",
 
10650
+                   "SunMonTueWedThuFriSat" + ltm.tm_wday * 3,
 
10651
+                   "JanFebMarAprMayJunJulAugSepOctNovDec" + ltm.tm_mon * 3,
 
10652
+                   ltm.tm_mday, ltm.tm_hour, ltm.tm_min, ltm.tm_sec, 
 
10653
+                   1900 + ltm.tm_year);
 
10654
+  if (n < 0)
 
10655
+    goto blank;
 
10656
+  if ((size_t) n <= max)
 
10657
+    {
 
10658
+      cf_strcpy (s, max, buf);
 
10659
+      return n;
 
10660
+    }
 
10661
+ blank:
 
10662
+  memset (s, ' ', max);
 
10663
+  return 0;
 
10664
 }
 
10665
 
 
10666
-/* In the default locale, the date and time representation fits in 26
 
10667
-   bytes. However, other locales might need more space.  */
 
10668
-#define CSZ 100
 
10669
 
 
10670
 extern void fdate (char **, gfc_charlen_type *);
 
10671
 export_proto(fdate);
 
10672
@@ -64,8 +86,8 @@
 
10673
 fdate (char ** date, gfc_charlen_type * date_len)
 
10674
 {
 
10675
   time_t now = time(NULL);
 
10676
-  *date = xmalloc (CSZ);
 
10677
-  *date_len = strctime (*date, CSZ, &now);
 
10678
+  *date = xmalloc (CTIME_BUFSZ);
 
10679
+  *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
 
10680
 }
 
10681
 
 
10682
 
 
10683
@@ -76,10 +98,7 @@
 
10684
 fdate_sub (char * date, gfc_charlen_type date_len)
 
10685
 {
 
10686
   time_t now = time(NULL);
 
10687
-  char *s = xmalloc (date_len + 1);
 
10688
-  size_t n = strctime (s, date_len + 1, &now);
 
10689
-  fstrcpy (date, date_len, s, n);
 
10690
-  free (s);
 
10691
+  gf_ctime (date, date_len, now);
 
10692
 }
 
10693
 
 
10694
 
 
10695
@@ -91,8 +110,8 @@
 
10696
 PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t)
 
10697
 {
 
10698
   time_t now = t;
 
10699
-  *date = xmalloc (CSZ);
 
10700
-  *date_len = strctime (*date, CSZ, &now);
 
10701
+  *date = xmalloc (CTIME_BUFSZ);
 
10702
+  *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
 
10703
 }
 
10704
 
 
10705
 
 
10706
@@ -103,8 +122,5 @@
 
10707
 ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len)
 
10708
 {
 
10709
   time_t now = *t;
 
10710
-  char *s = xmalloc (date_len + 1);
 
10711
-  size_t n = strctime (s, date_len + 1, &now);
 
10712
-  fstrcpy (date, date_len, s, n);
 
10713
-  free (s);
 
10714
+  gf_ctime (date, date_len, now);
 
10715
 }
 
10716
Index: libgfortran/intrinsics/spread_generic.c
 
10717
===================================================================
 
10718
--- a/src/libgfortran/intrinsics/spread_generic.c       (.../tags/gcc_4_8_3_release)
 
10719
+++ b/src/libgfortran/intrinsics/spread_generic.c       (.../branches/gcc-4_8-branch)
 
10720
@@ -100,7 +100,7 @@
 
10721
          GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
 
10722
        }
 
10723
       ret->offset = 0;
 
10724
-      ret->base_addr = xmalloc (rs * size);
 
10725
+      ret->base_addr = xmallocarray (rs, size);
 
10726
 
 
10727
       if (rs <= 0)
 
10728
        return;
 
10729
@@ -245,7 +245,7 @@
 
10730
 
 
10731
   if (ret->base_addr == NULL)
 
10732
     {
 
10733
-      ret->base_addr = xmalloc (ncopies * size);
 
10734
+      ret->base_addr = xmallocarray (ncopies, size);
 
10735
       ret->offset = 0;
 
10736
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
10737
     }
 
10738
Index: libgfortran/intrinsics/unpack_generic.c
 
10739
===================================================================
 
10740
--- a/src/libgfortran/intrinsics/unpack_generic.c       (.../tags/gcc_4_8_3_release)
 
10741
+++ b/src/libgfortran/intrinsics/unpack_generic.c       (.../branches/gcc-4_8-branch)
 
10742
@@ -125,7 +125,7 @@
 
10743
          rs *= extent[n];
 
10744
        }
 
10745
       ret->offset = 0;
 
10746
-      ret->base_addr = xmalloc (rs * size);
 
10747
+      ret->base_addr = xmallocarray (rs, size);
 
10748
     }
 
10749
   else
 
10750
     {
 
10751
Index: libgfortran/intrinsics/eoshift0.c
 
10752
===================================================================
 
10753
--- a/src/libgfortran/intrinsics/eoshift0.c     (.../tags/gcc_4_8_3_release)
 
10754
+++ b/src/libgfortran/intrinsics/eoshift0.c     (.../branches/gcc-4_8-branch)
 
10755
@@ -86,8 +86,8 @@
 
10756
 
 
10757
         }
 
10758
 
 
10759
-      /* xmalloc allocates a single byte for zero size.  */
 
10760
-      ret->base_addr = xmalloc (size * arraysize);
 
10761
+      /* xmallocarray allocates a single byte for zero size.  */
 
10762
+      ret->base_addr = xmallocarray (arraysize, size);
 
10763
     }
 
10764
   else if (unlikely (compile_options.bounds_check))
 
10765
     {
 
10766
Index: libgfortran/intrinsics/eoshift2.c
 
10767
===================================================================
 
10768
--- a/src/libgfortran/intrinsics/eoshift2.c     (.../tags/gcc_4_8_3_release)
 
10769
+++ b/src/libgfortran/intrinsics/eoshift2.c     (.../branches/gcc-4_8-branch)
 
10770
@@ -78,8 +78,8 @@
 
10771
       ret->offset = 0;
 
10772
       ret->dtype = array->dtype;
 
10773
 
 
10774
-      /* xmalloc allocates a single byte for zero size.  */
 
10775
-      ret->base_addr = xmalloc (size * arraysize);
 
10776
+      /* xmallocarray allocates a single byte for zero size.  */
 
10777
+      ret->base_addr = xmallocarray (arraysize, size);
 
10778
 
 
10779
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
10780
         {
 
10781
Index: libgfortran/intrinsics/reshape_generic.c
 
10782
===================================================================
 
10783
--- a/src/libgfortran/intrinsics/reshape_generic.c      (.../tags/gcc_4_8_3_release)
 
10784
+++ b/src/libgfortran/intrinsics/reshape_generic.c      (.../branches/gcc-4_8-branch)
 
10785
@@ -99,11 +99,11 @@
 
10786
       ret->offset = 0;
 
10787
 
 
10788
       if (unlikely (rs < 1))
 
10789
-       alloc_size = 1;
 
10790
+       alloc_size = 0; /* xmalloc will allocate 1 byte.  */
 
10791
       else
 
10792
-       alloc_size = rs * size;
 
10793
+       alloc_size = rs;
 
10794
 
 
10795
-      ret->base_addr = xmalloc (alloc_size);
 
10796
+      ret->base_addr = xmallocarray (alloc_size, size);
 
10797
 
 
10798
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
10799
     }
 
10800
Index: libgfortran/ChangeLog
 
10801
===================================================================
 
10802
--- a/src/libgfortran/ChangeLog (.../tags/gcc_4_8_3_release)
 
10803
+++ b/src/libgfortran/ChangeLog (.../branches/gcc-4_8-branch)
 
10804
@@ -1,3 +1,84 @@
 
10805
+2014-08-20  Steven G. Kargl  <kargl@gcc.gnu.org>
 
10806
+
 
10807
+       PR libgfortran/62188
 
10808
+       * m4/bessel.m4: Avoid indexing off the end of an array.
 
10809
+       * generated/bessel_r10.c: Regenerated.
 
10810
+       * generated/bessel_r16.c: Ditto.
 
10811
+       * generated/bessel_r4.c: Ditto.
 
10812
+       * generated/bessel_r8.c: Ditto.
 
10813
+
 
10814
+2014-07-31  Janne Blomqvist  <jb@gcc.gnu.org>
 
10815
+
 
10816
+       Backport from mainline
 
10817
+       CVE-2014-5044
 
10818
+        * libgfortran.h (xmallocarray): New prototype.
 
10819
+        * runtime/memory.c (xmallocarray): New function.
 
10820
+        (xcalloc): Check for nonzero separately instead of multiplying.
 
10821
+        * generated/*.c: Regenerated.
 
10822
+        * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of
 
10823
+        xmalloc.
 
10824
+        * intrinsics/eoshift0.c (eoshift0): Likewise.
 
10825
+        * intrinsics/eoshift2.c (eoshift2): Likewise.
 
10826
+        * intrinsics/pack_generic.c (pack_internal): Likewise.
 
10827
+        (pack_s_internal): Likewise.
 
10828
+        * intrinsics/reshape_generic.c (reshape_internal): Likewise.
 
10829
+        * intrinsics/spread_generic.c (spread_internal): Likewise.
 
10830
+        (spread_internal_scalar): Likewise.
 
10831
+        * intrinsics/string_intrinsics_inc.c (string_trim): Likewise.
 
10832
+        (string_minmax): Likewise.
 
10833
+        * intrinsics/transpose_generic.c (transpose_internal): Likewise.
 
10834
+        * intrinsics/unpack_generic.c (unpack_internal): Likewise.
 
10835
+        * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value.
 
10836
+        * io/transfer.c (st_set_nml_var): Call xmallocarray instead of
 
10837
+        xmalloc.
 
10838
+        * io/unit.c (get_internal_unit): Likewise.
 
10839
+        (filename_from_unit): Don't cast xmalloc return value.
 
10840
+        * io/write.c (nml_write_obj): Likewise, formatting.
 
10841
+        * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray
 
10842
+        instead of xmalloc.
 
10843
+        (besse_yn_r'rtype_kind`): Likewise.
 
10844
+        * m4/cshift1.m4 (cshift1): Likewise.
 
10845
+        * m4/eoshift1.m4 (eoshift1): Likewise.
 
10846
+        * m4/eoshift3.m4 (eoshift3): Likewise.
 
10847
+        * m4/iforeach.m4: Likewise.
 
10848
+        * m4/ifunction.m4: Likewise.
 
10849
+        * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
 
10850
+        Likewise.
 
10851
+        * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise.
 
10852
+        * m4/matmul.m4 (matmul_'rtype_code`): Likewise.
 
10853
+        * m4/matmull.m4 (matmul_'rtype_code`): Likewise.
 
10854
+        * m4/pack.m4 (pack_'rtype_code`): Likewise.
 
10855
+        * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise.
 
10856
+        * m4/shape.m4 (shape_'rtype_kind`): Likewise.
 
10857
+        * m4/spread.m4 (spread_'rtype_code`): Likewise.
 
10858
+        (spread_scalar_'rtype_code`): Likewise.
 
10859
+        * m4/transpose.m4 (transpose_'rtype_code`): Likewise.
 
10860
+        * m4/unpack.m4 (unpack0_'rtype_code`): Likewise.
 
10861
+        (unpack1_'rtype_code`): Likewise.
 
10862
+        * runtime/convert_char.c (convert_char1_to_char4): Likewise.
 
10863
+        (convert_char4_to_char1): Simplify.
 
10864
+        * runtime/environ.c (init_unformatted): Call xmallocarray instead
 
10865
+        of xmalloc.
 
10866
+        * runtime/in_pack_generic.c (internal_pack): Likewise.
 
10867
+
 
10868
+2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
 
10869
+
 
10870
+       Backport from mainline
 
10871
+       PR libfortran/61310
 
10872
+       * intrinsics/ctime.c (strctime): Rename to gf_ctime, use snprintf
 
10873
+       instead of strftime.
 
10874
+       (fdate): Use gf_ctime.
 
10875
+       (fdate_sub): Likewise.
 
10876
+       (ctime): Likewise.
 
10877
+       (ctime_sub): Likewise.
 
10878
+
 
10879
+2014-05-25  Janne Blomqvist  <jb@gcc.gnu.org>
 
10880
+
 
10881
+       Backport from trunk.
 
10882
+       PR libfortran/61187
 
10883
+       * io/unix.c (raw_close): Check if s->fd is -1.
 
10884
+       (fd_to_stream): Check return value of fstat(), handle error.
 
10885
+
 
10886
 2014-05-22  Release Manager
 
10887
 
 
10888
        * GCC 4.8.3 released.
 
10889
Index: libgfortran/generated/spread_r10.c
 
10890
===================================================================
 
10891
--- a/src/libgfortran/generated/spread_r10.c    (.../tags/gcc_4_8_3_release)
 
10892
+++ b/src/libgfortran/generated/spread_r10.c    (.../branches/gcc-4_8-branch)
 
10893
@@ -101,8 +101,8 @@
 
10894
        }
 
10895
       ret->offset = 0;
 
10896
 
 
10897
-      /* xmalloc allocates a single byte for zero size.  */
 
10898
-      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_10));
 
10899
+      /* xmallocarray allocates a single byte for zero size.  */
 
10900
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_10));
 
10901
       if (rs <= 0)
 
10902
         return;
 
10903
     }
 
10904
@@ -244,7 +244,7 @@
 
10905
 
 
10906
   if (ret->base_addr == NULL)
 
10907
     {
 
10908
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_10));
 
10909
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_10));
 
10910
       ret->offset = 0;
 
10911
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
10912
     }
 
10913
Index: libgfortran/generated/maxloc1_4_r8.c
 
10914
===================================================================
 
10915
--- a/src/libgfortran/generated/maxloc1_4_r8.c  (.../tags/gcc_4_8_3_release)
 
10916
+++ b/src/libgfortran/generated/maxloc1_4_r8.c  (.../branches/gcc-4_8-branch)
 
10917
@@ -98,10 +98,9 @@
 
10918
       retarray->offset = 0;
 
10919
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10920
 
 
10921
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10922
-                  * extent[rank-1];
 
10923
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10924
 
 
10925
-      retarray->base_addr = xmalloc (alloc_size);
 
10926
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
10927
       if (alloc_size == 0)
 
10928
        {
 
10929
          /* Make sure we have a zero-sized array.  */
 
10930
@@ -294,8 +293,7 @@
 
10931
 
 
10932
        }
 
10933
 
 
10934
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10935
-                  * extent[rank-1];
 
10936
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10937
 
 
10938
       retarray->offset = 0;
 
10939
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10940
@@ -307,7 +305,7 @@
 
10941
          return;
 
10942
        }
 
10943
       else
 
10944
-       retarray->base_addr = xmalloc (alloc_size);
 
10945
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
10946
 
 
10947
     }
 
10948
   else
 
10949
@@ -485,8 +483,7 @@
 
10950
       retarray->offset = 0;
 
10951
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10952
 
 
10953
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10954
-                  * extent[rank-1];
 
10955
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10956
 
 
10957
       if (alloc_size == 0)
 
10958
        {
 
10959
@@ -495,7 +492,7 @@
 
10960
          return;
 
10961
        }
 
10962
       else
 
10963
-       retarray->base_addr = xmalloc (alloc_size);
 
10964
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
10965
     }
 
10966
   else
 
10967
     {
 
10968
Index: libgfortran/generated/norm2_r4.c
 
10969
===================================================================
 
10970
--- a/src/libgfortran/generated/norm2_r4.c      (.../tags/gcc_4_8_3_release)
 
10971
+++ b/src/libgfortran/generated/norm2_r4.c      (.../branches/gcc-4_8-branch)
 
10972
@@ -101,10 +101,9 @@
 
10973
       retarray->offset = 0;
 
10974
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10975
 
 
10976
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10977
-                  * extent[rank-1];
 
10978
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10979
 
 
10980
-      retarray->base_addr = xmalloc (alloc_size);
 
10981
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
10982
       if (alloc_size == 0)
 
10983
        {
 
10984
          /* Make sure we have a zero-sized array.  */
 
10985
Index: libgfortran/generated/parity_l2.c
 
10986
===================================================================
 
10987
--- a/src/libgfortran/generated/parity_l2.c     (.../tags/gcc_4_8_3_release)
 
10988
+++ b/src/libgfortran/generated/parity_l2.c     (.../branches/gcc-4_8-branch)
 
10989
@@ -98,10 +98,9 @@
 
10990
       retarray->offset = 0;
 
10991
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10992
 
 
10993
-      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10994
-                  * extent[rank-1];
 
10995
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10996
 
 
10997
-      retarray->base_addr = xmalloc (alloc_size);
 
10998
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
 
10999
       if (alloc_size == 0)
 
11000
        {
 
11001
          /* Make sure we have a zero-sized array.  */
 
11002
Index: libgfortran/generated/eoshift3_4.c
 
11003
===================================================================
 
11004
--- a/src/libgfortran/generated/eoshift3_4.c    (.../tags/gcc_4_8_3_release)
 
11005
+++ b/src/libgfortran/generated/eoshift3_4.c    (.../branches/gcc-4_8-branch)
 
11006
@@ -89,7 +89,7 @@
 
11007
     {
 
11008
       int i;
 
11009
 
 
11010
-      ret->base_addr = xmalloc (size * arraysize);
 
11011
+      ret->base_addr = xmallocarray (arraysize, size);
 
11012
       ret->offset = 0;
 
11013
       ret->dtype = array->dtype;
 
11014
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
11015
@@ -107,8 +107,8 @@
 
11016
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
11017
 
 
11018
         }
 
11019
-      /* xmalloc allocates a single byte for zero size.  */
 
11020
-      ret->base_addr = xmalloc (size * arraysize);
 
11021
+      /* xmallocarray allocates a single byte for zero size.  */
 
11022
+      ret->base_addr = xmallocarray (arraysize, size);
 
11023
 
 
11024
     }
 
11025
   else if (unlikely (compile_options.bounds_check))
 
11026
Index: libgfortran/generated/transpose_c8.c
 
11027
===================================================================
 
11028
--- a/src/libgfortran/generated/transpose_c8.c  (.../tags/gcc_4_8_3_release)
 
11029
+++ b/src/libgfortran/generated/transpose_c8.c  (.../branches/gcc-4_8-branch)
 
11030
@@ -60,7 +60,8 @@
 
11031
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
11032
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
11033
 
 
11034
-      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
 
11035
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
11036
+                                     sizeof (GFC_COMPLEX_8));
 
11037
       ret->offset = 0;
 
11038
     } else if (unlikely (compile_options.bounds_check))
 
11039
     {
 
11040
Index: libgfortran/generated/eoshift1_8.c
 
11041
===================================================================
 
11042
--- a/src/libgfortran/generated/eoshift1_8.c    (.../tags/gcc_4_8_3_release)
 
11043
+++ b/src/libgfortran/generated/eoshift1_8.c    (.../branches/gcc-4_8-branch)
 
11044
@@ -105,8 +105,8 @@
 
11045
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
11046
 
 
11047
         }
 
11048
-      /* xmalloc allocates a single byte for zero size.  */
 
11049
-      ret->base_addr = xmalloc (size * arraysize);
 
11050
+      /* xmallocarray allocates a single byte for zero size.  */
 
11051
+      ret->base_addr = xmallocarray (arraysize, size);
 
11052
 
 
11053
     }
 
11054
   else if (unlikely (compile_options.bounds_check))
 
11055
Index: libgfortran/generated/reshape_r16.c
 
11056
===================================================================
 
11057
--- a/src/libgfortran/generated/reshape_r16.c   (.../tags/gcc_4_8_3_release)
 
11058
+++ b/src/libgfortran/generated/reshape_r16.c   (.../branches/gcc-4_8-branch)
 
11059
@@ -111,11 +111,11 @@
 
11060
       ret->offset = 0;
 
11061
 
 
11062
       if (unlikely (rs < 1))
 
11063
-        alloc_size = 1;
 
11064
+        alloc_size = 0;
 
11065
       else
 
11066
-        alloc_size = rs * sizeof (GFC_REAL_16);
 
11067
+        alloc_size = rs;
 
11068
 
 
11069
-      ret->base_addr = xmalloc (alloc_size);
 
11070
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
11071
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
11072
     }
 
11073
 
 
11074
Index: libgfortran/generated/bessel_r4.c
 
11075
===================================================================
 
11076
--- a/src/libgfortran/generated/bessel_r4.c     (.../tags/gcc_4_8_3_release)
 
11077
+++ b/src/libgfortran/generated/bessel_r4.c     (.../branches/gcc-4_8-branch)
 
11078
@@ -55,7 +55,7 @@
 
11079
     {
 
11080
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
11081
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
11082
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
 
11083
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
 
11084
       ret->offset = 0;
 
11085
     }
 
11086
 
 
11087
@@ -122,7 +122,7 @@
 
11088
     {
 
11089
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
11090
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
11091
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
 
11092
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
 
11093
       ret->offset = 0;
 
11094
     }
 
11095
 
 
11096
@@ -162,7 +162,7 @@
 
11097
 
 
11098
   x2rev = GFC_REAL_4_LITERAL(2.)/x;
 
11099
 
 
11100
-  for (i = 2; i <= n1+n2; i++)
 
11101
+  for (i = 2; i <= n2 - n1; i++)
 
11102
     {
 
11103
 #if defined(GFC_REAL_4_INFINITY)
 
11104
       if (unlikely (last2 == -GFC_REAL_4_INFINITY))
 
11105
Index: libgfortran/generated/any_l2.c
 
11106
===================================================================
 
11107
--- a/src/libgfortran/generated/any_l2.c        (.../tags/gcc_4_8_3_release)
 
11108
+++ b/src/libgfortran/generated/any_l2.c        (.../branches/gcc-4_8-branch)
 
11109
@@ -101,8 +101,7 @@
 
11110
       retarray->offset = 0;
 
11111
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11112
 
 
11113
-      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11114
-                  * extent[rank-1];
 
11115
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11116
 
 
11117
       if (alloc_size == 0)
 
11118
        {
 
11119
@@ -111,7 +110,7 @@
 
11120
          return;
 
11121
        }
 
11122
       else
 
11123
-       retarray->base_addr = xmalloc (alloc_size);
 
11124
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
 
11125
     }
 
11126
   else
 
11127
     {
 
11128
Index: libgfortran/generated/product_r4.c
 
11129
===================================================================
 
11130
--- a/src/libgfortran/generated/product_r4.c    (.../tags/gcc_4_8_3_release)
 
11131
+++ b/src/libgfortran/generated/product_r4.c    (.../branches/gcc-4_8-branch)
 
11132
@@ -97,10 +97,9 @@
 
11133
       retarray->offset = 0;
 
11134
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11135
 
 
11136
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11137
-                  * extent[rank-1];
 
11138
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11139
 
 
11140
-      retarray->base_addr = xmalloc (alloc_size);
 
11141
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
11142
       if (alloc_size == 0)
 
11143
        {
 
11144
          /* Make sure we have a zero-sized array.  */
 
11145
@@ -272,8 +271,7 @@
 
11146
 
 
11147
        }
 
11148
 
 
11149
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11150
-                  * extent[rank-1];
 
11151
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11152
 
 
11153
       retarray->offset = 0;
 
11154
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11155
@@ -285,7 +283,7 @@
 
11156
          return;
 
11157
        }
 
11158
       else
 
11159
-       retarray->base_addr = xmalloc (alloc_size);
 
11160
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
11161
 
 
11162
     }
 
11163
   else
 
11164
@@ -430,8 +428,7 @@
 
11165
       retarray->offset = 0;
 
11166
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11167
 
 
11168
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11169
-                  * extent[rank-1];
 
11170
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11171
 
 
11172
       if (alloc_size == 0)
 
11173
        {
 
11174
@@ -440,7 +437,7 @@
 
11175
          return;
 
11176
        }
 
11177
       else
 
11178
-       retarray->base_addr = xmalloc (alloc_size);
 
11179
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
11180
     }
 
11181
   else
 
11182
     {
 
11183
Index: libgfortran/generated/iany_i1.c
 
11184
===================================================================
 
11185
--- a/src/libgfortran/generated/iany_i1.c       (.../tags/gcc_4_8_3_release)
 
11186
+++ b/src/libgfortran/generated/iany_i1.c       (.../branches/gcc-4_8-branch)
 
11187
@@ -97,10 +97,9 @@
 
11188
       retarray->offset = 0;
 
11189
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11190
 
 
11191
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11192
-                  * extent[rank-1];
 
11193
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11194
 
 
11195
-      retarray->base_addr = xmalloc (alloc_size);
 
11196
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
11197
       if (alloc_size == 0)
 
11198
        {
 
11199
          /* Make sure we have a zero-sized array.  */
 
11200
@@ -272,8 +271,7 @@
 
11201
 
 
11202
        }
 
11203
 
 
11204
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11205
-                  * extent[rank-1];
 
11206
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11207
 
 
11208
       retarray->offset = 0;
 
11209
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11210
@@ -285,7 +283,7 @@
 
11211
          return;
 
11212
        }
 
11213
       else
 
11214
-       retarray->base_addr = xmalloc (alloc_size);
 
11215
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
11216
 
 
11217
     }
 
11218
   else
 
11219
@@ -430,8 +428,7 @@
 
11220
       retarray->offset = 0;
 
11221
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11222
 
 
11223
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11224
-                  * extent[rank-1];
 
11225
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11226
 
 
11227
       if (alloc_size == 0)
 
11228
        {
 
11229
@@ -440,7 +437,7 @@
 
11230
          return;
 
11231
        }
 
11232
       else
 
11233
-       retarray->base_addr = xmalloc (alloc_size);
 
11234
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
11235
     }
 
11236
   else
 
11237
     {
 
11238
Index: libgfortran/generated/parity_l16.c
 
11239
===================================================================
 
11240
--- a/src/libgfortran/generated/parity_l16.c    (.../tags/gcc_4_8_3_release)
 
11241
+++ b/src/libgfortran/generated/parity_l16.c    (.../branches/gcc-4_8-branch)
 
11242
@@ -98,10 +98,9 @@
 
11243
       retarray->offset = 0;
 
11244
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11245
 
 
11246
-      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11247
-                  * extent[rank-1];
 
11248
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11249
 
 
11250
-      retarray->base_addr = xmalloc (alloc_size);
 
11251
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
 
11252
       if (alloc_size == 0)
 
11253
        {
 
11254
          /* Make sure we have a zero-sized array.  */
 
11255
Index: libgfortran/generated/in_pack_r4.c
 
11256
===================================================================
 
11257
--- a/src/libgfortran/generated/in_pack_r4.c    (.../tags/gcc_4_8_3_release)
 
11258
+++ b/src/libgfortran/generated/in_pack_r4.c    (.../branches/gcc-4_8-branch)
 
11259
@@ -76,7 +76,7 @@
 
11260
     return source->base_addr;
 
11261
 
 
11262
   /* Allocate storage for the destination.  */
 
11263
-  destptr = (GFC_REAL_4 *)xmalloc (ssize * sizeof (GFC_REAL_4));
 
11264
+  destptr = xmallocarray (ssize, sizeof (GFC_REAL_4));
 
11265
   dest = destptr;
 
11266
   src = source->base_addr;
 
11267
   stride0 = stride[0];
 
11268
Index: libgfortran/generated/product_i2.c
 
11269
===================================================================
 
11270
--- a/src/libgfortran/generated/product_i2.c    (.../tags/gcc_4_8_3_release)
 
11271
+++ b/src/libgfortran/generated/product_i2.c    (.../branches/gcc-4_8-branch)
 
11272
@@ -97,10 +97,9 @@
 
11273
       retarray->offset = 0;
 
11274
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11275
 
 
11276
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11277
-                  * extent[rank-1];
 
11278
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11279
 
 
11280
-      retarray->base_addr = xmalloc (alloc_size);
 
11281
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
11282
       if (alloc_size == 0)
 
11283
        {
 
11284
          /* Make sure we have a zero-sized array.  */
 
11285
@@ -272,8 +271,7 @@
 
11286
 
 
11287
        }
 
11288
 
 
11289
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11290
-                  * extent[rank-1];
 
11291
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11292
 
 
11293
       retarray->offset = 0;
 
11294
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11295
@@ -285,7 +283,7 @@
 
11296
          return;
 
11297
        }
 
11298
       else
 
11299
-       retarray->base_addr = xmalloc (alloc_size);
 
11300
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
11301
 
 
11302
     }
 
11303
   else
 
11304
@@ -430,8 +428,7 @@
 
11305
       retarray->offset = 0;
 
11306
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11307
 
 
11308
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11309
-                  * extent[rank-1];
 
11310
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11311
 
 
11312
       if (alloc_size == 0)
 
11313
        {
 
11314
@@ -440,7 +437,7 @@
 
11315
          return;
 
11316
        }
 
11317
       else
 
11318
-       retarray->base_addr = xmalloc (alloc_size);
 
11319
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
11320
     }
 
11321
   else
 
11322
     {
 
11323
Index: libgfortran/generated/iparity_i4.c
 
11324
===================================================================
 
11325
--- a/src/libgfortran/generated/iparity_i4.c    (.../tags/gcc_4_8_3_release)
 
11326
+++ b/src/libgfortran/generated/iparity_i4.c    (.../branches/gcc-4_8-branch)
 
11327
@@ -97,10 +97,9 @@
 
11328
       retarray->offset = 0;
 
11329
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11330
 
 
11331
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11332
-                  * extent[rank-1];
 
11333
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11334
 
 
11335
-      retarray->base_addr = xmalloc (alloc_size);
 
11336
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11337
       if (alloc_size == 0)
 
11338
        {
 
11339
          /* Make sure we have a zero-sized array.  */
 
11340
@@ -272,8 +271,7 @@
 
11341
 
 
11342
        }
 
11343
 
 
11344
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11345
-                  * extent[rank-1];
 
11346
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11347
 
 
11348
       retarray->offset = 0;
 
11349
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11350
@@ -285,7 +283,7 @@
 
11351
          return;
 
11352
        }
 
11353
       else
 
11354
-       retarray->base_addr = xmalloc (alloc_size);
 
11355
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11356
 
 
11357
     }
 
11358
   else
 
11359
@@ -430,8 +428,7 @@
 
11360
       retarray->offset = 0;
 
11361
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11362
 
 
11363
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11364
-                  * extent[rank-1];
 
11365
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11366
 
 
11367
       if (alloc_size == 0)
 
11368
        {
 
11369
@@ -440,7 +437,7 @@
 
11370
          return;
 
11371
        }
 
11372
       else
 
11373
-       retarray->base_addr = xmalloc (alloc_size);
 
11374
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11375
     }
 
11376
   else
 
11377
     {
 
11378
Index: libgfortran/generated/minloc0_4_i1.c
 
11379
===================================================================
 
11380
--- a/src/libgfortran/generated/minloc0_4_i1.c  (.../tags/gcc_4_8_3_release)
 
11381
+++ b/src/libgfortran/generated/minloc0_4_i1.c  (.../branches/gcc-4_8-branch)
 
11382
@@ -58,7 +58,7 @@
 
11383
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11384
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11385
       retarray->offset = 0;
 
11386
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11387
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11388
     }
 
11389
   else
 
11390
     {
 
11391
@@ -199,7 +199,7 @@
 
11392
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11393
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11394
       retarray->offset = 0;
 
11395
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11396
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11397
     }
 
11398
   else
 
11399
     {
 
11400
@@ -367,7 +367,7 @@
 
11401
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11402
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11403
       retarray->offset = 0;
 
11404
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11405
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11406
     }
 
11407
   else if (unlikely (compile_options.bounds_check))
 
11408
     {
 
11409
Index: libgfortran/generated/reshape_c4.c
 
11410
===================================================================
 
11411
--- a/src/libgfortran/generated/reshape_c4.c    (.../tags/gcc_4_8_3_release)
 
11412
+++ b/src/libgfortran/generated/reshape_c4.c    (.../branches/gcc-4_8-branch)
 
11413
@@ -111,11 +111,11 @@
 
11414
       ret->offset = 0;
 
11415
 
 
11416
       if (unlikely (rs < 1))
 
11417
-        alloc_size = 1;
 
11418
+        alloc_size = 0;
 
11419
       else
 
11420
-        alloc_size = rs * sizeof (GFC_COMPLEX_4);
 
11421
+        alloc_size = rs;
 
11422
 
 
11423
-      ret->base_addr = xmalloc (alloc_size);
 
11424
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
11425
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
11426
     }
 
11427
 
 
11428
Index: libgfortran/generated/maxloc0_4_r16.c
 
11429
===================================================================
 
11430
--- a/src/libgfortran/generated/maxloc0_4_r16.c (.../tags/gcc_4_8_3_release)
 
11431
+++ b/src/libgfortran/generated/maxloc0_4_r16.c (.../branches/gcc-4_8-branch)
 
11432
@@ -58,7 +58,7 @@
 
11433
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11434
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11435
       retarray->offset = 0;
 
11436
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11437
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11438
     }
 
11439
   else
 
11440
     {
 
11441
@@ -199,7 +199,7 @@
 
11442
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11443
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11444
       retarray->offset = 0;
 
11445
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11446
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11447
     }
 
11448
   else
 
11449
     {
 
11450
@@ -367,7 +367,7 @@
 
11451
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11452
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11453
       retarray->offset = 0;
 
11454
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11455
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11456
     }
 
11457
   else if (unlikely (compile_options.bounds_check))
 
11458
     {
 
11459
Index: libgfortran/generated/iall_i8.c
 
11460
===================================================================
 
11461
--- a/src/libgfortran/generated/iall_i8.c       (.../tags/gcc_4_8_3_release)
 
11462
+++ b/src/libgfortran/generated/iall_i8.c       (.../branches/gcc-4_8-branch)
 
11463
@@ -97,10 +97,9 @@
 
11464
       retarray->offset = 0;
 
11465
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11466
 
 
11467
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11468
-                  * extent[rank-1];
 
11469
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11470
 
 
11471
-      retarray->base_addr = xmalloc (alloc_size);
 
11472
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11473
       if (alloc_size == 0)
 
11474
        {
 
11475
          /* Make sure we have a zero-sized array.  */
 
11476
@@ -272,8 +271,7 @@
 
11477
 
 
11478
        }
 
11479
 
 
11480
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11481
-                  * extent[rank-1];
 
11482
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11483
 
 
11484
       retarray->offset = 0;
 
11485
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11486
@@ -285,7 +283,7 @@
 
11487
          return;
 
11488
        }
 
11489
       else
 
11490
-       retarray->base_addr = xmalloc (alloc_size);
 
11491
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11492
 
 
11493
     }
 
11494
   else
 
11495
@@ -430,8 +428,7 @@
 
11496
       retarray->offset = 0;
 
11497
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11498
 
 
11499
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11500
-                  * extent[rank-1];
 
11501
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11502
 
 
11503
       if (alloc_size == 0)
 
11504
        {
 
11505
@@ -440,7 +437,7 @@
 
11506
          return;
 
11507
        }
 
11508
       else
 
11509
-       retarray->base_addr = xmalloc (alloc_size);
 
11510
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11511
     }
 
11512
   else
 
11513
     {
 
11514
Index: libgfortran/generated/maxloc1_8_r16.c
 
11515
===================================================================
 
11516
--- a/src/libgfortran/generated/maxloc1_8_r16.c (.../tags/gcc_4_8_3_release)
 
11517
+++ b/src/libgfortran/generated/maxloc1_8_r16.c (.../branches/gcc-4_8-branch)
 
11518
@@ -98,10 +98,9 @@
 
11519
       retarray->offset = 0;
 
11520
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11521
 
 
11522
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11523
-                  * extent[rank-1];
 
11524
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11525
 
 
11526
-      retarray->base_addr = xmalloc (alloc_size);
 
11527
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11528
       if (alloc_size == 0)
 
11529
        {
 
11530
          /* Make sure we have a zero-sized array.  */
 
11531
@@ -294,8 +293,7 @@
 
11532
 
 
11533
        }
 
11534
 
 
11535
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11536
-                  * extent[rank-1];
 
11537
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11538
 
 
11539
       retarray->offset = 0;
 
11540
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11541
@@ -307,7 +305,7 @@
 
11542
          return;
 
11543
        }
 
11544
       else
 
11545
-       retarray->base_addr = xmalloc (alloc_size);
 
11546
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11547
 
 
11548
     }
 
11549
   else
 
11550
@@ -485,8 +483,7 @@
 
11551
       retarray->offset = 0;
 
11552
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11553
 
 
11554
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11555
-                  * extent[rank-1];
 
11556
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11557
 
 
11558
       if (alloc_size == 0)
 
11559
        {
 
11560
@@ -495,7 +492,7 @@
 
11561
          return;
 
11562
        }
 
11563
       else
 
11564
-       retarray->base_addr = xmalloc (alloc_size);
 
11565
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11566
     }
 
11567
   else
 
11568
     {
 
11569
Index: libgfortran/generated/sum_r16.c
 
11570
===================================================================
 
11571
--- a/src/libgfortran/generated/sum_r16.c       (.../tags/gcc_4_8_3_release)
 
11572
+++ b/src/libgfortran/generated/sum_r16.c       (.../branches/gcc-4_8-branch)
 
11573
@@ -97,10 +97,9 @@
 
11574
       retarray->offset = 0;
 
11575
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11576
 
 
11577
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11578
-                  * extent[rank-1];
 
11579
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11580
 
 
11581
-      retarray->base_addr = xmalloc (alloc_size);
 
11582
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
11583
       if (alloc_size == 0)
 
11584
        {
 
11585
          /* Make sure we have a zero-sized array.  */
 
11586
@@ -272,8 +271,7 @@
 
11587
 
 
11588
        }
 
11589
 
 
11590
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11591
-                  * extent[rank-1];
 
11592
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11593
 
 
11594
       retarray->offset = 0;
 
11595
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11596
@@ -285,7 +283,7 @@
 
11597
          return;
 
11598
        }
 
11599
       else
 
11600
-       retarray->base_addr = xmalloc (alloc_size);
 
11601
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
11602
 
 
11603
     }
 
11604
   else
 
11605
@@ -430,8 +428,7 @@
 
11606
       retarray->offset = 0;
 
11607
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11608
 
 
11609
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11610
-                  * extent[rank-1];
 
11611
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11612
 
 
11613
       if (alloc_size == 0)
 
11614
        {
 
11615
@@ -440,7 +437,7 @@
 
11616
          return;
 
11617
        }
 
11618
       else
 
11619
-       retarray->base_addr = xmalloc (alloc_size);
 
11620
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
11621
     }
 
11622
   else
 
11623
     {
 
11624
Index: libgfortran/generated/sum_i1.c
 
11625
===================================================================
 
11626
--- a/src/libgfortran/generated/sum_i1.c        (.../tags/gcc_4_8_3_release)
 
11627
+++ b/src/libgfortran/generated/sum_i1.c        (.../branches/gcc-4_8-branch)
 
11628
@@ -97,10 +97,9 @@
 
11629
       retarray->offset = 0;
 
11630
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11631
 
 
11632
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11633
-                  * extent[rank-1];
 
11634
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11635
 
 
11636
-      retarray->base_addr = xmalloc (alloc_size);
 
11637
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
11638
       if (alloc_size == 0)
 
11639
        {
 
11640
          /* Make sure we have a zero-sized array.  */
 
11641
@@ -272,8 +271,7 @@
 
11642
 
 
11643
        }
 
11644
 
 
11645
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11646
-                  * extent[rank-1];
 
11647
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11648
 
 
11649
       retarray->offset = 0;
 
11650
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11651
@@ -285,7 +283,7 @@
 
11652
          return;
 
11653
        }
 
11654
       else
 
11655
-       retarray->base_addr = xmalloc (alloc_size);
 
11656
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
11657
 
 
11658
     }
 
11659
   else
 
11660
@@ -430,8 +428,7 @@
 
11661
       retarray->offset = 0;
 
11662
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11663
 
 
11664
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11665
-                  * extent[rank-1];
 
11666
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11667
 
 
11668
       if (alloc_size == 0)
 
11669
        {
 
11670
@@ -440,7 +437,7 @@
 
11671
          return;
 
11672
        }
 
11673
       else
 
11674
-       retarray->base_addr = xmalloc (alloc_size);
 
11675
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
11676
     }
 
11677
   else
 
11678
     {
 
11679
Index: libgfortran/generated/in_pack_i2.c
 
11680
===================================================================
 
11681
--- a/src/libgfortran/generated/in_pack_i2.c    (.../tags/gcc_4_8_3_release)
 
11682
+++ b/src/libgfortran/generated/in_pack_i2.c    (.../branches/gcc-4_8-branch)
 
11683
@@ -76,7 +76,7 @@
 
11684
     return source->base_addr;
 
11685
 
 
11686
   /* Allocate storage for the destination.  */
 
11687
-  destptr = (GFC_INTEGER_2 *)xmalloc (ssize * sizeof (GFC_INTEGER_2));
 
11688
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_2));
 
11689
   dest = destptr;
 
11690
   src = source->base_addr;
 
11691
   stride0 = stride[0];
 
11692
Index: libgfortran/generated/transpose_r10.c
 
11693
===================================================================
 
11694
--- a/src/libgfortran/generated/transpose_r10.c (.../tags/gcc_4_8_3_release)
 
11695
+++ b/src/libgfortran/generated/transpose_r10.c (.../branches/gcc-4_8-branch)
 
11696
@@ -60,7 +60,8 @@
 
11697
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
11698
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
11699
 
 
11700
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
 
11701
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
11702
+                                     sizeof (GFC_REAL_10));
 
11703
       ret->offset = 0;
 
11704
     } else if (unlikely (compile_options.bounds_check))
 
11705
     {
 
11706
Index: libgfortran/generated/maxloc1_16_r16.c
 
11707
===================================================================
 
11708
--- a/src/libgfortran/generated/maxloc1_16_r16.c        (.../tags/gcc_4_8_3_release)
 
11709
+++ b/src/libgfortran/generated/maxloc1_16_r16.c        (.../branches/gcc-4_8-branch)
 
11710
@@ -98,10 +98,9 @@
 
11711
       retarray->offset = 0;
 
11712
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11713
 
 
11714
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11715
-                  * extent[rank-1];
 
11716
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11717
 
 
11718
-      retarray->base_addr = xmalloc (alloc_size);
 
11719
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11720
       if (alloc_size == 0)
 
11721
        {
 
11722
          /* Make sure we have a zero-sized array.  */
 
11723
@@ -294,8 +293,7 @@
 
11724
 
 
11725
        }
 
11726
 
 
11727
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11728
-                  * extent[rank-1];
 
11729
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11730
 
 
11731
       retarray->offset = 0;
 
11732
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11733
@@ -307,7 +305,7 @@
 
11734
          return;
 
11735
        }
 
11736
       else
 
11737
-       retarray->base_addr = xmalloc (alloc_size);
 
11738
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11739
 
 
11740
     }
 
11741
   else
 
11742
@@ -485,8 +483,7 @@
 
11743
       retarray->offset = 0;
 
11744
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11745
 
 
11746
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11747
-                  * extent[rank-1];
 
11748
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11749
 
 
11750
       if (alloc_size == 0)
 
11751
        {
 
11752
@@ -495,7 +492,7 @@
 
11753
          return;
 
11754
        }
 
11755
       else
 
11756
-       retarray->base_addr = xmalloc (alloc_size);
 
11757
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11758
     }
 
11759
   else
 
11760
     {
 
11761
Index: libgfortran/generated/maxloc1_16_i4.c
 
11762
===================================================================
 
11763
--- a/src/libgfortran/generated/maxloc1_16_i4.c (.../tags/gcc_4_8_3_release)
 
11764
+++ b/src/libgfortran/generated/maxloc1_16_i4.c (.../branches/gcc-4_8-branch)
 
11765
@@ -98,10 +98,9 @@
 
11766
       retarray->offset = 0;
 
11767
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11768
 
 
11769
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11770
-                  * extent[rank-1];
 
11771
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11772
 
 
11773
-      retarray->base_addr = xmalloc (alloc_size);
 
11774
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11775
       if (alloc_size == 0)
 
11776
        {
 
11777
          /* Make sure we have a zero-sized array.  */
 
11778
@@ -294,8 +293,7 @@
 
11779
 
 
11780
        }
 
11781
 
 
11782
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11783
-                  * extent[rank-1];
 
11784
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11785
 
 
11786
       retarray->offset = 0;
 
11787
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11788
@@ -307,7 +305,7 @@
 
11789
          return;
 
11790
        }
 
11791
       else
 
11792
-       retarray->base_addr = xmalloc (alloc_size);
 
11793
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11794
 
 
11795
     }
 
11796
   else
 
11797
@@ -485,8 +483,7 @@
 
11798
       retarray->offset = 0;
 
11799
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11800
 
 
11801
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11802
-                  * extent[rank-1];
 
11803
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11804
 
 
11805
       if (alloc_size == 0)
 
11806
        {
 
11807
@@ -495,7 +492,7 @@
 
11808
          return;
 
11809
        }
 
11810
       else
 
11811
-       retarray->base_addr = xmalloc (alloc_size);
 
11812
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11813
     }
 
11814
   else
 
11815
     {
 
11816
Index: libgfortran/generated/spread_i1.c
 
11817
===================================================================
 
11818
--- a/src/libgfortran/generated/spread_i1.c     (.../tags/gcc_4_8_3_release)
 
11819
+++ b/src/libgfortran/generated/spread_i1.c     (.../branches/gcc-4_8-branch)
 
11820
@@ -101,8 +101,8 @@
 
11821
        }
 
11822
       ret->offset = 0;
 
11823
 
 
11824
-      /* xmalloc allocates a single byte for zero size.  */
 
11825
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
 
11826
+      /* xmallocarray allocates a single byte for zero size.  */
 
11827
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
 
11828
       if (rs <= 0)
 
11829
         return;
 
11830
     }
 
11831
@@ -244,7 +244,7 @@
 
11832
 
 
11833
   if (ret->base_addr == NULL)
 
11834
     {
 
11835
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
 
11836
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
 
11837
       ret->offset = 0;
 
11838
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
11839
     }
 
11840
Index: libgfortran/generated/maxloc0_16_i8.c
 
11841
===================================================================
 
11842
--- a/src/libgfortran/generated/maxloc0_16_i8.c (.../tags/gcc_4_8_3_release)
 
11843
+++ b/src/libgfortran/generated/maxloc0_16_i8.c (.../branches/gcc-4_8-branch)
 
11844
@@ -58,7 +58,7 @@
 
11845
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11846
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11847
       retarray->offset = 0;
 
11848
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11849
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11850
     }
 
11851
   else
 
11852
     {
 
11853
@@ -199,7 +199,7 @@
 
11854
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11855
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11856
       retarray->offset = 0;
 
11857
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11858
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11859
     }
 
11860
   else
 
11861
     {
 
11862
@@ -367,7 +367,7 @@
 
11863
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11864
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11865
       retarray->offset = 0;
 
11866
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11867
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11868
     }
 
11869
   else if (unlikely (compile_options.bounds_check))
 
11870
     {
 
11871
Index: libgfortran/generated/maxval_r16.c
 
11872
===================================================================
 
11873
--- a/src/libgfortran/generated/maxval_r16.c    (.../tags/gcc_4_8_3_release)
 
11874
+++ b/src/libgfortran/generated/maxval_r16.c    (.../branches/gcc-4_8-branch)
 
11875
@@ -97,10 +97,9 @@
 
11876
       retarray->offset = 0;
 
11877
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11878
 
 
11879
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11880
-                  * extent[rank-1];
 
11881
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11882
 
 
11883
-      retarray->base_addr = xmalloc (alloc_size);
 
11884
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
11885
       if (alloc_size == 0)
 
11886
        {
 
11887
          /* Make sure we have a zero-sized array.  */
 
11888
@@ -286,8 +285,7 @@
 
11889
 
 
11890
        }
 
11891
 
 
11892
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11893
-                  * extent[rank-1];
 
11894
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11895
 
 
11896
       retarray->offset = 0;
 
11897
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11898
@@ -299,7 +297,7 @@
 
11899
          return;
 
11900
        }
 
11901
       else
 
11902
-       retarray->base_addr = xmalloc (alloc_size);
 
11903
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
11904
 
 
11905
     }
 
11906
   else
 
11907
@@ -472,8 +470,7 @@
 
11908
       retarray->offset = 0;
 
11909
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11910
 
 
11911
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11912
-                  * extent[rank-1];
 
11913
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11914
 
 
11915
       if (alloc_size == 0)
 
11916
        {
 
11917
@@ -482,7 +479,7 @@
 
11918
          return;
 
11919
        }
 
11920
       else
 
11921
-       retarray->base_addr = xmalloc (alloc_size);
 
11922
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
11923
     }
 
11924
   else
 
11925
     {
 
11926
Index: libgfortran/generated/product_c10.c
 
11927
===================================================================
 
11928
--- a/src/libgfortran/generated/product_c10.c   (.../tags/gcc_4_8_3_release)
 
11929
+++ b/src/libgfortran/generated/product_c10.c   (.../branches/gcc-4_8-branch)
 
11930
@@ -97,10 +97,9 @@
 
11931
       retarray->offset = 0;
 
11932
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11933
 
 
11934
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11935
-                  * extent[rank-1];
 
11936
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11937
 
 
11938
-      retarray->base_addr = xmalloc (alloc_size);
 
11939
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
11940
       if (alloc_size == 0)
 
11941
        {
 
11942
          /* Make sure we have a zero-sized array.  */
 
11943
@@ -272,8 +271,7 @@
 
11944
 
 
11945
        }
 
11946
 
 
11947
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11948
-                  * extent[rank-1];
 
11949
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11950
 
 
11951
       retarray->offset = 0;
 
11952
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11953
@@ -285,7 +283,7 @@
 
11954
          return;
 
11955
        }
 
11956
       else
 
11957
-       retarray->base_addr = xmalloc (alloc_size);
 
11958
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
11959
 
 
11960
     }
 
11961
   else
 
11962
@@ -430,8 +428,7 @@
 
11963
       retarray->offset = 0;
 
11964
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11965
 
 
11966
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11967
-                  * extent[rank-1];
 
11968
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11969
 
 
11970
       if (alloc_size == 0)
 
11971
        {
 
11972
@@ -440,7 +437,7 @@
 
11973
          return;
 
11974
        }
 
11975
       else
 
11976
-       retarray->base_addr = xmalloc (alloc_size);
 
11977
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
11978
     }
 
11979
   else
 
11980
     {
 
11981
Index: libgfortran/generated/minloc1_8_i4.c
 
11982
===================================================================
 
11983
--- a/src/libgfortran/generated/minloc1_8_i4.c  (.../tags/gcc_4_8_3_release)
 
11984
+++ b/src/libgfortran/generated/minloc1_8_i4.c  (.../branches/gcc-4_8-branch)
 
11985
@@ -98,10 +98,9 @@
 
11986
       retarray->offset = 0;
 
11987
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11988
 
 
11989
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11990
-                  * extent[rank-1];
 
11991
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11992
 
 
11993
-      retarray->base_addr = xmalloc (alloc_size);
 
11994
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11995
       if (alloc_size == 0)
 
11996
        {
 
11997
          /* Make sure we have a zero-sized array.  */
 
11998
@@ -294,8 +293,7 @@
 
11999
 
 
12000
        }
 
12001
 
 
12002
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12003
-                  * extent[rank-1];
 
12004
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12005
 
 
12006
       retarray->offset = 0;
 
12007
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12008
@@ -307,7 +305,7 @@
 
12009
          return;
 
12010
        }
 
12011
       else
 
12012
-       retarray->base_addr = xmalloc (alloc_size);
 
12013
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12014
 
 
12015
     }
 
12016
   else
 
12017
@@ -485,8 +483,7 @@
 
12018
       retarray->offset = 0;
 
12019
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12020
 
 
12021
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12022
-                  * extent[rank-1];
 
12023
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12024
 
 
12025
       if (alloc_size == 0)
 
12026
        {
 
12027
@@ -495,7 +492,7 @@
 
12028
          return;
 
12029
        }
 
12030
       else
 
12031
-       retarray->base_addr = xmalloc (alloc_size);
 
12032
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12033
     }
 
12034
   else
 
12035
     {
 
12036
Index: libgfortran/generated/minloc0_16_i16.c
 
12037
===================================================================
 
12038
--- a/src/libgfortran/generated/minloc0_16_i16.c        (.../tags/gcc_4_8_3_release)
 
12039
+++ b/src/libgfortran/generated/minloc0_16_i16.c        (.../branches/gcc-4_8-branch)
 
12040
@@ -58,7 +58,7 @@
 
12041
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12042
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12043
       retarray->offset = 0;
 
12044
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12045
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12046
     }
 
12047
   else
 
12048
     {
 
12049
@@ -199,7 +199,7 @@
 
12050
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12051
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12052
       retarray->offset = 0;
 
12053
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12054
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12055
     }
 
12056
   else
 
12057
     {
 
12058
@@ -367,7 +367,7 @@
 
12059
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12060
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12061
       retarray->offset = 0;
 
12062
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12063
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12064
     }
 
12065
   else if (unlikely (compile_options.bounds_check))
 
12066
     {
 
12067
Index: libgfortran/generated/matmul_r16.c
 
12068
===================================================================
 
12069
--- a/src/libgfortran/generated/matmul_r16.c    (.../tags/gcc_4_8_3_release)
 
12070
+++ b/src/libgfortran/generated/matmul_r16.c    (.../branches/gcc-4_8-branch)
 
12071
@@ -124,7 +124,7 @@
 
12072
         }
 
12073
 
 
12074
       retarray->base_addr
 
12075
-       = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
 
12076
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_16));
 
12077
       retarray->offset = 0;
 
12078
     }
 
12079
     else if (unlikely (compile_options.bounds_check))
 
12080
Index: libgfortran/generated/minloc0_4_r4.c
 
12081
===================================================================
 
12082
--- a/src/libgfortran/generated/minloc0_4_r4.c  (.../tags/gcc_4_8_3_release)
 
12083
+++ b/src/libgfortran/generated/minloc0_4_r4.c  (.../branches/gcc-4_8-branch)
 
12084
@@ -58,7 +58,7 @@
 
12085
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12086
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12087
       retarray->offset = 0;
 
12088
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12089
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12090
     }
 
12091
   else
 
12092
     {
 
12093
@@ -199,7 +199,7 @@
 
12094
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12095
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12096
       retarray->offset = 0;
 
12097
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12098
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12099
     }
 
12100
   else
 
12101
     {
 
12102
@@ -367,7 +367,7 @@
 
12103
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12104
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12105
       retarray->offset = 0;
 
12106
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12107
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12108
     }
 
12109
   else if (unlikely (compile_options.bounds_check))
 
12110
     {
 
12111
Index: libgfortran/generated/iany_i2.c
 
12112
===================================================================
 
12113
--- a/src/libgfortran/generated/iany_i2.c       (.../tags/gcc_4_8_3_release)
 
12114
+++ b/src/libgfortran/generated/iany_i2.c       (.../branches/gcc-4_8-branch)
 
12115
@@ -97,10 +97,9 @@
 
12116
       retarray->offset = 0;
 
12117
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12118
 
 
12119
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12120
-                  * extent[rank-1];
 
12121
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12122
 
 
12123
-      retarray->base_addr = xmalloc (alloc_size);
 
12124
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12125
       if (alloc_size == 0)
 
12126
        {
 
12127
          /* Make sure we have a zero-sized array.  */
 
12128
@@ -272,8 +271,7 @@
 
12129
 
 
12130
        }
 
12131
 
 
12132
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12133
-                  * extent[rank-1];
 
12134
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12135
 
 
12136
       retarray->offset = 0;
 
12137
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12138
@@ -285,7 +283,7 @@
 
12139
          return;
 
12140
        }
 
12141
       else
 
12142
-       retarray->base_addr = xmalloc (alloc_size);
 
12143
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12144
 
 
12145
     }
 
12146
   else
 
12147
@@ -430,8 +428,7 @@
 
12148
       retarray->offset = 0;
 
12149
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12150
 
 
12151
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12152
-                  * extent[rank-1];
 
12153
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12154
 
 
12155
       if (alloc_size == 0)
 
12156
        {
 
12157
@@ -440,7 +437,7 @@
 
12158
          return;
 
12159
        }
 
12160
       else
 
12161
-       retarray->base_addr = xmalloc (alloc_size);
 
12162
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12163
     }
 
12164
   else
 
12165
     {
 
12166
Index: libgfortran/generated/sum_r4.c
 
12167
===================================================================
 
12168
--- a/src/libgfortran/generated/sum_r4.c        (.../tags/gcc_4_8_3_release)
 
12169
+++ b/src/libgfortran/generated/sum_r4.c        (.../branches/gcc-4_8-branch)
 
12170
@@ -97,10 +97,9 @@
 
12171
       retarray->offset = 0;
 
12172
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12173
 
 
12174
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12175
-                  * extent[rank-1];
 
12176
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12177
 
 
12178
-      retarray->base_addr = xmalloc (alloc_size);
 
12179
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
12180
       if (alloc_size == 0)
 
12181
        {
 
12182
          /* Make sure we have a zero-sized array.  */
 
12183
@@ -272,8 +271,7 @@
 
12184
 
 
12185
        }
 
12186
 
 
12187
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12188
-                  * extent[rank-1];
 
12189
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12190
 
 
12191
       retarray->offset = 0;
 
12192
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12193
@@ -285,7 +283,7 @@
 
12194
          return;
 
12195
        }
 
12196
       else
 
12197
-       retarray->base_addr = xmalloc (alloc_size);
 
12198
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
12199
 
 
12200
     }
 
12201
   else
 
12202
@@ -430,8 +428,7 @@
 
12203
       retarray->offset = 0;
 
12204
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12205
 
 
12206
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12207
-                  * extent[rank-1];
 
12208
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12209
 
 
12210
       if (alloc_size == 0)
 
12211
        {
 
12212
@@ -440,7 +437,7 @@
 
12213
          return;
 
12214
        }
 
12215
       else
 
12216
-       retarray->base_addr = xmalloc (alloc_size);
 
12217
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
12218
     }
 
12219
   else
 
12220
     {
 
12221
Index: libgfortran/generated/unpack_c8.c
 
12222
===================================================================
 
12223
--- a/src/libgfortran/generated/unpack_c8.c     (.../tags/gcc_4_8_3_release)
 
12224
+++ b/src/libgfortran/generated/unpack_c8.c     (.../branches/gcc-4_8-branch)
 
12225
@@ -99,7 +99,7 @@
 
12226
          rs *= extent[n];
 
12227
        }
 
12228
       ret->offset = 0;
 
12229
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
 
12230
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
 
12231
     }
 
12232
   else
 
12233
     {
 
12234
@@ -244,7 +244,7 @@
 
12235
          rs *= extent[n];
 
12236
        }
 
12237
       ret->offset = 0;
 
12238
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
 
12239
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
 
12240
     }
 
12241
   else
 
12242
     {
 
12243
Index: libgfortran/generated/in_pack_c16.c
 
12244
===================================================================
 
12245
--- a/src/libgfortran/generated/in_pack_c16.c   (.../tags/gcc_4_8_3_release)
 
12246
+++ b/src/libgfortran/generated/in_pack_c16.c   (.../branches/gcc-4_8-branch)
 
12247
@@ -76,7 +76,7 @@
 
12248
     return source->base_addr;
 
12249
 
 
12250
   /* Allocate storage for the destination.  */
 
12251
-  destptr = (GFC_COMPLEX_16 *)xmalloc (ssize * sizeof (GFC_COMPLEX_16));
 
12252
+  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_16));
 
12253
   dest = destptr;
 
12254
   src = source->base_addr;
 
12255
   stride0 = stride[0];
 
12256
Index: libgfortran/generated/minloc0_4_i2.c
 
12257
===================================================================
 
12258
--- a/src/libgfortran/generated/minloc0_4_i2.c  (.../tags/gcc_4_8_3_release)
 
12259
+++ b/src/libgfortran/generated/minloc0_4_i2.c  (.../branches/gcc-4_8-branch)
 
12260
@@ -58,7 +58,7 @@
 
12261
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12262
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12263
       retarray->offset = 0;
 
12264
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12265
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12266
     }
 
12267
   else
 
12268
     {
 
12269
@@ -199,7 +199,7 @@
 
12270
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12271
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12272
       retarray->offset = 0;
 
12273
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12274
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12275
     }
 
12276
   else
 
12277
     {
 
12278
@@ -367,7 +367,7 @@
 
12279
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12280
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12281
       retarray->offset = 0;
 
12282
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12283
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12284
     }
 
12285
   else if (unlikely (compile_options.bounds_check))
 
12286
     {
 
12287
Index: libgfortran/generated/spread_c10.c
 
12288
===================================================================
 
12289
--- a/src/libgfortran/generated/spread_c10.c    (.../tags/gcc_4_8_3_release)
 
12290
+++ b/src/libgfortran/generated/spread_c10.c    (.../branches/gcc-4_8-branch)
 
12291
@@ -101,8 +101,8 @@
 
12292
        }
 
12293
       ret->offset = 0;
 
12294
 
 
12295
-      /* xmalloc allocates a single byte for zero size.  */
 
12296
-      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_10));
 
12297
+      /* xmallocarray allocates a single byte for zero size.  */
 
12298
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_10));
 
12299
       if (rs <= 0)
 
12300
         return;
 
12301
     }
 
12302
@@ -244,7 +244,7 @@
 
12303
 
 
12304
   if (ret->base_addr == NULL)
 
12305
     {
 
12306
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_10));
 
12307
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_10));
 
12308
       ret->offset = 0;
 
12309
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
12310
     }
 
12311
Index: libgfortran/generated/maxloc0_8_i1.c
 
12312
===================================================================
 
12313
--- a/src/libgfortran/generated/maxloc0_8_i1.c  (.../tags/gcc_4_8_3_release)
 
12314
+++ b/src/libgfortran/generated/maxloc0_8_i1.c  (.../branches/gcc-4_8-branch)
 
12315
@@ -58,7 +58,7 @@
 
12316
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12317
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12318
       retarray->offset = 0;
 
12319
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12320
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12321
     }
 
12322
   else
 
12323
     {
 
12324
@@ -199,7 +199,7 @@
 
12325
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12326
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12327
       retarray->offset = 0;
 
12328
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12329
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12330
     }
 
12331
   else
 
12332
     {
 
12333
@@ -367,7 +367,7 @@
 
12334
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12335
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12336
       retarray->offset = 0;
 
12337
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12338
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12339
     }
 
12340
   else if (unlikely (compile_options.bounds_check))
 
12341
     {
 
12342
Index: libgfortran/generated/spread_r4.c
 
12343
===================================================================
 
12344
--- a/src/libgfortran/generated/spread_r4.c     (.../tags/gcc_4_8_3_release)
 
12345
+++ b/src/libgfortran/generated/spread_r4.c     (.../branches/gcc-4_8-branch)
 
12346
@@ -101,8 +101,8 @@
 
12347
        }
 
12348
       ret->offset = 0;
 
12349
 
 
12350
-      /* xmalloc allocates a single byte for zero size.  */
 
12351
-      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4));
 
12352
+      /* xmallocarray allocates a single byte for zero size.  */
 
12353
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4));
 
12354
       if (rs <= 0)
 
12355
         return;
 
12356
     }
 
12357
@@ -244,7 +244,7 @@
 
12358
 
 
12359
   if (ret->base_addr == NULL)
 
12360
     {
 
12361
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4));
 
12362
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4));
 
12363
       ret->offset = 0;
 
12364
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
12365
     }
 
12366
Index: libgfortran/generated/minloc0_8_i8.c
 
12367
===================================================================
 
12368
--- a/src/libgfortran/generated/minloc0_8_i8.c  (.../tags/gcc_4_8_3_release)
 
12369
+++ b/src/libgfortran/generated/minloc0_8_i8.c  (.../branches/gcc-4_8-branch)
 
12370
@@ -58,7 +58,7 @@
 
12371
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12372
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12373
       retarray->offset = 0;
 
12374
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12375
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12376
     }
 
12377
   else
 
12378
     {
 
12379
@@ -199,7 +199,7 @@
 
12380
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12381
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12382
       retarray->offset = 0;
 
12383
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12384
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12385
     }
 
12386
   else
 
12387
     {
 
12388
@@ -367,7 +367,7 @@
 
12389
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12390
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12391
       retarray->offset = 0;
 
12392
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12393
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12394
     }
 
12395
   else if (unlikely (compile_options.bounds_check))
 
12396
     {
 
12397
Index: libgfortran/generated/matmul_c8.c
 
12398
===================================================================
 
12399
--- a/src/libgfortran/generated/matmul_c8.c     (.../tags/gcc_4_8_3_release)
 
12400
+++ b/src/libgfortran/generated/matmul_c8.c     (.../branches/gcc-4_8-branch)
 
12401
@@ -124,7 +124,7 @@
 
12402
         }
 
12403
 
 
12404
       retarray->base_addr
 
12405
-       = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
 
12406
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_8));
 
12407
       retarray->offset = 0;
 
12408
     }
 
12409
     else if (unlikely (compile_options.bounds_check))
 
12410
Index: libgfortran/generated/minloc1_16_r10.c
 
12411
===================================================================
 
12412
--- a/src/libgfortran/generated/minloc1_16_r10.c        (.../tags/gcc_4_8_3_release)
 
12413
+++ b/src/libgfortran/generated/minloc1_16_r10.c        (.../branches/gcc-4_8-branch)
 
12414
@@ -98,10 +98,9 @@
 
12415
       retarray->offset = 0;
 
12416
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12417
 
 
12418
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12419
-                  * extent[rank-1];
 
12420
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12421
 
 
12422
-      retarray->base_addr = xmalloc (alloc_size);
 
12423
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12424
       if (alloc_size == 0)
 
12425
        {
 
12426
          /* Make sure we have a zero-sized array.  */
 
12427
@@ -294,8 +293,7 @@
 
12428
 
 
12429
        }
 
12430
 
 
12431
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12432
-                  * extent[rank-1];
 
12433
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12434
 
 
12435
       retarray->offset = 0;
 
12436
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12437
@@ -307,7 +305,7 @@
 
12438
          return;
 
12439
        }
 
12440
       else
 
12441
-       retarray->base_addr = xmalloc (alloc_size);
 
12442
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12443
 
 
12444
     }
 
12445
   else
 
12446
@@ -485,8 +483,7 @@
 
12447
       retarray->offset = 0;
 
12448
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12449
 
 
12450
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12451
-                  * extent[rank-1];
 
12452
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12453
 
 
12454
       if (alloc_size == 0)
 
12455
        {
 
12456
@@ -495,7 +492,7 @@
 
12457
          return;
 
12458
        }
 
12459
       else
 
12460
-       retarray->base_addr = xmalloc (alloc_size);
 
12461
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12462
     }
 
12463
   else
 
12464
     {
 
12465
Index: libgfortran/generated/sum_i2.c
 
12466
===================================================================
 
12467
--- a/src/libgfortran/generated/sum_i2.c        (.../tags/gcc_4_8_3_release)
 
12468
+++ b/src/libgfortran/generated/sum_i2.c        (.../branches/gcc-4_8-branch)
 
12469
@@ -97,10 +97,9 @@
 
12470
       retarray->offset = 0;
 
12471
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12472
 
 
12473
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12474
-                  * extent[rank-1];
 
12475
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12476
 
 
12477
-      retarray->base_addr = xmalloc (alloc_size);
 
12478
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12479
       if (alloc_size == 0)
 
12480
        {
 
12481
          /* Make sure we have a zero-sized array.  */
 
12482
@@ -272,8 +271,7 @@
 
12483
 
 
12484
        }
 
12485
 
 
12486
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12487
-                  * extent[rank-1];
 
12488
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12489
 
 
12490
       retarray->offset = 0;
 
12491
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12492
@@ -285,7 +283,7 @@
 
12493
          return;
 
12494
        }
 
12495
       else
 
12496
-       retarray->base_addr = xmalloc (alloc_size);
 
12497
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12498
 
 
12499
     }
 
12500
   else
 
12501
@@ -430,8 +428,7 @@
 
12502
       retarray->offset = 0;
 
12503
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12504
 
 
12505
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12506
-                  * extent[rank-1];
 
12507
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12508
 
 
12509
       if (alloc_size == 0)
 
12510
        {
 
12511
@@ -440,7 +437,7 @@
 
12512
          return;
 
12513
        }
 
12514
       else
 
12515
-       retarray->base_addr = xmalloc (alloc_size);
 
12516
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12517
     }
 
12518
   else
 
12519
     {
 
12520
Index: libgfortran/generated/iparity_i16.c
 
12521
===================================================================
 
12522
--- a/src/libgfortran/generated/iparity_i16.c   (.../tags/gcc_4_8_3_release)
 
12523
+++ b/src/libgfortran/generated/iparity_i16.c   (.../branches/gcc-4_8-branch)
 
12524
@@ -97,10 +97,9 @@
 
12525
       retarray->offset = 0;
 
12526
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12527
 
 
12528
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12529
-                  * extent[rank-1];
 
12530
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12531
 
 
12532
-      retarray->base_addr = xmalloc (alloc_size);
 
12533
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12534
       if (alloc_size == 0)
 
12535
        {
 
12536
          /* Make sure we have a zero-sized array.  */
 
12537
@@ -272,8 +271,7 @@
 
12538
 
 
12539
        }
 
12540
 
 
12541
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12542
-                  * extent[rank-1];
 
12543
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12544
 
 
12545
       retarray->offset = 0;
 
12546
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12547
@@ -285,7 +283,7 @@
 
12548
          return;
 
12549
        }
 
12550
       else
 
12551
-       retarray->base_addr = xmalloc (alloc_size);
 
12552
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12553
 
 
12554
     }
 
12555
   else
 
12556
@@ -430,8 +428,7 @@
 
12557
       retarray->offset = 0;
 
12558
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12559
 
 
12560
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12561
-                  * extent[rank-1];
 
12562
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12563
 
 
12564
       if (alloc_size == 0)
 
12565
        {
 
12566
@@ -440,7 +437,7 @@
 
12567
          return;
 
12568
        }
 
12569
       else
 
12570
-       retarray->base_addr = xmalloc (alloc_size);
 
12571
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12572
     }
 
12573
   else
 
12574
     {
 
12575
Index: libgfortran/generated/minloc0_16_i1.c
 
12576
===================================================================
 
12577
--- a/src/libgfortran/generated/minloc0_16_i1.c (.../tags/gcc_4_8_3_release)
 
12578
+++ b/src/libgfortran/generated/minloc0_16_i1.c (.../branches/gcc-4_8-branch)
 
12579
@@ -58,7 +58,7 @@
 
12580
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12581
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12582
       retarray->offset = 0;
 
12583
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12584
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12585
     }
 
12586
   else
 
12587
     {
 
12588
@@ -199,7 +199,7 @@
 
12589
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12590
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12591
       retarray->offset = 0;
 
12592
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12593
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12594
     }
 
12595
   else
 
12596
     {
 
12597
@@ -367,7 +367,7 @@
 
12598
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12599
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12600
       retarray->offset = 0;
 
12601
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12602
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12603
     }
 
12604
   else if (unlikely (compile_options.bounds_check))
 
12605
     {
 
12606
Index: libgfortran/generated/reshape_c16.c
 
12607
===================================================================
 
12608
--- a/src/libgfortran/generated/reshape_c16.c   (.../tags/gcc_4_8_3_release)
 
12609
+++ b/src/libgfortran/generated/reshape_c16.c   (.../branches/gcc-4_8-branch)
 
12610
@@ -111,11 +111,11 @@
 
12611
       ret->offset = 0;
 
12612
 
 
12613
       if (unlikely (rs < 1))
 
12614
-        alloc_size = 1;
 
12615
+        alloc_size = 0;
 
12616
       else
 
12617
-        alloc_size = rs * sizeof (GFC_COMPLEX_16);
 
12618
+        alloc_size = rs;
 
12619
 
 
12620
-      ret->base_addr = xmalloc (alloc_size);
 
12621
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
12622
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
12623
     }
 
12624
 
 
12625
Index: libgfortran/generated/pack_c4.c
 
12626
===================================================================
 
12627
--- a/src/libgfortran/generated/pack_c4.c       (.../tags/gcc_4_8_3_release)
 
12628
+++ b/src/libgfortran/generated/pack_c4.c       (.../branches/gcc-4_8-branch)
 
12629
@@ -167,8 +167,8 @@
 
12630
 
 
12631
          ret->offset = 0;
 
12632
 
 
12633
-         /* xmalloc allocates a single byte for zero size.  */
 
12634
-         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * total);
 
12635
+         /* xmallocarray allocates a single byte for zero size.  */
 
12636
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_4));
 
12637
 
 
12638
          if (total == 0)
 
12639
            return;
 
12640
Index: libgfortran/generated/parity_l4.c
 
12641
===================================================================
 
12642
--- a/src/libgfortran/generated/parity_l4.c     (.../tags/gcc_4_8_3_release)
 
12643
+++ b/src/libgfortran/generated/parity_l4.c     (.../branches/gcc-4_8-branch)
 
12644
@@ -98,10 +98,9 @@
 
12645
       retarray->offset = 0;
 
12646
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12647
 
 
12648
-      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12649
-                  * extent[rank-1];
 
12650
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12651
 
 
12652
-      retarray->base_addr = xmalloc (alloc_size);
 
12653
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
 
12654
       if (alloc_size == 0)
 
12655
        {
 
12656
          /* Make sure we have a zero-sized array.  */
 
12657
Index: libgfortran/generated/spread_i2.c
 
12658
===================================================================
 
12659
--- a/src/libgfortran/generated/spread_i2.c     (.../tags/gcc_4_8_3_release)
 
12660
+++ b/src/libgfortran/generated/spread_i2.c     (.../branches/gcc-4_8-branch)
 
12661
@@ -101,8 +101,8 @@
 
12662
        }
 
12663
       ret->offset = 0;
 
12664
 
 
12665
-      /* xmalloc allocates a single byte for zero size.  */
 
12666
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_2));
 
12667
+      /* xmallocarray allocates a single byte for zero size.  */
 
12668
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_2));
 
12669
       if (rs <= 0)
 
12670
         return;
 
12671
     }
 
12672
@@ -244,7 +244,7 @@
 
12673
 
 
12674
   if (ret->base_addr == NULL)
 
12675
     {
 
12676
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_2));
 
12677
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_2));
 
12678
       ret->offset = 0;
 
12679
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
12680
     }
 
12681
Index: libgfortran/generated/any_l4.c
 
12682
===================================================================
 
12683
--- a/src/libgfortran/generated/any_l4.c        (.../tags/gcc_4_8_3_release)
 
12684
+++ b/src/libgfortran/generated/any_l4.c        (.../branches/gcc-4_8-branch)
 
12685
@@ -101,8 +101,7 @@
 
12686
       retarray->offset = 0;
 
12687
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12688
 
 
12689
-      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12690
-                  * extent[rank-1];
 
12691
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12692
 
 
12693
       if (alloc_size == 0)
 
12694
        {
 
12695
@@ -111,7 +110,7 @@
 
12696
          return;
 
12697
        }
 
12698
       else
 
12699
-       retarray->base_addr = xmalloc (alloc_size);
 
12700
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
 
12701
     }
 
12702
   else
 
12703
     {
 
12704
Index: libgfortran/generated/maxloc1_4_i8.c
 
12705
===================================================================
 
12706
--- a/src/libgfortran/generated/maxloc1_4_i8.c  (.../tags/gcc_4_8_3_release)
 
12707
+++ b/src/libgfortran/generated/maxloc1_4_i8.c  (.../branches/gcc-4_8-branch)
 
12708
@@ -98,10 +98,9 @@
 
12709
       retarray->offset = 0;
 
12710
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12711
 
 
12712
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12713
-                  * extent[rank-1];
 
12714
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12715
 
 
12716
-      retarray->base_addr = xmalloc (alloc_size);
 
12717
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12718
       if (alloc_size == 0)
 
12719
        {
 
12720
          /* Make sure we have a zero-sized array.  */
 
12721
@@ -294,8 +293,7 @@
 
12722
 
 
12723
        }
 
12724
 
 
12725
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12726
-                  * extent[rank-1];
 
12727
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12728
 
 
12729
       retarray->offset = 0;
 
12730
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12731
@@ -307,7 +305,7 @@
 
12732
          return;
 
12733
        }
 
12734
       else
 
12735
-       retarray->base_addr = xmalloc (alloc_size);
 
12736
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12737
 
 
12738
     }
 
12739
   else
 
12740
@@ -485,8 +483,7 @@
 
12741
       retarray->offset = 0;
 
12742
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12743
 
 
12744
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12745
-                  * extent[rank-1];
 
12746
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12747
 
 
12748
       if (alloc_size == 0)
 
12749
        {
 
12750
@@ -495,7 +492,7 @@
 
12751
          return;
 
12752
        }
 
12753
       else
 
12754
-       retarray->base_addr = xmalloc (alloc_size);
 
12755
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12756
     }
 
12757
   else
 
12758
     {
 
12759
Index: libgfortran/generated/maxloc0_8_r4.c
 
12760
===================================================================
 
12761
--- a/src/libgfortran/generated/maxloc0_8_r4.c  (.../tags/gcc_4_8_3_release)
 
12762
+++ b/src/libgfortran/generated/maxloc0_8_r4.c  (.../branches/gcc-4_8-branch)
 
12763
@@ -58,7 +58,7 @@
 
12764
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12765
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12766
       retarray->offset = 0;
 
12767
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12768
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12769
     }
 
12770
   else
 
12771
     {
 
12772
@@ -199,7 +199,7 @@
 
12773
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12774
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12775
       retarray->offset = 0;
 
12776
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12777
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12778
     }
 
12779
   else
 
12780
     {
 
12781
@@ -367,7 +367,7 @@
 
12782
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12783
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12784
       retarray->offset = 0;
 
12785
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12786
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12787
     }
 
12788
   else if (unlikely (compile_options.bounds_check))
 
12789
     {
 
12790
Index: libgfortran/generated/maxloc1_4_i16.c
 
12791
===================================================================
 
12792
--- a/src/libgfortran/generated/maxloc1_4_i16.c (.../tags/gcc_4_8_3_release)
 
12793
+++ b/src/libgfortran/generated/maxloc1_4_i16.c (.../branches/gcc-4_8-branch)
 
12794
@@ -98,10 +98,9 @@
 
12795
       retarray->offset = 0;
 
12796
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12797
 
 
12798
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12799
-                  * extent[rank-1];
 
12800
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12801
 
 
12802
-      retarray->base_addr = xmalloc (alloc_size);
 
12803
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12804
       if (alloc_size == 0)
 
12805
        {
 
12806
          /* Make sure we have a zero-sized array.  */
 
12807
@@ -294,8 +293,7 @@
 
12808
 
 
12809
        }
 
12810
 
 
12811
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12812
-                  * extent[rank-1];
 
12813
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12814
 
 
12815
       retarray->offset = 0;
 
12816
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12817
@@ -307,7 +305,7 @@
 
12818
          return;
 
12819
        }
 
12820
       else
 
12821
-       retarray->base_addr = xmalloc (alloc_size);
 
12822
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12823
 
 
12824
     }
 
12825
   else
 
12826
@@ -485,8 +483,7 @@
 
12827
       retarray->offset = 0;
 
12828
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12829
 
 
12830
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12831
-                  * extent[rank-1];
 
12832
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12833
 
 
12834
       if (alloc_size == 0)
 
12835
        {
 
12836
@@ -495,7 +492,7 @@
 
12837
          return;
 
12838
        }
 
12839
       else
 
12840
-       retarray->base_addr = xmalloc (alloc_size);
 
12841
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12842
     }
 
12843
   else
 
12844
     {
 
12845
Index: libgfortran/generated/minloc0_4_r10.c
 
12846
===================================================================
 
12847
--- a/src/libgfortran/generated/minloc0_4_r10.c (.../tags/gcc_4_8_3_release)
 
12848
+++ b/src/libgfortran/generated/minloc0_4_r10.c (.../branches/gcc-4_8-branch)
 
12849
@@ -58,7 +58,7 @@
 
12850
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12851
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12852
       retarray->offset = 0;
 
12853
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12854
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12855
     }
 
12856
   else
 
12857
     {
 
12858
@@ -199,7 +199,7 @@
 
12859
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12860
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12861
       retarray->offset = 0;
 
12862
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12863
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12864
     }
 
12865
   else
 
12866
     {
 
12867
@@ -367,7 +367,7 @@
 
12868
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12869
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12870
       retarray->offset = 0;
 
12871
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12872
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12873
     }
 
12874
   else if (unlikely (compile_options.bounds_check))
 
12875
     {
 
12876
Index: libgfortran/generated/minloc0_8_i16.c
 
12877
===================================================================
 
12878
--- a/src/libgfortran/generated/minloc0_8_i16.c (.../tags/gcc_4_8_3_release)
 
12879
+++ b/src/libgfortran/generated/minloc0_8_i16.c (.../branches/gcc-4_8-branch)
 
12880
@@ -58,7 +58,7 @@
 
12881
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12882
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12883
       retarray->offset = 0;
 
12884
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12885
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12886
     }
 
12887
   else
 
12888
     {
 
12889
@@ -199,7 +199,7 @@
 
12890
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12891
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12892
       retarray->offset = 0;
 
12893
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12894
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12895
     }
 
12896
   else
 
12897
     {
 
12898
@@ -367,7 +367,7 @@
 
12899
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12900
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12901
       retarray->offset = 0;
 
12902
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12903
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12904
     }
 
12905
   else if (unlikely (compile_options.bounds_check))
 
12906
     {
 
12907
Index: libgfortran/generated/minloc1_8_r10.c
 
12908
===================================================================
 
12909
--- a/src/libgfortran/generated/minloc1_8_r10.c (.../tags/gcc_4_8_3_release)
 
12910
+++ b/src/libgfortran/generated/minloc1_8_r10.c (.../branches/gcc-4_8-branch)
 
12911
@@ -98,10 +98,9 @@
 
12912
       retarray->offset = 0;
 
12913
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12914
 
 
12915
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12916
-                  * extent[rank-1];
 
12917
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12918
 
 
12919
-      retarray->base_addr = xmalloc (alloc_size);
 
12920
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12921
       if (alloc_size == 0)
 
12922
        {
 
12923
          /* Make sure we have a zero-sized array.  */
 
12924
@@ -294,8 +293,7 @@
 
12925
 
 
12926
        }
 
12927
 
 
12928
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12929
-                  * extent[rank-1];
 
12930
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12931
 
 
12932
       retarray->offset = 0;
 
12933
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12934
@@ -307,7 +305,7 @@
 
12935
          return;
 
12936
        }
 
12937
       else
 
12938
-       retarray->base_addr = xmalloc (alloc_size);
 
12939
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12940
 
 
12941
     }
 
12942
   else
 
12943
@@ -485,8 +483,7 @@
 
12944
       retarray->offset = 0;
 
12945
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12946
 
 
12947
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12948
-                  * extent[rank-1];
 
12949
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12950
 
 
12951
       if (alloc_size == 0)
 
12952
        {
 
12953
@@ -495,7 +492,7 @@
 
12954
          return;
 
12955
        }
 
12956
       else
 
12957
-       retarray->base_addr = xmalloc (alloc_size);
 
12958
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12959
     }
 
12960
   else
 
12961
     {
 
12962
Index: libgfortran/generated/minloc0_16_r4.c
 
12963
===================================================================
 
12964
--- a/src/libgfortran/generated/minloc0_16_r4.c (.../tags/gcc_4_8_3_release)
 
12965
+++ b/src/libgfortran/generated/minloc0_16_r4.c (.../branches/gcc-4_8-branch)
 
12966
@@ -58,7 +58,7 @@
 
12967
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12968
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12969
       retarray->offset = 0;
 
12970
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12971
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12972
     }
 
12973
   else
 
12974
     {
 
12975
@@ -199,7 +199,7 @@
 
12976
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12977
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12978
       retarray->offset = 0;
 
12979
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12980
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12981
     }
 
12982
   else
 
12983
     {
 
12984
@@ -367,7 +367,7 @@
 
12985
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12986
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12987
       retarray->offset = 0;
 
12988
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12989
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12990
     }
 
12991
   else if (unlikely (compile_options.bounds_check))
 
12992
     {
 
12993
Index: libgfortran/generated/product_i4.c
 
12994
===================================================================
 
12995
--- a/src/libgfortran/generated/product_i4.c    (.../tags/gcc_4_8_3_release)
 
12996
+++ b/src/libgfortran/generated/product_i4.c    (.../branches/gcc-4_8-branch)
 
12997
@@ -97,10 +97,9 @@
 
12998
       retarray->offset = 0;
 
12999
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13000
 
 
13001
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13002
-                  * extent[rank-1];
 
13003
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13004
 
 
13005
-      retarray->base_addr = xmalloc (alloc_size);
 
13006
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13007
       if (alloc_size == 0)
 
13008
        {
 
13009
          /* Make sure we have a zero-sized array.  */
 
13010
@@ -272,8 +271,7 @@
 
13011
 
 
13012
        }
 
13013
 
 
13014
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13015
-                  * extent[rank-1];
 
13016
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13017
 
 
13018
       retarray->offset = 0;
 
13019
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13020
@@ -285,7 +283,7 @@
 
13021
          return;
 
13022
        }
 
13023
       else
 
13024
-       retarray->base_addr = xmalloc (alloc_size);
 
13025
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13026
 
 
13027
     }
 
13028
   else
 
13029
@@ -430,8 +428,7 @@
 
13030
       retarray->offset = 0;
 
13031
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13032
 
 
13033
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13034
-                  * extent[rank-1];
 
13035
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13036
 
 
13037
       if (alloc_size == 0)
 
13038
        {
 
13039
@@ -440,7 +437,7 @@
 
13040
          return;
 
13041
        }
 
13042
       else
 
13043
-       retarray->base_addr = xmalloc (alloc_size);
 
13044
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13045
     }
 
13046
   else
 
13047
     {
 
13048
Index: libgfortran/generated/sum_c16.c
 
13049
===================================================================
 
13050
--- a/src/libgfortran/generated/sum_c16.c       (.../tags/gcc_4_8_3_release)
 
13051
+++ b/src/libgfortran/generated/sum_c16.c       (.../branches/gcc-4_8-branch)
 
13052
@@ -97,10 +97,9 @@
 
13053
       retarray->offset = 0;
 
13054
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13055
 
 
13056
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13057
-                  * extent[rank-1];
 
13058
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13059
 
 
13060
-      retarray->base_addr = xmalloc (alloc_size);
 
13061
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
13062
       if (alloc_size == 0)
 
13063
        {
 
13064
          /* Make sure we have a zero-sized array.  */
 
13065
@@ -272,8 +271,7 @@
 
13066
 
 
13067
        }
 
13068
 
 
13069
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13070
-                  * extent[rank-1];
 
13071
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13072
 
 
13073
       retarray->offset = 0;
 
13074
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13075
@@ -285,7 +283,7 @@
 
13076
          return;
 
13077
        }
 
13078
       else
 
13079
-       retarray->base_addr = xmalloc (alloc_size);
 
13080
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
13081
 
 
13082
     }
 
13083
   else
 
13084
@@ -430,8 +428,7 @@
 
13085
       retarray->offset = 0;
 
13086
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13087
 
 
13088
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13089
-                  * extent[rank-1];
 
13090
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13091
 
 
13092
       if (alloc_size == 0)
 
13093
        {
 
13094
@@ -440,7 +437,7 @@
 
13095
          return;
 
13096
        }
 
13097
       else
 
13098
-       retarray->base_addr = xmalloc (alloc_size);
 
13099
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
13100
     }
 
13101
   else
 
13102
     {
 
13103
Index: libgfortran/generated/transpose_c10.c
 
13104
===================================================================
 
13105
--- a/src/libgfortran/generated/transpose_c10.c (.../tags/gcc_4_8_3_release)
 
13106
+++ b/src/libgfortran/generated/transpose_c10.c (.../branches/gcc-4_8-branch)
 
13107
@@ -60,7 +60,8 @@
 
13108
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
13109
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
13110
 
 
13111
-      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
 
13112
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
13113
+                                     sizeof (GFC_COMPLEX_10));
 
13114
       ret->offset = 0;
 
13115
     } else if (unlikely (compile_options.bounds_check))
 
13116
     {
 
13117
Index: libgfortran/generated/maxloc1_16_r8.c
 
13118
===================================================================
 
13119
--- a/src/libgfortran/generated/maxloc1_16_r8.c (.../tags/gcc_4_8_3_release)
 
13120
+++ b/src/libgfortran/generated/maxloc1_16_r8.c (.../branches/gcc-4_8-branch)
 
13121
@@ -98,10 +98,9 @@
 
13122
       retarray->offset = 0;
 
13123
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13124
 
 
13125
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13126
-                  * extent[rank-1];
 
13127
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13128
 
 
13129
-      retarray->base_addr = xmalloc (alloc_size);
 
13130
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13131
       if (alloc_size == 0)
 
13132
        {
 
13133
          /* Make sure we have a zero-sized array.  */
 
13134
@@ -294,8 +293,7 @@
 
13135
 
 
13136
        }
 
13137
 
 
13138
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13139
-                  * extent[rank-1];
 
13140
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13141
 
 
13142
       retarray->offset = 0;
 
13143
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13144
@@ -307,7 +305,7 @@
 
13145
          return;
 
13146
        }
 
13147
       else
 
13148
-       retarray->base_addr = xmalloc (alloc_size);
 
13149
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13150
 
 
13151
     }
 
13152
   else
 
13153
@@ -485,8 +483,7 @@
 
13154
       retarray->offset = 0;
 
13155
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13156
 
 
13157
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13158
-                  * extent[rank-1];
 
13159
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13160
 
 
13161
       if (alloc_size == 0)
 
13162
        {
 
13163
@@ -495,7 +492,7 @@
 
13164
          return;
 
13165
        }
 
13166
       else
 
13167
-       retarray->base_addr = xmalloc (alloc_size);
 
13168
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13169
     }
 
13170
   else
 
13171
     {
 
13172
Index: libgfortran/generated/transpose_r4.c
 
13173
===================================================================
 
13174
--- a/src/libgfortran/generated/transpose_r4.c  (.../tags/gcc_4_8_3_release)
 
13175
+++ b/src/libgfortran/generated/transpose_r4.c  (.../branches/gcc-4_8-branch)
 
13176
@@ -60,7 +60,8 @@
 
13177
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
13178
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
13179
 
 
13180
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
 
13181
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
13182
+                                     sizeof (GFC_REAL_4));
 
13183
       ret->offset = 0;
 
13184
     } else if (unlikely (compile_options.bounds_check))
 
13185
     {
 
13186
Index: libgfortran/generated/cshift1_4.c
 
13187
===================================================================
 
13188
--- a/src/libgfortran/generated/cshift1_4.c     (.../tags/gcc_4_8_3_release)
 
13189
+++ b/src/libgfortran/generated/cshift1_4.c     (.../branches/gcc-4_8-branch)
 
13190
@@ -80,7 +80,7 @@
 
13191
     {
 
13192
       int i;
 
13193
 
 
13194
-      ret->base_addr = xmalloc (size * arraysize);
 
13195
+      ret->base_addr = xmallocarray (arraysize, size);
 
13196
       ret->offset = 0;
 
13197
       ret->dtype = array->dtype;
 
13198
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
13199
Index: libgfortran/generated/maxloc0_8_i2.c
 
13200
===================================================================
 
13201
--- a/src/libgfortran/generated/maxloc0_8_i2.c  (.../tags/gcc_4_8_3_release)
 
13202
+++ b/src/libgfortran/generated/maxloc0_8_i2.c  (.../branches/gcc-4_8-branch)
 
13203
@@ -58,7 +58,7 @@
 
13204
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13205
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13206
       retarray->offset = 0;
 
13207
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
13208
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
13209
     }
 
13210
   else
 
13211
     {
 
13212
@@ -199,7 +199,7 @@
 
13213
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
13214
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13215
       retarray->offset = 0;
 
13216
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
13217
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
13218
     }
 
13219
   else
 
13220
     {
 
13221
@@ -367,7 +367,7 @@
 
13222
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13223
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13224
       retarray->offset = 0;
 
13225
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
13226
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
13227
     }
 
13228
   else if (unlikely (compile_options.bounds_check))
 
13229
     {
 
13230
Index: libgfortran/generated/count_8_l.c
 
13231
===================================================================
 
13232
--- a/src/libgfortran/generated/count_8_l.c     (.../tags/gcc_4_8_3_release)
 
13233
+++ b/src/libgfortran/generated/count_8_l.c     (.../branches/gcc-4_8-branch)
 
13234
@@ -101,8 +101,7 @@
 
13235
       retarray->offset = 0;
 
13236
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13237
 
 
13238
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13239
-                  * extent[rank-1];
 
13240
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13241
 
 
13242
       if (alloc_size == 0)
 
13243
        {
 
13244
@@ -111,7 +110,7 @@
 
13245
          return;
 
13246
        }
 
13247
       else
 
13248
-       retarray->base_addr = xmalloc (alloc_size);
 
13249
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13250
     }
 
13251
   else
 
13252
     {
 
13253
Index: libgfortran/generated/in_pack_i4.c
 
13254
===================================================================
 
13255
--- a/src/libgfortran/generated/in_pack_i4.c    (.../tags/gcc_4_8_3_release)
 
13256
+++ b/src/libgfortran/generated/in_pack_i4.c    (.../branches/gcc-4_8-branch)
 
13257
@@ -76,7 +76,7 @@
 
13258
     return source->base_addr;
 
13259
 
 
13260
   /* Allocate storage for the destination.  */
 
13261
-  destptr = (GFC_INTEGER_4 *)xmalloc (ssize * sizeof (GFC_INTEGER_4));
 
13262
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_4));
 
13263
   dest = destptr;
 
13264
   src = source->base_addr;
 
13265
   stride0 = stride[0];
 
13266
Index: libgfortran/generated/minloc0_16_i2.c
 
13267
===================================================================
 
13268
--- a/src/libgfortran/generated/minloc0_16_i2.c (.../tags/gcc_4_8_3_release)
 
13269
+++ b/src/libgfortran/generated/minloc0_16_i2.c (.../branches/gcc-4_8-branch)
 
13270
@@ -58,7 +58,7 @@
 
13271
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13272
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13273
       retarray->offset = 0;
 
13274
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13275
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13276
     }
 
13277
   else
 
13278
     {
 
13279
@@ -199,7 +199,7 @@
 
13280
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
13281
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13282
       retarray->offset = 0;
 
13283
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13284
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13285
     }
 
13286
   else
 
13287
     {
 
13288
@@ -367,7 +367,7 @@
 
13289
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13290
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13291
       retarray->offset = 0;
 
13292
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13293
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13294
     }
 
13295
   else if (unlikely (compile_options.bounds_check))
 
13296
     {
 
13297
Index: libgfortran/generated/minloc1_8_r8.c
 
13298
===================================================================
 
13299
--- a/src/libgfortran/generated/minloc1_8_r8.c  (.../tags/gcc_4_8_3_release)
 
13300
+++ b/src/libgfortran/generated/minloc1_8_r8.c  (.../branches/gcc-4_8-branch)
 
13301
@@ -98,10 +98,9 @@
 
13302
       retarray->offset = 0;
 
13303
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13304
 
 
13305
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13306
-                  * extent[rank-1];
 
13307
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13308
 
 
13309
-      retarray->base_addr = xmalloc (alloc_size);
 
13310
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13311
       if (alloc_size == 0)
 
13312
        {
 
13313
          /* Make sure we have a zero-sized array.  */
 
13314
@@ -294,8 +293,7 @@
 
13315
 
 
13316
        }
 
13317
 
 
13318
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13319
-                  * extent[rank-1];
 
13320
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13321
 
 
13322
       retarray->offset = 0;
 
13323
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13324
@@ -307,7 +305,7 @@
 
13325
          return;
 
13326
        }
 
13327
       else
 
13328
-       retarray->base_addr = xmalloc (alloc_size);
 
13329
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13330
 
 
13331
     }
 
13332
   else
 
13333
@@ -485,8 +483,7 @@
 
13334
       retarray->offset = 0;
 
13335
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13336
 
 
13337
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13338
-                  * extent[rank-1];
 
13339
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13340
 
 
13341
       if (alloc_size == 0)
 
13342
        {
 
13343
@@ -495,7 +492,7 @@
 
13344
          return;
 
13345
        }
 
13346
       else
 
13347
-       retarray->base_addr = xmalloc (alloc_size);
 
13348
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13349
     }
 
13350
   else
 
13351
     {
 
13352
Index: libgfortran/generated/matmul_c16.c
 
13353
===================================================================
 
13354
--- a/src/libgfortran/generated/matmul_c16.c    (.../tags/gcc_4_8_3_release)
 
13355
+++ b/src/libgfortran/generated/matmul_c16.c    (.../branches/gcc-4_8-branch)
 
13356
@@ -124,7 +124,7 @@
 
13357
         }
 
13358
 
 
13359
       retarray->base_addr
 
13360
-       = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
 
13361
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_16));
 
13362
       retarray->offset = 0;
 
13363
     }
 
13364
     else if (unlikely (compile_options.bounds_check))
 
13365
Index: libgfortran/generated/minval_i1.c
 
13366
===================================================================
 
13367
--- a/src/libgfortran/generated/minval_i1.c     (.../tags/gcc_4_8_3_release)
 
13368
+++ b/src/libgfortran/generated/minval_i1.c     (.../branches/gcc-4_8-branch)
 
13369
@@ -97,10 +97,9 @@
 
13370
       retarray->offset = 0;
 
13371
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13372
 
 
13373
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13374
-                  * extent[rank-1];
 
13375
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13376
 
 
13377
-      retarray->base_addr = xmalloc (alloc_size);
 
13378
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
13379
       if (alloc_size == 0)
 
13380
        {
 
13381
          /* Make sure we have a zero-sized array.  */
 
13382
@@ -286,8 +285,7 @@
 
13383
 
 
13384
        }
 
13385
 
 
13386
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13387
-                  * extent[rank-1];
 
13388
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13389
 
 
13390
       retarray->offset = 0;
 
13391
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13392
@@ -299,7 +297,7 @@
 
13393
          return;
 
13394
        }
 
13395
       else
 
13396
-       retarray->base_addr = xmalloc (alloc_size);
 
13397
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
13398
 
 
13399
     }
 
13400
   else
 
13401
@@ -472,8 +470,7 @@
 
13402
       retarray->offset = 0;
 
13403
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13404
 
 
13405
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13406
-                  * extent[rank-1];
 
13407
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13408
 
 
13409
       if (alloc_size == 0)
 
13410
        {
 
13411
@@ -482,7 +479,7 @@
 
13412
          return;
 
13413
        }
 
13414
       else
 
13415
-       retarray->base_addr = xmalloc (alloc_size);
 
13416
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
13417
     }
 
13418
   else
 
13419
     {
 
13420
Index: libgfortran/generated/shape_i16.c
 
13421
===================================================================
 
13422
--- a/src/libgfortran/generated/shape_i16.c     (.../tags/gcc_4_8_3_release)
 
13423
+++ b/src/libgfortran/generated/shape_i16.c     (.../branches/gcc-4_8-branch)
 
13424
@@ -49,7 +49,7 @@
 
13425
     {
 
13426
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
 
13427
       ret->offset = 0;
 
13428
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13429
+      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13430
     }
 
13431
 
 
13432
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
13433
Index: libgfortran/generated/iany_i4.c
 
13434
===================================================================
 
13435
--- a/src/libgfortran/generated/iany_i4.c       (.../tags/gcc_4_8_3_release)
 
13436
+++ b/src/libgfortran/generated/iany_i4.c       (.../branches/gcc-4_8-branch)
 
13437
@@ -97,10 +97,9 @@
 
13438
       retarray->offset = 0;
 
13439
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13440
 
 
13441
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13442
-                  * extent[rank-1];
 
13443
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13444
 
 
13445
-      retarray->base_addr = xmalloc (alloc_size);
 
13446
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13447
       if (alloc_size == 0)
 
13448
        {
 
13449
          /* Make sure we have a zero-sized array.  */
 
13450
@@ -272,8 +271,7 @@
 
13451
 
 
13452
        }
 
13453
 
 
13454
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13455
-                  * extent[rank-1];
 
13456
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13457
 
 
13458
       retarray->offset = 0;
 
13459
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13460
@@ -285,7 +283,7 @@
 
13461
          return;
 
13462
        }
 
13463
       else
 
13464
-       retarray->base_addr = xmalloc (alloc_size);
 
13465
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13466
 
 
13467
     }
 
13468
   else
 
13469
@@ -430,8 +428,7 @@
 
13470
       retarray->offset = 0;
 
13471
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13472
 
 
13473
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13474
-                  * extent[rank-1];
 
13475
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13476
 
 
13477
       if (alloc_size == 0)
 
13478
        {
 
13479
@@ -440,7 +437,7 @@
 
13480
          return;
 
13481
        }
 
13482
       else
 
13483
-       retarray->base_addr = xmalloc (alloc_size);
 
13484
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13485
     }
 
13486
   else
 
13487
     {
 
13488
Index: libgfortran/generated/minloc0_16_r16.c
 
13489
===================================================================
 
13490
--- a/src/libgfortran/generated/minloc0_16_r16.c        (.../tags/gcc_4_8_3_release)
 
13491
+++ b/src/libgfortran/generated/minloc0_16_r16.c        (.../branches/gcc-4_8-branch)
 
13492
@@ -58,7 +58,7 @@
 
13493
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13494
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13495
       retarray->offset = 0;
 
13496
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13497
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13498
     }
 
13499
   else
 
13500
     {
 
13501
@@ -199,7 +199,7 @@
 
13502
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
13503
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13504
       retarray->offset = 0;
 
13505
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13506
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13507
     }
 
13508
   else
 
13509
     {
 
13510
@@ -367,7 +367,7 @@
 
13511
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13512
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13513
       retarray->offset = 0;
 
13514
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13515
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13516
     }
 
13517
   else if (unlikely (compile_options.bounds_check))
 
13518
     {
 
13519
Index: libgfortran/generated/product_i16.c
 
13520
===================================================================
 
13521
--- a/src/libgfortran/generated/product_i16.c   (.../tags/gcc_4_8_3_release)
 
13522
+++ b/src/libgfortran/generated/product_i16.c   (.../branches/gcc-4_8-branch)
 
13523
@@ -97,10 +97,9 @@
 
13524
       retarray->offset = 0;
 
13525
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13526
 
 
13527
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13528
-                  * extent[rank-1];
 
13529
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13530
 
 
13531
-      retarray->base_addr = xmalloc (alloc_size);
 
13532
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13533
       if (alloc_size == 0)
 
13534
        {
 
13535
          /* Make sure we have a zero-sized array.  */
 
13536
@@ -272,8 +271,7 @@
 
13537
 
 
13538
        }
 
13539
 
 
13540
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13541
-                  * extent[rank-1];
 
13542
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13543
 
 
13544
       retarray->offset = 0;
 
13545
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13546
@@ -285,7 +283,7 @@
 
13547
          return;
 
13548
        }
 
13549
       else
 
13550
-       retarray->base_addr = xmalloc (alloc_size);
 
13551
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13552
 
 
13553
     }
 
13554
   else
 
13555
@@ -430,8 +428,7 @@
 
13556
       retarray->offset = 0;
 
13557
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13558
 
 
13559
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13560
-                  * extent[rank-1];
 
13561
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13562
 
 
13563
       if (alloc_size == 0)
 
13564
        {
 
13565
@@ -440,7 +437,7 @@
 
13566
          return;
 
13567
        }
 
13568
       else
 
13569
-       retarray->base_addr = xmalloc (alloc_size);
 
13570
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13571
     }
 
13572
   else
 
13573
     {
 
13574
Index: libgfortran/generated/unpack_i1.c
 
13575
===================================================================
 
13576
--- a/src/libgfortran/generated/unpack_i1.c     (.../tags/gcc_4_8_3_release)
 
13577
+++ b/src/libgfortran/generated/unpack_i1.c     (.../branches/gcc-4_8-branch)
 
13578
@@ -99,7 +99,7 @@
 
13579
          rs *= extent[n];
 
13580
        }
 
13581
       ret->offset = 0;
 
13582
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
 
13583
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
 
13584
     }
 
13585
   else
 
13586
     {
 
13587
@@ -244,7 +244,7 @@
 
13588
          rs *= extent[n];
 
13589
        }
 
13590
       ret->offset = 0;
 
13591
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
 
13592
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
 
13593
     }
 
13594
   else
 
13595
     {
 
13596
Index: libgfortran/generated/minloc0_4_i4.c
 
13597
===================================================================
 
13598
--- a/src/libgfortran/generated/minloc0_4_i4.c  (.../tags/gcc_4_8_3_release)
 
13599
+++ b/src/libgfortran/generated/minloc0_4_i4.c  (.../branches/gcc-4_8-branch)
 
13600
@@ -58,7 +58,7 @@
 
13601
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13602
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13603
       retarray->offset = 0;
 
13604
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
13605
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
13606
     }
 
13607
   else
 
13608
     {
 
13609
@@ -199,7 +199,7 @@
 
13610
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
13611
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13612
       retarray->offset = 0;
 
13613
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
13614
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
13615
     }
 
13616
   else
 
13617
     {
 
13618
@@ -367,7 +367,7 @@
 
13619
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13620
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13621
       retarray->offset = 0;
 
13622
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
13623
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
13624
     }
 
13625
   else if (unlikely (compile_options.bounds_check))
 
13626
     {
 
13627
Index: libgfortran/generated/matmul_i1.c
 
13628
===================================================================
 
13629
--- a/src/libgfortran/generated/matmul_i1.c     (.../tags/gcc_4_8_3_release)
 
13630
+++ b/src/libgfortran/generated/matmul_i1.c     (.../branches/gcc-4_8-branch)
 
13631
@@ -124,7 +124,7 @@
 
13632
         }
 
13633
 
 
13634
       retarray->base_addr
 
13635
-       = xmalloc (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
 
13636
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_1));
 
13637
       retarray->offset = 0;
 
13638
     }
 
13639
     else if (unlikely (compile_options.bounds_check))
 
13640
Index: libgfortran/generated/minval_r4.c
 
13641
===================================================================
 
13642
--- a/src/libgfortran/generated/minval_r4.c     (.../tags/gcc_4_8_3_release)
 
13643
+++ b/src/libgfortran/generated/minval_r4.c     (.../branches/gcc-4_8-branch)
 
13644
@@ -97,10 +97,9 @@
 
13645
       retarray->offset = 0;
 
13646
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13647
 
 
13648
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13649
-                  * extent[rank-1];
 
13650
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13651
 
 
13652
-      retarray->base_addr = xmalloc (alloc_size);
 
13653
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
13654
       if (alloc_size == 0)
 
13655
        {
 
13656
          /* Make sure we have a zero-sized array.  */
 
13657
@@ -286,8 +285,7 @@
 
13658
 
 
13659
        }
 
13660
 
 
13661
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13662
-                  * extent[rank-1];
 
13663
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13664
 
 
13665
       retarray->offset = 0;
 
13666
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13667
@@ -299,7 +297,7 @@
 
13668
          return;
 
13669
        }
 
13670
       else
 
13671
-       retarray->base_addr = xmalloc (alloc_size);
 
13672
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
13673
 
 
13674
     }
 
13675
   else
 
13676
@@ -472,8 +470,7 @@
 
13677
       retarray->offset = 0;
 
13678
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13679
 
 
13680
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13681
-                  * extent[rank-1];
 
13682
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13683
 
 
13684
       if (alloc_size == 0)
 
13685
        {
 
13686
@@ -482,7 +479,7 @@
 
13687
          return;
 
13688
        }
 
13689
       else
 
13690
-       retarray->base_addr = xmalloc (alloc_size);
 
13691
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
13692
     }
 
13693
   else
 
13694
     {
 
13695
Index: libgfortran/generated/spread_i16.c
 
13696
===================================================================
 
13697
--- a/src/libgfortran/generated/spread_i16.c    (.../tags/gcc_4_8_3_release)
 
13698
+++ b/src/libgfortran/generated/spread_i16.c    (.../branches/gcc-4_8-branch)
 
13699
@@ -101,8 +101,8 @@
 
13700
        }
 
13701
       ret->offset = 0;
 
13702
 
 
13703
-      /* xmalloc allocates a single byte for zero size.  */
 
13704
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_16));
 
13705
+      /* xmallocarray allocates a single byte for zero size.  */
 
13706
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_16));
 
13707
       if (rs <= 0)
 
13708
         return;
 
13709
     }
 
13710
@@ -244,7 +244,7 @@
 
13711
 
 
13712
   if (ret->base_addr == NULL)
 
13713
     {
 
13714
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_16));
 
13715
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_16));
 
13716
       ret->offset = 0;
 
13717
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
13718
     }
 
13719
Index: libgfortran/generated/sum_i4.c
 
13720
===================================================================
 
13721
--- a/src/libgfortran/generated/sum_i4.c        (.../tags/gcc_4_8_3_release)
 
13722
+++ b/src/libgfortran/generated/sum_i4.c        (.../branches/gcc-4_8-branch)
 
13723
@@ -97,10 +97,9 @@
 
13724
       retarray->offset = 0;
 
13725
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13726
 
 
13727
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13728
-                  * extent[rank-1];
 
13729
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13730
 
 
13731
-      retarray->base_addr = xmalloc (alloc_size);
 
13732
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13733
       if (alloc_size == 0)
 
13734
        {
 
13735
          /* Make sure we have a zero-sized array.  */
 
13736
@@ -272,8 +271,7 @@
 
13737
 
 
13738
        }
 
13739
 
 
13740
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13741
-                  * extent[rank-1];
 
13742
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13743
 
 
13744
       retarray->offset = 0;
 
13745
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13746
@@ -285,7 +283,7 @@
 
13747
          return;
 
13748
        }
 
13749
       else
 
13750
-       retarray->base_addr = xmalloc (alloc_size);
 
13751
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13752
 
 
13753
     }
 
13754
   else
 
13755
@@ -430,8 +428,7 @@
 
13756
       retarray->offset = 0;
 
13757
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13758
 
 
13759
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13760
-                  * extent[rank-1];
 
13761
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13762
 
 
13763
       if (alloc_size == 0)
 
13764
        {
 
13765
@@ -440,7 +437,7 @@
 
13766
          return;
 
13767
        }
 
13768
       else
 
13769
-       retarray->base_addr = xmalloc (alloc_size);
 
13770
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13771
     }
 
13772
   else
 
13773
     {
 
13774
Index: libgfortran/generated/unpack_r10.c
 
13775
===================================================================
 
13776
--- a/src/libgfortran/generated/unpack_r10.c    (.../tags/gcc_4_8_3_release)
 
13777
+++ b/src/libgfortran/generated/unpack_r10.c    (.../branches/gcc-4_8-branch)
 
13778
@@ -99,7 +99,7 @@
 
13779
          rs *= extent[n];
 
13780
        }
 
13781
       ret->offset = 0;
 
13782
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
 
13783
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
 
13784
     }
 
13785
   else
 
13786
     {
 
13787
@@ -244,7 +244,7 @@
 
13788
          rs *= extent[n];
 
13789
        }
 
13790
       ret->offset = 0;
 
13791
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
 
13792
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
 
13793
     }
 
13794
   else
 
13795
     {
 
13796
Index: libgfortran/generated/bessel_r16.c
 
13797
===================================================================
 
13798
--- a/src/libgfortran/generated/bessel_r16.c    (.../tags/gcc_4_8_3_release)
 
13799
+++ b/src/libgfortran/generated/bessel_r16.c    (.../branches/gcc-4_8-branch)
 
13800
@@ -59,7 +59,7 @@
 
13801
     {
 
13802
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
13803
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
13804
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
 
13805
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
 
13806
       ret->offset = 0;
 
13807
     }
 
13808
 
 
13809
@@ -126,7 +126,7 @@
 
13810
     {
 
13811
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
13812
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
13813
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
 
13814
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
 
13815
       ret->offset = 0;
 
13816
     }
 
13817
 
 
13818
@@ -166,7 +166,7 @@
 
13819
 
 
13820
   x2rev = GFC_REAL_16_LITERAL(2.)/x;
 
13821
 
 
13822
-  for (i = 2; i <= n1+n2; i++)
 
13823
+  for (i = 2; i <= n2 - n1; i++)
 
13824
     {
 
13825
 #if defined(GFC_REAL_16_INFINITY)
 
13826
       if (unlikely (last2 == -GFC_REAL_16_INFINITY))
 
13827
Index: libgfortran/generated/norm2_r8.c
 
13828
===================================================================
 
13829
--- a/src/libgfortran/generated/norm2_r8.c      (.../tags/gcc_4_8_3_release)
 
13830
+++ b/src/libgfortran/generated/norm2_r8.c      (.../branches/gcc-4_8-branch)
 
13831
@@ -101,10 +101,9 @@
 
13832
       retarray->offset = 0;
 
13833
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13834
 
 
13835
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13836
-                  * extent[rank-1];
 
13837
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13838
 
 
13839
-      retarray->base_addr = xmalloc (alloc_size);
 
13840
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
13841
       if (alloc_size == 0)
 
13842
        {
 
13843
          /* Make sure we have a zero-sized array.  */
 
13844
Index: libgfortran/generated/spread_i4.c
 
13845
===================================================================
 
13846
--- a/src/libgfortran/generated/spread_i4.c     (.../tags/gcc_4_8_3_release)
 
13847
+++ b/src/libgfortran/generated/spread_i4.c     (.../branches/gcc-4_8-branch)
 
13848
@@ -101,8 +101,8 @@
 
13849
        }
 
13850
       ret->offset = 0;
 
13851
 
 
13852
-      /* xmalloc allocates a single byte for zero size.  */
 
13853
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_4));
 
13854
+      /* xmallocarray allocates a single byte for zero size.  */
 
13855
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_4));
 
13856
       if (rs <= 0)
 
13857
         return;
 
13858
     }
 
13859
@@ -244,7 +244,7 @@
 
13860
 
 
13861
   if (ret->base_addr == NULL)
 
13862
     {
 
13863
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_4));
 
13864
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_4));
 
13865
       ret->offset = 0;
 
13866
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
13867
     }
 
13868
Index: libgfortran/generated/eoshift3_8.c
 
13869
===================================================================
 
13870
--- a/src/libgfortran/generated/eoshift3_8.c    (.../tags/gcc_4_8_3_release)
 
13871
+++ b/src/libgfortran/generated/eoshift3_8.c    (.../branches/gcc-4_8-branch)
 
13872
@@ -89,7 +89,7 @@
 
13873
     {
 
13874
       int i;
 
13875
 
 
13876
-      ret->base_addr = xmalloc (size * arraysize);
 
13877
+      ret->base_addr = xmallocarray (arraysize, size);
 
13878
       ret->offset = 0;
 
13879
       ret->dtype = array->dtype;
 
13880
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
13881
@@ -107,8 +107,8 @@
 
13882
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
13883
 
 
13884
         }
 
13885
-      /* xmalloc allocates a single byte for zero size.  */
 
13886
-      ret->base_addr = xmalloc (size * arraysize);
 
13887
+      /* xmallocarray allocates a single byte for zero size.  */
 
13888
+      ret->base_addr = xmallocarray (arraysize, size);
 
13889
 
 
13890
     }
 
13891
   else if (unlikely (compile_options.bounds_check))
 
13892
Index: libgfortran/generated/minloc1_4_i1.c
 
13893
===================================================================
 
13894
--- a/src/libgfortran/generated/minloc1_4_i1.c  (.../tags/gcc_4_8_3_release)
 
13895
+++ b/src/libgfortran/generated/minloc1_4_i1.c  (.../branches/gcc-4_8-branch)
 
13896
@@ -98,10 +98,9 @@
 
13897
       retarray->offset = 0;
 
13898
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13899
 
 
13900
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13901
-                  * extent[rank-1];
 
13902
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13903
 
 
13904
-      retarray->base_addr = xmalloc (alloc_size);
 
13905
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13906
       if (alloc_size == 0)
 
13907
        {
 
13908
          /* Make sure we have a zero-sized array.  */
 
13909
@@ -294,8 +293,7 @@
 
13910
 
 
13911
        }
 
13912
 
 
13913
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13914
-                  * extent[rank-1];
 
13915
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13916
 
 
13917
       retarray->offset = 0;
 
13918
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13919
@@ -307,7 +305,7 @@
 
13920
          return;
 
13921
        }
 
13922
       else
 
13923
-       retarray->base_addr = xmalloc (alloc_size);
 
13924
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13925
 
 
13926
     }
 
13927
   else
 
13928
@@ -485,8 +483,7 @@
 
13929
       retarray->offset = 0;
 
13930
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13931
 
 
13932
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13933
-                  * extent[rank-1];
 
13934
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13935
 
 
13936
       if (alloc_size == 0)
 
13937
        {
 
13938
@@ -495,7 +492,7 @@
 
13939
          return;
 
13940
        }
 
13941
       else
 
13942
-       retarray->base_addr = xmalloc (alloc_size);
 
13943
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13944
     }
 
13945
   else
 
13946
     {
 
13947
Index: libgfortran/generated/minval_i2.c
 
13948
===================================================================
 
13949
--- a/src/libgfortran/generated/minval_i2.c     (.../tags/gcc_4_8_3_release)
 
13950
+++ b/src/libgfortran/generated/minval_i2.c     (.../branches/gcc-4_8-branch)
 
13951
@@ -97,10 +97,9 @@
 
13952
       retarray->offset = 0;
 
13953
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13954
 
 
13955
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13956
-                  * extent[rank-1];
 
13957
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13958
 
 
13959
-      retarray->base_addr = xmalloc (alloc_size);
 
13960
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
13961
       if (alloc_size == 0)
 
13962
        {
 
13963
          /* Make sure we have a zero-sized array.  */
 
13964
@@ -286,8 +285,7 @@
 
13965
 
 
13966
        }
 
13967
 
 
13968
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13969
-                  * extent[rank-1];
 
13970
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13971
 
 
13972
       retarray->offset = 0;
 
13973
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13974
@@ -299,7 +297,7 @@
 
13975
          return;
 
13976
        }
 
13977
       else
 
13978
-       retarray->base_addr = xmalloc (alloc_size);
 
13979
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
13980
 
 
13981
     }
 
13982
   else
 
13983
@@ -472,8 +470,7 @@
 
13984
       retarray->offset = 0;
 
13985
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13986
 
 
13987
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13988
-                  * extent[rank-1];
 
13989
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13990
 
 
13991
       if (alloc_size == 0)
 
13992
        {
 
13993
@@ -482,7 +479,7 @@
 
13994
          return;
 
13995
        }
 
13996
       else
 
13997
-       retarray->base_addr = xmalloc (alloc_size);
 
13998
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
13999
     }
 
14000
   else
 
14001
     {
 
14002
Index: libgfortran/generated/bessel_r8.c
 
14003
===================================================================
 
14004
--- a/src/libgfortran/generated/bessel_r8.c     (.../tags/gcc_4_8_3_release)
 
14005
+++ b/src/libgfortran/generated/bessel_r8.c     (.../branches/gcc-4_8-branch)
 
14006
@@ -55,7 +55,7 @@
 
14007
     {
 
14008
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
14009
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
14010
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
 
14011
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
 
14012
       ret->offset = 0;
 
14013
     }
 
14014
 
 
14015
@@ -122,7 +122,7 @@
 
14016
     {
 
14017
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
14018
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
14019
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
 
14020
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
 
14021
       ret->offset = 0;
 
14022
     }
 
14023
 
 
14024
@@ -162,7 +162,7 @@
 
14025
 
 
14026
   x2rev = GFC_REAL_8_LITERAL(2.)/x;
 
14027
 
 
14028
-  for (i = 2; i <= n1+n2; i++)
 
14029
+  for (i = 2; i <= n2 - n1; i++)
 
14030
     {
 
14031
 #if defined(GFC_REAL_8_INFINITY)
 
14032
       if (unlikely (last2 == -GFC_REAL_8_INFINITY))
 
14033
Index: libgfortran/generated/unpack_r4.c
 
14034
===================================================================
 
14035
--- a/src/libgfortran/generated/unpack_r4.c     (.../tags/gcc_4_8_3_release)
 
14036
+++ b/src/libgfortran/generated/unpack_r4.c     (.../branches/gcc-4_8-branch)
 
14037
@@ -99,7 +99,7 @@
 
14038
          rs *= extent[n];
 
14039
        }
 
14040
       ret->offset = 0;
 
14041
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
 
14042
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
 
14043
     }
 
14044
   else
 
14045
     {
 
14046
@@ -244,7 +244,7 @@
 
14047
          rs *= extent[n];
 
14048
        }
 
14049
       ret->offset = 0;
 
14050
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
 
14051
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
 
14052
     }
 
14053
   else
 
14054
     {
 
14055
Index: libgfortran/generated/product_r8.c
 
14056
===================================================================
 
14057
--- a/src/libgfortran/generated/product_r8.c    (.../tags/gcc_4_8_3_release)
 
14058
+++ b/src/libgfortran/generated/product_r8.c    (.../branches/gcc-4_8-branch)
 
14059
@@ -97,10 +97,9 @@
 
14060
       retarray->offset = 0;
 
14061
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14062
 
 
14063
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14064
-                  * extent[rank-1];
 
14065
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14066
 
 
14067
-      retarray->base_addr = xmalloc (alloc_size);
 
14068
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
14069
       if (alloc_size == 0)
 
14070
        {
 
14071
          /* Make sure we have a zero-sized array.  */
 
14072
@@ -272,8 +271,7 @@
 
14073
 
 
14074
        }
 
14075
 
 
14076
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14077
-                  * extent[rank-1];
 
14078
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14079
 
 
14080
       retarray->offset = 0;
 
14081
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14082
@@ -285,7 +283,7 @@
 
14083
          return;
 
14084
        }
 
14085
       else
 
14086
-       retarray->base_addr = xmalloc (alloc_size);
 
14087
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
14088
 
 
14089
     }
 
14090
   else
 
14091
@@ -430,8 +428,7 @@
 
14092
       retarray->offset = 0;
 
14093
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14094
 
 
14095
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14096
-                  * extent[rank-1];
 
14097
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14098
 
 
14099
       if (alloc_size == 0)
 
14100
        {
 
14101
@@ -440,7 +437,7 @@
 
14102
          return;
 
14103
        }
 
14104
       else
 
14105
-       retarray->base_addr = xmalloc (alloc_size);
 
14106
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
14107
     }
 
14108
   else
 
14109
     {
 
14110
Index: libgfortran/generated/matmul_r4.c
 
14111
===================================================================
 
14112
--- a/src/libgfortran/generated/matmul_r4.c     (.../tags/gcc_4_8_3_release)
 
14113
+++ b/src/libgfortran/generated/matmul_r4.c     (.../branches/gcc-4_8-branch)
 
14114
@@ -124,7 +124,7 @@
 
14115
         }
 
14116
 
 
14117
       retarray->base_addr
 
14118
-       = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
 
14119
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_4));
 
14120
       retarray->offset = 0;
 
14121
     }
 
14122
     else if (unlikely (compile_options.bounds_check))
 
14123
Index: libgfortran/generated/unpack_i2.c
 
14124
===================================================================
 
14125
--- a/src/libgfortran/generated/unpack_i2.c     (.../tags/gcc_4_8_3_release)
 
14126
+++ b/src/libgfortran/generated/unpack_i2.c     (.../branches/gcc-4_8-branch)
 
14127
@@ -99,7 +99,7 @@
 
14128
          rs *= extent[n];
 
14129
        }
 
14130
       ret->offset = 0;
 
14131
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
 
14132
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
 
14133
     }
 
14134
   else
 
14135
     {
 
14136
@@ -244,7 +244,7 @@
 
14137
          rs *= extent[n];
 
14138
        }
 
14139
       ret->offset = 0;
 
14140
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
 
14141
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
 
14142
     }
 
14143
   else
 
14144
     {
 
14145
Index: libgfortran/generated/in_pack_r8.c
 
14146
===================================================================
 
14147
--- a/src/libgfortran/generated/in_pack_r8.c    (.../tags/gcc_4_8_3_release)
 
14148
+++ b/src/libgfortran/generated/in_pack_r8.c    (.../branches/gcc-4_8-branch)
 
14149
@@ -76,7 +76,7 @@
 
14150
     return source->base_addr;
 
14151
 
 
14152
   /* Allocate storage for the destination.  */
 
14153
-  destptr = (GFC_REAL_8 *)xmalloc (ssize * sizeof (GFC_REAL_8));
 
14154
+  destptr = xmallocarray (ssize, sizeof (GFC_REAL_8));
 
14155
   dest = destptr;
 
14156
   src = source->base_addr;
 
14157
   stride0 = stride[0];
 
14158
Index: libgfortran/generated/maxloc1_4_r16.c
 
14159
===================================================================
 
14160
--- a/src/libgfortran/generated/maxloc1_4_r16.c (.../tags/gcc_4_8_3_release)
 
14161
+++ b/src/libgfortran/generated/maxloc1_4_r16.c (.../branches/gcc-4_8-branch)
 
14162
@@ -98,10 +98,9 @@
 
14163
       retarray->offset = 0;
 
14164
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14165
 
 
14166
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14167
-                  * extent[rank-1];
 
14168
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14169
 
 
14170
-      retarray->base_addr = xmalloc (alloc_size);
 
14171
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14172
       if (alloc_size == 0)
 
14173
        {
 
14174
          /* Make sure we have a zero-sized array.  */
 
14175
@@ -294,8 +293,7 @@
 
14176
 
 
14177
        }
 
14178
 
 
14179
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14180
-                  * extent[rank-1];
 
14181
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14182
 
 
14183
       retarray->offset = 0;
 
14184
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14185
@@ -307,7 +305,7 @@
 
14186
          return;
 
14187
        }
 
14188
       else
 
14189
-       retarray->base_addr = xmalloc (alloc_size);
 
14190
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14191
 
 
14192
     }
 
14193
   else
 
14194
@@ -485,8 +483,7 @@
 
14195
       retarray->offset = 0;
 
14196
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14197
 
 
14198
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14199
-                  * extent[rank-1];
 
14200
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14201
 
 
14202
       if (alloc_size == 0)
 
14203
        {
 
14204
@@ -495,7 +492,7 @@
 
14205
          return;
 
14206
        }
 
14207
       else
 
14208
-       retarray->base_addr = xmalloc (alloc_size);
 
14209
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14210
     }
 
14211
   else
 
14212
     {
 
14213
Index: libgfortran/generated/minloc0_8_r16.c
 
14214
===================================================================
 
14215
--- a/src/libgfortran/generated/minloc0_8_r16.c (.../tags/gcc_4_8_3_release)
 
14216
+++ b/src/libgfortran/generated/minloc0_8_r16.c (.../branches/gcc-4_8-branch)
 
14217
@@ -58,7 +58,7 @@
 
14218
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14219
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14220
       retarray->offset = 0;
 
14221
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14222
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14223
     }
 
14224
   else
 
14225
     {
 
14226
@@ -199,7 +199,7 @@
 
14227
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14228
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14229
       retarray->offset = 0;
 
14230
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14231
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14232
     }
 
14233
   else
 
14234
     {
 
14235
@@ -367,7 +367,7 @@
 
14236
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14237
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14238
       retarray->offset = 0;
 
14239
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14240
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14241
     }
 
14242
   else if (unlikely (compile_options.bounds_check))
 
14243
     {
 
14244
Index: libgfortran/generated/reshape_c8.c
 
14245
===================================================================
 
14246
--- a/src/libgfortran/generated/reshape_c8.c    (.../tags/gcc_4_8_3_release)
 
14247
+++ b/src/libgfortran/generated/reshape_c8.c    (.../branches/gcc-4_8-branch)
 
14248
@@ -111,11 +111,11 @@
 
14249
       ret->offset = 0;
 
14250
 
 
14251
       if (unlikely (rs < 1))
 
14252
-        alloc_size = 1;
 
14253
+        alloc_size = 0;
 
14254
       else
 
14255
-        alloc_size = rs * sizeof (GFC_COMPLEX_8);
 
14256
+        alloc_size = rs;
 
14257
 
 
14258
-      ret->base_addr = xmalloc (alloc_size);
 
14259
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
14260
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
14261
     }
 
14262
 
 
14263
Index: libgfortran/generated/iparity_i8.c
 
14264
===================================================================
 
14265
--- a/src/libgfortran/generated/iparity_i8.c    (.../tags/gcc_4_8_3_release)
 
14266
+++ b/src/libgfortran/generated/iparity_i8.c    (.../branches/gcc-4_8-branch)
 
14267
@@ -97,10 +97,9 @@
 
14268
       retarray->offset = 0;
 
14269
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14270
 
 
14271
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14272
-                  * extent[rank-1];
 
14273
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14274
 
 
14275
-      retarray->base_addr = xmalloc (alloc_size);
 
14276
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14277
       if (alloc_size == 0)
 
14278
        {
 
14279
          /* Make sure we have a zero-sized array.  */
 
14280
@@ -272,8 +271,7 @@
 
14281
 
 
14282
        }
 
14283
 
 
14284
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14285
-                  * extent[rank-1];
 
14286
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14287
 
 
14288
       retarray->offset = 0;
 
14289
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14290
@@ -285,7 +283,7 @@
 
14291
          return;
 
14292
        }
 
14293
       else
 
14294
-       retarray->base_addr = xmalloc (alloc_size);
 
14295
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14296
 
 
14297
     }
 
14298
   else
 
14299
@@ -430,8 +428,7 @@
 
14300
       retarray->offset = 0;
 
14301
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14302
 
 
14303
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14304
-                  * extent[rank-1];
 
14305
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14306
 
 
14307
       if (alloc_size == 0)
 
14308
        {
 
14309
@@ -440,7 +437,7 @@
 
14310
          return;
 
14311
        }
 
14312
       else
 
14313
-       retarray->base_addr = xmalloc (alloc_size);
 
14314
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14315
     }
 
14316
   else
 
14317
     {
 
14318
Index: libgfortran/generated/count_1_l.c
 
14319
===================================================================
 
14320
--- a/src/libgfortran/generated/count_1_l.c     (.../tags/gcc_4_8_3_release)
 
14321
+++ b/src/libgfortran/generated/count_1_l.c     (.../branches/gcc-4_8-branch)
 
14322
@@ -101,8 +101,7 @@
 
14323
       retarray->offset = 0;
 
14324
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14325
 
 
14326
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14327
-                  * extent[rank-1];
 
14328
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14329
 
 
14330
       if (alloc_size == 0)
 
14331
        {
 
14332
@@ -111,7 +110,7 @@
 
14333
          return;
 
14334
        }
 
14335
       else
 
14336
-       retarray->base_addr = xmalloc (alloc_size);
 
14337
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
14338
     }
 
14339
   else
 
14340
     {
 
14341
Index: libgfortran/generated/maxloc0_8_i4.c
 
14342
===================================================================
 
14343
--- a/src/libgfortran/generated/maxloc0_8_i4.c  (.../tags/gcc_4_8_3_release)
 
14344
+++ b/src/libgfortran/generated/maxloc0_8_i4.c  (.../branches/gcc-4_8-branch)
 
14345
@@ -58,7 +58,7 @@
 
14346
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14347
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14348
       retarray->offset = 0;
 
14349
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14350
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14351
     }
 
14352
   else
 
14353
     {
 
14354
@@ -199,7 +199,7 @@
 
14355
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14356
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14357
       retarray->offset = 0;
 
14358
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14359
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14360
     }
 
14361
   else
 
14362
     {
 
14363
@@ -367,7 +367,7 @@
 
14364
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14365
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14366
       retarray->offset = 0;
 
14367
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14368
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14369
     }
 
14370
   else if (unlikely (compile_options.bounds_check))
 
14371
     {
 
14372
Index: libgfortran/generated/matmul_i2.c
 
14373
===================================================================
 
14374
--- a/src/libgfortran/generated/matmul_i2.c     (.../tags/gcc_4_8_3_release)
 
14375
+++ b/src/libgfortran/generated/matmul_i2.c     (.../branches/gcc-4_8-branch)
 
14376
@@ -124,7 +124,7 @@
 
14377
         }
 
14378
 
 
14379
       retarray->base_addr
 
14380
-       = xmalloc (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
 
14381
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_2));
 
14382
       retarray->offset = 0;
 
14383
     }
 
14384
     else if (unlikely (compile_options.bounds_check))
 
14385
Index: libgfortran/generated/minloc1_4_r4.c
 
14386
===================================================================
 
14387
--- a/src/libgfortran/generated/minloc1_4_r4.c  (.../tags/gcc_4_8_3_release)
 
14388
+++ b/src/libgfortran/generated/minloc1_4_r4.c  (.../branches/gcc-4_8-branch)
 
14389
@@ -98,10 +98,9 @@
 
14390
       retarray->offset = 0;
 
14391
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14392
 
 
14393
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14394
-                  * extent[rank-1];
 
14395
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14396
 
 
14397
-      retarray->base_addr = xmalloc (alloc_size);
 
14398
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14399
       if (alloc_size == 0)
 
14400
        {
 
14401
          /* Make sure we have a zero-sized array.  */
 
14402
@@ -294,8 +293,7 @@
 
14403
 
 
14404
        }
 
14405
 
 
14406
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14407
-                  * extent[rank-1];
 
14408
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14409
 
 
14410
       retarray->offset = 0;
 
14411
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14412
@@ -307,7 +305,7 @@
 
14413
          return;
 
14414
        }
 
14415
       else
 
14416
-       retarray->base_addr = xmalloc (alloc_size);
 
14417
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14418
 
 
14419
     }
 
14420
   else
 
14421
@@ -485,8 +483,7 @@
 
14422
       retarray->offset = 0;
 
14423
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14424
 
 
14425
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14426
-                  * extent[rank-1];
 
14427
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14428
 
 
14429
       if (alloc_size == 0)
 
14430
        {
 
14431
@@ -495,7 +492,7 @@
 
14432
          return;
 
14433
        }
 
14434
       else
 
14435
-       retarray->base_addr = xmalloc (alloc_size);
 
14436
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14437
     }
 
14438
   else
 
14439
     {
 
14440
Index: libgfortran/generated/transpose_i16.c
 
14441
===================================================================
 
14442
--- a/src/libgfortran/generated/transpose_i16.c (.../tags/gcc_4_8_3_release)
 
14443
+++ b/src/libgfortran/generated/transpose_i16.c (.../branches/gcc-4_8-branch)
 
14444
@@ -60,7 +60,8 @@
 
14445
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
14446
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
14447
 
 
14448
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
 
14449
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
14450
+                                     sizeof (GFC_INTEGER_16));
 
14451
       ret->offset = 0;
 
14452
     } else if (unlikely (compile_options.bounds_check))
 
14453
     {
 
14454
Index: libgfortran/generated/minloc0_16_i4.c
 
14455
===================================================================
 
14456
--- a/src/libgfortran/generated/minloc0_16_i4.c (.../tags/gcc_4_8_3_release)
 
14457
+++ b/src/libgfortran/generated/minloc0_16_i4.c (.../branches/gcc-4_8-branch)
 
14458
@@ -58,7 +58,7 @@
 
14459
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14460
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14461
       retarray->offset = 0;
 
14462
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14463
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14464
     }
 
14465
   else
 
14466
     {
 
14467
@@ -199,7 +199,7 @@
 
14468
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14469
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14470
       retarray->offset = 0;
 
14471
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14472
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14473
     }
 
14474
   else
 
14475
     {
 
14476
@@ -367,7 +367,7 @@
 
14477
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14478
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14479
       retarray->offset = 0;
 
14480
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14481
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14482
     }
 
14483
   else if (unlikely (compile_options.bounds_check))
 
14484
     {
 
14485
Index: libgfortran/generated/transpose_i4.c
 
14486
===================================================================
 
14487
--- a/src/libgfortran/generated/transpose_i4.c  (.../tags/gcc_4_8_3_release)
 
14488
+++ b/src/libgfortran/generated/transpose_i4.c  (.../branches/gcc-4_8-branch)
 
14489
@@ -60,7 +60,8 @@
 
14490
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
14491
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
14492
 
 
14493
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
 
14494
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
14495
+                                     sizeof (GFC_INTEGER_4));
 
14496
       ret->offset = 0;
 
14497
     } else if (unlikely (compile_options.bounds_check))
 
14498
     {
 
14499
Index: libgfortran/generated/maxloc1_16_i8.c
 
14500
===================================================================
 
14501
--- a/src/libgfortran/generated/maxloc1_16_i8.c (.../tags/gcc_4_8_3_release)
 
14502
+++ b/src/libgfortran/generated/maxloc1_16_i8.c (.../branches/gcc-4_8-branch)
 
14503
@@ -98,10 +98,9 @@
 
14504
       retarray->offset = 0;
 
14505
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14506
 
 
14507
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14508
-                  * extent[rank-1];
 
14509
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14510
 
 
14511
-      retarray->base_addr = xmalloc (alloc_size);
 
14512
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14513
       if (alloc_size == 0)
 
14514
        {
 
14515
          /* Make sure we have a zero-sized array.  */
 
14516
@@ -294,8 +293,7 @@
 
14517
 
 
14518
        }
 
14519
 
 
14520
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14521
-                  * extent[rank-1];
 
14522
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14523
 
 
14524
       retarray->offset = 0;
 
14525
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14526
@@ -307,7 +305,7 @@
 
14527
          return;
 
14528
        }
 
14529
       else
 
14530
-       retarray->base_addr = xmalloc (alloc_size);
 
14531
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14532
 
 
14533
     }
 
14534
   else
 
14535
@@ -485,8 +483,7 @@
 
14536
       retarray->offset = 0;
 
14537
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14538
 
 
14539
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14540
-                  * extent[rank-1];
 
14541
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14542
 
 
14543
       if (alloc_size == 0)
 
14544
        {
 
14545
@@ -495,7 +492,7 @@
 
14546
          return;
 
14547
        }
 
14548
       else
 
14549
-       retarray->base_addr = xmalloc (alloc_size);
 
14550
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14551
     }
 
14552
   else
 
14553
     {
 
14554
Index: libgfortran/generated/minloc1_4_i2.c
 
14555
===================================================================
 
14556
--- a/src/libgfortran/generated/minloc1_4_i2.c  (.../tags/gcc_4_8_3_release)
 
14557
+++ b/src/libgfortran/generated/minloc1_4_i2.c  (.../branches/gcc-4_8-branch)
 
14558
@@ -98,10 +98,9 @@
 
14559
       retarray->offset = 0;
 
14560
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14561
 
 
14562
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14563
-                  * extent[rank-1];
 
14564
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14565
 
 
14566
-      retarray->base_addr = xmalloc (alloc_size);
 
14567
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14568
       if (alloc_size == 0)
 
14569
        {
 
14570
          /* Make sure we have a zero-sized array.  */
 
14571
@@ -294,8 +293,7 @@
 
14572
 
 
14573
        }
 
14574
 
 
14575
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14576
-                  * extent[rank-1];
 
14577
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14578
 
 
14579
       retarray->offset = 0;
 
14580
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14581
@@ -307,7 +305,7 @@
 
14582
          return;
 
14583
        }
 
14584
       else
 
14585
-       retarray->base_addr = xmalloc (alloc_size);
 
14586
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14587
 
 
14588
     }
 
14589
   else
 
14590
@@ -485,8 +483,7 @@
 
14591
       retarray->offset = 0;
 
14592
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14593
 
 
14594
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14595
-                  * extent[rank-1];
 
14596
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14597
 
 
14598
       if (alloc_size == 0)
 
14599
        {
 
14600
@@ -495,7 +492,7 @@
 
14601
          return;
 
14602
        }
 
14603
       else
 
14604
-       retarray->base_addr = xmalloc (alloc_size);
 
14605
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14606
     }
 
14607
   else
 
14608
     {
 
14609
Index: libgfortran/generated/matmul_l16.c
 
14610
===================================================================
 
14611
--- a/src/libgfortran/generated/matmul_l16.c    (.../tags/gcc_4_8_3_release)
 
14612
+++ b/src/libgfortran/generated/matmul_l16.c    (.../branches/gcc-4_8-branch)
 
14613
@@ -88,7 +88,7 @@
 
14614
         }
 
14615
           
 
14616
       retarray->base_addr
 
14617
-       = xmalloc (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
 
14618
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_16));
 
14619
       retarray->offset = 0;
 
14620
     }
 
14621
     else if (unlikely (compile_options.bounds_check))
 
14622
Index: libgfortran/generated/maxloc1_8_i1.c
 
14623
===================================================================
 
14624
--- a/src/libgfortran/generated/maxloc1_8_i1.c  (.../tags/gcc_4_8_3_release)
 
14625
+++ b/src/libgfortran/generated/maxloc1_8_i1.c  (.../branches/gcc-4_8-branch)
 
14626
@@ -98,10 +98,9 @@
 
14627
       retarray->offset = 0;
 
14628
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14629
 
 
14630
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14631
-                  * extent[rank-1];
 
14632
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14633
 
 
14634
-      retarray->base_addr = xmalloc (alloc_size);
 
14635
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14636
       if (alloc_size == 0)
 
14637
        {
 
14638
          /* Make sure we have a zero-sized array.  */
 
14639
@@ -294,8 +293,7 @@
 
14640
 
 
14641
        }
 
14642
 
 
14643
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14644
-                  * extent[rank-1];
 
14645
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14646
 
 
14647
       retarray->offset = 0;
 
14648
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14649
@@ -307,7 +305,7 @@
 
14650
          return;
 
14651
        }
 
14652
       else
 
14653
-       retarray->base_addr = xmalloc (alloc_size);
 
14654
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14655
 
 
14656
     }
 
14657
   else
 
14658
@@ -485,8 +483,7 @@
 
14659
       retarray->offset = 0;
 
14660
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14661
 
 
14662
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14663
-                  * extent[rank-1];
 
14664
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14665
 
 
14666
       if (alloc_size == 0)
 
14667
        {
 
14668
@@ -495,7 +492,7 @@
 
14669
          return;
 
14670
        }
 
14671
       else
 
14672
-       retarray->base_addr = xmalloc (alloc_size);
 
14673
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14674
     }
 
14675
   else
 
14676
     {
 
14677
Index: libgfortran/generated/minloc1_8_i8.c
 
14678
===================================================================
 
14679
--- a/src/libgfortran/generated/minloc1_8_i8.c  (.../tags/gcc_4_8_3_release)
 
14680
+++ b/src/libgfortran/generated/minloc1_8_i8.c  (.../branches/gcc-4_8-branch)
 
14681
@@ -98,10 +98,9 @@
 
14682
       retarray->offset = 0;
 
14683
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14684
 
 
14685
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14686
-                  * extent[rank-1];
 
14687
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14688
 
 
14689
-      retarray->base_addr = xmalloc (alloc_size);
 
14690
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14691
       if (alloc_size == 0)
 
14692
        {
 
14693
          /* Make sure we have a zero-sized array.  */
 
14694
@@ -294,8 +293,7 @@
 
14695
 
 
14696
        }
 
14697
 
 
14698
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14699
-                  * extent[rank-1];
 
14700
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14701
 
 
14702
       retarray->offset = 0;
 
14703
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14704
@@ -307,7 +305,7 @@
 
14705
          return;
 
14706
        }
 
14707
       else
 
14708
-       retarray->base_addr = xmalloc (alloc_size);
 
14709
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14710
 
 
14711
     }
 
14712
   else
 
14713
@@ -485,8 +483,7 @@
 
14714
       retarray->offset = 0;
 
14715
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14716
 
 
14717
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14718
-                  * extent[rank-1];
 
14719
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14720
 
 
14721
       if (alloc_size == 0)
 
14722
        {
 
14723
@@ -495,7 +492,7 @@
 
14724
          return;
 
14725
        }
 
14726
       else
 
14727
-       retarray->base_addr = xmalloc (alloc_size);
 
14728
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14729
     }
 
14730
   else
 
14731
     {
 
14732
Index: libgfortran/generated/minloc0_4_r8.c
 
14733
===================================================================
 
14734
--- a/src/libgfortran/generated/minloc0_4_r8.c  (.../tags/gcc_4_8_3_release)
 
14735
+++ b/src/libgfortran/generated/minloc0_4_r8.c  (.../branches/gcc-4_8-branch)
 
14736
@@ -58,7 +58,7 @@
 
14737
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14738
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14739
       retarray->offset = 0;
 
14740
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14741
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14742
     }
 
14743
   else
 
14744
     {
 
14745
@@ -199,7 +199,7 @@
 
14746
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14747
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14748
       retarray->offset = 0;
 
14749
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14750
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14751
     }
 
14752
   else
 
14753
     {
 
14754
@@ -367,7 +367,7 @@
 
14755
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14756
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14757
       retarray->offset = 0;
 
14758
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14759
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14760
     }
 
14761
   else if (unlikely (compile_options.bounds_check))
 
14762
     {
 
14763
Index: libgfortran/generated/product_r16.c
 
14764
===================================================================
 
14765
--- a/src/libgfortran/generated/product_r16.c   (.../tags/gcc_4_8_3_release)
 
14766
+++ b/src/libgfortran/generated/product_r16.c   (.../branches/gcc-4_8-branch)
 
14767
@@ -97,10 +97,9 @@
 
14768
       retarray->offset = 0;
 
14769
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14770
 
 
14771
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14772
-                  * extent[rank-1];
 
14773
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14774
 
 
14775
-      retarray->base_addr = xmalloc (alloc_size);
 
14776
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
14777
       if (alloc_size == 0)
 
14778
        {
 
14779
          /* Make sure we have a zero-sized array.  */
 
14780
@@ -272,8 +271,7 @@
 
14781
 
 
14782
        }
 
14783
 
 
14784
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14785
-                  * extent[rank-1];
 
14786
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14787
 
 
14788
       retarray->offset = 0;
 
14789
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14790
@@ -285,7 +283,7 @@
 
14791
          return;
 
14792
        }
 
14793
       else
 
14794
-       retarray->base_addr = xmalloc (alloc_size);
 
14795
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
14796
 
 
14797
     }
 
14798
   else
 
14799
@@ -430,8 +428,7 @@
 
14800
       retarray->offset = 0;
 
14801
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14802
 
 
14803
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14804
-                  * extent[rank-1];
 
14805
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14806
 
 
14807
       if (alloc_size == 0)
 
14808
        {
 
14809
@@ -440,7 +437,7 @@
 
14810
          return;
 
14811
        }
 
14812
       else
 
14813
-       retarray->base_addr = xmalloc (alloc_size);
 
14814
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
14815
     }
 
14816
   else
 
14817
     {
 
14818
Index: libgfortran/generated/sum_r8.c
 
14819
===================================================================
 
14820
--- a/src/libgfortran/generated/sum_r8.c        (.../tags/gcc_4_8_3_release)
 
14821
+++ b/src/libgfortran/generated/sum_r8.c        (.../branches/gcc-4_8-branch)
 
14822
@@ -97,10 +97,9 @@
 
14823
       retarray->offset = 0;
 
14824
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14825
 
 
14826
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14827
-                  * extent[rank-1];
 
14828
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14829
 
 
14830
-      retarray->base_addr = xmalloc (alloc_size);
 
14831
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
14832
       if (alloc_size == 0)
 
14833
        {
 
14834
          /* Make sure we have a zero-sized array.  */
 
14835
@@ -272,8 +271,7 @@
 
14836
 
 
14837
        }
 
14838
 
 
14839
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14840
-                  * extent[rank-1];
 
14841
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14842
 
 
14843
       retarray->offset = 0;
 
14844
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14845
@@ -285,7 +283,7 @@
 
14846
          return;
 
14847
        }
 
14848
       else
 
14849
-       retarray->base_addr = xmalloc (alloc_size);
 
14850
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
14851
 
 
14852
     }
 
14853
   else
 
14854
@@ -430,8 +428,7 @@
 
14855
       retarray->offset = 0;
 
14856
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14857
 
 
14858
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14859
-                  * extent[rank-1];
 
14860
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14861
 
 
14862
       if (alloc_size == 0)
 
14863
        {
 
14864
@@ -440,7 +437,7 @@
 
14865
          return;
 
14866
        }
 
14867
       else
 
14868
-       retarray->base_addr = xmalloc (alloc_size);
 
14869
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
14870
     }
 
14871
   else
 
14872
     {
 
14873
Index: libgfortran/generated/norm2_r10.c
 
14874
===================================================================
 
14875
--- a/src/libgfortran/generated/norm2_r10.c     (.../tags/gcc_4_8_3_release)
 
14876
+++ b/src/libgfortran/generated/norm2_r10.c     (.../branches/gcc-4_8-branch)
 
14877
@@ -101,10 +101,9 @@
 
14878
       retarray->offset = 0;
 
14879
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14880
 
 
14881
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14882
-                  * extent[rank-1];
 
14883
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14884
 
 
14885
-      retarray->base_addr = xmalloc (alloc_size);
 
14886
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
14887
       if (alloc_size == 0)
 
14888
        {
 
14889
          /* Make sure we have a zero-sized array.  */
 
14890
Index: libgfortran/generated/unpack_c10.c
 
14891
===================================================================
 
14892
--- a/src/libgfortran/generated/unpack_c10.c    (.../tags/gcc_4_8_3_release)
 
14893
+++ b/src/libgfortran/generated/unpack_c10.c    (.../branches/gcc-4_8-branch)
 
14894
@@ -99,7 +99,7 @@
 
14895
          rs *= extent[n];
 
14896
        }
 
14897
       ret->offset = 0;
 
14898
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
 
14899
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
 
14900
     }
 
14901
   else
 
14902
     {
 
14903
@@ -244,7 +244,7 @@
 
14904
          rs *= extent[n];
 
14905
        }
 
14906
       ret->offset = 0;
 
14907
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
 
14908
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
 
14909
     }
 
14910
   else
 
14911
     {
 
14912
Index: libgfortran/generated/spread_r8.c
 
14913
===================================================================
 
14914
--- a/src/libgfortran/generated/spread_r8.c     (.../tags/gcc_4_8_3_release)
 
14915
+++ b/src/libgfortran/generated/spread_r8.c     (.../branches/gcc-4_8-branch)
 
14916
@@ -101,8 +101,8 @@
 
14917
        }
 
14918
       ret->offset = 0;
 
14919
 
 
14920
-      /* xmalloc allocates a single byte for zero size.  */
 
14921
-      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
 
14922
+      /* xmallocarray allocates a single byte for zero size.  */
 
14923
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
 
14924
       if (rs <= 0)
 
14925
         return;
 
14926
     }
 
14927
@@ -244,7 +244,7 @@
 
14928
 
 
14929
   if (ret->base_addr == NULL)
 
14930
     {
 
14931
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
 
14932
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
 
14933
       ret->offset = 0;
 
14934
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
14935
     }
 
14936
Index: libgfortran/generated/minloc1_16_i16.c
 
14937
===================================================================
 
14938
--- a/src/libgfortran/generated/minloc1_16_i16.c        (.../tags/gcc_4_8_3_release)
 
14939
+++ b/src/libgfortran/generated/minloc1_16_i16.c        (.../branches/gcc-4_8-branch)
 
14940
@@ -98,10 +98,9 @@
 
14941
       retarray->offset = 0;
 
14942
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14943
 
 
14944
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14945
-                  * extent[rank-1];
 
14946
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14947
 
 
14948
-      retarray->base_addr = xmalloc (alloc_size);
 
14949
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14950
       if (alloc_size == 0)
 
14951
        {
 
14952
          /* Make sure we have a zero-sized array.  */
 
14953
@@ -294,8 +293,7 @@
 
14954
 
 
14955
        }
 
14956
 
 
14957
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14958
-                  * extent[rank-1];
 
14959
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14960
 
 
14961
       retarray->offset = 0;
 
14962
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14963
@@ -307,7 +305,7 @@
 
14964
          return;
 
14965
        }
 
14966
       else
 
14967
-       retarray->base_addr = xmalloc (alloc_size);
 
14968
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14969
 
 
14970
     }
 
14971
   else
 
14972
@@ -485,8 +483,7 @@
 
14973
       retarray->offset = 0;
 
14974
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14975
 
 
14976
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14977
-                  * extent[rank-1];
 
14978
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14979
 
 
14980
       if (alloc_size == 0)
 
14981
        {
 
14982
@@ -495,7 +492,7 @@
 
14983
          return;
 
14984
        }
 
14985
       else
 
14986
-       retarray->base_addr = xmalloc (alloc_size);
 
14987
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14988
     }
 
14989
   else
 
14990
     {
 
14991
Index: libgfortran/generated/maxloc1_8_r4.c
 
14992
===================================================================
 
14993
--- a/src/libgfortran/generated/maxloc1_8_r4.c  (.../tags/gcc_4_8_3_release)
 
14994
+++ b/src/libgfortran/generated/maxloc1_8_r4.c  (.../branches/gcc-4_8-branch)
 
14995
@@ -98,10 +98,9 @@
 
14996
       retarray->offset = 0;
 
14997
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14998
 
 
14999
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15000
-                  * extent[rank-1];
 
15001
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15002
 
 
15003
-      retarray->base_addr = xmalloc (alloc_size);
 
15004
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15005
       if (alloc_size == 0)
 
15006
        {
 
15007
          /* Make sure we have a zero-sized array.  */
 
15008
@@ -294,8 +293,7 @@
 
15009
 
 
15010
        }
 
15011
 
 
15012
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15013
-                  * extent[rank-1];
 
15014
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15015
 
 
15016
       retarray->offset = 0;
 
15017
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15018
@@ -307,7 +305,7 @@
 
15019
          return;
 
15020
        }
 
15021
       else
 
15022
-       retarray->base_addr = xmalloc (alloc_size);
 
15023
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15024
 
 
15025
     }
 
15026
   else
 
15027
@@ -485,8 +483,7 @@
 
15028
       retarray->offset = 0;
 
15029
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15030
 
 
15031
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15032
-                  * extent[rank-1];
 
15033
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15034
 
 
15035
       if (alloc_size == 0)
 
15036
        {
 
15037
@@ -495,7 +492,7 @@
 
15038
          return;
 
15039
        }
 
15040
       else
 
15041
-       retarray->base_addr = xmalloc (alloc_size);
 
15042
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15043
     }
 
15044
   else
 
15045
     {
 
15046
Index: libgfortran/generated/minloc1_16_i1.c
 
15047
===================================================================
 
15048
--- a/src/libgfortran/generated/minloc1_16_i1.c (.../tags/gcc_4_8_3_release)
 
15049
+++ b/src/libgfortran/generated/minloc1_16_i1.c (.../branches/gcc-4_8-branch)
 
15050
@@ -98,10 +98,9 @@
 
15051
       retarray->offset = 0;
 
15052
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15053
 
 
15054
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15055
-                  * extent[rank-1];
 
15056
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15057
 
 
15058
-      retarray->base_addr = xmalloc (alloc_size);
 
15059
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15060
       if (alloc_size == 0)
 
15061
        {
 
15062
          /* Make sure we have a zero-sized array.  */
 
15063
@@ -294,8 +293,7 @@
 
15064
 
 
15065
        }
 
15066
 
 
15067
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15068
-                  * extent[rank-1];
 
15069
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15070
 
 
15071
       retarray->offset = 0;
 
15072
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15073
@@ -307,7 +305,7 @@
 
15074
          return;
 
15075
        }
 
15076
       else
 
15077
-       retarray->base_addr = xmalloc (alloc_size);
 
15078
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15079
 
 
15080
     }
 
15081
   else
 
15082
@@ -485,8 +483,7 @@
 
15083
       retarray->offset = 0;
 
15084
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15085
 
 
15086
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15087
-                  * extent[rank-1];
 
15088
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15089
 
 
15090
       if (alloc_size == 0)
 
15091
        {
 
15092
@@ -495,7 +492,7 @@
 
15093
          return;
 
15094
        }
 
15095
       else
 
15096
-       retarray->base_addr = xmalloc (alloc_size);
 
15097
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15098
     }
 
15099
   else
 
15100
     {
 
15101
Index: libgfortran/generated/spread_r16.c
 
15102
===================================================================
 
15103
--- a/src/libgfortran/generated/spread_r16.c    (.../tags/gcc_4_8_3_release)
 
15104
+++ b/src/libgfortran/generated/spread_r16.c    (.../branches/gcc-4_8-branch)
 
15105
@@ -101,8 +101,8 @@
 
15106
        }
 
15107
       ret->offset = 0;
 
15108
 
 
15109
-      /* xmalloc allocates a single byte for zero size.  */
 
15110
-      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_16));
 
15111
+      /* xmallocarray allocates a single byte for zero size.  */
 
15112
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_16));
 
15113
       if (rs <= 0)
 
15114
         return;
 
15115
     }
 
15116
@@ -244,7 +244,7 @@
 
15117
 
 
15118
   if (ret->base_addr == NULL)
 
15119
     {
 
15120
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_16));
 
15121
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_16));
 
15122
       ret->offset = 0;
 
15123
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
15124
     }
 
15125
Index: libgfortran/generated/pack_c8.c
 
15126
===================================================================
 
15127
--- a/src/libgfortran/generated/pack_c8.c       (.../tags/gcc_4_8_3_release)
 
15128
+++ b/src/libgfortran/generated/pack_c8.c       (.../branches/gcc-4_8-branch)
 
15129
@@ -167,8 +167,8 @@
 
15130
 
 
15131
          ret->offset = 0;
 
15132
 
 
15133
-         /* xmalloc allocates a single byte for zero size.  */
 
15134
-         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * total);
 
15135
+         /* xmallocarray allocates a single byte for zero size.  */
 
15136
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_8));
 
15137
 
 
15138
          if (total == 0)
 
15139
            return;
 
15140
Index: libgfortran/generated/minval_r10.c
 
15141
===================================================================
 
15142
--- a/src/libgfortran/generated/minval_r10.c    (.../tags/gcc_4_8_3_release)
 
15143
+++ b/src/libgfortran/generated/minval_r10.c    (.../branches/gcc-4_8-branch)
 
15144
@@ -97,10 +97,9 @@
 
15145
       retarray->offset = 0;
 
15146
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15147
 
 
15148
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15149
-                  * extent[rank-1];
 
15150
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15151
 
 
15152
-      retarray->base_addr = xmalloc (alloc_size);
 
15153
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
15154
       if (alloc_size == 0)
 
15155
        {
 
15156
          /* Make sure we have a zero-sized array.  */
 
15157
@@ -286,8 +285,7 @@
 
15158
 
 
15159
        }
 
15160
 
 
15161
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15162
-                  * extent[rank-1];
 
15163
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15164
 
 
15165
       retarray->offset = 0;
 
15166
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15167
@@ -299,7 +297,7 @@
 
15168
          return;
 
15169
        }
 
15170
       else
 
15171
-       retarray->base_addr = xmalloc (alloc_size);
 
15172
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
15173
 
 
15174
     }
 
15175
   else
 
15176
@@ -472,8 +470,7 @@
 
15177
       retarray->offset = 0;
 
15178
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15179
 
 
15180
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15181
-                  * extent[rank-1];
 
15182
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15183
 
 
15184
       if (alloc_size == 0)
 
15185
        {
 
15186
@@ -482,7 +479,7 @@
 
15187
          return;
 
15188
        }
 
15189
       else
 
15190
-       retarray->base_addr = xmalloc (alloc_size);
 
15191
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
15192
     }
 
15193
   else
 
15194
     {
 
15195
Index: libgfortran/generated/parity_l8.c
 
15196
===================================================================
 
15197
--- a/src/libgfortran/generated/parity_l8.c     (.../tags/gcc_4_8_3_release)
 
15198
+++ b/src/libgfortran/generated/parity_l8.c     (.../branches/gcc-4_8-branch)
 
15199
@@ -98,10 +98,9 @@
 
15200
       retarray->offset = 0;
 
15201
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15202
 
 
15203
-      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15204
-                  * extent[rank-1];
 
15205
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15206
 
 
15207
-      retarray->base_addr = xmalloc (alloc_size);
 
15208
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
 
15209
       if (alloc_size == 0)
 
15210
        {
 
15211
          /* Make sure we have a zero-sized array.  */
 
15212
Index: libgfortran/generated/minval_i4.c
 
15213
===================================================================
 
15214
--- a/src/libgfortran/generated/minval_i4.c     (.../tags/gcc_4_8_3_release)
 
15215
+++ b/src/libgfortran/generated/minval_i4.c     (.../branches/gcc-4_8-branch)
 
15216
@@ -97,10 +97,9 @@
 
15217
       retarray->offset = 0;
 
15218
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15219
 
 
15220
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15221
-                  * extent[rank-1];
 
15222
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15223
 
 
15224
-      retarray->base_addr = xmalloc (alloc_size);
 
15225
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15226
       if (alloc_size == 0)
 
15227
        {
 
15228
          /* Make sure we have a zero-sized array.  */
 
15229
@@ -286,8 +285,7 @@
 
15230
 
 
15231
        }
 
15232
 
 
15233
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15234
-                  * extent[rank-1];
 
15235
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15236
 
 
15237
       retarray->offset = 0;
 
15238
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15239
@@ -299,7 +297,7 @@
 
15240
          return;
 
15241
        }
 
15242
       else
 
15243
-       retarray->base_addr = xmalloc (alloc_size);
 
15244
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15245
 
 
15246
     }
 
15247
   else
 
15248
@@ -472,8 +470,7 @@
 
15249
       retarray->offset = 0;
 
15250
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15251
 
 
15252
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15253
-                  * extent[rank-1];
 
15254
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15255
 
 
15256
       if (alloc_size == 0)
 
15257
        {
 
15258
@@ -482,7 +479,7 @@
 
15259
          return;
 
15260
        }
 
15261
       else
 
15262
-       retarray->base_addr = xmalloc (alloc_size);
 
15263
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15264
     }
 
15265
   else
 
15266
     {
 
15267
Index: libgfortran/generated/maxloc1_8_i2.c
 
15268
===================================================================
 
15269
--- a/src/libgfortran/generated/maxloc1_8_i2.c  (.../tags/gcc_4_8_3_release)
 
15270
+++ b/src/libgfortran/generated/maxloc1_8_i2.c  (.../branches/gcc-4_8-branch)
 
15271
@@ -98,10 +98,9 @@
 
15272
       retarray->offset = 0;
 
15273
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15274
 
 
15275
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15276
-                  * extent[rank-1];
 
15277
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15278
 
 
15279
-      retarray->base_addr = xmalloc (alloc_size);
 
15280
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15281
       if (alloc_size == 0)
 
15282
        {
 
15283
          /* Make sure we have a zero-sized array.  */
 
15284
@@ -294,8 +293,7 @@
 
15285
 
 
15286
        }
 
15287
 
 
15288
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15289
-                  * extent[rank-1];
 
15290
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15291
 
 
15292
       retarray->offset = 0;
 
15293
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15294
@@ -307,7 +305,7 @@
 
15295
          return;
 
15296
        }
 
15297
       else
 
15298
-       retarray->base_addr = xmalloc (alloc_size);
 
15299
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15300
 
 
15301
     }
 
15302
   else
 
15303
@@ -485,8 +483,7 @@
 
15304
       retarray->offset = 0;
 
15305
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15306
 
 
15307
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15308
-                  * extent[rank-1];
 
15309
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15310
 
 
15311
       if (alloc_size == 0)
 
15312
        {
 
15313
@@ -495,7 +492,7 @@
 
15314
          return;
 
15315
        }
 
15316
       else
 
15317
-       retarray->base_addr = xmalloc (alloc_size);
 
15318
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15319
     }
 
15320
   else
 
15321
     {
 
15322
Index: libgfortran/generated/any_l8.c
 
15323
===================================================================
 
15324
--- a/src/libgfortran/generated/any_l8.c        (.../tags/gcc_4_8_3_release)
 
15325
+++ b/src/libgfortran/generated/any_l8.c        (.../branches/gcc-4_8-branch)
 
15326
@@ -101,8 +101,7 @@
 
15327
       retarray->offset = 0;
 
15328
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15329
 
 
15330
-      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15331
-                  * extent[rank-1];
 
15332
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15333
 
 
15334
       if (alloc_size == 0)
 
15335
        {
 
15336
@@ -111,7 +110,7 @@
 
15337
          return;
 
15338
        }
 
15339
       else
 
15340
-       retarray->base_addr = xmalloc (alloc_size);
 
15341
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
 
15342
     }
 
15343
   else
 
15344
     {
 
15345
Index: libgfortran/generated/maxloc0_16_r10.c
 
15346
===================================================================
 
15347
--- a/src/libgfortran/generated/maxloc0_16_r10.c        (.../tags/gcc_4_8_3_release)
 
15348
+++ b/src/libgfortran/generated/maxloc0_16_r10.c        (.../branches/gcc-4_8-branch)
 
15349
@@ -58,7 +58,7 @@
 
15350
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15351
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15352
       retarray->offset = 0;
 
15353
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15354
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15355
     }
 
15356
   else
 
15357
     {
 
15358
@@ -199,7 +199,7 @@
 
15359
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15360
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15361
       retarray->offset = 0;
 
15362
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15363
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15364
     }
 
15365
   else
 
15366
     {
 
15367
@@ -367,7 +367,7 @@
 
15368
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15369
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15370
       retarray->offset = 0;
 
15371
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15372
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15373
     }
 
15374
   else if (unlikely (compile_options.bounds_check))
 
15375
     {
 
15376
Index: libgfortran/generated/minloc0_4_i16.c
 
15377
===================================================================
 
15378
--- a/src/libgfortran/generated/minloc0_4_i16.c (.../tags/gcc_4_8_3_release)
 
15379
+++ b/src/libgfortran/generated/minloc0_4_i16.c (.../branches/gcc-4_8-branch)
 
15380
@@ -58,7 +58,7 @@
 
15381
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15382
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15383
       retarray->offset = 0;
 
15384
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15385
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15386
     }
 
15387
   else
 
15388
     {
 
15389
@@ -199,7 +199,7 @@
 
15390
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15391
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15392
       retarray->offset = 0;
 
15393
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15394
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15395
     }
 
15396
   else
 
15397
     {
 
15398
@@ -367,7 +367,7 @@
 
15399
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15400
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15401
       retarray->offset = 0;
 
15402
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15403
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15404
     }
 
15405
   else if (unlikely (compile_options.bounds_check))
 
15406
     {
 
15407
Index: libgfortran/generated/maxloc0_8_r8.c
 
15408
===================================================================
 
15409
--- a/src/libgfortran/generated/maxloc0_8_r8.c  (.../tags/gcc_4_8_3_release)
 
15410
+++ b/src/libgfortran/generated/maxloc0_8_r8.c  (.../branches/gcc-4_8-branch)
 
15411
@@ -58,7 +58,7 @@
 
15412
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15413
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15414
       retarray->offset = 0;
 
15415
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15416
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15417
     }
 
15418
   else
 
15419
     {
 
15420
@@ -199,7 +199,7 @@
 
15421
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15422
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15423
       retarray->offset = 0;
 
15424
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15425
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15426
     }
 
15427
   else
 
15428
     {
 
15429
@@ -367,7 +367,7 @@
 
15430
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15431
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15432
       retarray->offset = 0;
 
15433
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15434
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15435
     }
 
15436
   else if (unlikely (compile_options.bounds_check))
 
15437
     {
 
15438
Index: libgfortran/generated/minloc1_4_r10.c
 
15439
===================================================================
 
15440
--- a/src/libgfortran/generated/minloc1_4_r10.c (.../tags/gcc_4_8_3_release)
 
15441
+++ b/src/libgfortran/generated/minloc1_4_r10.c (.../branches/gcc-4_8-branch)
 
15442
@@ -98,10 +98,9 @@
 
15443
       retarray->offset = 0;
 
15444
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15445
 
 
15446
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15447
-                  * extent[rank-1];
 
15448
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15449
 
 
15450
-      retarray->base_addr = xmalloc (alloc_size);
 
15451
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15452
       if (alloc_size == 0)
 
15453
        {
 
15454
          /* Make sure we have a zero-sized array.  */
 
15455
@@ -294,8 +293,7 @@
 
15456
 
 
15457
        }
 
15458
 
 
15459
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15460
-                  * extent[rank-1];
 
15461
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15462
 
 
15463
       retarray->offset = 0;
 
15464
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15465
@@ -307,7 +305,7 @@
 
15466
          return;
 
15467
        }
 
15468
       else
 
15469
-       retarray->base_addr = xmalloc (alloc_size);
 
15470
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15471
 
 
15472
     }
 
15473
   else
 
15474
@@ -485,8 +483,7 @@
 
15475
       retarray->offset = 0;
 
15476
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15477
 
 
15478
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15479
-                  * extent[rank-1];
 
15480
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15481
 
 
15482
       if (alloc_size == 0)
 
15483
        {
 
15484
@@ -495,7 +492,7 @@
 
15485
          return;
 
15486
        }
 
15487
       else
 
15488
-       retarray->base_addr = xmalloc (alloc_size);
 
15489
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15490
     }
 
15491
   else
 
15492
     {
 
15493
Index: libgfortran/generated/minloc1_8_i16.c
 
15494
===================================================================
 
15495
--- a/src/libgfortran/generated/minloc1_8_i16.c (.../tags/gcc_4_8_3_release)
 
15496
+++ b/src/libgfortran/generated/minloc1_8_i16.c (.../branches/gcc-4_8-branch)
 
15497
@@ -98,10 +98,9 @@
 
15498
       retarray->offset = 0;
 
15499
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15500
 
 
15501
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15502
-                  * extent[rank-1];
 
15503
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15504
 
 
15505
-      retarray->base_addr = xmalloc (alloc_size);
 
15506
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15507
       if (alloc_size == 0)
 
15508
        {
 
15509
          /* Make sure we have a zero-sized array.  */
 
15510
@@ -294,8 +293,7 @@
 
15511
 
 
15512
        }
 
15513
 
 
15514
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15515
-                  * extent[rank-1];
 
15516
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15517
 
 
15518
       retarray->offset = 0;
 
15519
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15520
@@ -307,7 +305,7 @@
 
15521
          return;
 
15522
        }
 
15523
       else
 
15524
-       retarray->base_addr = xmalloc (alloc_size);
 
15525
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15526
 
 
15527
     }
 
15528
   else
 
15529
@@ -485,8 +483,7 @@
 
15530
       retarray->offset = 0;
 
15531
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15532
 
 
15533
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15534
-                  * extent[rank-1];
 
15535
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15536
 
 
15537
       if (alloc_size == 0)
 
15538
        {
 
15539
@@ -495,7 +492,7 @@
 
15540
          return;
 
15541
        }
 
15542
       else
 
15543
-       retarray->base_addr = xmalloc (alloc_size);
 
15544
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15545
     }
 
15546
   else
 
15547
     {
 
15548
Index: libgfortran/generated/maxloc0_8_r10.c
 
15549
===================================================================
 
15550
--- a/src/libgfortran/generated/maxloc0_8_r10.c (.../tags/gcc_4_8_3_release)
 
15551
+++ b/src/libgfortran/generated/maxloc0_8_r10.c (.../branches/gcc-4_8-branch)
 
15552
@@ -58,7 +58,7 @@
 
15553
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15554
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15555
       retarray->offset = 0;
 
15556
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15557
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15558
     }
 
15559
   else
 
15560
     {
 
15561
@@ -199,7 +199,7 @@
 
15562
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15563
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15564
       retarray->offset = 0;
 
15565
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15566
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15567
     }
 
15568
   else
 
15569
     {
 
15570
@@ -367,7 +367,7 @@
 
15571
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15572
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15573
       retarray->offset = 0;
 
15574
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15575
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15576
     }
 
15577
   else if (unlikely (compile_options.bounds_check))
 
15578
     {
 
15579
Index: libgfortran/generated/unpack_i4.c
 
15580
===================================================================
 
15581
--- a/src/libgfortran/generated/unpack_i4.c     (.../tags/gcc_4_8_3_release)
 
15582
+++ b/src/libgfortran/generated/unpack_i4.c     (.../branches/gcc-4_8-branch)
 
15583
@@ -99,7 +99,7 @@
 
15584
          rs *= extent[n];
 
15585
        }
 
15586
       ret->offset = 0;
 
15587
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
 
15588
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
 
15589
     }
 
15590
   else
 
15591
     {
 
15592
@@ -244,7 +244,7 @@
 
15593
          rs *= extent[n];
 
15594
        }
 
15595
       ret->offset = 0;
 
15596
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
 
15597
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
 
15598
     }
 
15599
   else
 
15600
     {
 
15601
Index: libgfortran/generated/minloc1_16_r4.c
 
15602
===================================================================
 
15603
--- a/src/libgfortran/generated/minloc1_16_r4.c (.../tags/gcc_4_8_3_release)
 
15604
+++ b/src/libgfortran/generated/minloc1_16_r4.c (.../branches/gcc-4_8-branch)
 
15605
@@ -98,10 +98,9 @@
 
15606
       retarray->offset = 0;
 
15607
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15608
 
 
15609
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15610
-                  * extent[rank-1];
 
15611
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15612
 
 
15613
-      retarray->base_addr = xmalloc (alloc_size);
 
15614
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15615
       if (alloc_size == 0)
 
15616
        {
 
15617
          /* Make sure we have a zero-sized array.  */
 
15618
@@ -294,8 +293,7 @@
 
15619
 
 
15620
        }
 
15621
 
 
15622
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15623
-                  * extent[rank-1];
 
15624
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15625
 
 
15626
       retarray->offset = 0;
 
15627
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15628
@@ -307,7 +305,7 @@
 
15629
          return;
 
15630
        }
 
15631
       else
 
15632
-       retarray->base_addr = xmalloc (alloc_size);
 
15633
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15634
 
 
15635
     }
 
15636
   else
 
15637
@@ -485,8 +483,7 @@
 
15638
       retarray->offset = 0;
 
15639
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15640
 
 
15641
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15642
-                  * extent[rank-1];
 
15643
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15644
 
 
15645
       if (alloc_size == 0)
 
15646
        {
 
15647
@@ -495,7 +492,7 @@
 
15648
          return;
 
15649
        }
 
15650
       else
 
15651
-       retarray->base_addr = xmalloc (alloc_size);
 
15652
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15653
     }
 
15654
   else
 
15655
     {
 
15656
Index: libgfortran/generated/product_i8.c
 
15657
===================================================================
 
15658
--- a/src/libgfortran/generated/product_i8.c    (.../tags/gcc_4_8_3_release)
 
15659
+++ b/src/libgfortran/generated/product_i8.c    (.../branches/gcc-4_8-branch)
 
15660
@@ -97,10 +97,9 @@
 
15661
       retarray->offset = 0;
 
15662
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15663
 
 
15664
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15665
-                  * extent[rank-1];
 
15666
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15667
 
 
15668
-      retarray->base_addr = xmalloc (alloc_size);
 
15669
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15670
       if (alloc_size == 0)
 
15671
        {
 
15672
          /* Make sure we have a zero-sized array.  */
 
15673
@@ -272,8 +271,7 @@
 
15674
 
 
15675
        }
 
15676
 
 
15677
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15678
-                  * extent[rank-1];
 
15679
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15680
 
 
15681
       retarray->offset = 0;
 
15682
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15683
@@ -285,7 +283,7 @@
 
15684
          return;
 
15685
        }
 
15686
       else
 
15687
-       retarray->base_addr = xmalloc (alloc_size);
 
15688
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15689
 
 
15690
     }
 
15691
   else
 
15692
@@ -430,8 +428,7 @@
 
15693
       retarray->offset = 0;
 
15694
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15695
 
 
15696
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15697
-                  * extent[rank-1];
 
15698
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15699
 
 
15700
       if (alloc_size == 0)
 
15701
        {
 
15702
@@ -440,7 +437,7 @@
 
15703
          return;
 
15704
        }
 
15705
       else
 
15706
-       retarray->base_addr = xmalloc (alloc_size);
 
15707
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15708
     }
 
15709
   else
 
15710
     {
 
15711
Index: libgfortran/generated/minloc0_16_r8.c
 
15712
===================================================================
 
15713
--- a/src/libgfortran/generated/minloc0_16_r8.c (.../tags/gcc_4_8_3_release)
 
15714
+++ b/src/libgfortran/generated/minloc0_16_r8.c (.../branches/gcc-4_8-branch)
 
15715
@@ -58,7 +58,7 @@
 
15716
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15717
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15718
       retarray->offset = 0;
 
15719
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15720
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15721
     }
 
15722
   else
 
15723
     {
 
15724
@@ -199,7 +199,7 @@
 
15725
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15726
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15727
       retarray->offset = 0;
 
15728
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15729
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15730
     }
 
15731
   else
 
15732
     {
 
15733
@@ -367,7 +367,7 @@
 
15734
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15735
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15736
       retarray->offset = 0;
 
15737
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15738
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15739
     }
 
15740
   else if (unlikely (compile_options.bounds_check))
 
15741
     {
 
15742
Index: libgfortran/generated/count_2_l.c
 
15743
===================================================================
 
15744
--- a/src/libgfortran/generated/count_2_l.c     (.../tags/gcc_4_8_3_release)
 
15745
+++ b/src/libgfortran/generated/count_2_l.c     (.../branches/gcc-4_8-branch)
 
15746
@@ -101,8 +101,7 @@
 
15747
       retarray->offset = 0;
 
15748
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15749
 
 
15750
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15751
-                  * extent[rank-1];
 
15752
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15753
 
 
15754
       if (alloc_size == 0)
 
15755
        {
 
15756
@@ -111,7 +110,7 @@
 
15757
          return;
 
15758
        }
 
15759
       else
 
15760
-       retarray->base_addr = xmalloc (alloc_size);
 
15761
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
15762
     }
 
15763
   else
 
15764
     {
 
15765
Index: libgfortran/generated/transpose_r8.c
 
15766
===================================================================
 
15767
--- a/src/libgfortran/generated/transpose_r8.c  (.../tags/gcc_4_8_3_release)
 
15768
+++ b/src/libgfortran/generated/transpose_r8.c  (.../branches/gcc-4_8-branch)
 
15769
@@ -60,7 +60,8 @@
 
15770
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
15771
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
15772
 
 
15773
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
 
15774
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
15775
+                                     sizeof (GFC_REAL_8));
 
15776
       ret->offset = 0;
 
15777
     } else if (unlikely (compile_options.bounds_check))
 
15778
     {
 
15779
Index: libgfortran/generated/cshift1_8.c
 
15780
===================================================================
 
15781
--- a/src/libgfortran/generated/cshift1_8.c     (.../tags/gcc_4_8_3_release)
 
15782
+++ b/src/libgfortran/generated/cshift1_8.c     (.../branches/gcc-4_8-branch)
 
15783
@@ -80,7 +80,7 @@
 
15784
     {
 
15785
       int i;
 
15786
 
 
15787
-      ret->base_addr = xmalloc (size * arraysize);
 
15788
+      ret->base_addr = xmallocarray (arraysize, size);
 
15789
       ret->offset = 0;
 
15790
       ret->dtype = array->dtype;
 
15791
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
15792
Index: libgfortran/generated/matmul_i4.c
 
15793
===================================================================
 
15794
--- a/src/libgfortran/generated/matmul_i4.c     (.../tags/gcc_4_8_3_release)
 
15795
+++ b/src/libgfortran/generated/matmul_i4.c     (.../branches/gcc-4_8-branch)
 
15796
@@ -124,7 +124,7 @@
 
15797
         }
 
15798
 
 
15799
       retarray->base_addr
 
15800
-       = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
 
15801
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_4));
 
15802
       retarray->offset = 0;
 
15803
     }
 
15804
     else if (unlikely (compile_options.bounds_check))
 
15805
Index: libgfortran/generated/pack_r10.c
 
15806
===================================================================
 
15807
--- a/src/libgfortran/generated/pack_r10.c      (.../tags/gcc_4_8_3_release)
 
15808
+++ b/src/libgfortran/generated/pack_r10.c      (.../branches/gcc-4_8-branch)
 
15809
@@ -167,8 +167,8 @@
 
15810
 
 
15811
          ret->offset = 0;
 
15812
 
 
15813
-         /* xmalloc allocates a single byte for zero size.  */
 
15814
-         ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * total);
 
15815
+         /* xmallocarray allocates a single byte for zero size.  */
 
15816
+         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_10));
 
15817
 
 
15818
          if (total == 0)
 
15819
            return;
 
15820
Index: libgfortran/generated/minloc1_16_i2.c
 
15821
===================================================================
 
15822
--- a/src/libgfortran/generated/minloc1_16_i2.c (.../tags/gcc_4_8_3_release)
 
15823
+++ b/src/libgfortran/generated/minloc1_16_i2.c (.../branches/gcc-4_8-branch)
 
15824
@@ -98,10 +98,9 @@
 
15825
       retarray->offset = 0;
 
15826
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15827
 
 
15828
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15829
-                  * extent[rank-1];
 
15830
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15831
 
 
15832
-      retarray->base_addr = xmalloc (alloc_size);
 
15833
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15834
       if (alloc_size == 0)
 
15835
        {
 
15836
          /* Make sure we have a zero-sized array.  */
 
15837
@@ -294,8 +293,7 @@
 
15838
 
 
15839
        }
 
15840
 
 
15841
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15842
-                  * extent[rank-1];
 
15843
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15844
 
 
15845
       retarray->offset = 0;
 
15846
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15847
@@ -307,7 +305,7 @@
 
15848
          return;
 
15849
        }
 
15850
       else
 
15851
-       retarray->base_addr = xmalloc (alloc_size);
 
15852
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15853
 
 
15854
     }
 
15855
   else
 
15856
@@ -485,8 +483,7 @@
 
15857
       retarray->offset = 0;
 
15858
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15859
 
 
15860
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15861
-                  * extent[rank-1];
 
15862
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15863
 
 
15864
       if (alloc_size == 0)
 
15865
        {
 
15866
@@ -495,7 +492,7 @@
 
15867
          return;
 
15868
        }
 
15869
       else
 
15870
-       retarray->base_addr = xmalloc (alloc_size);
 
15871
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15872
     }
 
15873
   else
 
15874
     {
 
15875
Index: libgfortran/generated/in_pack_i8.c
 
15876
===================================================================
 
15877
--- a/src/libgfortran/generated/in_pack_i8.c    (.../tags/gcc_4_8_3_release)
 
15878
+++ b/src/libgfortran/generated/in_pack_i8.c    (.../branches/gcc-4_8-branch)
 
15879
@@ -76,7 +76,7 @@
 
15880
     return source->base_addr;
 
15881
 
 
15882
   /* Allocate storage for the destination.  */
 
15883
-  destptr = (GFC_INTEGER_8 *)xmalloc (ssize * sizeof (GFC_INTEGER_8));
 
15884
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_8));
 
15885
   dest = destptr;
 
15886
   src = source->base_addr;
 
15887
   stride0 = stride[0];
 
15888
Index: libgfortran/generated/transpose_r16.c
 
15889
===================================================================
 
15890
--- a/src/libgfortran/generated/transpose_r16.c (.../tags/gcc_4_8_3_release)
 
15891
+++ b/src/libgfortran/generated/transpose_r16.c (.../branches/gcc-4_8-branch)
 
15892
@@ -60,7 +60,8 @@
 
15893
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
15894
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
15895
 
 
15896
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
 
15897
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
15898
+                                     sizeof (GFC_REAL_16));
 
15899
       ret->offset = 0;
 
15900
     } else if (unlikely (compile_options.bounds_check))
 
15901
     {
 
15902
Index: libgfortran/generated/minloc1_4_i4.c
 
15903
===================================================================
 
15904
--- a/src/libgfortran/generated/minloc1_4_i4.c  (.../tags/gcc_4_8_3_release)
 
15905
+++ b/src/libgfortran/generated/minloc1_4_i4.c  (.../branches/gcc-4_8-branch)
 
15906
@@ -98,10 +98,9 @@
 
15907
       retarray->offset = 0;
 
15908
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15909
 
 
15910
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15911
-                  * extent[rank-1];
 
15912
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15913
 
 
15914
-      retarray->base_addr = xmalloc (alloc_size);
 
15915
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15916
       if (alloc_size == 0)
 
15917
        {
 
15918
          /* Make sure we have a zero-sized array.  */
 
15919
@@ -294,8 +293,7 @@
 
15920
 
 
15921
        }
 
15922
 
 
15923
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15924
-                  * extent[rank-1];
 
15925
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15926
 
 
15927
       retarray->offset = 0;
 
15928
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15929
@@ -307,7 +305,7 @@
 
15930
          return;
 
15931
        }
 
15932
       else
 
15933
-       retarray->base_addr = xmalloc (alloc_size);
 
15934
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15935
 
 
15936
     }
 
15937
   else
 
15938
@@ -485,8 +483,7 @@
 
15939
       retarray->offset = 0;
 
15940
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15941
 
 
15942
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15943
-                  * extent[rank-1];
 
15944
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15945
 
 
15946
       if (alloc_size == 0)
 
15947
        {
 
15948
@@ -495,7 +492,7 @@
 
15949
          return;
 
15950
        }
 
15951
       else
 
15952
-       retarray->base_addr = xmalloc (alloc_size);
 
15953
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15954
     }
 
15955
   else
 
15956
     {
 
15957
Index: libgfortran/generated/maxval_i1.c
 
15958
===================================================================
 
15959
--- a/src/libgfortran/generated/maxval_i1.c     (.../tags/gcc_4_8_3_release)
 
15960
+++ b/src/libgfortran/generated/maxval_i1.c     (.../branches/gcc-4_8-branch)
 
15961
@@ -97,10 +97,9 @@
 
15962
       retarray->offset = 0;
 
15963
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15964
 
 
15965
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15966
-                  * extent[rank-1];
 
15967
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15968
 
 
15969
-      retarray->base_addr = xmalloc (alloc_size);
 
15970
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
15971
       if (alloc_size == 0)
 
15972
        {
 
15973
          /* Make sure we have a zero-sized array.  */
 
15974
@@ -286,8 +285,7 @@
 
15975
 
 
15976
        }
 
15977
 
 
15978
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15979
-                  * extent[rank-1];
 
15980
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15981
 
 
15982
       retarray->offset = 0;
 
15983
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15984
@@ -299,7 +297,7 @@
 
15985
          return;
 
15986
        }
 
15987
       else
 
15988
-       retarray->base_addr = xmalloc (alloc_size);
 
15989
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
15990
 
 
15991
     }
 
15992
   else
 
15993
@@ -472,8 +470,7 @@
 
15994
       retarray->offset = 0;
 
15995
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15996
 
 
15997
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15998
-                  * extent[rank-1];
 
15999
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16000
 
 
16001
       if (alloc_size == 0)
 
16002
        {
 
16003
@@ -482,7 +479,7 @@
 
16004
          return;
 
16005
        }
 
16006
       else
 
16007
-       retarray->base_addr = xmalloc (alloc_size);
 
16008
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
16009
     }
 
16010
   else
 
16011
     {
 
16012
Index: libgfortran/generated/product_c16.c
 
16013
===================================================================
 
16014
--- a/src/libgfortran/generated/product_c16.c   (.../tags/gcc_4_8_3_release)
 
16015
+++ b/src/libgfortran/generated/product_c16.c   (.../branches/gcc-4_8-branch)
 
16016
@@ -97,10 +97,9 @@
 
16017
       retarray->offset = 0;
 
16018
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16019
 
 
16020
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16021
-                  * extent[rank-1];
 
16022
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16023
 
 
16024
-      retarray->base_addr = xmalloc (alloc_size);
 
16025
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
16026
       if (alloc_size == 0)
 
16027
        {
 
16028
          /* Make sure we have a zero-sized array.  */
 
16029
@@ -272,8 +271,7 @@
 
16030
 
 
16031
        }
 
16032
 
 
16033
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16034
-                  * extent[rank-1];
 
16035
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16036
 
 
16037
       retarray->offset = 0;
 
16038
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16039
@@ -285,7 +283,7 @@
 
16040
          return;
 
16041
        }
 
16042
       else
 
16043
-       retarray->base_addr = xmalloc (alloc_size);
 
16044
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
16045
 
 
16046
     }
 
16047
   else
 
16048
@@ -430,8 +428,7 @@
 
16049
       retarray->offset = 0;
 
16050
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16051
 
 
16052
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16053
-                  * extent[rank-1];
 
16054
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16055
 
 
16056
       if (alloc_size == 0)
 
16057
        {
 
16058
@@ -440,7 +437,7 @@
 
16059
          return;
 
16060
        }
 
16061
       else
 
16062
-       retarray->base_addr = xmalloc (alloc_size);
 
16063
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
16064
     }
 
16065
   else
 
16066
     {
 
16067
Index: libgfortran/generated/reshape_r4.c
 
16068
===================================================================
 
16069
--- a/src/libgfortran/generated/reshape_r4.c    (.../tags/gcc_4_8_3_release)
 
16070
+++ b/src/libgfortran/generated/reshape_r4.c    (.../branches/gcc-4_8-branch)
 
16071
@@ -111,11 +111,11 @@
 
16072
       ret->offset = 0;
 
16073
 
 
16074
       if (unlikely (rs < 1))
 
16075
-        alloc_size = 1;
 
16076
+        alloc_size = 0;
 
16077
       else
 
16078
-        alloc_size = rs * sizeof (GFC_REAL_4);
 
16079
+        alloc_size = rs;
 
16080
 
 
16081
-      ret->base_addr = xmalloc (alloc_size);
 
16082
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
16083
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
16084
     }
 
16085
 
 
16086
Index: libgfortran/generated/iany_i8.c
 
16087
===================================================================
 
16088
--- a/src/libgfortran/generated/iany_i8.c       (.../tags/gcc_4_8_3_release)
 
16089
+++ b/src/libgfortran/generated/iany_i8.c       (.../branches/gcc-4_8-branch)
 
16090
@@ -97,10 +97,9 @@
 
16091
       retarray->offset = 0;
 
16092
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16093
 
 
16094
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16095
-                  * extent[rank-1];
 
16096
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16097
 
 
16098
-      retarray->base_addr = xmalloc (alloc_size);
 
16099
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16100
       if (alloc_size == 0)
 
16101
        {
 
16102
          /* Make sure we have a zero-sized array.  */
 
16103
@@ -272,8 +271,7 @@
 
16104
 
 
16105
        }
 
16106
 
 
16107
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16108
-                  * extent[rank-1];
 
16109
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16110
 
 
16111
       retarray->offset = 0;
 
16112
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16113
@@ -285,7 +283,7 @@
 
16114
          return;
 
16115
        }
 
16116
       else
 
16117
-       retarray->base_addr = xmalloc (alloc_size);
 
16118
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16119
 
 
16120
     }
 
16121
   else
 
16122
@@ -430,8 +428,7 @@
 
16123
       retarray->offset = 0;
 
16124
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16125
 
 
16126
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16127
-                  * extent[rank-1];
 
16128
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16129
 
 
16130
       if (alloc_size == 0)
 
16131
        {
 
16132
@@ -440,7 +437,7 @@
 
16133
          return;
 
16134
        }
 
16135
       else
 
16136
-       retarray->base_addr = xmalloc (alloc_size);
 
16137
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16138
     }
 
16139
   else
 
16140
     {
 
16141
Index: libgfortran/generated/cshift1_16.c
 
16142
===================================================================
 
16143
--- a/src/libgfortran/generated/cshift1_16.c    (.../tags/gcc_4_8_3_release)
 
16144
+++ b/src/libgfortran/generated/cshift1_16.c    (.../branches/gcc-4_8-branch)
 
16145
@@ -80,7 +80,7 @@
 
16146
     {
 
16147
       int i;
 
16148
 
 
16149
-      ret->base_addr = xmalloc (size * arraysize);
 
16150
+      ret->base_addr = xmallocarray (arraysize, size);
 
16151
       ret->offset = 0;
 
16152
       ret->dtype = array->dtype;
 
16153
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
16154
Index: libgfortran/generated/maxloc0_4_i1.c
 
16155
===================================================================
 
16156
--- a/src/libgfortran/generated/maxloc0_4_i1.c  (.../tags/gcc_4_8_3_release)
 
16157
+++ b/src/libgfortran/generated/maxloc0_4_i1.c  (.../branches/gcc-4_8-branch)
 
16158
@@ -58,7 +58,7 @@
 
16159
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16160
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16161
       retarray->offset = 0;
 
16162
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16163
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16164
     }
 
16165
   else
 
16166
     {
 
16167
@@ -199,7 +199,7 @@
 
16168
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16169
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16170
       retarray->offset = 0;
 
16171
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16172
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16173
     }
 
16174
   else
 
16175
     {
 
16176
@@ -367,7 +367,7 @@
 
16177
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16178
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16179
       retarray->offset = 0;
 
16180
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16181
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16182
     }
 
16183
   else if (unlikely (compile_options.bounds_check))
 
16184
     {
 
16185
Index: libgfortran/generated/minloc0_4_i8.c
 
16186
===================================================================
 
16187
--- a/src/libgfortran/generated/minloc0_4_i8.c  (.../tags/gcc_4_8_3_release)
 
16188
+++ b/src/libgfortran/generated/minloc0_4_i8.c  (.../branches/gcc-4_8-branch)
 
16189
@@ -58,7 +58,7 @@
 
16190
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16191
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16192
       retarray->offset = 0;
 
16193
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16194
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16195
     }
 
16196
   else
 
16197
     {
 
16198
@@ -199,7 +199,7 @@
 
16199
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16200
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16201
       retarray->offset = 0;
 
16202
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16203
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16204
     }
 
16205
   else
 
16206
     {
 
16207
@@ -367,7 +367,7 @@
 
16208
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16209
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16210
       retarray->offset = 0;
 
16211
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16212
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16213
     }
 
16214
   else if (unlikely (compile_options.bounds_check))
 
16215
     {
 
16216
Index: libgfortran/generated/spread_c16.c
 
16217
===================================================================
 
16218
--- a/src/libgfortran/generated/spread_c16.c    (.../tags/gcc_4_8_3_release)
 
16219
+++ b/src/libgfortran/generated/spread_c16.c    (.../branches/gcc-4_8-branch)
 
16220
@@ -101,8 +101,8 @@
 
16221
        }
 
16222
       ret->offset = 0;
 
16223
 
 
16224
-      /* xmalloc allocates a single byte for zero size.  */
 
16225
-      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_16));
 
16226
+      /* xmallocarray allocates a single byte for zero size.  */
 
16227
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_16));
 
16228
       if (rs <= 0)
 
16229
         return;
 
16230
     }
 
16231
@@ -244,7 +244,7 @@
 
16232
 
 
16233
   if (ret->base_addr == NULL)
 
16234
     {
 
16235
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_16));
 
16236
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_16));
 
16237
       ret->offset = 0;
 
16238
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
16239
     }
 
16240
Index: libgfortran/generated/maxval_r4.c
 
16241
===================================================================
 
16242
--- a/src/libgfortran/generated/maxval_r4.c     (.../tags/gcc_4_8_3_release)
 
16243
+++ b/src/libgfortran/generated/maxval_r4.c     (.../branches/gcc-4_8-branch)
 
16244
@@ -97,10 +97,9 @@
 
16245
       retarray->offset = 0;
 
16246
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16247
 
 
16248
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16249
-                  * extent[rank-1];
 
16250
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16251
 
 
16252
-      retarray->base_addr = xmalloc (alloc_size);
 
16253
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
16254
       if (alloc_size == 0)
 
16255
        {
 
16256
          /* Make sure we have a zero-sized array.  */
 
16257
@@ -286,8 +285,7 @@
 
16258
 
 
16259
        }
 
16260
 
 
16261
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16262
-                  * extent[rank-1];
 
16263
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16264
 
 
16265
       retarray->offset = 0;
 
16266
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16267
@@ -299,7 +297,7 @@
 
16268
          return;
 
16269
        }
 
16270
       else
 
16271
-       retarray->base_addr = xmalloc (alloc_size);
 
16272
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
16273
 
 
16274
     }
 
16275
   else
 
16276
@@ -472,8 +470,7 @@
 
16277
       retarray->offset = 0;
 
16278
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16279
 
 
16280
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16281
-                  * extent[rank-1];
 
16282
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16283
 
 
16284
       if (alloc_size == 0)
 
16285
        {
 
16286
@@ -482,7 +479,7 @@
 
16287
          return;
 
16288
        }
 
16289
       else
 
16290
-       retarray->base_addr = xmalloc (alloc_size);
 
16291
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
16292
     }
 
16293
   else
 
16294
     {
 
16295
Index: libgfortran/generated/minval_r8.c
 
16296
===================================================================
 
16297
--- a/src/libgfortran/generated/minval_r8.c     (.../tags/gcc_4_8_3_release)
 
16298
+++ b/src/libgfortran/generated/minval_r8.c     (.../branches/gcc-4_8-branch)
 
16299
@@ -97,10 +97,9 @@
 
16300
       retarray->offset = 0;
 
16301
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16302
 
 
16303
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16304
-                  * extent[rank-1];
 
16305
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16306
 
 
16307
-      retarray->base_addr = xmalloc (alloc_size);
 
16308
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
16309
       if (alloc_size == 0)
 
16310
        {
 
16311
          /* Make sure we have a zero-sized array.  */
 
16312
@@ -286,8 +285,7 @@
 
16313
 
 
16314
        }
 
16315
 
 
16316
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16317
-                  * extent[rank-1];
 
16318
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16319
 
 
16320
       retarray->offset = 0;
 
16321
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16322
@@ -299,7 +297,7 @@
 
16323
          return;
 
16324
        }
 
16325
       else
 
16326
-       retarray->base_addr = xmalloc (alloc_size);
 
16327
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
16328
 
 
16329
     }
 
16330
   else
 
16331
@@ -472,8 +470,7 @@
 
16332
       retarray->offset = 0;
 
16333
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16334
 
 
16335
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16336
-                  * extent[rank-1];
 
16337
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16338
 
 
16339
       if (alloc_size == 0)
 
16340
        {
 
16341
@@ -482,7 +479,7 @@
 
16342
          return;
 
16343
        }
 
16344
       else
 
16345
-       retarray->base_addr = xmalloc (alloc_size);
 
16346
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
16347
     }
 
16348
   else
 
16349
     {
 
16350
Index: libgfortran/generated/minloc1_16_r16.c
 
16351
===================================================================
 
16352
--- a/src/libgfortran/generated/minloc1_16_r16.c        (.../tags/gcc_4_8_3_release)
 
16353
+++ b/src/libgfortran/generated/minloc1_16_r16.c        (.../branches/gcc-4_8-branch)
 
16354
@@ -98,10 +98,9 @@
 
16355
       retarray->offset = 0;
 
16356
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16357
 
 
16358
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16359
-                  * extent[rank-1];
 
16360
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16361
 
 
16362
-      retarray->base_addr = xmalloc (alloc_size);
 
16363
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16364
       if (alloc_size == 0)
 
16365
        {
 
16366
          /* Make sure we have a zero-sized array.  */
 
16367
@@ -294,8 +293,7 @@
 
16368
 
 
16369
        }
 
16370
 
 
16371
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16372
-                  * extent[rank-1];
 
16373
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16374
 
 
16375
       retarray->offset = 0;
 
16376
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16377
@@ -307,7 +305,7 @@
 
16378
          return;
 
16379
        }
 
16380
       else
 
16381
-       retarray->base_addr = xmalloc (alloc_size);
 
16382
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16383
 
 
16384
     }
 
16385
   else
 
16386
@@ -485,8 +483,7 @@
 
16387
       retarray->offset = 0;
 
16388
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16389
 
 
16390
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16391
-                  * extent[rank-1];
 
16392
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16393
 
 
16394
       if (alloc_size == 0)
 
16395
        {
 
16396
@@ -495,7 +492,7 @@
 
16397
          return;
 
16398
        }
 
16399
       else
 
16400
-       retarray->base_addr = xmalloc (alloc_size);
 
16401
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16402
     }
 
16403
   else
 
16404
     {
 
16405
Index: libgfortran/generated/unpack_i16.c
 
16406
===================================================================
 
16407
--- a/src/libgfortran/generated/unpack_i16.c    (.../tags/gcc_4_8_3_release)
 
16408
+++ b/src/libgfortran/generated/unpack_i16.c    (.../branches/gcc-4_8-branch)
 
16409
@@ -99,7 +99,7 @@
 
16410
          rs *= extent[n];
 
16411
        }
 
16412
       ret->offset = 0;
 
16413
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
 
16414
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
 
16415
     }
 
16416
   else
 
16417
     {
 
16418
@@ -244,7 +244,7 @@
 
16419
          rs *= extent[n];
 
16420
        }
 
16421
       ret->offset = 0;
 
16422
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
 
16423
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
 
16424
     }
 
16425
   else
 
16426
     {
 
16427
Index: libgfortran/generated/sum_i8.c
 
16428
===================================================================
 
16429
--- a/src/libgfortran/generated/sum_i8.c        (.../tags/gcc_4_8_3_release)
 
16430
+++ b/src/libgfortran/generated/sum_i8.c        (.../branches/gcc-4_8-branch)
 
16431
@@ -97,10 +97,9 @@
 
16432
       retarray->offset = 0;
 
16433
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16434
 
 
16435
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16436
-                  * extent[rank-1];
 
16437
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16438
 
 
16439
-      retarray->base_addr = xmalloc (alloc_size);
 
16440
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16441
       if (alloc_size == 0)
 
16442
        {
 
16443
          /* Make sure we have a zero-sized array.  */
 
16444
@@ -272,8 +271,7 @@
 
16445
 
 
16446
        }
 
16447
 
 
16448
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16449
-                  * extent[rank-1];
 
16450
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16451
 
 
16452
       retarray->offset = 0;
 
16453
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16454
@@ -285,7 +283,7 @@
 
16455
          return;
 
16456
        }
 
16457
       else
 
16458
-       retarray->base_addr = xmalloc (alloc_size);
 
16459
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16460
 
 
16461
     }
 
16462
   else
 
16463
@@ -430,8 +428,7 @@
 
16464
       retarray->offset = 0;
 
16465
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16466
 
 
16467
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16468
-                  * extent[rank-1];
 
16469
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16470
 
 
16471
       if (alloc_size == 0)
 
16472
        {
 
16473
@@ -440,7 +437,7 @@
 
16474
          return;
 
16475
        }
 
16476
       else
 
16477
-       retarray->base_addr = xmalloc (alloc_size);
 
16478
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16479
     }
 
16480
   else
 
16481
     {
 
16482
Index: libgfortran/generated/pack_i1.c
 
16483
===================================================================
 
16484
--- a/src/libgfortran/generated/pack_i1.c       (.../tags/gcc_4_8_3_release)
 
16485
+++ b/src/libgfortran/generated/pack_i1.c       (.../branches/gcc-4_8-branch)
 
16486
@@ -167,8 +167,8 @@
 
16487
 
 
16488
          ret->offset = 0;
 
16489
 
 
16490
-         /* xmalloc allocates a single byte for zero size.  */
 
16491
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_1) * total);
 
16492
+         /* xmallocarray allocates a single byte for zero size.  */
 
16493
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_1));
 
16494
 
 
16495
          if (total == 0)
 
16496
            return;
 
16497
Index: libgfortran/generated/any_l16.c
 
16498
===================================================================
 
16499
--- a/src/libgfortran/generated/any_l16.c       (.../tags/gcc_4_8_3_release)
 
16500
+++ b/src/libgfortran/generated/any_l16.c       (.../branches/gcc-4_8-branch)
 
16501
@@ -101,8 +101,7 @@
 
16502
       retarray->offset = 0;
 
16503
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16504
 
 
16505
-      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16506
-                  * extent[rank-1];
 
16507
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16508
 
 
16509
       if (alloc_size == 0)
 
16510
        {
 
16511
@@ -111,7 +110,7 @@
 
16512
          return;
 
16513
        }
 
16514
       else
 
16515
-       retarray->base_addr = xmalloc (alloc_size);
 
16516
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
 
16517
     }
 
16518
   else
 
16519
     {
 
16520
Index: libgfortran/generated/spread_i8.c
 
16521
===================================================================
 
16522
--- a/src/libgfortran/generated/spread_i8.c     (.../tags/gcc_4_8_3_release)
 
16523
+++ b/src/libgfortran/generated/spread_i8.c     (.../branches/gcc-4_8-branch)
 
16524
@@ -101,8 +101,8 @@
 
16525
        }
 
16526
       ret->offset = 0;
 
16527
 
 
16528
-      /* xmalloc allocates a single byte for zero size.  */
 
16529
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_8));
 
16530
+      /* xmallocarray allocates a single byte for zero size.  */
 
16531
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_8));
 
16532
       if (rs <= 0)
 
16533
         return;
 
16534
     }
 
16535
@@ -244,7 +244,7 @@
 
16536
 
 
16537
   if (ret->base_addr == NULL)
 
16538
     {
 
16539
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_8));
 
16540
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_8));
 
16541
       ret->offset = 0;
 
16542
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
16543
     }
 
16544
Index: libgfortran/generated/maxval_i2.c
 
16545
===================================================================
 
16546
--- a/src/libgfortran/generated/maxval_i2.c     (.../tags/gcc_4_8_3_release)
 
16547
+++ b/src/libgfortran/generated/maxval_i2.c     (.../branches/gcc-4_8-branch)
 
16548
@@ -97,10 +97,9 @@
 
16549
       retarray->offset = 0;
 
16550
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16551
 
 
16552
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16553
-                  * extent[rank-1];
 
16554
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16555
 
 
16556
-      retarray->base_addr = xmalloc (alloc_size);
 
16557
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
16558
       if (alloc_size == 0)
 
16559
        {
 
16560
          /* Make sure we have a zero-sized array.  */
 
16561
@@ -286,8 +285,7 @@
 
16562
 
 
16563
        }
 
16564
 
 
16565
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16566
-                  * extent[rank-1];
 
16567
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16568
 
 
16569
       retarray->offset = 0;
 
16570
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16571
@@ -299,7 +297,7 @@
 
16572
          return;
 
16573
        }
 
16574
       else
 
16575
-       retarray->base_addr = xmalloc (alloc_size);
 
16576
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
16577
 
 
16578
     }
 
16579
   else
 
16580
@@ -472,8 +470,7 @@
 
16581
       retarray->offset = 0;
 
16582
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16583
 
 
16584
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16585
-                  * extent[rank-1];
 
16586
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16587
 
 
16588
       if (alloc_size == 0)
 
16589
        {
 
16590
@@ -482,7 +479,7 @@
 
16591
          return;
 
16592
        }
 
16593
       else
 
16594
-       retarray->base_addr = xmalloc (alloc_size);
 
16595
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
16596
     }
 
16597
   else
 
16598
     {
 
16599
Index: libgfortran/generated/maxloc1_8_i4.c
 
16600
===================================================================
 
16601
--- a/src/libgfortran/generated/maxloc1_8_i4.c  (.../tags/gcc_4_8_3_release)
 
16602
+++ b/src/libgfortran/generated/maxloc1_8_i4.c  (.../branches/gcc-4_8-branch)
 
16603
@@ -98,10 +98,9 @@
 
16604
       retarray->offset = 0;
 
16605
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16606
 
 
16607
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16608
-                  * extent[rank-1];
 
16609
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16610
 
 
16611
-      retarray->base_addr = xmalloc (alloc_size);
 
16612
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16613
       if (alloc_size == 0)
 
16614
        {
 
16615
          /* Make sure we have a zero-sized array.  */
 
16616
@@ -294,8 +293,7 @@
 
16617
 
 
16618
        }
 
16619
 
 
16620
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16621
-                  * extent[rank-1];
 
16622
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16623
 
 
16624
       retarray->offset = 0;
 
16625
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16626
@@ -307,7 +305,7 @@
 
16627
          return;
 
16628
        }
 
16629
       else
 
16630
-       retarray->base_addr = xmalloc (alloc_size);
 
16631
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16632
 
 
16633
     }
 
16634
   else
 
16635
@@ -485,8 +483,7 @@
 
16636
       retarray->offset = 0;
 
16637
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16638
 
 
16639
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16640
-                  * extent[rank-1];
 
16641
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16642
 
 
16643
       if (alloc_size == 0)
 
16644
        {
 
16645
@@ -495,7 +492,7 @@
 
16646
          return;
 
16647
        }
 
16648
       else
 
16649
-       retarray->base_addr = xmalloc (alloc_size);
 
16650
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16651
     }
 
16652
   else
 
16653
     {
 
16654
Index: libgfortran/generated/unpack_r8.c
 
16655
===================================================================
 
16656
--- a/src/libgfortran/generated/unpack_r8.c     (.../tags/gcc_4_8_3_release)
 
16657
+++ b/src/libgfortran/generated/unpack_r8.c     (.../branches/gcc-4_8-branch)
 
16658
@@ -99,7 +99,7 @@
 
16659
          rs *= extent[n];
 
16660
        }
 
16661
       ret->offset = 0;
 
16662
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
 
16663
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
 
16664
     }
 
16665
   else
 
16666
     {
 
16667
@@ -244,7 +244,7 @@
 
16668
          rs *= extent[n];
 
16669
        }
 
16670
       ret->offset = 0;
 
16671
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
 
16672
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
 
16673
     }
 
16674
   else
 
16675
     {
 
16676
Index: libgfortran/generated/maxloc0_4_r4.c
 
16677
===================================================================
 
16678
--- a/src/libgfortran/generated/maxloc0_4_r4.c  (.../tags/gcc_4_8_3_release)
 
16679
+++ b/src/libgfortran/generated/maxloc0_4_r4.c  (.../branches/gcc-4_8-branch)
 
16680
@@ -58,7 +58,7 @@
 
16681
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16682
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16683
       retarray->offset = 0;
 
16684
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16685
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16686
     }
 
16687
   else
 
16688
     {
 
16689
@@ -199,7 +199,7 @@
 
16690
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16691
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16692
       retarray->offset = 0;
 
16693
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16694
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16695
     }
 
16696
   else
 
16697
     {
 
16698
@@ -367,7 +367,7 @@
 
16699
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16700
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16701
       retarray->offset = 0;
 
16702
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16703
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16704
     }
 
16705
   else if (unlikely (compile_options.bounds_check))
 
16706
     {
 
16707
Index: libgfortran/generated/all_l1.c
 
16708
===================================================================
 
16709
--- a/src/libgfortran/generated/all_l1.c        (.../tags/gcc_4_8_3_release)
 
16710
+++ b/src/libgfortran/generated/all_l1.c        (.../branches/gcc-4_8-branch)
 
16711
@@ -101,8 +101,7 @@
 
16712
       retarray->offset = 0;
 
16713
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16714
 
 
16715
-      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16716
-                  * extent[rank-1];
 
16717
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16718
 
 
16719
       if (alloc_size == 0)
 
16720
        {
 
16721
@@ -111,7 +110,7 @@
 
16722
          return;
 
16723
        }
 
16724
       else
 
16725
-       retarray->base_addr = xmalloc (alloc_size);
 
16726
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
 
16727
     }
 
16728
   else
 
16729
     {
 
16730
Index: libgfortran/generated/matmul_r8.c
 
16731
===================================================================
 
16732
--- a/src/libgfortran/generated/matmul_r8.c     (.../tags/gcc_4_8_3_release)
 
16733
+++ b/src/libgfortran/generated/matmul_r8.c     (.../branches/gcc-4_8-branch)
 
16734
@@ -124,7 +124,7 @@
 
16735
         }
 
16736
 
 
16737
       retarray->base_addr
 
16738
-       = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
 
16739
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_8));
 
16740
       retarray->offset = 0;
 
16741
     }
 
16742
     else if (unlikely (compile_options.bounds_check))
 
16743
Index: libgfortran/generated/minloc0_4_r16.c
 
16744
===================================================================
 
16745
--- a/src/libgfortran/generated/minloc0_4_r16.c (.../tags/gcc_4_8_3_release)
 
16746
+++ b/src/libgfortran/generated/minloc0_4_r16.c (.../branches/gcc-4_8-branch)
 
16747
@@ -58,7 +58,7 @@
 
16748
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16749
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16750
       retarray->offset = 0;
 
16751
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16752
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16753
     }
 
16754
   else
 
16755
     {
 
16756
@@ -199,7 +199,7 @@
 
16757
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16758
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16759
       retarray->offset = 0;
 
16760
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16761
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16762
     }
 
16763
   else
 
16764
     {
 
16765
@@ -367,7 +367,7 @@
 
16766
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16767
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16768
       retarray->offset = 0;
 
16769
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16770
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16771
     }
 
16772
   else if (unlikely (compile_options.bounds_check))
 
16773
     {
 
16774
Index: libgfortran/generated/maxloc0_4_i2.c
 
16775
===================================================================
 
16776
--- a/src/libgfortran/generated/maxloc0_4_i2.c  (.../tags/gcc_4_8_3_release)
 
16777
+++ b/src/libgfortran/generated/maxloc0_4_i2.c  (.../branches/gcc-4_8-branch)
 
16778
@@ -58,7 +58,7 @@
 
16779
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16780
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16781
       retarray->offset = 0;
 
16782
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16783
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16784
     }
 
16785
   else
 
16786
     {
 
16787
@@ -199,7 +199,7 @@
 
16788
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16789
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16790
       retarray->offset = 0;
 
16791
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16792
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16793
     }
 
16794
   else
 
16795
     {
 
16796
@@ -367,7 +367,7 @@
 
16797
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16798
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16799
       retarray->offset = 0;
 
16800
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16801
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16802
     }
 
16803
   else if (unlikely (compile_options.bounds_check))
 
16804
     {
 
16805
Index: libgfortran/generated/minloc1_8_r16.c
 
16806
===================================================================
 
16807
--- a/src/libgfortran/generated/minloc1_8_r16.c (.../tags/gcc_4_8_3_release)
 
16808
+++ b/src/libgfortran/generated/minloc1_8_r16.c (.../branches/gcc-4_8-branch)
 
16809
@@ -98,10 +98,9 @@
 
16810
       retarray->offset = 0;
 
16811
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16812
 
 
16813
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16814
-                  * extent[rank-1];
 
16815
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16816
 
 
16817
-      retarray->base_addr = xmalloc (alloc_size);
 
16818
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16819
       if (alloc_size == 0)
 
16820
        {
 
16821
          /* Make sure we have a zero-sized array.  */
 
16822
@@ -294,8 +293,7 @@
 
16823
 
 
16824
        }
 
16825
 
 
16826
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16827
-                  * extent[rank-1];
 
16828
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16829
 
 
16830
       retarray->offset = 0;
 
16831
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16832
@@ -307,7 +305,7 @@
 
16833
          return;
 
16834
        }
 
16835
       else
 
16836
-       retarray->base_addr = xmalloc (alloc_size);
 
16837
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16838
 
 
16839
     }
 
16840
   else
 
16841
@@ -485,8 +483,7 @@
 
16842
       retarray->offset = 0;
 
16843
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16844
 
 
16845
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16846
-                  * extent[rank-1];
 
16847
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16848
 
 
16849
       if (alloc_size == 0)
 
16850
        {
 
16851
@@ -495,7 +492,7 @@
 
16852
          return;
 
16853
        }
 
16854
       else
 
16855
-       retarray->base_addr = xmalloc (alloc_size);
 
16856
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16857
     }
 
16858
   else
 
16859
     {
 
16860
Index: libgfortran/generated/pack_c10.c
 
16861
===================================================================
 
16862
--- a/src/libgfortran/generated/pack_c10.c      (.../tags/gcc_4_8_3_release)
 
16863
+++ b/src/libgfortran/generated/pack_c10.c      (.../branches/gcc-4_8-branch)
 
16864
@@ -167,8 +167,8 @@
 
16865
 
 
16866
          ret->offset = 0;
 
16867
 
 
16868
-         /* xmalloc allocates a single byte for zero size.  */
 
16869
-         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * total);
 
16870
+         /* xmallocarray allocates a single byte for zero size.  */
 
16871
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
 
16872
 
 
16873
          if (total == 0)
 
16874
            return;
 
16875
Index: libgfortran/generated/pack_r4.c
 
16876
===================================================================
 
16877
--- a/src/libgfortran/generated/pack_r4.c       (.../tags/gcc_4_8_3_release)
 
16878
+++ b/src/libgfortran/generated/pack_r4.c       (.../branches/gcc-4_8-branch)
 
16879
@@ -167,8 +167,8 @@
 
16880
 
 
16881
          ret->offset = 0;
 
16882
 
 
16883
-         /* xmalloc allocates a single byte for zero size.  */
 
16884
-         ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * total);
 
16885
+         /* xmallocarray allocates a single byte for zero size.  */
 
16886
+         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_4));
 
16887
 
 
16888
          if (total == 0)
 
16889
            return;
 
16890
Index: libgfortran/generated/transpose_c16.c
 
16891
===================================================================
 
16892
--- a/src/libgfortran/generated/transpose_c16.c (.../tags/gcc_4_8_3_release)
 
16893
+++ b/src/libgfortran/generated/transpose_c16.c (.../branches/gcc-4_8-branch)
 
16894
@@ -60,7 +60,8 @@
 
16895
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
16896
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
16897
 
 
16898
-      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
 
16899
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
16900
+                                     sizeof (GFC_COMPLEX_16));
 
16901
       ret->offset = 0;
 
16902
     } else if (unlikely (compile_options.bounds_check))
 
16903
     {
 
16904
Index: libgfortran/generated/maxloc0_8_i8.c
 
16905
===================================================================
 
16906
--- a/src/libgfortran/generated/maxloc0_8_i8.c  (.../tags/gcc_4_8_3_release)
 
16907
+++ b/src/libgfortran/generated/maxloc0_8_i8.c  (.../branches/gcc-4_8-branch)
 
16908
@@ -58,7 +58,7 @@
 
16909
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16910
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16911
       retarray->offset = 0;
 
16912
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16913
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16914
     }
 
16915
   else
 
16916
     {
 
16917
@@ -199,7 +199,7 @@
 
16918
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16919
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16920
       retarray->offset = 0;
 
16921
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16922
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16923
     }
 
16924
   else
 
16925
     {
 
16926
@@ -367,7 +367,7 @@
 
16927
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16928
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16929
       retarray->offset = 0;
 
16930
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16931
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16932
     }
 
16933
   else if (unlikely (compile_options.bounds_check))
 
16934
     {
 
16935
Index: libgfortran/generated/minloc1_4_r8.c
 
16936
===================================================================
 
16937
--- a/src/libgfortran/generated/minloc1_4_r8.c  (.../tags/gcc_4_8_3_release)
 
16938
+++ b/src/libgfortran/generated/minloc1_4_r8.c  (.../branches/gcc-4_8-branch)
 
16939
@@ -98,10 +98,9 @@
 
16940
       retarray->offset = 0;
 
16941
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16942
 
 
16943
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16944
-                  * extent[rank-1];
 
16945
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16946
 
 
16947
-      retarray->base_addr = xmalloc (alloc_size);
 
16948
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16949
       if (alloc_size == 0)
 
16950
        {
 
16951
          /* Make sure we have a zero-sized array.  */
 
16952
@@ -294,8 +293,7 @@
 
16953
 
 
16954
        }
 
16955
 
 
16956
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16957
-                  * extent[rank-1];
 
16958
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16959
 
 
16960
       retarray->offset = 0;
 
16961
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16962
@@ -307,7 +305,7 @@
 
16963
          return;
 
16964
        }
 
16965
       else
 
16966
-       retarray->base_addr = xmalloc (alloc_size);
 
16967
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16968
 
 
16969
     }
 
16970
   else
 
16971
@@ -485,8 +483,7 @@
 
16972
       retarray->offset = 0;
 
16973
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16974
 
 
16975
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16976
-                  * extent[rank-1];
 
16977
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16978
 
 
16979
       if (alloc_size == 0)
 
16980
        {
 
16981
@@ -495,7 +492,7 @@
 
16982
          return;
 
16983
        }
 
16984
       else
 
16985
-       retarray->base_addr = xmalloc (alloc_size);
 
16986
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16987
     }
 
16988
   else
 
16989
     {
 
16990
Index: libgfortran/generated/minloc1_16_i4.c
 
16991
===================================================================
 
16992
--- a/src/libgfortran/generated/minloc1_16_i4.c (.../tags/gcc_4_8_3_release)
 
16993
+++ b/src/libgfortran/generated/minloc1_16_i4.c (.../branches/gcc-4_8-branch)
 
16994
@@ -98,10 +98,9 @@
 
16995
       retarray->offset = 0;
 
16996
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16997
 
 
16998
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16999
-                  * extent[rank-1];
 
17000
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17001
 
 
17002
-      retarray->base_addr = xmalloc (alloc_size);
 
17003
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17004
       if (alloc_size == 0)
 
17005
        {
 
17006
          /* Make sure we have a zero-sized array.  */
 
17007
@@ -294,8 +293,7 @@
 
17008
 
 
17009
        }
 
17010
 
 
17011
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17012
-                  * extent[rank-1];
 
17013
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17014
 
 
17015
       retarray->offset = 0;
 
17016
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17017
@@ -307,7 +305,7 @@
 
17018
          return;
 
17019
        }
 
17020
       else
 
17021
-       retarray->base_addr = xmalloc (alloc_size);
 
17022
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17023
 
 
17024
     }
 
17025
   else
 
17026
@@ -485,8 +483,7 @@
 
17027
       retarray->offset = 0;
 
17028
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17029
 
 
17030
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17031
-                  * extent[rank-1];
 
17032
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17033
 
 
17034
       if (alloc_size == 0)
 
17035
        {
 
17036
@@ -495,7 +492,7 @@
 
17037
          return;
 
17038
        }
 
17039
       else
 
17040
-       retarray->base_addr = xmalloc (alloc_size);
 
17041
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17042
     }
 
17043
   else
 
17044
     {
 
17045
Index: libgfortran/generated/minloc0_16_i8.c
 
17046
===================================================================
 
17047
--- a/src/libgfortran/generated/minloc0_16_i8.c (.../tags/gcc_4_8_3_release)
 
17048
+++ b/src/libgfortran/generated/minloc0_16_i8.c (.../branches/gcc-4_8-branch)
 
17049
@@ -58,7 +58,7 @@
 
17050
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17051
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17052
       retarray->offset = 0;
 
17053
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17054
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17055
     }
 
17056
   else
 
17057
     {
 
17058
@@ -199,7 +199,7 @@
 
17059
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17060
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17061
       retarray->offset = 0;
 
17062
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17063
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17064
     }
 
17065
   else
 
17066
     {
 
17067
@@ -367,7 +367,7 @@
 
17068
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17069
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17070
       retarray->offset = 0;
 
17071
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17072
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17073
     }
 
17074
   else if (unlikely (compile_options.bounds_check))
 
17075
     {
 
17076
Index: libgfortran/generated/pack_i2.c
 
17077
===================================================================
 
17078
--- a/src/libgfortran/generated/pack_i2.c       (.../tags/gcc_4_8_3_release)
 
17079
+++ b/src/libgfortran/generated/pack_i2.c       (.../branches/gcc-4_8-branch)
 
17080
@@ -167,8 +167,8 @@
 
17081
 
 
17082
          ret->offset = 0;
 
17083
 
 
17084
-         /* xmalloc allocates a single byte for zero size.  */
 
17085
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_2) * total);
 
17086
+         /* xmallocarray allocates a single byte for zero size.  */
 
17087
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_2));
 
17088
 
 
17089
          if (total == 0)
 
17090
            return;
 
17091
Index: libgfortran/generated/transpose_i8.c
 
17092
===================================================================
 
17093
--- a/src/libgfortran/generated/transpose_i8.c  (.../tags/gcc_4_8_3_release)
 
17094
+++ b/src/libgfortran/generated/transpose_i8.c  (.../branches/gcc-4_8-branch)
 
17095
@@ -60,7 +60,8 @@
 
17096
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
17097
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
17098
 
 
17099
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
 
17100
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
17101
+                                     sizeof (GFC_INTEGER_8));
 
17102
       ret->offset = 0;
 
17103
     } else if (unlikely (compile_options.bounds_check))
 
17104
     {
 
17105
Index: libgfortran/generated/eoshift1_16.c
 
17106
===================================================================
 
17107
--- a/src/libgfortran/generated/eoshift1_16.c   (.../tags/gcc_4_8_3_release)
 
17108
+++ b/src/libgfortran/generated/eoshift1_16.c   (.../branches/gcc-4_8-branch)
 
17109
@@ -105,8 +105,8 @@
 
17110
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
17111
 
 
17112
         }
 
17113
-      /* xmalloc allocates a single byte for zero size.  */
 
17114
-      ret->base_addr = xmalloc (size * arraysize);
 
17115
+      /* xmallocarray allocates a single byte for zero size.  */
 
17116
+      ret->base_addr = xmallocarray (arraysize, size);
 
17117
 
 
17118
     }
 
17119
   else if (unlikely (compile_options.bounds_check))
 
17120
Index: libgfortran/generated/all_l2.c
 
17121
===================================================================
 
17122
--- a/src/libgfortran/generated/all_l2.c        (.../tags/gcc_4_8_3_release)
 
17123
+++ b/src/libgfortran/generated/all_l2.c        (.../branches/gcc-4_8-branch)
 
17124
@@ -101,8 +101,7 @@
 
17125
       retarray->offset = 0;
 
17126
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17127
 
 
17128
-      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17129
-                  * extent[rank-1];
 
17130
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17131
 
 
17132
       if (alloc_size == 0)
 
17133
        {
 
17134
@@ -111,7 +110,7 @@
 
17135
          return;
 
17136
        }
 
17137
       else
 
17138
-       retarray->base_addr = xmalloc (alloc_size);
 
17139
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
 
17140
     }
 
17141
   else
 
17142
     {
 
17143
Index: libgfortran/generated/product_c4.c
 
17144
===================================================================
 
17145
--- a/src/libgfortran/generated/product_c4.c    (.../tags/gcc_4_8_3_release)
 
17146
+++ b/src/libgfortran/generated/product_c4.c    (.../branches/gcc-4_8-branch)
 
17147
@@ -97,10 +97,9 @@
 
17148
       retarray->offset = 0;
 
17149
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17150
 
 
17151
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17152
-                  * extent[rank-1];
 
17153
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17154
 
 
17155
-      retarray->base_addr = xmalloc (alloc_size);
 
17156
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
17157
       if (alloc_size == 0)
 
17158
        {
 
17159
          /* Make sure we have a zero-sized array.  */
 
17160
@@ -272,8 +271,7 @@
 
17161
 
 
17162
        }
 
17163
 
 
17164
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17165
-                  * extent[rank-1];
 
17166
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17167
 
 
17168
       retarray->offset = 0;
 
17169
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17170
@@ -285,7 +283,7 @@
 
17171
          return;
 
17172
        }
 
17173
       else
 
17174
-       retarray->base_addr = xmalloc (alloc_size);
 
17175
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
17176
 
 
17177
     }
 
17178
   else
 
17179
@@ -430,8 +428,7 @@
 
17180
       retarray->offset = 0;
 
17181
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17182
 
 
17183
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17184
-                  * extent[rank-1];
 
17185
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17186
 
 
17187
       if (alloc_size == 0)
 
17188
        {
 
17189
@@ -440,7 +437,7 @@
 
17190
          return;
 
17191
        }
 
17192
       else
 
17193
-       retarray->base_addr = xmalloc (alloc_size);
 
17194
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
17195
     }
 
17196
   else
 
17197
     {
 
17198
Index: libgfortran/generated/iall_i1.c
 
17199
===================================================================
 
17200
--- a/src/libgfortran/generated/iall_i1.c       (.../tags/gcc_4_8_3_release)
 
17201
+++ b/src/libgfortran/generated/iall_i1.c       (.../branches/gcc-4_8-branch)
 
17202
@@ -97,10 +97,9 @@
 
17203
       retarray->offset = 0;
 
17204
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17205
 
 
17206
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17207
-                  * extent[rank-1];
 
17208
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17209
 
 
17210
-      retarray->base_addr = xmalloc (alloc_size);
 
17211
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
17212
       if (alloc_size == 0)
 
17213
        {
 
17214
          /* Make sure we have a zero-sized array.  */
 
17215
@@ -272,8 +271,7 @@
 
17216
 
 
17217
        }
 
17218
 
 
17219
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17220
-                  * extent[rank-1];
 
17221
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17222
 
 
17223
       retarray->offset = 0;
 
17224
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17225
@@ -285,7 +283,7 @@
 
17226
          return;
 
17227
        }
 
17228
       else
 
17229
-       retarray->base_addr = xmalloc (alloc_size);
 
17230
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
17231
 
 
17232
     }
 
17233
   else
 
17234
@@ -430,8 +428,7 @@
 
17235
       retarray->offset = 0;
 
17236
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17237
 
 
17238
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17239
-                  * extent[rank-1];
 
17240
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17241
 
 
17242
       if (alloc_size == 0)
 
17243
        {
 
17244
@@ -440,7 +437,7 @@
 
17245
          return;
 
17246
        }
 
17247
       else
 
17248
-       retarray->base_addr = xmalloc (alloc_size);
 
17249
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
17250
     }
 
17251
   else
 
17252
     {
 
17253
Index: libgfortran/generated/reshape_i4.c
 
17254
===================================================================
 
17255
--- a/src/libgfortran/generated/reshape_i4.c    (.../tags/gcc_4_8_3_release)
 
17256
+++ b/src/libgfortran/generated/reshape_i4.c    (.../branches/gcc-4_8-branch)
 
17257
@@ -111,11 +111,11 @@
 
17258
       ret->offset = 0;
 
17259
 
 
17260
       if (unlikely (rs < 1))
 
17261
-        alloc_size = 1;
 
17262
+        alloc_size = 0;
 
17263
       else
 
17264
-        alloc_size = rs * sizeof (GFC_INTEGER_4);
 
17265
+        alloc_size = rs;
 
17266
 
 
17267
-      ret->base_addr = xmalloc (alloc_size);
 
17268
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17269
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
17270
     }
 
17271
 
 
17272
Index: libgfortran/generated/in_pack_r10.c
 
17273
===================================================================
 
17274
--- a/src/libgfortran/generated/in_pack_r10.c   (.../tags/gcc_4_8_3_release)
 
17275
+++ b/src/libgfortran/generated/in_pack_r10.c   (.../branches/gcc-4_8-branch)
 
17276
@@ -76,7 +76,7 @@
 
17277
     return source->base_addr;
 
17278
 
 
17279
   /* Allocate storage for the destination.  */
 
17280
-  destptr = (GFC_REAL_10 *)xmalloc (ssize * sizeof (GFC_REAL_10));
 
17281
+  destptr = xmallocarray (ssize, sizeof (GFC_REAL_10));
 
17282
   dest = destptr;
 
17283
   src = source->base_addr;
 
17284
   stride0 = stride[0];
 
17285
Index: libgfortran/generated/in_pack_c4.c
 
17286
===================================================================
 
17287
--- a/src/libgfortran/generated/in_pack_c4.c    (.../tags/gcc_4_8_3_release)
 
17288
+++ b/src/libgfortran/generated/in_pack_c4.c    (.../branches/gcc-4_8-branch)
 
17289
@@ -76,7 +76,7 @@
 
17290
     return source->base_addr;
 
17291
 
 
17292
   /* Allocate storage for the destination.  */
 
17293
-  destptr = (GFC_COMPLEX_4 *)xmalloc (ssize * sizeof (GFC_COMPLEX_4));
 
17294
+  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_4));
 
17295
   dest = destptr;
 
17296
   src = source->base_addr;
 
17297
   stride0 = stride[0];
 
17298
Index: libgfortran/generated/all_l16.c
 
17299
===================================================================
 
17300
--- a/src/libgfortran/generated/all_l16.c       (.../tags/gcc_4_8_3_release)
 
17301
+++ b/src/libgfortran/generated/all_l16.c       (.../branches/gcc-4_8-branch)
 
17302
@@ -101,8 +101,7 @@
 
17303
       retarray->offset = 0;
 
17304
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17305
 
 
17306
-      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17307
-                  * extent[rank-1];
 
17308
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17309
 
 
17310
       if (alloc_size == 0)
 
17311
        {
 
17312
@@ -111,7 +110,7 @@
 
17313
          return;
 
17314
        }
 
17315
       else
 
17316
-       retarray->base_addr = xmalloc (alloc_size);
 
17317
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
 
17318
     }
 
17319
   else
 
17320
     {
 
17321
Index: libgfortran/generated/maxloc0_16_i1.c
 
17322
===================================================================
 
17323
--- a/src/libgfortran/generated/maxloc0_16_i1.c (.../tags/gcc_4_8_3_release)
 
17324
+++ b/src/libgfortran/generated/maxloc0_16_i1.c (.../branches/gcc-4_8-branch)
 
17325
@@ -58,7 +58,7 @@
 
17326
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17327
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17328
       retarray->offset = 0;
 
17329
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17330
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17331
     }
 
17332
   else
 
17333
     {
 
17334
@@ -199,7 +199,7 @@
 
17335
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17336
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17337
       retarray->offset = 0;
 
17338
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17339
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17340
     }
 
17341
   else
 
17342
     {
 
17343
@@ -367,7 +367,7 @@
 
17344
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17345
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17346
       retarray->offset = 0;
 
17347
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17348
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17349
     }
 
17350
   else if (unlikely (compile_options.bounds_check))
 
17351
     {
 
17352
Index: libgfortran/generated/maxloc1_8_r8.c
 
17353
===================================================================
 
17354
--- a/src/libgfortran/generated/maxloc1_8_r8.c  (.../tags/gcc_4_8_3_release)
 
17355
+++ b/src/libgfortran/generated/maxloc1_8_r8.c  (.../branches/gcc-4_8-branch)
 
17356
@@ -98,10 +98,9 @@
 
17357
       retarray->offset = 0;
 
17358
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17359
 
 
17360
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17361
-                  * extent[rank-1];
 
17362
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17363
 
 
17364
-      retarray->base_addr = xmalloc (alloc_size);
 
17365
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17366
       if (alloc_size == 0)
 
17367
        {
 
17368
          /* Make sure we have a zero-sized array.  */
 
17369
@@ -294,8 +293,7 @@
 
17370
 
 
17371
        }
 
17372
 
 
17373
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17374
-                  * extent[rank-1];
 
17375
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17376
 
 
17377
       retarray->offset = 0;
 
17378
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17379
@@ -307,7 +305,7 @@
 
17380
          return;
 
17381
        }
 
17382
       else
 
17383
-       retarray->base_addr = xmalloc (alloc_size);
 
17384
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17385
 
 
17386
     }
 
17387
   else
 
17388
@@ -485,8 +483,7 @@
 
17389
       retarray->offset = 0;
 
17390
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17391
 
 
17392
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17393
-                  * extent[rank-1];
 
17394
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17395
 
 
17396
       if (alloc_size == 0)
 
17397
        {
 
17398
@@ -495,7 +492,7 @@
 
17399
          return;
 
17400
        }
 
17401
       else
 
17402
-       retarray->base_addr = xmalloc (alloc_size);
 
17403
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17404
     }
 
17405
   else
 
17406
     {
 
17407
Index: libgfortran/generated/minval_i16.c
 
17408
===================================================================
 
17409
--- a/src/libgfortran/generated/minval_i16.c    (.../tags/gcc_4_8_3_release)
 
17410
+++ b/src/libgfortran/generated/minval_i16.c    (.../branches/gcc-4_8-branch)
 
17411
@@ -97,10 +97,9 @@
 
17412
       retarray->offset = 0;
 
17413
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17414
 
 
17415
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17416
-                  * extent[rank-1];
 
17417
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17418
 
 
17419
-      retarray->base_addr = xmalloc (alloc_size);
 
17420
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17421
       if (alloc_size == 0)
 
17422
        {
 
17423
          /* Make sure we have a zero-sized array.  */
 
17424
@@ -286,8 +285,7 @@
 
17425
 
 
17426
        }
 
17427
 
 
17428
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17429
-                  * extent[rank-1];
 
17430
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17431
 
 
17432
       retarray->offset = 0;
 
17433
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17434
@@ -299,7 +297,7 @@
 
17435
          return;
 
17436
        }
 
17437
       else
 
17438
-       retarray->base_addr = xmalloc (alloc_size);
 
17439
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17440
 
 
17441
     }
 
17442
   else
 
17443
@@ -472,8 +470,7 @@
 
17444
       retarray->offset = 0;
 
17445
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17446
 
 
17447
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17448
-                  * extent[rank-1];
 
17449
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17450
 
 
17451
       if (alloc_size == 0)
 
17452
        {
 
17453
@@ -482,7 +479,7 @@
 
17454
          return;
 
17455
        }
 
17456
       else
 
17457
-       retarray->base_addr = xmalloc (alloc_size);
 
17458
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17459
     }
 
17460
   else
 
17461
     {
 
17462
Index: libgfortran/generated/reshape_r10.c
 
17463
===================================================================
 
17464
--- a/src/libgfortran/generated/reshape_r10.c   (.../tags/gcc_4_8_3_release)
 
17465
+++ b/src/libgfortran/generated/reshape_r10.c   (.../branches/gcc-4_8-branch)
 
17466
@@ -111,11 +111,11 @@
 
17467
       ret->offset = 0;
 
17468
 
 
17469
       if (unlikely (rs < 1))
 
17470
-        alloc_size = 1;
 
17471
+        alloc_size = 0;
 
17472
       else
 
17473
-        alloc_size = rs * sizeof (GFC_REAL_10);
 
17474
+        alloc_size = rs;
 
17475
 
 
17476
-      ret->base_addr = xmalloc (alloc_size);
 
17477
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
17478
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
17479
     }
 
17480
 
 
17481
Index: libgfortran/generated/unpack_r16.c
 
17482
===================================================================
 
17483
--- a/src/libgfortran/generated/unpack_r16.c    (.../tags/gcc_4_8_3_release)
 
17484
+++ b/src/libgfortran/generated/unpack_r16.c    (.../branches/gcc-4_8-branch)
 
17485
@@ -99,7 +99,7 @@
 
17486
          rs *= extent[n];
 
17487
        }
 
17488
       ret->offset = 0;
 
17489
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
 
17490
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
 
17491
     }
 
17492
   else
 
17493
     {
 
17494
@@ -244,7 +244,7 @@
 
17495
          rs *= extent[n];
 
17496
        }
 
17497
       ret->offset = 0;
 
17498
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
 
17499
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
 
17500
     }
 
17501
   else
 
17502
     {
 
17503
Index: libgfortran/generated/maxval_i4.c
 
17504
===================================================================
 
17505
--- a/src/libgfortran/generated/maxval_i4.c     (.../tags/gcc_4_8_3_release)
 
17506
+++ b/src/libgfortran/generated/maxval_i4.c     (.../branches/gcc-4_8-branch)
 
17507
@@ -97,10 +97,9 @@
 
17508
       retarray->offset = 0;
 
17509
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17510
 
 
17511
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17512
-                  * extent[rank-1];
 
17513
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17514
 
 
17515
-      retarray->base_addr = xmalloc (alloc_size);
 
17516
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17517
       if (alloc_size == 0)
 
17518
        {
 
17519
          /* Make sure we have a zero-sized array.  */
 
17520
@@ -286,8 +285,7 @@
 
17521
 
 
17522
        }
 
17523
 
 
17524
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17525
-                  * extent[rank-1];
 
17526
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17527
 
 
17528
       retarray->offset = 0;
 
17529
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17530
@@ -299,7 +297,7 @@
 
17531
          return;
 
17532
        }
 
17533
       else
 
17534
-       retarray->base_addr = xmalloc (alloc_size);
 
17535
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17536
 
 
17537
     }
 
17538
   else
 
17539
@@ -472,8 +470,7 @@
 
17540
       retarray->offset = 0;
 
17541
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17542
 
 
17543
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17544
-                  * extent[rank-1];
 
17545
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17546
 
 
17547
       if (alloc_size == 0)
 
17548
        {
 
17549
@@ -482,7 +479,7 @@
 
17550
          return;
 
17551
        }
 
17552
       else
 
17553
-       retarray->base_addr = xmalloc (alloc_size);
 
17554
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17555
     }
 
17556
   else
 
17557
     {
 
17558
Index: libgfortran/generated/minval_i8.c
 
17559
===================================================================
 
17560
--- a/src/libgfortran/generated/minval_i8.c     (.../tags/gcc_4_8_3_release)
 
17561
+++ b/src/libgfortran/generated/minval_i8.c     (.../branches/gcc-4_8-branch)
 
17562
@@ -97,10 +97,9 @@
 
17563
       retarray->offset = 0;
 
17564
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17565
 
 
17566
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17567
-                  * extent[rank-1];
 
17568
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17569
 
 
17570
-      retarray->base_addr = xmalloc (alloc_size);
 
17571
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17572
       if (alloc_size == 0)
 
17573
        {
 
17574
          /* Make sure we have a zero-sized array.  */
 
17575
@@ -286,8 +285,7 @@
 
17576
 
 
17577
        }
 
17578
 
 
17579
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17580
-                  * extent[rank-1];
 
17581
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17582
 
 
17583
       retarray->offset = 0;
 
17584
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17585
@@ -299,7 +297,7 @@
 
17586
          return;
 
17587
        }
 
17588
       else
 
17589
-       retarray->base_addr = xmalloc (alloc_size);
 
17590
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17591
 
 
17592
     }
 
17593
   else
 
17594
@@ -472,8 +470,7 @@
 
17595
       retarray->offset = 0;
 
17596
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17597
 
 
17598
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17599
-                  * extent[rank-1];
 
17600
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17601
 
 
17602
       if (alloc_size == 0)
 
17603
        {
 
17604
@@ -482,7 +479,7 @@
 
17605
          return;
 
17606
        }
 
17607
       else
 
17608
-       retarray->base_addr = xmalloc (alloc_size);
 
17609
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17610
     }
 
17611
   else
 
17612
     {
 
17613
Index: libgfortran/generated/maxloc0_16_i16.c
 
17614
===================================================================
 
17615
--- a/src/libgfortran/generated/maxloc0_16_i16.c        (.../tags/gcc_4_8_3_release)
 
17616
+++ b/src/libgfortran/generated/maxloc0_16_i16.c        (.../branches/gcc-4_8-branch)
 
17617
@@ -58,7 +58,7 @@
 
17618
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17619
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17620
       retarray->offset = 0;
 
17621
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17622
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17623
     }
 
17624
   else
 
17625
     {
 
17626
@@ -199,7 +199,7 @@
 
17627
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17628
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17629
       retarray->offset = 0;
 
17630
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17631
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17632
     }
 
17633
   else
 
17634
     {
 
17635
@@ -367,7 +367,7 @@
 
17636
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17637
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17638
       retarray->offset = 0;
 
17639
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17640
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17641
     }
 
17642
   else if (unlikely (compile_options.bounds_check))
 
17643
     {
 
17644
Index: libgfortran/generated/shape_i4.c
 
17645
===================================================================
 
17646
--- a/src/libgfortran/generated/shape_i4.c      (.../tags/gcc_4_8_3_release)
 
17647
+++ b/src/libgfortran/generated/shape_i4.c      (.../branches/gcc-4_8-branch)
 
17648
@@ -49,7 +49,7 @@
 
17649
     {
 
17650
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
 
17651
       ret->offset = 0;
 
17652
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
17653
+      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
17654
     }
 
17655
 
 
17656
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
17657
Index: libgfortran/generated/minloc1_4_i16.c
 
17658
===================================================================
 
17659
--- a/src/libgfortran/generated/minloc1_4_i16.c (.../tags/gcc_4_8_3_release)
 
17660
+++ b/src/libgfortran/generated/minloc1_4_i16.c (.../branches/gcc-4_8-branch)
 
17661
@@ -98,10 +98,9 @@
 
17662
       retarray->offset = 0;
 
17663
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17664
 
 
17665
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17666
-                  * extent[rank-1];
 
17667
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17668
 
 
17669
-      retarray->base_addr = xmalloc (alloc_size);
 
17670
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17671
       if (alloc_size == 0)
 
17672
        {
 
17673
          /* Make sure we have a zero-sized array.  */
 
17674
@@ -294,8 +293,7 @@
 
17675
 
 
17676
        }
 
17677
 
 
17678
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17679
-                  * extent[rank-1];
 
17680
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17681
 
 
17682
       retarray->offset = 0;
 
17683
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17684
@@ -307,7 +305,7 @@
 
17685
          return;
 
17686
        }
 
17687
       else
 
17688
-       retarray->base_addr = xmalloc (alloc_size);
 
17689
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17690
 
 
17691
     }
 
17692
   else
 
17693
@@ -485,8 +483,7 @@
 
17694
       retarray->offset = 0;
 
17695
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17696
 
 
17697
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17698
-                  * extent[rank-1];
 
17699
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17700
 
 
17701
       if (alloc_size == 0)
 
17702
        {
 
17703
@@ -495,7 +492,7 @@
 
17704
          return;
 
17705
        }
 
17706
       else
 
17707
-       retarray->base_addr = xmalloc (alloc_size);
 
17708
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17709
     }
 
17710
   else
 
17711
     {
 
17712
Index: libgfortran/generated/maxloc0_4_r10.c
 
17713
===================================================================
 
17714
--- a/src/libgfortran/generated/maxloc0_4_r10.c (.../tags/gcc_4_8_3_release)
 
17715
+++ b/src/libgfortran/generated/maxloc0_4_r10.c (.../branches/gcc-4_8-branch)
 
17716
@@ -58,7 +58,7 @@
 
17717
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17718
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17719
       retarray->offset = 0;
 
17720
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
17721
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
17722
     }
 
17723
   else
 
17724
     {
 
17725
@@ -199,7 +199,7 @@
 
17726
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17727
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17728
       retarray->offset = 0;
 
17729
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
17730
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
17731
     }
 
17732
   else
 
17733
     {
 
17734
@@ -367,7 +367,7 @@
 
17735
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17736
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17737
       retarray->offset = 0;
 
17738
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
17739
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
17740
     }
 
17741
   else if (unlikely (compile_options.bounds_check))
 
17742
     {
 
17743
Index: libgfortran/generated/maxloc0_8_i16.c
 
17744
===================================================================
 
17745
--- a/src/libgfortran/generated/maxloc0_8_i16.c (.../tags/gcc_4_8_3_release)
 
17746
+++ b/src/libgfortran/generated/maxloc0_8_i16.c (.../branches/gcc-4_8-branch)
 
17747
@@ -58,7 +58,7 @@
 
17748
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17749
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17750
       retarray->offset = 0;
 
17751
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17752
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17753
     }
 
17754
   else
 
17755
     {
 
17756
@@ -199,7 +199,7 @@
 
17757
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17758
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17759
       retarray->offset = 0;
 
17760
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17761
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17762
     }
 
17763
   else
 
17764
     {
 
17765
@@ -367,7 +367,7 @@
 
17766
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17767
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17768
       retarray->offset = 0;
 
17769
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17770
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17771
     }
 
17772
   else if (unlikely (compile_options.bounds_check))
 
17773
     {
 
17774
Index: libgfortran/generated/iall_i2.c
 
17775
===================================================================
 
17776
--- a/src/libgfortran/generated/iall_i2.c       (.../tags/gcc_4_8_3_release)
 
17777
+++ b/src/libgfortran/generated/iall_i2.c       (.../branches/gcc-4_8-branch)
 
17778
@@ -97,10 +97,9 @@
 
17779
       retarray->offset = 0;
 
17780
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17781
 
 
17782
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17783
-                  * extent[rank-1];
 
17784
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17785
 
 
17786
-      retarray->base_addr = xmalloc (alloc_size);
 
17787
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
17788
       if (alloc_size == 0)
 
17789
        {
 
17790
          /* Make sure we have a zero-sized array.  */
 
17791
@@ -272,8 +271,7 @@
 
17792
 
 
17793
        }
 
17794
 
 
17795
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17796
-                  * extent[rank-1];
 
17797
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17798
 
 
17799
       retarray->offset = 0;
 
17800
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17801
@@ -285,7 +283,7 @@
 
17802
          return;
 
17803
        }
 
17804
       else
 
17805
-       retarray->base_addr = xmalloc (alloc_size);
 
17806
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
17807
 
 
17808
     }
 
17809
   else
 
17810
@@ -430,8 +428,7 @@
 
17811
       retarray->offset = 0;
 
17812
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17813
 
 
17814
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17815
-                  * extent[rank-1];
 
17816
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17817
 
 
17818
       if (alloc_size == 0)
 
17819
        {
 
17820
@@ -440,7 +437,7 @@
 
17821
          return;
 
17822
        }
 
17823
       else
 
17824
-       retarray->base_addr = xmalloc (alloc_size);
 
17825
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
17826
     }
 
17827
   else
 
17828
     {
 
17829
Index: libgfortran/generated/maxloc1_8_r10.c
 
17830
===================================================================
 
17831
--- a/src/libgfortran/generated/maxloc1_8_r10.c (.../tags/gcc_4_8_3_release)
 
17832
+++ b/src/libgfortran/generated/maxloc1_8_r10.c (.../branches/gcc-4_8-branch)
 
17833
@@ -98,10 +98,9 @@
 
17834
       retarray->offset = 0;
 
17835
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17836
 
 
17837
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17838
-                  * extent[rank-1];
 
17839
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17840
 
 
17841
-      retarray->base_addr = xmalloc (alloc_size);
 
17842
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17843
       if (alloc_size == 0)
 
17844
        {
 
17845
          /* Make sure we have a zero-sized array.  */
 
17846
@@ -294,8 +293,7 @@
 
17847
 
 
17848
        }
 
17849
 
 
17850
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17851
-                  * extent[rank-1];
 
17852
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17853
 
 
17854
       retarray->offset = 0;
 
17855
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17856
@@ -307,7 +305,7 @@
 
17857
          return;
 
17858
        }
 
17859
       else
 
17860
-       retarray->base_addr = xmalloc (alloc_size);
 
17861
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17862
 
 
17863
     }
 
17864
   else
 
17865
@@ -485,8 +483,7 @@
 
17866
       retarray->offset = 0;
 
17867
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17868
 
 
17869
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17870
-                  * extent[rank-1];
 
17871
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17872
 
 
17873
       if (alloc_size == 0)
 
17874
        {
 
17875
@@ -495,7 +492,7 @@
 
17876
          return;
 
17877
        }
 
17878
       else
 
17879
-       retarray->base_addr = xmalloc (alloc_size);
 
17880
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17881
     }
 
17882
   else
 
17883
     {
 
17884
Index: libgfortran/generated/maxloc0_16_r4.c
 
17885
===================================================================
 
17886
--- a/src/libgfortran/generated/maxloc0_16_r4.c (.../tags/gcc_4_8_3_release)
 
17887
+++ b/src/libgfortran/generated/maxloc0_16_r4.c (.../branches/gcc-4_8-branch)
 
17888
@@ -58,7 +58,7 @@
 
17889
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17890
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17891
       retarray->offset = 0;
 
17892
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17893
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17894
     }
 
17895
   else
 
17896
     {
 
17897
@@ -199,7 +199,7 @@
 
17898
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17899
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17900
       retarray->offset = 0;
 
17901
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17902
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17903
     }
 
17904
   else
 
17905
     {
 
17906
@@ -367,7 +367,7 @@
 
17907
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17908
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17909
       retarray->offset = 0;
 
17910
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17911
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17912
     }
 
17913
   else if (unlikely (compile_options.bounds_check))
 
17914
     {
 
17915
Index: libgfortran/generated/minloc0_8_i1.c
 
17916
===================================================================
 
17917
--- a/src/libgfortran/generated/minloc0_8_i1.c  (.../tags/gcc_4_8_3_release)
 
17918
+++ b/src/libgfortran/generated/minloc0_8_i1.c  (.../branches/gcc-4_8-branch)
 
17919
@@ -58,7 +58,7 @@
 
17920
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17921
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17922
       retarray->offset = 0;
 
17923
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17924
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17925
     }
 
17926
   else
 
17927
     {
 
17928
@@ -199,7 +199,7 @@
 
17929
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17930
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17931
       retarray->offset = 0;
 
17932
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17933
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17934
     }
 
17935
   else
 
17936
     {
 
17937
@@ -367,7 +367,7 @@
 
17938
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17939
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17940
       retarray->offset = 0;
 
17941
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17942
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17943
     }
 
17944
   else if (unlikely (compile_options.bounds_check))
 
17945
     {
 
17946
Index: libgfortran/generated/minloc1_16_r8.c
 
17947
===================================================================
 
17948
--- a/src/libgfortran/generated/minloc1_16_r8.c (.../tags/gcc_4_8_3_release)
 
17949
+++ b/src/libgfortran/generated/minloc1_16_r8.c (.../branches/gcc-4_8-branch)
 
17950
@@ -98,10 +98,9 @@
 
17951
       retarray->offset = 0;
 
17952
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17953
 
 
17954
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17955
-                  * extent[rank-1];
 
17956
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17957
 
 
17958
-      retarray->base_addr = xmalloc (alloc_size);
 
17959
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17960
       if (alloc_size == 0)
 
17961
        {
 
17962
          /* Make sure we have a zero-sized array.  */
 
17963
@@ -294,8 +293,7 @@
 
17964
 
 
17965
        }
 
17966
 
 
17967
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17968
-                  * extent[rank-1];
 
17969
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17970
 
 
17971
       retarray->offset = 0;
 
17972
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17973
@@ -307,7 +305,7 @@
 
17974
          return;
 
17975
        }
 
17976
       else
 
17977
-       retarray->base_addr = xmalloc (alloc_size);
 
17978
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17979
 
 
17980
     }
 
17981
   else
 
17982
@@ -485,8 +483,7 @@
 
17983
       retarray->offset = 0;
 
17984
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17985
 
 
17986
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17987
-                  * extent[rank-1];
 
17988
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17989
 
 
17990
       if (alloc_size == 0)
 
17991
        {
 
17992
@@ -495,7 +492,7 @@
 
17993
          return;
 
17994
        }
 
17995
       else
 
17996
-       retarray->base_addr = xmalloc (alloc_size);
 
17997
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17998
     }
 
17999
   else
 
18000
     {
 
18001
Index: libgfortran/generated/unpack_i8.c
 
18002
===================================================================
 
18003
--- a/src/libgfortran/generated/unpack_i8.c     (.../tags/gcc_4_8_3_release)
 
18004
+++ b/src/libgfortran/generated/unpack_i8.c     (.../branches/gcc-4_8-branch)
 
18005
@@ -99,7 +99,7 @@
 
18006
          rs *= extent[n];
 
18007
        }
 
18008
       ret->offset = 0;
 
18009
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
 
18010
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
 
18011
     }
 
18012
   else
 
18013
     {
 
18014
@@ -244,7 +244,7 @@
 
18015
          rs *= extent[n];
 
18016
        }
 
18017
       ret->offset = 0;
 
18018
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
 
18019
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
 
18020
     }
 
18021
   else
 
18022
     {
 
18023
Index: libgfortran/generated/maxloc0_4_i4.c
 
18024
===================================================================
 
18025
--- a/src/libgfortran/generated/maxloc0_4_i4.c  (.../tags/gcc_4_8_3_release)
 
18026
+++ b/src/libgfortran/generated/maxloc0_4_i4.c  (.../branches/gcc-4_8-branch)
 
18027
@@ -58,7 +58,7 @@
 
18028
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18029
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18030
       retarray->offset = 0;
 
18031
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
18032
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
18033
     }
 
18034
   else
 
18035
     {
 
18036
@@ -199,7 +199,7 @@
 
18037
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18038
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18039
       retarray->offset = 0;
 
18040
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
18041
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
18042
     }
 
18043
   else
 
18044
     {
 
18045
@@ -367,7 +367,7 @@
 
18046
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18047
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18048
       retarray->offset = 0;
 
18049
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
18050
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
18051
     }
 
18052
   else if (unlikely (compile_options.bounds_check))
 
18053
     {
 
18054
Index: libgfortran/generated/count_4_l.c
 
18055
===================================================================
 
18056
--- a/src/libgfortran/generated/count_4_l.c     (.../tags/gcc_4_8_3_release)
 
18057
+++ b/src/libgfortran/generated/count_4_l.c     (.../branches/gcc-4_8-branch)
 
18058
@@ -101,8 +101,7 @@
 
18059
       retarray->offset = 0;
 
18060
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18061
 
 
18062
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18063
-                  * extent[rank-1];
 
18064
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18065
 
 
18066
       if (alloc_size == 0)
 
18067
        {
 
18068
@@ -111,7 +110,7 @@
 
18069
          return;
 
18070
        }
 
18071
       else
 
18072
-       retarray->base_addr = xmalloc (alloc_size);
 
18073
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18074
     }
 
18075
   else
 
18076
     {
 
18077
Index: libgfortran/generated/sum_r10.c
 
18078
===================================================================
 
18079
--- a/src/libgfortran/generated/sum_r10.c       (.../tags/gcc_4_8_3_release)
 
18080
+++ b/src/libgfortran/generated/sum_r10.c       (.../branches/gcc-4_8-branch)
 
18081
@@ -97,10 +97,9 @@
 
18082
       retarray->offset = 0;
 
18083
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18084
 
 
18085
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18086
-                  * extent[rank-1];
 
18087
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18088
 
 
18089
-      retarray->base_addr = xmalloc (alloc_size);
 
18090
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
18091
       if (alloc_size == 0)
 
18092
        {
 
18093
          /* Make sure we have a zero-sized array.  */
 
18094
@@ -272,8 +271,7 @@
 
18095
 
 
18096
        }
 
18097
 
 
18098
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18099
-                  * extent[rank-1];
 
18100
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18101
 
 
18102
       retarray->offset = 0;
 
18103
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18104
@@ -285,7 +283,7 @@
 
18105
          return;
 
18106
        }
 
18107
       else
 
18108
-       retarray->base_addr = xmalloc (alloc_size);
 
18109
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
18110
 
 
18111
     }
 
18112
   else
 
18113
@@ -430,8 +428,7 @@
 
18114
       retarray->offset = 0;
 
18115
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18116
 
 
18117
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18118
-                  * extent[rank-1];
 
18119
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18120
 
 
18121
       if (alloc_size == 0)
 
18122
        {
 
18123
@@ -440,7 +437,7 @@
 
18124
          return;
 
18125
        }
 
18126
       else
 
18127
-       retarray->base_addr = xmalloc (alloc_size);
 
18128
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
18129
     }
 
18130
   else
 
18131
     {
 
18132
Index: libgfortran/generated/sum_c4.c
 
18133
===================================================================
 
18134
--- a/src/libgfortran/generated/sum_c4.c        (.../tags/gcc_4_8_3_release)
 
18135
+++ b/src/libgfortran/generated/sum_c4.c        (.../branches/gcc-4_8-branch)
 
18136
@@ -97,10 +97,9 @@
 
18137
       retarray->offset = 0;
 
18138
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18139
 
 
18140
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18141
-                  * extent[rank-1];
 
18142
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18143
 
 
18144
-      retarray->base_addr = xmalloc (alloc_size);
 
18145
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
18146
       if (alloc_size == 0)
 
18147
        {
 
18148
          /* Make sure we have a zero-sized array.  */
 
18149
@@ -272,8 +271,7 @@
 
18150
 
 
18151
        }
 
18152
 
 
18153
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18154
-                  * extent[rank-1];
 
18155
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18156
 
 
18157
       retarray->offset = 0;
 
18158
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18159
@@ -285,7 +283,7 @@
 
18160
          return;
 
18161
        }
 
18162
       else
 
18163
-       retarray->base_addr = xmalloc (alloc_size);
 
18164
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
18165
 
 
18166
     }
 
18167
   else
 
18168
@@ -430,8 +428,7 @@
 
18169
       retarray->offset = 0;
 
18170
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18171
 
 
18172
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18173
-                  * extent[rank-1];
 
18174
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18175
 
 
18176
       if (alloc_size == 0)
 
18177
        {
 
18178
@@ -440,7 +437,7 @@
 
18179
          return;
 
18180
        }
 
18181
       else
 
18182
-       retarray->base_addr = xmalloc (alloc_size);
 
18183
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
18184
     }
 
18185
   else
 
18186
     {
 
18187
Index: libgfortran/generated/maxloc1_16_r10.c
 
18188
===================================================================
 
18189
--- a/src/libgfortran/generated/maxloc1_16_r10.c        (.../tags/gcc_4_8_3_release)
 
18190
+++ b/src/libgfortran/generated/maxloc1_16_r10.c        (.../branches/gcc-4_8-branch)
 
18191
@@ -98,10 +98,9 @@
 
18192
       retarray->offset = 0;
 
18193
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18194
 
 
18195
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18196
-                  * extent[rank-1];
 
18197
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18198
 
 
18199
-      retarray->base_addr = xmalloc (alloc_size);
 
18200
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18201
       if (alloc_size == 0)
 
18202
        {
 
18203
          /* Make sure we have a zero-sized array.  */
 
18204
@@ -294,8 +293,7 @@
 
18205
 
 
18206
        }
 
18207
 
 
18208
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18209
-                  * extent[rank-1];
 
18210
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18211
 
 
18212
       retarray->offset = 0;
 
18213
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18214
@@ -307,7 +305,7 @@
 
18215
          return;
 
18216
        }
 
18217
       else
 
18218
-       retarray->base_addr = xmalloc (alloc_size);
 
18219
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18220
 
 
18221
     }
 
18222
   else
 
18223
@@ -485,8 +483,7 @@
 
18224
       retarray->offset = 0;
 
18225
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18226
 
 
18227
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18228
-                  * extent[rank-1];
 
18229
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18230
 
 
18231
       if (alloc_size == 0)
 
18232
        {
 
18233
@@ -495,7 +492,7 @@
 
18234
          return;
 
18235
        }
 
18236
       else
 
18237
-       retarray->base_addr = xmalloc (alloc_size);
 
18238
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18239
     }
 
18240
   else
 
18241
     {
 
18242
Index: libgfortran/generated/pack_i16.c
 
18243
===================================================================
 
18244
--- a/src/libgfortran/generated/pack_i16.c      (.../tags/gcc_4_8_3_release)
 
18245
+++ b/src/libgfortran/generated/pack_i16.c      (.../branches/gcc-4_8-branch)
 
18246
@@ -167,8 +167,8 @@
 
18247
 
 
18248
          ret->offset = 0;
 
18249
 
 
18250
-         /* xmalloc allocates a single byte for zero size.  */
 
18251
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
 
18252
+         /* xmallocarray allocates a single byte for zero size.  */
 
18253
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
 
18254
 
 
18255
          if (total == 0)
 
18256
            return;
 
18257
Index: libgfortran/generated/matmul_i8.c
 
18258
===================================================================
 
18259
--- a/src/libgfortran/generated/matmul_i8.c     (.../tags/gcc_4_8_3_release)
 
18260
+++ b/src/libgfortran/generated/matmul_i8.c     (.../branches/gcc-4_8-branch)
 
18261
@@ -124,7 +124,7 @@
 
18262
         }
 
18263
 
 
18264
       retarray->base_addr
 
18265
-       = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
 
18266
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_8));
 
18267
       retarray->offset = 0;
 
18268
     }
 
18269
     else if (unlikely (compile_options.bounds_check))
 
18270
Index: libgfortran/generated/maxloc0_16_i2.c
 
18271
===================================================================
 
18272
--- a/src/libgfortran/generated/maxloc0_16_i2.c (.../tags/gcc_4_8_3_release)
 
18273
+++ b/src/libgfortran/generated/maxloc0_16_i2.c (.../branches/gcc-4_8-branch)
 
18274
@@ -58,7 +58,7 @@
 
18275
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18276
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18277
       retarray->offset = 0;
 
18278
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18279
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18280
     }
 
18281
   else
 
18282
     {
 
18283
@@ -199,7 +199,7 @@
 
18284
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18285
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18286
       retarray->offset = 0;
 
18287
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18288
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18289
     }
 
18290
   else
 
18291
     {
 
18292
@@ -367,7 +367,7 @@
 
18293
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18294
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18295
       retarray->offset = 0;
 
18296
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18297
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18298
     }
 
18299
   else if (unlikely (compile_options.bounds_check))
 
18300
     {
 
18301
Index: libgfortran/generated/spread_c4.c
 
18302
===================================================================
 
18303
--- a/src/libgfortran/generated/spread_c4.c     (.../tags/gcc_4_8_3_release)
 
18304
+++ b/src/libgfortran/generated/spread_c4.c     (.../branches/gcc-4_8-branch)
 
18305
@@ -101,8 +101,8 @@
 
18306
        }
 
18307
       ret->offset = 0;
 
18308
 
 
18309
-      /* xmalloc allocates a single byte for zero size.  */
 
18310
-      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_4));
 
18311
+      /* xmallocarray allocates a single byte for zero size.  */
 
18312
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_4));
 
18313
       if (rs <= 0)
 
18314
         return;
 
18315
     }
 
18316
@@ -244,7 +244,7 @@
 
18317
 
 
18318
   if (ret->base_addr == NULL)
 
18319
     {
 
18320
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_4));
 
18321
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_4));
 
18322
       ret->offset = 0;
 
18323
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
18324
     }
 
18325
Index: libgfortran/generated/maxval_r10.c
 
18326
===================================================================
 
18327
--- a/src/libgfortran/generated/maxval_r10.c    (.../tags/gcc_4_8_3_release)
 
18328
+++ b/src/libgfortran/generated/maxval_r10.c    (.../branches/gcc-4_8-branch)
 
18329
@@ -97,10 +97,9 @@
 
18330
       retarray->offset = 0;
 
18331
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18332
 
 
18333
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18334
-                  * extent[rank-1];
 
18335
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18336
 
 
18337
-      retarray->base_addr = xmalloc (alloc_size);
 
18338
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
18339
       if (alloc_size == 0)
 
18340
        {
 
18341
          /* Make sure we have a zero-sized array.  */
 
18342
@@ -286,8 +285,7 @@
 
18343
 
 
18344
        }
 
18345
 
 
18346
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18347
-                  * extent[rank-1];
 
18348
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18349
 
 
18350
       retarray->offset = 0;
 
18351
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18352
@@ -299,7 +297,7 @@
 
18353
          return;
 
18354
        }
 
18355
       else
 
18356
-       retarray->base_addr = xmalloc (alloc_size);
 
18357
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
18358
 
 
18359
     }
 
18360
   else
 
18361
@@ -472,8 +470,7 @@
 
18362
       retarray->offset = 0;
 
18363
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18364
 
 
18365
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18366
-                  * extent[rank-1];
 
18367
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18368
 
 
18369
       if (alloc_size == 0)
 
18370
        {
 
18371
@@ -482,7 +479,7 @@
 
18372
          return;
 
18373
        }
 
18374
       else
 
18375
-       retarray->base_addr = xmalloc (alloc_size);
 
18376
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
18377
     }
 
18378
   else
 
18379
     {
 
18380
Index: libgfortran/generated/pack_i4.c
 
18381
===================================================================
 
18382
--- a/src/libgfortran/generated/pack_i4.c       (.../tags/gcc_4_8_3_release)
 
18383
+++ b/src/libgfortran/generated/pack_i4.c       (.../branches/gcc-4_8-branch)
 
18384
@@ -167,8 +167,8 @@
 
18385
 
 
18386
          ret->offset = 0;
 
18387
 
 
18388
-         /* xmalloc allocates a single byte for zero size.  */
 
18389
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * total);
 
18390
+         /* xmallocarray allocates a single byte for zero size.  */
 
18391
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_4));
 
18392
 
 
18393
          if (total == 0)
 
18394
            return;
 
18395
Index: libgfortran/generated/maxloc1_4_i1.c
 
18396
===================================================================
 
18397
--- a/src/libgfortran/generated/maxloc1_4_i1.c  (.../tags/gcc_4_8_3_release)
 
18398
+++ b/src/libgfortran/generated/maxloc1_4_i1.c  (.../branches/gcc-4_8-branch)
 
18399
@@ -98,10 +98,9 @@
 
18400
       retarray->offset = 0;
 
18401
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18402
 
 
18403
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18404
-                  * extent[rank-1];
 
18405
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18406
 
 
18407
-      retarray->base_addr = xmalloc (alloc_size);
 
18408
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18409
       if (alloc_size == 0)
 
18410
        {
 
18411
          /* Make sure we have a zero-sized array.  */
 
18412
@@ -294,8 +293,7 @@
 
18413
 
 
18414
        }
 
18415
 
 
18416
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18417
-                  * extent[rank-1];
 
18418
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18419
 
 
18420
       retarray->offset = 0;
 
18421
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18422
@@ -307,7 +305,7 @@
 
18423
          return;
 
18424
        }
 
18425
       else
 
18426
-       retarray->base_addr = xmalloc (alloc_size);
 
18427
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18428
 
 
18429
     }
 
18430
   else
 
18431
@@ -485,8 +483,7 @@
 
18432
       retarray->offset = 0;
 
18433
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18434
 
 
18435
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18436
-                  * extent[rank-1];
 
18437
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18438
 
 
18439
       if (alloc_size == 0)
 
18440
        {
 
18441
@@ -495,7 +492,7 @@
 
18442
          return;
 
18443
        }
 
18444
       else
 
18445
-       retarray->base_addr = xmalloc (alloc_size);
 
18446
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18447
     }
 
18448
   else
 
18449
     {
 
18450
Index: libgfortran/generated/matmul_r10.c
 
18451
===================================================================
 
18452
--- a/src/libgfortran/generated/matmul_r10.c    (.../tags/gcc_4_8_3_release)
 
18453
+++ b/src/libgfortran/generated/matmul_r10.c    (.../branches/gcc-4_8-branch)
 
18454
@@ -124,7 +124,7 @@
 
18455
         }
 
18456
 
 
18457
       retarray->base_addr
 
18458
-       = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
 
18459
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_10));
 
18460
       retarray->offset = 0;
 
18461
     }
 
18462
     else if (unlikely (compile_options.bounds_check))
 
18463
Index: libgfortran/generated/minloc1_4_i8.c
 
18464
===================================================================
 
18465
--- a/src/libgfortran/generated/minloc1_4_i8.c  (.../tags/gcc_4_8_3_release)
 
18466
+++ b/src/libgfortran/generated/minloc1_4_i8.c  (.../branches/gcc-4_8-branch)
 
18467
@@ -98,10 +98,9 @@
 
18468
       retarray->offset = 0;
 
18469
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18470
 
 
18471
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18472
-                  * extent[rank-1];
 
18473
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18474
 
 
18475
-      retarray->base_addr = xmalloc (alloc_size);
 
18476
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18477
       if (alloc_size == 0)
 
18478
        {
 
18479
          /* Make sure we have a zero-sized array.  */
 
18480
@@ -294,8 +293,7 @@
 
18481
 
 
18482
        }
 
18483
 
 
18484
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18485
-                  * extent[rank-1];
 
18486
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18487
 
 
18488
       retarray->offset = 0;
 
18489
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18490
@@ -307,7 +305,7 @@
 
18491
          return;
 
18492
        }
 
18493
       else
 
18494
-       retarray->base_addr = xmalloc (alloc_size);
 
18495
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18496
 
 
18497
     }
 
18498
   else
 
18499
@@ -485,8 +483,7 @@
 
18500
       retarray->offset = 0;
 
18501
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18502
 
 
18503
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18504
-                  * extent[rank-1];
 
18505
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18506
 
 
18507
       if (alloc_size == 0)
 
18508
        {
 
18509
@@ -495,7 +492,7 @@
 
18510
          return;
 
18511
        }
 
18512
       else
 
18513
-       retarray->base_addr = xmalloc (alloc_size);
 
18514
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18515
     }
 
18516
   else
 
18517
     {
 
18518
Index: libgfortran/generated/minloc0_8_r4.c
 
18519
===================================================================
 
18520
--- a/src/libgfortran/generated/minloc0_8_r4.c  (.../tags/gcc_4_8_3_release)
 
18521
+++ b/src/libgfortran/generated/minloc0_8_r4.c  (.../branches/gcc-4_8-branch)
 
18522
@@ -58,7 +58,7 @@
 
18523
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18524
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18525
       retarray->offset = 0;
 
18526
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18527
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18528
     }
 
18529
   else
 
18530
     {
 
18531
@@ -199,7 +199,7 @@
 
18532
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18533
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18534
       retarray->offset = 0;
 
18535
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18536
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18537
     }
 
18538
   else
 
18539
     {
 
18540
@@ -367,7 +367,7 @@
 
18541
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18542
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18543
       retarray->offset = 0;
 
18544
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18545
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18546
     }
 
18547
   else if (unlikely (compile_options.bounds_check))
 
18548
     {
 
18549
Index: libgfortran/generated/matmul_l4.c
 
18550
===================================================================
 
18551
--- a/src/libgfortran/generated/matmul_l4.c     (.../tags/gcc_4_8_3_release)
 
18552
+++ b/src/libgfortran/generated/matmul_l4.c     (.../branches/gcc-4_8-branch)
 
18553
@@ -88,7 +88,7 @@
 
18554
         }
 
18555
           
 
18556
       retarray->base_addr
 
18557
-       = xmalloc (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
 
18558
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_4));
 
18559
       retarray->offset = 0;
 
18560
     }
 
18561
     else if (unlikely (compile_options.bounds_check))
 
18562
Index: libgfortran/generated/reshape_r8.c
 
18563
===================================================================
 
18564
--- a/src/libgfortran/generated/reshape_r8.c    (.../tags/gcc_4_8_3_release)
 
18565
+++ b/src/libgfortran/generated/reshape_r8.c    (.../branches/gcc-4_8-branch)
 
18566
@@ -111,11 +111,11 @@
 
18567
       ret->offset = 0;
 
18568
 
 
18569
       if (unlikely (rs < 1))
 
18570
-        alloc_size = 1;
 
18571
+        alloc_size = 0;
 
18572
       else
 
18573
-        alloc_size = rs * sizeof (GFC_REAL_8);
 
18574
+        alloc_size = rs;
 
18575
 
 
18576
-      ret->base_addr = xmalloc (alloc_size);
 
18577
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
18578
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
18579
     }
 
18580
 
 
18581
Index: libgfortran/generated/in_pack_c10.c
 
18582
===================================================================
 
18583
--- a/src/libgfortran/generated/in_pack_c10.c   (.../tags/gcc_4_8_3_release)
 
18584
+++ b/src/libgfortran/generated/in_pack_c10.c   (.../branches/gcc-4_8-branch)
 
18585
@@ -76,7 +76,7 @@
 
18586
     return source->base_addr;
 
18587
 
 
18588
   /* Allocate storage for the destination.  */
 
18589
-  destptr = (GFC_COMPLEX_10 *)xmalloc (ssize * sizeof (GFC_COMPLEX_10));
 
18590
+  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_10));
 
18591
   dest = destptr;
 
18592
   src = source->base_addr;
 
18593
   stride0 = stride[0];
 
18594
Index: libgfortran/generated/all_l4.c
 
18595
===================================================================
 
18596
--- a/src/libgfortran/generated/all_l4.c        (.../tags/gcc_4_8_3_release)
 
18597
+++ b/src/libgfortran/generated/all_l4.c        (.../branches/gcc-4_8-branch)
 
18598
@@ -101,8 +101,7 @@
 
18599
       retarray->offset = 0;
 
18600
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18601
 
 
18602
-      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18603
-                  * extent[rank-1];
 
18604
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18605
 
 
18606
       if (alloc_size == 0)
 
18607
        {
 
18608
@@ -111,7 +110,7 @@
 
18609
          return;
 
18610
        }
 
18611
       else
 
18612
-       retarray->base_addr = xmalloc (alloc_size);
 
18613
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
 
18614
     }
 
18615
   else
 
18616
     {
 
18617
Index: libgfortran/generated/minloc0_8_i2.c
 
18618
===================================================================
 
18619
--- a/src/libgfortran/generated/minloc0_8_i2.c  (.../tags/gcc_4_8_3_release)
 
18620
+++ b/src/libgfortran/generated/minloc0_8_i2.c  (.../branches/gcc-4_8-branch)
 
18621
@@ -58,7 +58,7 @@
 
18622
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18623
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18624
       retarray->offset = 0;
 
18625
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18626
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18627
     }
 
18628
   else
 
18629
     {
 
18630
@@ -199,7 +199,7 @@
 
18631
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18632
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18633
       retarray->offset = 0;
 
18634
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18635
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18636
     }
 
18637
   else
 
18638
     {
 
18639
@@ -367,7 +367,7 @@
 
18640
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18641
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18642
       retarray->offset = 0;
 
18643
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18644
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18645
     }
 
18646
   else if (unlikely (compile_options.bounds_check))
 
18647
     {
 
18648
Index: libgfortran/generated/norm2_r16.c
 
18649
===================================================================
 
18650
--- a/src/libgfortran/generated/norm2_r16.c     (.../tags/gcc_4_8_3_release)
 
18651
+++ b/src/libgfortran/generated/norm2_r16.c     (.../branches/gcc-4_8-branch)
 
18652
@@ -105,10 +105,9 @@
 
18653
       retarray->offset = 0;
 
18654
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18655
 
 
18656
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18657
-                  * extent[rank-1];
 
18658
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18659
 
 
18660
-      retarray->base_addr = xmalloc (alloc_size);
 
18661
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
18662
       if (alloc_size == 0)
 
18663
        {
 
18664
          /* Make sure we have a zero-sized array.  */
 
18665
Index: libgfortran/generated/reshape_c10.c
 
18666
===================================================================
 
18667
--- a/src/libgfortran/generated/reshape_c10.c   (.../tags/gcc_4_8_3_release)
 
18668
+++ b/src/libgfortran/generated/reshape_c10.c   (.../branches/gcc-4_8-branch)
 
18669
@@ -111,11 +111,11 @@
 
18670
       ret->offset = 0;
 
18671
 
 
18672
       if (unlikely (rs < 1))
 
18673
-        alloc_size = 1;
 
18674
+        alloc_size = 0;
 
18675
       else
 
18676
-        alloc_size = rs * sizeof (GFC_COMPLEX_10);
 
18677
+        alloc_size = rs;
 
18678
 
 
18679
-      ret->base_addr = xmalloc (alloc_size);
 
18680
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
18681
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
18682
     }
 
18683
 
 
18684
Index: libgfortran/generated/unpack_c16.c
 
18685
===================================================================
 
18686
--- a/src/libgfortran/generated/unpack_c16.c    (.../tags/gcc_4_8_3_release)
 
18687
+++ b/src/libgfortran/generated/unpack_c16.c    (.../branches/gcc-4_8-branch)
 
18688
@@ -99,7 +99,7 @@
 
18689
          rs *= extent[n];
 
18690
        }
 
18691
       ret->offset = 0;
 
18692
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
 
18693
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
 
18694
     }
 
18695
   else
 
18696
     {
 
18697
@@ -244,7 +244,7 @@
 
18698
          rs *= extent[n];
 
18699
        }
 
18700
       ret->offset = 0;
 
18701
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
 
18702
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
 
18703
     }
 
18704
   else
 
18705
     {
 
18706
Index: libgfortran/generated/maxloc1_4_r4.c
 
18707
===================================================================
 
18708
--- a/src/libgfortran/generated/maxloc1_4_r4.c  (.../tags/gcc_4_8_3_release)
 
18709
+++ b/src/libgfortran/generated/maxloc1_4_r4.c  (.../branches/gcc-4_8-branch)
 
18710
@@ -98,10 +98,9 @@
 
18711
       retarray->offset = 0;
 
18712
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18713
 
 
18714
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18715
-                  * extent[rank-1];
 
18716
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18717
 
 
18718
-      retarray->base_addr = xmalloc (alloc_size);
 
18719
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18720
       if (alloc_size == 0)
 
18721
        {
 
18722
          /* Make sure we have a zero-sized array.  */
 
18723
@@ -294,8 +293,7 @@
 
18724
 
 
18725
        }
 
18726
 
 
18727
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18728
-                  * extent[rank-1];
 
18729
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18730
 
 
18731
       retarray->offset = 0;
 
18732
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18733
@@ -307,7 +305,7 @@
 
18734
          return;
 
18735
        }
 
18736
       else
 
18737
-       retarray->base_addr = xmalloc (alloc_size);
 
18738
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18739
 
 
18740
     }
 
18741
   else
 
18742
@@ -485,8 +483,7 @@
 
18743
       retarray->offset = 0;
 
18744
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18745
 
 
18746
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18747
-                  * extent[rank-1];
 
18748
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18749
 
 
18750
       if (alloc_size == 0)
 
18751
        {
 
18752
@@ -495,7 +492,7 @@
 
18753
          return;
 
18754
        }
 
18755
       else
 
18756
-       retarray->base_addr = xmalloc (alloc_size);
 
18757
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18758
     }
 
18759
   else
 
18760
     {
 
18761
Index: libgfortran/generated/maxval_r8.c
 
18762
===================================================================
 
18763
--- a/src/libgfortran/generated/maxval_r8.c     (.../tags/gcc_4_8_3_release)
 
18764
+++ b/src/libgfortran/generated/maxval_r8.c     (.../branches/gcc-4_8-branch)
 
18765
@@ -97,10 +97,9 @@
 
18766
       retarray->offset = 0;
 
18767
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18768
 
 
18769
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18770
-                  * extent[rank-1];
 
18771
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18772
 
 
18773
-      retarray->base_addr = xmalloc (alloc_size);
 
18774
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
18775
       if (alloc_size == 0)
 
18776
        {
 
18777
          /* Make sure we have a zero-sized array.  */
 
18778
@@ -286,8 +285,7 @@
 
18779
 
 
18780
        }
 
18781
 
 
18782
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18783
-                  * extent[rank-1];
 
18784
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18785
 
 
18786
       retarray->offset = 0;
 
18787
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18788
@@ -299,7 +297,7 @@
 
18789
          return;
 
18790
        }
 
18791
       else
 
18792
-       retarray->base_addr = xmalloc (alloc_size);
 
18793
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
18794
 
 
18795
     }
 
18796
   else
 
18797
@@ -472,8 +470,7 @@
 
18798
       retarray->offset = 0;
 
18799
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18800
 
 
18801
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18802
-                  * extent[rank-1];
 
18803
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18804
 
 
18805
       if (alloc_size == 0)
 
18806
        {
 
18807
@@ -482,7 +479,7 @@
 
18808
          return;
 
18809
        }
 
18810
       else
 
18811
-       retarray->base_addr = xmalloc (alloc_size);
 
18812
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
18813
     }
 
18814
   else
 
18815
     {
 
18816
Index: libgfortran/generated/transpose_c4.c
 
18817
===================================================================
 
18818
--- a/src/libgfortran/generated/transpose_c4.c  (.../tags/gcc_4_8_3_release)
 
18819
+++ b/src/libgfortran/generated/transpose_c4.c  (.../branches/gcc-4_8-branch)
 
18820
@@ -60,7 +60,8 @@
 
18821
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
18822
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
18823
 
 
18824
-      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
 
18825
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
18826
+                                     sizeof (GFC_COMPLEX_4));
 
18827
       ret->offset = 0;
 
18828
     } else if (unlikely (compile_options.bounds_check))
 
18829
     {
 
18830
Index: libgfortran/generated/eoshift1_4.c
 
18831
===================================================================
 
18832
--- a/src/libgfortran/generated/eoshift1_4.c    (.../tags/gcc_4_8_3_release)
 
18833
+++ b/src/libgfortran/generated/eoshift1_4.c    (.../branches/gcc-4_8-branch)
 
18834
@@ -105,8 +105,8 @@
 
18835
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
18836
 
 
18837
         }
 
18838
-      /* xmalloc allocates a single byte for zero size.  */
 
18839
-      ret->base_addr = xmalloc (size * arraysize);
 
18840
+      /* xmallocarray allocates a single byte for zero size.  */
 
18841
+      ret->base_addr = xmallocarray (arraysize, size);
 
18842
 
 
18843
     }
 
18844
   else if (unlikely (compile_options.bounds_check))
 
18845
Index: libgfortran/generated/minval_r16.c
 
18846
===================================================================
 
18847
--- a/src/libgfortran/generated/minval_r16.c    (.../tags/gcc_4_8_3_release)
 
18848
+++ b/src/libgfortran/generated/minval_r16.c    (.../branches/gcc-4_8-branch)
 
18849
@@ -97,10 +97,9 @@
 
18850
       retarray->offset = 0;
 
18851
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18852
 
 
18853
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18854
-                  * extent[rank-1];
 
18855
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18856
 
 
18857
-      retarray->base_addr = xmalloc (alloc_size);
 
18858
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
18859
       if (alloc_size == 0)
 
18860
        {
 
18861
          /* Make sure we have a zero-sized array.  */
 
18862
@@ -286,8 +285,7 @@
 
18863
 
 
18864
        }
 
18865
 
 
18866
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18867
-                  * extent[rank-1];
 
18868
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18869
 
 
18870
       retarray->offset = 0;
 
18871
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18872
@@ -299,7 +297,7 @@
 
18873
          return;
 
18874
        }
 
18875
       else
 
18876
-       retarray->base_addr = xmalloc (alloc_size);
 
18877
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
18878
 
 
18879
     }
 
18880
   else
 
18881
@@ -472,8 +470,7 @@
 
18882
       retarray->offset = 0;
 
18883
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18884
 
 
18885
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18886
-                  * extent[rank-1];
 
18887
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18888
 
 
18889
       if (alloc_size == 0)
 
18890
        {
 
18891
@@ -482,7 +479,7 @@
 
18892
          return;
 
18893
        }
 
18894
       else
 
18895
-       retarray->base_addr = xmalloc (alloc_size);
 
18896
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
18897
     }
 
18898
   else
 
18899
     {
 
18900
Index: libgfortran/generated/iany_i16.c
 
18901
===================================================================
 
18902
--- a/src/libgfortran/generated/iany_i16.c      (.../tags/gcc_4_8_3_release)
 
18903
+++ b/src/libgfortran/generated/iany_i16.c      (.../branches/gcc-4_8-branch)
 
18904
@@ -97,10 +97,9 @@
 
18905
       retarray->offset = 0;
 
18906
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18907
 
 
18908
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18909
-                  * extent[rank-1];
 
18910
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18911
 
 
18912
-      retarray->base_addr = xmalloc (alloc_size);
 
18913
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18914
       if (alloc_size == 0)
 
18915
        {
 
18916
          /* Make sure we have a zero-sized array.  */
 
18917
@@ -272,8 +271,7 @@
 
18918
 
 
18919
        }
 
18920
 
 
18921
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18922
-                  * extent[rank-1];
 
18923
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18924
 
 
18925
       retarray->offset = 0;
 
18926
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18927
@@ -285,7 +283,7 @@
 
18928
          return;
 
18929
        }
 
18930
       else
 
18931
-       retarray->base_addr = xmalloc (alloc_size);
 
18932
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18933
 
 
18934
     }
 
18935
   else
 
18936
@@ -430,8 +428,7 @@
 
18937
       retarray->offset = 0;
 
18938
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18939
 
 
18940
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18941
-                  * extent[rank-1];
 
18942
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18943
 
 
18944
       if (alloc_size == 0)
 
18945
        {
 
18946
@@ -440,7 +437,7 @@
 
18947
          return;
 
18948
        }
 
18949
       else
 
18950
-       retarray->base_addr = xmalloc (alloc_size);
 
18951
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18952
     }
 
18953
   else
 
18954
     {
 
18955
Index: libgfortran/generated/maxloc1_4_i2.c
 
18956
===================================================================
 
18957
--- a/src/libgfortran/generated/maxloc1_4_i2.c  (.../tags/gcc_4_8_3_release)
 
18958
+++ b/src/libgfortran/generated/maxloc1_4_i2.c  (.../branches/gcc-4_8-branch)
 
18959
@@ -98,10 +98,9 @@
 
18960
       retarray->offset = 0;
 
18961
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18962
 
 
18963
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18964
-                  * extent[rank-1];
 
18965
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18966
 
 
18967
-      retarray->base_addr = xmalloc (alloc_size);
 
18968
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18969
       if (alloc_size == 0)
 
18970
        {
 
18971
          /* Make sure we have a zero-sized array.  */
 
18972
@@ -294,8 +293,7 @@
 
18973
 
 
18974
        }
 
18975
 
 
18976
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18977
-                  * extent[rank-1];
 
18978
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18979
 
 
18980
       retarray->offset = 0;
 
18981
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18982
@@ -307,7 +305,7 @@
 
18983
          return;
 
18984
        }
 
18985
       else
 
18986
-       retarray->base_addr = xmalloc (alloc_size);
 
18987
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18988
 
 
18989
     }
 
18990
   else
 
18991
@@ -485,8 +483,7 @@
 
18992
       retarray->offset = 0;
 
18993
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18994
 
 
18995
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18996
-                  * extent[rank-1];
 
18997
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18998
 
 
18999
       if (alloc_size == 0)
 
19000
        {
 
19001
@@ -495,7 +492,7 @@
 
19002
          return;
 
19003
        }
 
19004
       else
 
19005
-       retarray->base_addr = xmalloc (alloc_size);
 
19006
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19007
     }
 
19008
   else
 
19009
     {
 
19010
Index: libgfortran/generated/maxloc1_8_i8.c
 
19011
===================================================================
 
19012
--- a/src/libgfortran/generated/maxloc1_8_i8.c  (.../tags/gcc_4_8_3_release)
 
19013
+++ b/src/libgfortran/generated/maxloc1_8_i8.c  (.../branches/gcc-4_8-branch)
 
19014
@@ -98,10 +98,9 @@
 
19015
       retarray->offset = 0;
 
19016
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19017
 
 
19018
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19019
-                  * extent[rank-1];
 
19020
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19021
 
 
19022
-      retarray->base_addr = xmalloc (alloc_size);
 
19023
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19024
       if (alloc_size == 0)
 
19025
        {
 
19026
          /* Make sure we have a zero-sized array.  */
 
19027
@@ -294,8 +293,7 @@
 
19028
 
 
19029
        }
 
19030
 
 
19031
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19032
-                  * extent[rank-1];
 
19033
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19034
 
 
19035
       retarray->offset = 0;
 
19036
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19037
@@ -307,7 +305,7 @@
 
19038
          return;
 
19039
        }
 
19040
       else
 
19041
-       retarray->base_addr = xmalloc (alloc_size);
 
19042
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19043
 
 
19044
     }
 
19045
   else
 
19046
@@ -485,8 +483,7 @@
 
19047
       retarray->offset = 0;
 
19048
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19049
 
 
19050
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19051
-                  * extent[rank-1];
 
19052
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19053
 
 
19054
       if (alloc_size == 0)
 
19055
        {
 
19056
@@ -495,7 +492,7 @@
 
19057
          return;
 
19058
        }
 
19059
       else
 
19060
-       retarray->base_addr = xmalloc (alloc_size);
 
19061
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19062
     }
 
19063
   else
 
19064
     {
 
19065
Index: libgfortran/generated/maxloc0_4_r8.c
 
19066
===================================================================
 
19067
--- a/src/libgfortran/generated/maxloc0_4_r8.c  (.../tags/gcc_4_8_3_release)
 
19068
+++ b/src/libgfortran/generated/maxloc0_4_r8.c  (.../branches/gcc-4_8-branch)
 
19069
@@ -58,7 +58,7 @@
 
19070
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19071
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19072
       retarray->offset = 0;
 
19073
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
19074
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
19075
     }
 
19076
   else
 
19077
     {
 
19078
@@ -199,7 +199,7 @@
 
19079
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19080
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19081
       retarray->offset = 0;
 
19082
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
19083
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
19084
     }
 
19085
   else
 
19086
     {
 
19087
@@ -367,7 +367,7 @@
 
19088
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19089
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19090
       retarray->offset = 0;
 
19091
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
19092
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
19093
     }
 
19094
   else if (unlikely (compile_options.bounds_check))
 
19095
     {
 
19096
Index: libgfortran/generated/maxloc0_16_r16.c
 
19097
===================================================================
 
19098
--- a/src/libgfortran/generated/maxloc0_16_r16.c        (.../tags/gcc_4_8_3_release)
 
19099
+++ b/src/libgfortran/generated/maxloc0_16_r16.c        (.../branches/gcc-4_8-branch)
 
19100
@@ -58,7 +58,7 @@
 
19101
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19102
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19103
       retarray->offset = 0;
 
19104
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19105
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19106
     }
 
19107
   else
 
19108
     {
 
19109
@@ -199,7 +199,7 @@
 
19110
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19111
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19112
       retarray->offset = 0;
 
19113
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19114
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19115
     }
 
19116
   else
 
19117
     {
 
19118
@@ -367,7 +367,7 @@
 
19119
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19120
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19121
       retarray->offset = 0;
 
19122
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19123
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19124
     }
 
19125
   else if (unlikely (compile_options.bounds_check))
 
19126
     {
 
19127
Index: libgfortran/generated/sum_c10.c
 
19128
===================================================================
 
19129
--- a/src/libgfortran/generated/sum_c10.c       (.../tags/gcc_4_8_3_release)
 
19130
+++ b/src/libgfortran/generated/sum_c10.c       (.../branches/gcc-4_8-branch)
 
19131
@@ -97,10 +97,9 @@
 
19132
       retarray->offset = 0;
 
19133
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19134
 
 
19135
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19136
-                  * extent[rank-1];
 
19137
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19138
 
 
19139
-      retarray->base_addr = xmalloc (alloc_size);
 
19140
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
19141
       if (alloc_size == 0)
 
19142
        {
 
19143
          /* Make sure we have a zero-sized array.  */
 
19144
@@ -272,8 +271,7 @@
 
19145
 
 
19146
        }
 
19147
 
 
19148
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19149
-                  * extent[rank-1];
 
19150
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19151
 
 
19152
       retarray->offset = 0;
 
19153
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19154
@@ -285,7 +283,7 @@
 
19155
          return;
 
19156
        }
 
19157
       else
 
19158
-       retarray->base_addr = xmalloc (alloc_size);
 
19159
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
19160
 
 
19161
     }
 
19162
   else
 
19163
@@ -430,8 +428,7 @@
 
19164
       retarray->offset = 0;
 
19165
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19166
 
 
19167
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19168
-                  * extent[rank-1];
 
19169
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19170
 
 
19171
       if (alloc_size == 0)
 
19172
        {
 
19173
@@ -440,7 +437,7 @@
 
19174
          return;
 
19175
        }
 
19176
       else
 
19177
-       retarray->base_addr = xmalloc (alloc_size);
 
19178
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
19179
     }
 
19180
   else
 
19181
     {
 
19182
Index: libgfortran/generated/iall_i4.c
 
19183
===================================================================
 
19184
--- a/src/libgfortran/generated/iall_i4.c       (.../tags/gcc_4_8_3_release)
 
19185
+++ b/src/libgfortran/generated/iall_i4.c       (.../branches/gcc-4_8-branch)
 
19186
@@ -97,10 +97,9 @@
 
19187
       retarray->offset = 0;
 
19188
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19189
 
 
19190
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19191
-                  * extent[rank-1];
 
19192
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19193
 
 
19194
-      retarray->base_addr = xmalloc (alloc_size);
 
19195
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19196
       if (alloc_size == 0)
 
19197
        {
 
19198
          /* Make sure we have a zero-sized array.  */
 
19199
@@ -272,8 +271,7 @@
 
19200
 
 
19201
        }
 
19202
 
 
19203
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19204
-                  * extent[rank-1];
 
19205
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19206
 
 
19207
       retarray->offset = 0;
 
19208
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19209
@@ -285,7 +283,7 @@
 
19210
          return;
 
19211
        }
 
19212
       else
 
19213
-       retarray->base_addr = xmalloc (alloc_size);
 
19214
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19215
 
 
19216
     }
 
19217
   else
 
19218
@@ -430,8 +428,7 @@
 
19219
       retarray->offset = 0;
 
19220
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19221
 
 
19222
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19223
-                  * extent[rank-1];
 
19224
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19225
 
 
19226
       if (alloc_size == 0)
 
19227
        {
 
19228
@@ -440,7 +437,7 @@
 
19229
          return;
 
19230
        }
 
19231
       else
 
19232
-       retarray->base_addr = xmalloc (alloc_size);
 
19233
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19234
     }
 
19235
   else
 
19236
     {
 
19237
Index: libgfortran/generated/minloc1_4_r16.c
 
19238
===================================================================
 
19239
--- a/src/libgfortran/generated/minloc1_4_r16.c (.../tags/gcc_4_8_3_release)
 
19240
+++ b/src/libgfortran/generated/minloc1_4_r16.c (.../branches/gcc-4_8-branch)
 
19241
@@ -98,10 +98,9 @@
 
19242
       retarray->offset = 0;
 
19243
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19244
 
 
19245
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19246
-                  * extent[rank-1];
 
19247
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19248
 
 
19249
-      retarray->base_addr = xmalloc (alloc_size);
 
19250
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19251
       if (alloc_size == 0)
 
19252
        {
 
19253
          /* Make sure we have a zero-sized array.  */
 
19254
@@ -294,8 +293,7 @@
 
19255
 
 
19256
        }
 
19257
 
 
19258
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19259
-                  * extent[rank-1];
 
19260
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19261
 
 
19262
       retarray->offset = 0;
 
19263
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19264
@@ -307,7 +305,7 @@
 
19265
          return;
 
19266
        }
 
19267
       else
 
19268
-       retarray->base_addr = xmalloc (alloc_size);
 
19269
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19270
 
 
19271
     }
 
19272
   else
 
19273
@@ -485,8 +483,7 @@
 
19274
       retarray->offset = 0;
 
19275
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19276
 
 
19277
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19278
-                  * extent[rank-1];
 
19279
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19280
 
 
19281
       if (alloc_size == 0)
 
19282
        {
 
19283
@@ -495,7 +492,7 @@
 
19284
          return;
 
19285
        }
 
19286
       else
 
19287
-       retarray->base_addr = xmalloc (alloc_size);
 
19288
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19289
     }
 
19290
   else
 
19291
     {
 
19292
Index: libgfortran/generated/maxloc0_8_r16.c
 
19293
===================================================================
 
19294
--- a/src/libgfortran/generated/maxloc0_8_r16.c (.../tags/gcc_4_8_3_release)
 
19295
+++ b/src/libgfortran/generated/maxloc0_8_r16.c (.../branches/gcc-4_8-branch)
 
19296
@@ -58,7 +58,7 @@
 
19297
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19298
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19299
       retarray->offset = 0;
 
19300
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19301
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19302
     }
 
19303
   else
 
19304
     {
 
19305
@@ -199,7 +199,7 @@
 
19306
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19307
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19308
       retarray->offset = 0;
 
19309
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19310
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19311
     }
 
19312
   else
 
19313
     {
 
19314
@@ -367,7 +367,7 @@
 
19315
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19316
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19317
       retarray->offset = 0;
 
19318
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19319
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19320
     }
 
19321
   else if (unlikely (compile_options.bounds_check))
 
19322
     {
 
19323
Index: libgfortran/generated/pack_r8.c
 
19324
===================================================================
 
19325
--- a/src/libgfortran/generated/pack_r8.c       (.../tags/gcc_4_8_3_release)
 
19326
+++ b/src/libgfortran/generated/pack_r8.c       (.../branches/gcc-4_8-branch)
 
19327
@@ -167,8 +167,8 @@
 
19328
 
 
19329
          ret->offset = 0;
 
19330
 
 
19331
-         /* xmalloc allocates a single byte for zero size.  */
 
19332
-         ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * total);
 
19333
+         /* xmallocarray allocates a single byte for zero size.  */
 
19334
+         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_8));
 
19335
 
 
19336
          if (total == 0)
 
19337
            return;
 
19338
Index: libgfortran/generated/matmul_c10.c
 
19339
===================================================================
 
19340
--- a/src/libgfortran/generated/matmul_c10.c    (.../tags/gcc_4_8_3_release)
 
19341
+++ b/src/libgfortran/generated/matmul_c10.c    (.../branches/gcc-4_8-branch)
 
19342
@@ -124,7 +124,7 @@
 
19343
         }
 
19344
 
 
19345
       retarray->base_addr
 
19346
-       = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
 
19347
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_10));
 
19348
       retarray->offset = 0;
 
19349
     }
 
19350
     else if (unlikely (compile_options.bounds_check))
 
19351
Index: libgfortran/generated/maxloc0_16_i4.c
 
19352
===================================================================
 
19353
--- a/src/libgfortran/generated/maxloc0_16_i4.c (.../tags/gcc_4_8_3_release)
 
19354
+++ b/src/libgfortran/generated/maxloc0_16_i4.c (.../branches/gcc-4_8-branch)
 
19355
@@ -58,7 +58,7 @@
 
19356
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19357
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19358
       retarray->offset = 0;
 
19359
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19360
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19361
     }
 
19362
   else
 
19363
     {
 
19364
@@ -199,7 +199,7 @@
 
19365
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19366
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19367
       retarray->offset = 0;
 
19368
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19369
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19370
     }
 
19371
   else
 
19372
     {
 
19373
@@ -367,7 +367,7 @@
 
19374
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19375
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19376
       retarray->offset = 0;
 
19377
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19378
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19379
     }
 
19380
   else if (unlikely (compile_options.bounds_check))
 
19381
     {
 
19382
Index: libgfortran/generated/pack_r16.c
 
19383
===================================================================
 
19384
--- a/src/libgfortran/generated/pack_r16.c      (.../tags/gcc_4_8_3_release)
 
19385
+++ b/src/libgfortran/generated/pack_r16.c      (.../branches/gcc-4_8-branch)
 
19386
@@ -167,8 +167,8 @@
 
19387
 
 
19388
          ret->offset = 0;
 
19389
 
 
19390
-         /* xmalloc allocates a single byte for zero size.  */
 
19391
-         ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * total);
 
19392
+         /* xmallocarray allocates a single byte for zero size.  */
 
19393
+         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_16));
 
19394
 
 
19395
          if (total == 0)
 
19396
            return;
 
19397
Index: libgfortran/generated/minloc1_16_i8.c
 
19398
===================================================================
 
19399
--- a/src/libgfortran/generated/minloc1_16_i8.c (.../tags/gcc_4_8_3_release)
 
19400
+++ b/src/libgfortran/generated/minloc1_16_i8.c (.../branches/gcc-4_8-branch)
 
19401
@@ -98,10 +98,9 @@
 
19402
       retarray->offset = 0;
 
19403
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19404
 
 
19405
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19406
-                  * extent[rank-1];
 
19407
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19408
 
 
19409
-      retarray->base_addr = xmalloc (alloc_size);
 
19410
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19411
       if (alloc_size == 0)
 
19412
        {
 
19413
          /* Make sure we have a zero-sized array.  */
 
19414
@@ -294,8 +293,7 @@
 
19415
 
 
19416
        }
 
19417
 
 
19418
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19419
-                  * extent[rank-1];
 
19420
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19421
 
 
19422
       retarray->offset = 0;
 
19423
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19424
@@ -307,7 +305,7 @@
 
19425
          return;
 
19426
        }
 
19427
       else
 
19428
-       retarray->base_addr = xmalloc (alloc_size);
 
19429
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19430
 
 
19431
     }
 
19432
   else
 
19433
@@ -485,8 +483,7 @@
 
19434
       retarray->offset = 0;
 
19435
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19436
 
 
19437
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19438
-                  * extent[rank-1];
 
19439
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19440
 
 
19441
       if (alloc_size == 0)
 
19442
        {
 
19443
@@ -495,7 +492,7 @@
 
19444
          return;
 
19445
        }
 
19446
       else
 
19447
-       retarray->base_addr = xmalloc (alloc_size);
 
19448
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19449
     }
 
19450
   else
 
19451
     {
 
19452
Index: libgfortran/generated/minloc0_16_r10.c
 
19453
===================================================================
 
19454
--- a/src/libgfortran/generated/minloc0_16_r10.c        (.../tags/gcc_4_8_3_release)
 
19455
+++ b/src/libgfortran/generated/minloc0_16_r10.c        (.../branches/gcc-4_8-branch)
 
19456
@@ -58,7 +58,7 @@
 
19457
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19458
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19459
       retarray->offset = 0;
 
19460
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19461
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19462
     }
 
19463
   else
 
19464
     {
 
19465
@@ -199,7 +199,7 @@
 
19466
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19467
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19468
       retarray->offset = 0;
 
19469
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19470
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19471
     }
 
19472
   else
 
19473
     {
 
19474
@@ -367,7 +367,7 @@
 
19475
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19476
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19477
       retarray->offset = 0;
 
19478
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19479
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19480
     }
 
19481
   else if (unlikely (compile_options.bounds_check))
 
19482
     {
 
19483
Index: libgfortran/generated/unpack_c4.c
 
19484
===================================================================
 
19485
--- a/src/libgfortran/generated/unpack_c4.c     (.../tags/gcc_4_8_3_release)
 
19486
+++ b/src/libgfortran/generated/unpack_c4.c     (.../branches/gcc-4_8-branch)
 
19487
@@ -99,7 +99,7 @@
 
19488
          rs *= extent[n];
 
19489
        }
 
19490
       ret->offset = 0;
 
19491
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
 
19492
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
 
19493
     }
 
19494
   else
 
19495
     {
 
19496
@@ -244,7 +244,7 @@
 
19497
          rs *= extent[n];
 
19498
        }
 
19499
       ret->offset = 0;
 
19500
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
 
19501
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
 
19502
     }
 
19503
   else
 
19504
     {
 
19505
Index: libgfortran/generated/iparity_i1.c
 
19506
===================================================================
 
19507
--- a/src/libgfortran/generated/iparity_i1.c    (.../tags/gcc_4_8_3_release)
 
19508
+++ b/src/libgfortran/generated/iparity_i1.c    (.../branches/gcc-4_8-branch)
 
19509
@@ -97,10 +97,9 @@
 
19510
       retarray->offset = 0;
 
19511
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19512
 
 
19513
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19514
-                  * extent[rank-1];
 
19515
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19516
 
 
19517
-      retarray->base_addr = xmalloc (alloc_size);
 
19518
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
19519
       if (alloc_size == 0)
 
19520
        {
 
19521
          /* Make sure we have a zero-sized array.  */
 
19522
@@ -272,8 +271,7 @@
 
19523
 
 
19524
        }
 
19525
 
 
19526
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19527
-                  * extent[rank-1];
 
19528
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19529
 
 
19530
       retarray->offset = 0;
 
19531
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19532
@@ -285,7 +283,7 @@
 
19533
          return;
 
19534
        }
 
19535
       else
 
19536
-       retarray->base_addr = xmalloc (alloc_size);
 
19537
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
19538
 
 
19539
     }
 
19540
   else
 
19541
@@ -430,8 +428,7 @@
 
19542
       retarray->offset = 0;
 
19543
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19544
 
 
19545
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19546
-                  * extent[rank-1];
 
19547
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19548
 
 
19549
       if (alloc_size == 0)
 
19550
        {
 
19551
@@ -440,7 +437,7 @@
 
19552
          return;
 
19553
        }
 
19554
       else
 
19555
-       retarray->base_addr = xmalloc (alloc_size);
 
19556
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
19557
     }
 
19558
   else
 
19559
     {
 
19560
Index: libgfortran/generated/product_c8.c
 
19561
===================================================================
 
19562
--- a/src/libgfortran/generated/product_c8.c    (.../tags/gcc_4_8_3_release)
 
19563
+++ b/src/libgfortran/generated/product_c8.c    (.../branches/gcc-4_8-branch)
 
19564
@@ -97,10 +97,9 @@
 
19565
       retarray->offset = 0;
 
19566
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19567
 
 
19568
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19569
-                  * extent[rank-1];
 
19570
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19571
 
 
19572
-      retarray->base_addr = xmalloc (alloc_size);
 
19573
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
19574
       if (alloc_size == 0)
 
19575
        {
 
19576
          /* Make sure we have a zero-sized array.  */
 
19577
@@ -272,8 +271,7 @@
 
19578
 
 
19579
        }
 
19580
 
 
19581
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19582
-                  * extent[rank-1];
 
19583
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19584
 
 
19585
       retarray->offset = 0;
 
19586
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19587
@@ -285,7 +283,7 @@
 
19588
          return;
 
19589
        }
 
19590
       else
 
19591
-       retarray->base_addr = xmalloc (alloc_size);
 
19592
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
19593
 
 
19594
     }
 
19595
   else
 
19596
@@ -430,8 +428,7 @@
 
19597
       retarray->offset = 0;
 
19598
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19599
 
 
19600
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19601
-                  * extent[rank-1];
 
19602
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19603
 
 
19604
       if (alloc_size == 0)
 
19605
        {
 
19606
@@ -440,7 +437,7 @@
 
19607
          return;
 
19608
        }
 
19609
       else
 
19610
-       retarray->base_addr = xmalloc (alloc_size);
 
19611
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
19612
     }
 
19613
   else
 
19614
     {
 
19615
Index: libgfortran/generated/in_pack_i16.c
 
19616
===================================================================
 
19617
--- a/src/libgfortran/generated/in_pack_i16.c   (.../tags/gcc_4_8_3_release)
 
19618
+++ b/src/libgfortran/generated/in_pack_i16.c   (.../branches/gcc-4_8-branch)
 
19619
@@ -76,7 +76,7 @@
 
19620
     return source->base_addr;
 
19621
 
 
19622
   /* Allocate storage for the destination.  */
 
19623
-  destptr = (GFC_INTEGER_16 *)xmalloc (ssize * sizeof (GFC_INTEGER_16));
 
19624
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_16));
 
19625
   dest = destptr;
 
19626
   src = source->base_addr;
 
19627
   stride0 = stride[0];
 
19628
Index: libgfortran/generated/minloc0_8_i4.c
 
19629
===================================================================
 
19630
--- a/src/libgfortran/generated/minloc0_8_i4.c  (.../tags/gcc_4_8_3_release)
 
19631
+++ b/src/libgfortran/generated/minloc0_8_i4.c  (.../branches/gcc-4_8-branch)
 
19632
@@ -58,7 +58,7 @@
 
19633
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19634
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19635
       retarray->offset = 0;
 
19636
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19637
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19638
     }
 
19639
   else
 
19640
     {
 
19641
@@ -199,7 +199,7 @@
 
19642
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19643
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19644
       retarray->offset = 0;
 
19645
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19646
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19647
     }
 
19648
   else
 
19649
     {
 
19650
@@ -367,7 +367,7 @@
 
19651
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19652
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19653
       retarray->offset = 0;
 
19654
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19655
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19656
     }
 
19657
   else if (unlikely (compile_options.bounds_check))
 
19658
     {
 
19659
Index: libgfortran/generated/matmul_c4.c
 
19660
===================================================================
 
19661
--- a/src/libgfortran/generated/matmul_c4.c     (.../tags/gcc_4_8_3_release)
 
19662
+++ b/src/libgfortran/generated/matmul_c4.c     (.../branches/gcc-4_8-branch)
 
19663
@@ -124,7 +124,7 @@
 
19664
         }
 
19665
 
 
19666
       retarray->base_addr
 
19667
-       = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
 
19668
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_4));
 
19669
       retarray->offset = 0;
 
19670
     }
 
19671
     else if (unlikely (compile_options.bounds_check))
 
19672
Index: libgfortran/generated/reshape_i8.c
 
19673
===================================================================
 
19674
--- a/src/libgfortran/generated/reshape_i8.c    (.../tags/gcc_4_8_3_release)
 
19675
+++ b/src/libgfortran/generated/reshape_i8.c    (.../branches/gcc-4_8-branch)
 
19676
@@ -111,11 +111,11 @@
 
19677
       ret->offset = 0;
 
19678
 
 
19679
       if (unlikely (rs < 1))
 
19680
-        alloc_size = 1;
 
19681
+        alloc_size = 0;
 
19682
       else
 
19683
-        alloc_size = rs * sizeof (GFC_INTEGER_8);
 
19684
+        alloc_size = rs;
 
19685
 
 
19686
-      ret->base_addr = xmalloc (alloc_size);
 
19687
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19688
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
19689
     }
 
19690
 
 
19691
Index: libgfortran/generated/in_pack_c8.c
 
19692
===================================================================
 
19693
--- a/src/libgfortran/generated/in_pack_c8.c    (.../tags/gcc_4_8_3_release)
 
19694
+++ b/src/libgfortran/generated/in_pack_c8.c    (.../branches/gcc-4_8-branch)
 
19695
@@ -76,7 +76,7 @@
 
19696
     return source->base_addr;
 
19697
 
 
19698
   /* Allocate storage for the destination.  */
 
19699
-  destptr = (GFC_COMPLEX_8 *)xmalloc (ssize * sizeof (GFC_COMPLEX_8));
 
19700
+  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_8));
 
19701
   dest = destptr;
 
19702
   src = source->base_addr;
 
19703
   stride0 = stride[0];
 
19704
Index: libgfortran/generated/bessel_r10.c
 
19705
===================================================================
 
19706
--- a/src/libgfortran/generated/bessel_r10.c    (.../tags/gcc_4_8_3_release)
 
19707
+++ b/src/libgfortran/generated/bessel_r10.c    (.../branches/gcc-4_8-branch)
 
19708
@@ -55,7 +55,7 @@
 
19709
     {
 
19710
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
19711
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
19712
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
 
19713
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
 
19714
       ret->offset = 0;
 
19715
     }
 
19716
 
 
19717
@@ -122,7 +122,7 @@
 
19718
     {
 
19719
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
19720
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
19721
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
 
19722
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
 
19723
       ret->offset = 0;
 
19724
     }
 
19725
 
 
19726
@@ -162,7 +162,7 @@
 
19727
 
 
19728
   x2rev = GFC_REAL_10_LITERAL(2.)/x;
 
19729
 
 
19730
-  for (i = 2; i <= n1+n2; i++)
 
19731
+  for (i = 2; i <= n2 - n1; i++)
 
19732
     {
 
19733
 #if defined(GFC_REAL_10_INFINITY)
 
19734
       if (unlikely (last2 == -GFC_REAL_10_INFINITY))
 
19735
Index: libgfortran/generated/iall_i16.c
 
19736
===================================================================
 
19737
--- a/src/libgfortran/generated/iall_i16.c      (.../tags/gcc_4_8_3_release)
 
19738
+++ b/src/libgfortran/generated/iall_i16.c      (.../branches/gcc-4_8-branch)
 
19739
@@ -97,10 +97,9 @@
 
19740
       retarray->offset = 0;
 
19741
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19742
 
 
19743
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19744
-                  * extent[rank-1];
 
19745
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19746
 
 
19747
-      retarray->base_addr = xmalloc (alloc_size);
 
19748
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19749
       if (alloc_size == 0)
 
19750
        {
 
19751
          /* Make sure we have a zero-sized array.  */
 
19752
@@ -272,8 +271,7 @@
 
19753
 
 
19754
        }
 
19755
 
 
19756
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19757
-                  * extent[rank-1];
 
19758
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19759
 
 
19760
       retarray->offset = 0;
 
19761
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19762
@@ -285,7 +283,7 @@
 
19763
          return;
 
19764
        }
 
19765
       else
 
19766
-       retarray->base_addr = xmalloc (alloc_size);
 
19767
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19768
 
 
19769
     }
 
19770
   else
 
19771
@@ -430,8 +428,7 @@
 
19772
       retarray->offset = 0;
 
19773
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19774
 
 
19775
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19776
-                  * extent[rank-1];
 
19777
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19778
 
 
19779
       if (alloc_size == 0)
 
19780
        {
 
19781
@@ -440,7 +437,7 @@
 
19782
          return;
 
19783
        }
 
19784
       else
 
19785
-       retarray->base_addr = xmalloc (alloc_size);
 
19786
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19787
     }
 
19788
   else
 
19789
     {
 
19790
Index: libgfortran/generated/maxloc1_16_i1.c
 
19791
===================================================================
 
19792
--- a/src/libgfortran/generated/maxloc1_16_i1.c (.../tags/gcc_4_8_3_release)
 
19793
+++ b/src/libgfortran/generated/maxloc1_16_i1.c (.../branches/gcc-4_8-branch)
 
19794
@@ -98,10 +98,9 @@
 
19795
       retarray->offset = 0;
 
19796
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19797
 
 
19798
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19799
-                  * extent[rank-1];
 
19800
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19801
 
 
19802
-      retarray->base_addr = xmalloc (alloc_size);
 
19803
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19804
       if (alloc_size == 0)
 
19805
        {
 
19806
          /* Make sure we have a zero-sized array.  */
 
19807
@@ -294,8 +293,7 @@
 
19808
 
 
19809
        }
 
19810
 
 
19811
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19812
-                  * extent[rank-1];
 
19813
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19814
 
 
19815
       retarray->offset = 0;
 
19816
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19817
@@ -307,7 +305,7 @@
 
19818
          return;
 
19819
        }
 
19820
       else
 
19821
-       retarray->base_addr = xmalloc (alloc_size);
 
19822
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19823
 
 
19824
     }
 
19825
   else
 
19826
@@ -485,8 +483,7 @@
 
19827
       retarray->offset = 0;
 
19828
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19829
 
 
19830
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19831
-                  * extent[rank-1];
 
19832
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19833
 
 
19834
       if (alloc_size == 0)
 
19835
        {
 
19836
@@ -495,7 +492,7 @@
 
19837
          return;
 
19838
        }
 
19839
       else
 
19840
-       retarray->base_addr = xmalloc (alloc_size);
 
19841
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19842
     }
 
19843
   else
 
19844
     {
 
19845
Index: libgfortran/generated/reshape_i16.c
 
19846
===================================================================
 
19847
--- a/src/libgfortran/generated/reshape_i16.c   (.../tags/gcc_4_8_3_release)
 
19848
+++ b/src/libgfortran/generated/reshape_i16.c   (.../branches/gcc-4_8-branch)
 
19849
@@ -111,11 +111,11 @@
 
19850
       ret->offset = 0;
 
19851
 
 
19852
       if (unlikely (rs < 1))
 
19853
-        alloc_size = 1;
 
19854
+        alloc_size = 0;
 
19855
       else
 
19856
-        alloc_size = rs * sizeof (GFC_INTEGER_16);
 
19857
+        alloc_size = rs;
 
19858
 
 
19859
-      ret->base_addr = xmalloc (alloc_size);
 
19860
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19861
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
19862
     }
 
19863
 
 
19864
Index: libgfortran/generated/count_16_l.c
 
19865
===================================================================
 
19866
--- a/src/libgfortran/generated/count_16_l.c    (.../tags/gcc_4_8_3_release)
 
19867
+++ b/src/libgfortran/generated/count_16_l.c    (.../branches/gcc-4_8-branch)
 
19868
@@ -101,8 +101,7 @@
 
19869
       retarray->offset = 0;
 
19870
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19871
 
 
19872
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19873
-                  * extent[rank-1];
 
19874
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19875
 
 
19876
       if (alloc_size == 0)
 
19877
        {
 
19878
@@ -111,7 +110,7 @@
 
19879
          return;
 
19880
        }
 
19881
       else
 
19882
-       retarray->base_addr = xmalloc (alloc_size);
 
19883
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19884
     }
 
19885
   else
 
19886
     {
 
19887
Index: libgfortran/generated/minloc1_8_i1.c
 
19888
===================================================================
 
19889
--- a/src/libgfortran/generated/minloc1_8_i1.c  (.../tags/gcc_4_8_3_release)
 
19890
+++ b/src/libgfortran/generated/minloc1_8_i1.c  (.../branches/gcc-4_8-branch)
 
19891
@@ -98,10 +98,9 @@
 
19892
       retarray->offset = 0;
 
19893
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19894
 
 
19895
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19896
-                  * extent[rank-1];
 
19897
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19898
 
 
19899
-      retarray->base_addr = xmalloc (alloc_size);
 
19900
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19901
       if (alloc_size == 0)
 
19902
        {
 
19903
          /* Make sure we have a zero-sized array.  */
 
19904
@@ -294,8 +293,7 @@
 
19905
 
 
19906
        }
 
19907
 
 
19908
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19909
-                  * extent[rank-1];
 
19910
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19911
 
 
19912
       retarray->offset = 0;
 
19913
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19914
@@ -307,7 +305,7 @@
 
19915
          return;
 
19916
        }
 
19917
       else
 
19918
-       retarray->base_addr = xmalloc (alloc_size);
 
19919
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19920
 
 
19921
     }
 
19922
   else
 
19923
@@ -485,8 +483,7 @@
 
19924
       retarray->offset = 0;
 
19925
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19926
 
 
19927
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19928
-                  * extent[rank-1];
 
19929
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19930
 
 
19931
       if (alloc_size == 0)
 
19932
        {
 
19933
@@ -495,7 +492,7 @@
 
19934
          return;
 
19935
        }
 
19936
       else
 
19937
-       retarray->base_addr = xmalloc (alloc_size);
 
19938
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19939
     }
 
19940
   else
 
19941
     {
 
19942
Index: libgfortran/generated/maxloc1_4_i4.c
 
19943
===================================================================
 
19944
--- a/src/libgfortran/generated/maxloc1_4_i4.c  (.../tags/gcc_4_8_3_release)
 
19945
+++ b/src/libgfortran/generated/maxloc1_4_i4.c  (.../branches/gcc-4_8-branch)
 
19946
@@ -98,10 +98,9 @@
 
19947
       retarray->offset = 0;
 
19948
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19949
 
 
19950
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19951
-                  * extent[rank-1];
 
19952
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19953
 
 
19954
-      retarray->base_addr = xmalloc (alloc_size);
 
19955
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19956
       if (alloc_size == 0)
 
19957
        {
 
19958
          /* Make sure we have a zero-sized array.  */
 
19959
@@ -294,8 +293,7 @@
 
19960
 
 
19961
        }
 
19962
 
 
19963
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19964
-                  * extent[rank-1];
 
19965
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19966
 
 
19967
       retarray->offset = 0;
 
19968
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19969
@@ -307,7 +305,7 @@
 
19970
          return;
 
19971
        }
 
19972
       else
 
19973
-       retarray->base_addr = xmalloc (alloc_size);
 
19974
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19975
 
 
19976
     }
 
19977
   else
 
19978
@@ -485,8 +483,7 @@
 
19979
       retarray->offset = 0;
 
19980
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19981
 
 
19982
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19983
-                  * extent[rank-1];
 
19984
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19985
 
 
19986
       if (alloc_size == 0)
 
19987
        {
 
19988
@@ -495,7 +492,7 @@
 
19989
          return;
 
19990
        }
 
19991
       else
 
19992
-       retarray->base_addr = xmalloc (alloc_size);
 
19993
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
19994
     }
 
19995
   else
 
19996
     {
 
19997
Index: libgfortran/generated/maxval_i8.c
 
19998
===================================================================
 
19999
--- a/src/libgfortran/generated/maxval_i8.c     (.../tags/gcc_4_8_3_release)
 
20000
+++ b/src/libgfortran/generated/maxval_i8.c     (.../branches/gcc-4_8-branch)
 
20001
@@ -97,10 +97,9 @@
 
20002
       retarray->offset = 0;
 
20003
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20004
 
 
20005
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20006
-                  * extent[rank-1];
 
20007
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20008
 
 
20009
-      retarray->base_addr = xmalloc (alloc_size);
 
20010
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20011
       if (alloc_size == 0)
 
20012
        {
 
20013
          /* Make sure we have a zero-sized array.  */
 
20014
@@ -286,8 +285,7 @@
 
20015
 
 
20016
        }
 
20017
 
 
20018
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20019
-                  * extent[rank-1];
 
20020
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20021
 
 
20022
       retarray->offset = 0;
 
20023
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20024
@@ -299,7 +297,7 @@
 
20025
          return;
 
20026
        }
 
20027
       else
 
20028
-       retarray->base_addr = xmalloc (alloc_size);
 
20029
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20030
 
 
20031
     }
 
20032
   else
 
20033
@@ -472,8 +470,7 @@
 
20034
       retarray->offset = 0;
 
20035
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20036
 
 
20037
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20038
-                  * extent[rank-1];
 
20039
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20040
 
 
20041
       if (alloc_size == 0)
 
20042
        {
 
20043
@@ -482,7 +479,7 @@
 
20044
          return;
 
20045
        }
 
20046
       else
 
20047
-       retarray->base_addr = xmalloc (alloc_size);
 
20048
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20049
     }
 
20050
   else
 
20051
     {
 
20052
Index: libgfortran/generated/eoshift3_16.c
 
20053
===================================================================
 
20054
--- a/src/libgfortran/generated/eoshift3_16.c   (.../tags/gcc_4_8_3_release)
 
20055
+++ b/src/libgfortran/generated/eoshift3_16.c   (.../branches/gcc-4_8-branch)
 
20056
@@ -89,7 +89,7 @@
 
20057
     {
 
20058
       int i;
 
20059
 
 
20060
-      ret->base_addr = xmalloc (size * arraysize);
 
20061
+      ret->base_addr = xmallocarray (arraysize, size);
 
20062
       ret->offset = 0;
 
20063
       ret->dtype = array->dtype;
 
20064
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
20065
@@ -107,8 +107,8 @@
 
20066
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
20067
 
 
20068
         }
 
20069
-      /* xmalloc allocates a single byte for zero size.  */
 
20070
-      ret->base_addr = xmalloc (size * arraysize);
 
20071
+      /* xmallocarray allocates a single byte for zero size.  */
 
20072
+      ret->base_addr = xmallocarray (arraysize, size);
 
20073
 
 
20074
     }
 
20075
   else if (unlikely (compile_options.bounds_check))
 
20076
Index: libgfortran/generated/shape_i8.c
 
20077
===================================================================
 
20078
--- a/src/libgfortran/generated/shape_i8.c      (.../tags/gcc_4_8_3_release)
 
20079
+++ b/src/libgfortran/generated/shape_i8.c      (.../branches/gcc-4_8-branch)
 
20080
@@ -49,7 +49,7 @@
 
20081
     {
 
20082
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
 
20083
       ret->offset = 0;
 
20084
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
20085
+      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
20086
     }
 
20087
 
 
20088
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
20089
Index: libgfortran/generated/maxloc0_4_i16.c
 
20090
===================================================================
 
20091
--- a/src/libgfortran/generated/maxloc0_4_i16.c (.../tags/gcc_4_8_3_release)
 
20092
+++ b/src/libgfortran/generated/maxloc0_4_i16.c (.../branches/gcc-4_8-branch)
 
20093
@@ -58,7 +58,7 @@
 
20094
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20095
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20096
       retarray->offset = 0;
 
20097
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
20098
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
20099
     }
 
20100
   else
 
20101
     {
 
20102
@@ -199,7 +199,7 @@
 
20103
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
20104
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20105
       retarray->offset = 0;
 
20106
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
20107
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
20108
     }
 
20109
   else
 
20110
     {
 
20111
@@ -367,7 +367,7 @@
 
20112
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20113
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20114
       retarray->offset = 0;
 
20115
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
20116
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
20117
     }
 
20118
   else if (unlikely (compile_options.bounds_check))
 
20119
     {
 
20120
Index: libgfortran/generated/maxloc1_4_r10.c
 
20121
===================================================================
 
20122
--- a/src/libgfortran/generated/maxloc1_4_r10.c (.../tags/gcc_4_8_3_release)
 
20123
+++ b/src/libgfortran/generated/maxloc1_4_r10.c (.../branches/gcc-4_8-branch)
 
20124
@@ -98,10 +98,9 @@
 
20125
       retarray->offset = 0;
 
20126
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20127
 
 
20128
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20129
-                  * extent[rank-1];
 
20130
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20131
 
 
20132
-      retarray->base_addr = xmalloc (alloc_size);
 
20133
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
20134
       if (alloc_size == 0)
 
20135
        {
 
20136
          /* Make sure we have a zero-sized array.  */
 
20137
@@ -294,8 +293,7 @@
 
20138
 
 
20139
        }
 
20140
 
 
20141
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20142
-                  * extent[rank-1];
 
20143
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20144
 
 
20145
       retarray->offset = 0;
 
20146
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20147
@@ -307,7 +305,7 @@
 
20148
          return;
 
20149
        }
 
20150
       else
 
20151
-       retarray->base_addr = xmalloc (alloc_size);
 
20152
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
20153
 
 
20154
     }
 
20155
   else
 
20156
@@ -485,8 +483,7 @@
 
20157
       retarray->offset = 0;
 
20158
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20159
 
 
20160
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20161
-                  * extent[rank-1];
 
20162
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20163
 
 
20164
       if (alloc_size == 0)
 
20165
        {
 
20166
@@ -495,7 +492,7 @@
 
20167
          return;
 
20168
        }
 
20169
       else
 
20170
-       retarray->base_addr = xmalloc (alloc_size);
 
20171
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
20172
     }
 
20173
   else
 
20174
     {
 
20175
Index: libgfortran/generated/maxloc1_8_i16.c
 
20176
===================================================================
 
20177
--- a/src/libgfortran/generated/maxloc1_8_i16.c (.../tags/gcc_4_8_3_release)
 
20178
+++ b/src/libgfortran/generated/maxloc1_8_i16.c (.../branches/gcc-4_8-branch)
 
20179
@@ -98,10 +98,9 @@
 
20180
       retarray->offset = 0;
 
20181
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20182
 
 
20183
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20184
-                  * extent[rank-1];
 
20185
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20186
 
 
20187
-      retarray->base_addr = xmalloc (alloc_size);
 
20188
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20189
       if (alloc_size == 0)
 
20190
        {
 
20191
          /* Make sure we have a zero-sized array.  */
 
20192
@@ -294,8 +293,7 @@
 
20193
 
 
20194
        }
 
20195
 
 
20196
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20197
-                  * extent[rank-1];
 
20198
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20199
 
 
20200
       retarray->offset = 0;
 
20201
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20202
@@ -307,7 +305,7 @@
 
20203
          return;
 
20204
        }
 
20205
       else
 
20206
-       retarray->base_addr = xmalloc (alloc_size);
 
20207
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20208
 
 
20209
     }
 
20210
   else
 
20211
@@ -485,8 +483,7 @@
 
20212
       retarray->offset = 0;
 
20213
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20214
 
 
20215
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20216
-                  * extent[rank-1];
 
20217
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20218
 
 
20219
       if (alloc_size == 0)
 
20220
        {
 
20221
@@ -495,7 +492,7 @@
 
20222
          return;
 
20223
        }
 
20224
       else
 
20225
-       retarray->base_addr = xmalloc (alloc_size);
 
20226
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20227
     }
 
20228
   else
 
20229
     {
 
20230
Index: libgfortran/generated/minloc0_8_r10.c
 
20231
===================================================================
 
20232
--- a/src/libgfortran/generated/minloc0_8_r10.c (.../tags/gcc_4_8_3_release)
 
20233
+++ b/src/libgfortran/generated/minloc0_8_r10.c (.../branches/gcc-4_8-branch)
 
20234
@@ -58,7 +58,7 @@
 
20235
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20236
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20237
       retarray->offset = 0;
 
20238
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
20239
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
20240
     }
 
20241
   else
 
20242
     {
 
20243
@@ -199,7 +199,7 @@
 
20244
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
20245
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20246
       retarray->offset = 0;
 
20247
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
20248
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
20249
     }
 
20250
   else
 
20251
     {
 
20252
@@ -367,7 +367,7 @@
 
20253
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20254
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20255
       retarray->offset = 0;
 
20256
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
20257
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
20258
     }
 
20259
   else if (unlikely (compile_options.bounds_check))
 
20260
     {
 
20261
Index: libgfortran/generated/iparity_i2.c
 
20262
===================================================================
 
20263
--- a/src/libgfortran/generated/iparity_i2.c    (.../tags/gcc_4_8_3_release)
 
20264
+++ b/src/libgfortran/generated/iparity_i2.c    (.../branches/gcc-4_8-branch)
 
20265
@@ -97,10 +97,9 @@
 
20266
       retarray->offset = 0;
 
20267
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20268
 
 
20269
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20270
-                  * extent[rank-1];
 
20271
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20272
 
 
20273
-      retarray->base_addr = xmalloc (alloc_size);
 
20274
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
20275
       if (alloc_size == 0)
 
20276
        {
 
20277
          /* Make sure we have a zero-sized array.  */
 
20278
@@ -272,8 +271,7 @@
 
20279
 
 
20280
        }
 
20281
 
 
20282
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20283
-                  * extent[rank-1];
 
20284
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20285
 
 
20286
       retarray->offset = 0;
 
20287
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20288
@@ -285,7 +283,7 @@
 
20289
          return;
 
20290
        }
 
20291
       else
 
20292
-       retarray->base_addr = xmalloc (alloc_size);
 
20293
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
20294
 
 
20295
     }
 
20296
   else
 
20297
@@ -430,8 +428,7 @@
 
20298
       retarray->offset = 0;
 
20299
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20300
 
 
20301
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20302
-                  * extent[rank-1];
 
20303
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20304
 
 
20305
       if (alloc_size == 0)
 
20306
        {
 
20307
@@ -440,7 +437,7 @@
 
20308
          return;
 
20309
        }
 
20310
       else
 
20311
-       retarray->base_addr = xmalloc (alloc_size);
 
20312
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
20313
     }
 
20314
   else
 
20315
     {
 
20316
Index: libgfortran/generated/maxloc1_16_r4.c
 
20317
===================================================================
 
20318
--- a/src/libgfortran/generated/maxloc1_16_r4.c (.../tags/gcc_4_8_3_release)
 
20319
+++ b/src/libgfortran/generated/maxloc1_16_r4.c (.../branches/gcc-4_8-branch)
 
20320
@@ -98,10 +98,9 @@
 
20321
       retarray->offset = 0;
 
20322
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20323
 
 
20324
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20325
-                  * extent[rank-1];
 
20326
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20327
 
 
20328
-      retarray->base_addr = xmalloc (alloc_size);
 
20329
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20330
       if (alloc_size == 0)
 
20331
        {
 
20332
          /* Make sure we have a zero-sized array.  */
 
20333
@@ -294,8 +293,7 @@
 
20334
 
 
20335
        }
 
20336
 
 
20337
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20338
-                  * extent[rank-1];
 
20339
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20340
 
 
20341
       retarray->offset = 0;
 
20342
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20343
@@ -307,7 +305,7 @@
 
20344
          return;
 
20345
        }
 
20346
       else
 
20347
-       retarray->base_addr = xmalloc (alloc_size);
 
20348
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20349
 
 
20350
     }
 
20351
   else
 
20352
@@ -485,8 +483,7 @@
 
20353
       retarray->offset = 0;
 
20354
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20355
 
 
20356
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20357
-                  * extent[rank-1];
 
20358
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20359
 
 
20360
       if (alloc_size == 0)
 
20361
        {
 
20362
@@ -495,7 +492,7 @@
 
20363
          return;
 
20364
        }
 
20365
       else
 
20366
-       retarray->base_addr = xmalloc (alloc_size);
 
20367
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20368
     }
 
20369
   else
 
20370
     {
 
20371
Index: libgfortran/generated/maxloc0_16_r8.c
 
20372
===================================================================
 
20373
--- a/src/libgfortran/generated/maxloc0_16_r8.c (.../tags/gcc_4_8_3_release)
 
20374
+++ b/src/libgfortran/generated/maxloc0_16_r8.c (.../branches/gcc-4_8-branch)
 
20375
@@ -58,7 +58,7 @@
 
20376
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20377
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20378
       retarray->offset = 0;
 
20379
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
20380
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
20381
     }
 
20382
   else
 
20383
     {
 
20384
@@ -199,7 +199,7 @@
 
20385
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
20386
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20387
       retarray->offset = 0;
 
20388
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
20389
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
20390
     }
 
20391
   else
 
20392
     {
 
20393
@@ -367,7 +367,7 @@
 
20394
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20395
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20396
       retarray->offset = 0;
 
20397
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
20398
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
20399
     }
 
20400
   else if (unlikely (compile_options.bounds_check))
 
20401
     {
 
20402
Index: libgfortran/generated/sum_i16.c
 
20403
===================================================================
 
20404
--- a/src/libgfortran/generated/sum_i16.c       (.../tags/gcc_4_8_3_release)
 
20405
+++ b/src/libgfortran/generated/sum_i16.c       (.../branches/gcc-4_8-branch)
 
20406
@@ -97,10 +97,9 @@
 
20407
       retarray->offset = 0;
 
20408
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20409
 
 
20410
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20411
-                  * extent[rank-1];
 
20412
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20413
 
 
20414
-      retarray->base_addr = xmalloc (alloc_size);
 
20415
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20416
       if (alloc_size == 0)
 
20417
        {
 
20418
          /* Make sure we have a zero-sized array.  */
 
20419
@@ -272,8 +271,7 @@
 
20420
 
 
20421
        }
 
20422
 
 
20423
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20424
-                  * extent[rank-1];
 
20425
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20426
 
 
20427
       retarray->offset = 0;
 
20428
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20429
@@ -285,7 +283,7 @@
 
20430
          return;
 
20431
        }
 
20432
       else
 
20433
-       retarray->base_addr = xmalloc (alloc_size);
 
20434
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20435
 
 
20436
     }
 
20437
   else
 
20438
@@ -430,8 +428,7 @@
 
20439
       retarray->offset = 0;
 
20440
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20441
 
 
20442
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20443
-                  * extent[rank-1];
 
20444
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20445
 
 
20446
       if (alloc_size == 0)
 
20447
        {
 
20448
@@ -440,7 +437,7 @@
 
20449
          return;
 
20450
        }
 
20451
       else
 
20452
-       retarray->base_addr = xmalloc (alloc_size);
 
20453
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20454
     }
 
20455
   else
 
20456
     {
 
20457
Index: libgfortran/generated/maxloc0_4_i8.c
 
20458
===================================================================
 
20459
--- a/src/libgfortran/generated/maxloc0_4_i8.c  (.../tags/gcc_4_8_3_release)
 
20460
+++ b/src/libgfortran/generated/maxloc0_4_i8.c  (.../branches/gcc-4_8-branch)
 
20461
@@ -58,7 +58,7 @@
 
20462
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20463
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20464
       retarray->offset = 0;
 
20465
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
20466
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
20467
     }
 
20468
   else
 
20469
     {
 
20470
@@ -199,7 +199,7 @@
 
20471
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
20472
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20473
       retarray->offset = 0;
 
20474
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
20475
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
20476
     }
 
20477
   else
 
20478
     {
 
20479
@@ -367,7 +367,7 @@
 
20480
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20481
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20482
       retarray->offset = 0;
 
20483
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
20484
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
20485
     }
 
20486
   else if (unlikely (compile_options.bounds_check))
 
20487
     {
 
20488
Index: libgfortran/generated/pack_c16.c
 
20489
===================================================================
 
20490
--- a/src/libgfortran/generated/pack_c16.c      (.../tags/gcc_4_8_3_release)
 
20491
+++ b/src/libgfortran/generated/pack_c16.c      (.../branches/gcc-4_8-branch)
 
20492
@@ -167,8 +167,8 @@
 
20493
 
 
20494
          ret->offset = 0;
 
20495
 
 
20496
-         /* xmalloc allocates a single byte for zero size.  */
 
20497
-         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * total);
 
20498
+         /* xmallocarray allocates a single byte for zero size.  */
 
20499
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_16));
 
20500
 
 
20501
          if (total == 0)
 
20502
            return;
 
20503
Index: libgfortran/generated/maxloc1_16_i16.c
 
20504
===================================================================
 
20505
--- a/src/libgfortran/generated/maxloc1_16_i16.c        (.../tags/gcc_4_8_3_release)
 
20506
+++ b/src/libgfortran/generated/maxloc1_16_i16.c        (.../branches/gcc-4_8-branch)
 
20507
@@ -98,10 +98,9 @@
 
20508
       retarray->offset = 0;
 
20509
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20510
 
 
20511
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20512
-                  * extent[rank-1];
 
20513
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20514
 
 
20515
-      retarray->base_addr = xmalloc (alloc_size);
 
20516
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20517
       if (alloc_size == 0)
 
20518
        {
 
20519
          /* Make sure we have a zero-sized array.  */
 
20520
@@ -294,8 +293,7 @@
 
20521
 
 
20522
        }
 
20523
 
 
20524
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20525
-                  * extent[rank-1];
 
20526
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20527
 
 
20528
       retarray->offset = 0;
 
20529
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20530
@@ -307,7 +305,7 @@
 
20531
          return;
 
20532
        }
 
20533
       else
 
20534
-       retarray->base_addr = xmalloc (alloc_size);
 
20535
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20536
 
 
20537
     }
 
20538
   else
 
20539
@@ -485,8 +483,7 @@
 
20540
       retarray->offset = 0;
 
20541
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20542
 
 
20543
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20544
-                  * extent[rank-1];
 
20545
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20546
 
 
20547
       if (alloc_size == 0)
 
20548
        {
 
20549
@@ -495,7 +492,7 @@
 
20550
          return;
 
20551
        }
 
20552
       else
 
20553
-       retarray->base_addr = xmalloc (alloc_size);
 
20554
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20555
     }
 
20556
   else
 
20557
     {
 
20558
Index: libgfortran/generated/minloc1_8_r4.c
 
20559
===================================================================
 
20560
--- a/src/libgfortran/generated/minloc1_8_r4.c  (.../tags/gcc_4_8_3_release)
 
20561
+++ b/src/libgfortran/generated/minloc1_8_r4.c  (.../branches/gcc-4_8-branch)
 
20562
@@ -98,10 +98,9 @@
 
20563
       retarray->offset = 0;
 
20564
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20565
 
 
20566
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20567
-                  * extent[rank-1];
 
20568
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20569
 
 
20570
-      retarray->base_addr = xmalloc (alloc_size);
 
20571
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20572
       if (alloc_size == 0)
 
20573
        {
 
20574
          /* Make sure we have a zero-sized array.  */
 
20575
@@ -294,8 +293,7 @@
 
20576
 
 
20577
        }
 
20578
 
 
20579
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20580
-                  * extent[rank-1];
 
20581
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20582
 
 
20583
       retarray->offset = 0;
 
20584
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20585
@@ -307,7 +305,7 @@
 
20586
          return;
 
20587
        }
 
20588
       else
 
20589
-       retarray->base_addr = xmalloc (alloc_size);
 
20590
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20591
 
 
20592
     }
 
20593
   else
 
20594
@@ -485,8 +483,7 @@
 
20595
       retarray->offset = 0;
 
20596
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20597
 
 
20598
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20599
-                  * extent[rank-1];
 
20600
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20601
 
 
20602
       if (alloc_size == 0)
 
20603
        {
 
20604
@@ -495,7 +492,7 @@
 
20605
          return;
 
20606
        }
 
20607
       else
 
20608
-       retarray->base_addr = xmalloc (alloc_size);
 
20609
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20610
     }
 
20611
   else
 
20612
     {
 
20613
Index: libgfortran/generated/sum_c8.c
 
20614
===================================================================
 
20615
--- a/src/libgfortran/generated/sum_c8.c        (.../tags/gcc_4_8_3_release)
 
20616
+++ b/src/libgfortran/generated/sum_c8.c        (.../branches/gcc-4_8-branch)
 
20617
@@ -97,10 +97,9 @@
 
20618
       retarray->offset = 0;
 
20619
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20620
 
 
20621
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20622
-                  * extent[rank-1];
 
20623
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20624
 
 
20625
-      retarray->base_addr = xmalloc (alloc_size);
 
20626
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
20627
       if (alloc_size == 0)
 
20628
        {
 
20629
          /* Make sure we have a zero-sized array.  */
 
20630
@@ -272,8 +271,7 @@
 
20631
 
 
20632
        }
 
20633
 
 
20634
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20635
-                  * extent[rank-1];
 
20636
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20637
 
 
20638
       retarray->offset = 0;
 
20639
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20640
@@ -285,7 +283,7 @@
 
20641
          return;
 
20642
        }
 
20643
       else
 
20644
-       retarray->base_addr = xmalloc (alloc_size);
 
20645
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
20646
 
 
20647
     }
 
20648
   else
 
20649
@@ -430,8 +428,7 @@
 
20650
       retarray->offset = 0;
 
20651
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20652
 
 
20653
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20654
-                  * extent[rank-1];
 
20655
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20656
 
 
20657
       if (alloc_size == 0)
 
20658
        {
 
20659
@@ -440,7 +437,7 @@
 
20660
          return;
 
20661
        }
 
20662
       else
 
20663
-       retarray->base_addr = xmalloc (alloc_size);
 
20664
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
20665
     }
 
20666
   else
 
20667
     {
 
20668
Index: libgfortran/generated/maxloc1_16_i2.c
 
20669
===================================================================
 
20670
--- a/src/libgfortran/generated/maxloc1_16_i2.c (.../tags/gcc_4_8_3_release)
 
20671
+++ b/src/libgfortran/generated/maxloc1_16_i2.c (.../branches/gcc-4_8-branch)
 
20672
@@ -98,10 +98,9 @@
 
20673
       retarray->offset = 0;
 
20674
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20675
 
 
20676
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20677
-                  * extent[rank-1];
 
20678
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20679
 
 
20680
-      retarray->base_addr = xmalloc (alloc_size);
 
20681
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20682
       if (alloc_size == 0)
 
20683
        {
 
20684
          /* Make sure we have a zero-sized array.  */
 
20685
@@ -294,8 +293,7 @@
 
20686
 
 
20687
        }
 
20688
 
 
20689
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20690
-                  * extent[rank-1];
 
20691
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20692
 
 
20693
       retarray->offset = 0;
 
20694
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20695
@@ -307,7 +305,7 @@
 
20696
          return;
 
20697
        }
 
20698
       else
 
20699
-       retarray->base_addr = xmalloc (alloc_size);
 
20700
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20701
 
 
20702
     }
 
20703
   else
 
20704
@@ -485,8 +483,7 @@
 
20705
       retarray->offset = 0;
 
20706
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20707
 
 
20708
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20709
-                  * extent[rank-1];
 
20710
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20711
 
 
20712
       if (alloc_size == 0)
 
20713
        {
 
20714
@@ -495,7 +492,7 @@
 
20715
          return;
 
20716
        }
 
20717
       else
 
20718
-       retarray->base_addr = xmalloc (alloc_size);
 
20719
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20720
     }
 
20721
   else
 
20722
     {
 
20723
Index: libgfortran/generated/parity_l1.c
 
20724
===================================================================
 
20725
--- a/src/libgfortran/generated/parity_l1.c     (.../tags/gcc_4_8_3_release)
 
20726
+++ b/src/libgfortran/generated/parity_l1.c     (.../branches/gcc-4_8-branch)
 
20727
@@ -98,10 +98,9 @@
 
20728
       retarray->offset = 0;
 
20729
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20730
 
 
20731
-      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20732
-                  * extent[rank-1];
 
20733
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20734
 
 
20735
-      retarray->base_addr = xmalloc (alloc_size);
 
20736
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
 
20737
       if (alloc_size == 0)
 
20738
        {
 
20739
          /* Make sure we have a zero-sized array.  */
 
20740
Index: libgfortran/generated/maxval_i16.c
 
20741
===================================================================
 
20742
--- a/src/libgfortran/generated/maxval_i16.c    (.../tags/gcc_4_8_3_release)
 
20743
+++ b/src/libgfortran/generated/maxval_i16.c    (.../branches/gcc-4_8-branch)
 
20744
@@ -97,10 +97,9 @@
 
20745
       retarray->offset = 0;
 
20746
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20747
 
 
20748
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20749
-                  * extent[rank-1];
 
20750
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20751
 
 
20752
-      retarray->base_addr = xmalloc (alloc_size);
 
20753
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20754
       if (alloc_size == 0)
 
20755
        {
 
20756
          /* Make sure we have a zero-sized array.  */
 
20757
@@ -286,8 +285,7 @@
 
20758
 
 
20759
        }
 
20760
 
 
20761
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20762
-                  * extent[rank-1];
 
20763
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20764
 
 
20765
       retarray->offset = 0;
 
20766
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20767
@@ -299,7 +297,7 @@
 
20768
          return;
 
20769
        }
 
20770
       else
 
20771
-       retarray->base_addr = xmalloc (alloc_size);
 
20772
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20773
 
 
20774
     }
 
20775
   else
 
20776
@@ -472,8 +470,7 @@
 
20777
       retarray->offset = 0;
 
20778
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20779
 
 
20780
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20781
-                  * extent[rank-1];
 
20782
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20783
 
 
20784
       if (alloc_size == 0)
 
20785
        {
 
20786
@@ -482,7 +479,7 @@
 
20787
          return;
 
20788
        }
 
20789
       else
 
20790
-       retarray->base_addr = xmalloc (alloc_size);
 
20791
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
20792
     }
 
20793
   else
 
20794
     {
 
20795
Index: libgfortran/generated/spread_c8.c
 
20796
===================================================================
 
20797
--- a/src/libgfortran/generated/spread_c8.c     (.../tags/gcc_4_8_3_release)
 
20798
+++ b/src/libgfortran/generated/spread_c8.c     (.../branches/gcc-4_8-branch)
 
20799
@@ -101,8 +101,8 @@
 
20800
        }
 
20801
       ret->offset = 0;
 
20802
 
 
20803
-      /* xmalloc allocates a single byte for zero size.  */
 
20804
-      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_8));
 
20805
+      /* xmallocarray allocates a single byte for zero size.  */
 
20806
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_8));
 
20807
       if (rs <= 0)
 
20808
         return;
 
20809
     }
 
20810
@@ -244,7 +244,7 @@
 
20811
 
 
20812
   if (ret->base_addr == NULL)
 
20813
     {
 
20814
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_8));
 
20815
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_8));
 
20816
       ret->offset = 0;
 
20817
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
20818
     }
 
20819
Index: libgfortran/generated/matmul_i16.c
 
20820
===================================================================
 
20821
--- a/src/libgfortran/generated/matmul_i16.c    (.../tags/gcc_4_8_3_release)
 
20822
+++ b/src/libgfortran/generated/matmul_i16.c    (.../branches/gcc-4_8-branch)
 
20823
@@ -124,7 +124,7 @@
 
20824
         }
 
20825
 
 
20826
       retarray->base_addr
 
20827
-       = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
 
20828
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_16));
 
20829
       retarray->offset = 0;
 
20830
     }
 
20831
     else if (unlikely (compile_options.bounds_check))
 
20832
Index: libgfortran/generated/pack_i8.c
 
20833
===================================================================
 
20834
--- a/src/libgfortran/generated/pack_i8.c       (.../tags/gcc_4_8_3_release)
 
20835
+++ b/src/libgfortran/generated/pack_i8.c       (.../branches/gcc-4_8-branch)
 
20836
@@ -167,8 +167,8 @@
 
20837
 
 
20838
          ret->offset = 0;
 
20839
 
 
20840
-         /* xmalloc allocates a single byte for zero size.  */
 
20841
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * total);
 
20842
+         /* xmallocarray allocates a single byte for zero size.  */
 
20843
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_8));
 
20844
 
 
20845
          if (total == 0)
 
20846
            return;
 
20847
Index: libgfortran/generated/any_l1.c
 
20848
===================================================================
 
20849
--- a/src/libgfortran/generated/any_l1.c        (.../tags/gcc_4_8_3_release)
 
20850
+++ b/src/libgfortran/generated/any_l1.c        (.../branches/gcc-4_8-branch)
 
20851
@@ -101,8 +101,7 @@
 
20852
       retarray->offset = 0;
 
20853
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20854
 
 
20855
-      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20856
-                  * extent[rank-1];
 
20857
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20858
 
 
20859
       if (alloc_size == 0)
 
20860
        {
 
20861
@@ -111,7 +110,7 @@
 
20862
          return;
 
20863
        }
 
20864
       else
 
20865
-       retarray->base_addr = xmalloc (alloc_size);
 
20866
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
 
20867
     }
 
20868
   else
 
20869
     {
 
20870
Index: libgfortran/generated/minloc1_8_i2.c
 
20871
===================================================================
 
20872
--- a/src/libgfortran/generated/minloc1_8_i2.c  (.../tags/gcc_4_8_3_release)
 
20873
+++ b/src/libgfortran/generated/minloc1_8_i2.c  (.../branches/gcc-4_8-branch)
 
20874
@@ -98,10 +98,9 @@
 
20875
       retarray->offset = 0;
 
20876
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20877
 
 
20878
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20879
-                  * extent[rank-1];
 
20880
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20881
 
 
20882
-      retarray->base_addr = xmalloc (alloc_size);
 
20883
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20884
       if (alloc_size == 0)
 
20885
        {
 
20886
          /* Make sure we have a zero-sized array.  */
 
20887
@@ -294,8 +293,7 @@
 
20888
 
 
20889
        }
 
20890
 
 
20891
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20892
-                  * extent[rank-1];
 
20893
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20894
 
 
20895
       retarray->offset = 0;
 
20896
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20897
@@ -307,7 +305,7 @@
 
20898
          return;
 
20899
        }
 
20900
       else
 
20901
-       retarray->base_addr = xmalloc (alloc_size);
 
20902
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20903
 
 
20904
     }
 
20905
   else
 
20906
@@ -485,8 +483,7 @@
 
20907
       retarray->offset = 0;
 
20908
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20909
 
 
20910
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20911
-                  * extent[rank-1];
 
20912
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20913
 
 
20914
       if (alloc_size == 0)
 
20915
        {
 
20916
@@ -495,7 +492,7 @@
 
20917
          return;
 
20918
        }
 
20919
       else
 
20920
-       retarray->base_addr = xmalloc (alloc_size);
 
20921
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
20922
     }
 
20923
   else
 
20924
     {
 
20925
Index: libgfortran/generated/minloc0_8_r8.c
 
20926
===================================================================
 
20927
--- a/src/libgfortran/generated/minloc0_8_r8.c  (.../tags/gcc_4_8_3_release)
 
20928
+++ b/src/libgfortran/generated/minloc0_8_r8.c  (.../branches/gcc-4_8-branch)
 
20929
@@ -58,7 +58,7 @@
 
20930
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20931
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20932
       retarray->offset = 0;
 
20933
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
20934
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
20935
     }
 
20936
   else
 
20937
     {
 
20938
@@ -199,7 +199,7 @@
 
20939
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
20940
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20941
       retarray->offset = 0;
 
20942
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
20943
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
20944
     }
 
20945
   else
 
20946
     {
 
20947
@@ -367,7 +367,7 @@
 
20948
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
20949
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
20950
       retarray->offset = 0;
 
20951
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
20952
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
20953
     }
 
20954
   else if (unlikely (compile_options.bounds_check))
 
20955
     {
 
20956
Index: libgfortran/generated/matmul_l8.c
 
20957
===================================================================
 
20958
--- a/src/libgfortran/generated/matmul_l8.c     (.../tags/gcc_4_8_3_release)
 
20959
+++ b/src/libgfortran/generated/matmul_l8.c     (.../branches/gcc-4_8-branch)
 
20960
@@ -88,7 +88,7 @@
 
20961
         }
 
20962
           
 
20963
       retarray->base_addr
 
20964
-       = xmalloc (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
 
20965
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_8));
 
20966
       retarray->offset = 0;
 
20967
     }
 
20968
     else if (unlikely (compile_options.bounds_check))
 
20969
Index: libgfortran/generated/product_r10.c
 
20970
===================================================================
 
20971
--- a/src/libgfortran/generated/product_r10.c   (.../tags/gcc_4_8_3_release)
 
20972
+++ b/src/libgfortran/generated/product_r10.c   (.../branches/gcc-4_8-branch)
 
20973
@@ -97,10 +97,9 @@
 
20974
       retarray->offset = 0;
 
20975
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20976
 
 
20977
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20978
-                  * extent[rank-1];
 
20979
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20980
 
 
20981
-      retarray->base_addr = xmalloc (alloc_size);
 
20982
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
20983
       if (alloc_size == 0)
 
20984
        {
 
20985
          /* Make sure we have a zero-sized array.  */
 
20986
@@ -272,8 +271,7 @@
 
20987
 
 
20988
        }
 
20989
 
 
20990
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
20991
-                  * extent[rank-1];
 
20992
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
20993
 
 
20994
       retarray->offset = 0;
 
20995
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
20996
@@ -285,7 +283,7 @@
 
20997
          return;
 
20998
        }
 
20999
       else
 
21000
-       retarray->base_addr = xmalloc (alloc_size);
 
21001
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
21002
 
 
21003
     }
 
21004
   else
 
21005
@@ -430,8 +428,7 @@
 
21006
       retarray->offset = 0;
 
21007
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
21008
 
 
21009
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
21010
-                  * extent[rank-1];
 
21011
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
21012
 
 
21013
       if (alloc_size == 0)
 
21014
        {
 
21015
@@ -440,7 +437,7 @@
 
21016
          return;
 
21017
        }
 
21018
       else
 
21019
-       retarray->base_addr = xmalloc (alloc_size);
 
21020
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
21021
     }
 
21022
   else
 
21023
     {
 
21024
Index: libgfortran/generated/product_i1.c
 
21025
===================================================================
 
21026
--- a/src/libgfortran/generated/product_i1.c    (.../tags/gcc_4_8_3_release)
 
21027
+++ b/src/libgfortran/generated/product_i1.c    (.../branches/gcc-4_8-branch)
 
21028
@@ -97,10 +97,9 @@
 
21029
       retarray->offset = 0;
 
21030
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
21031
 
 
21032
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
21033
-                  * extent[rank-1];
 
21034
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
21035
 
 
21036
-      retarray->base_addr = xmalloc (alloc_size);
 
21037
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
21038
       if (alloc_size == 0)
 
21039
        {
 
21040
          /* Make sure we have a zero-sized array.  */
 
21041
@@ -272,8 +271,7 @@
 
21042
 
 
21043
        }
 
21044
 
 
21045
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
21046
-                  * extent[rank-1];
 
21047
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
21048
 
 
21049
       retarray->offset = 0;
 
21050
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
21051
@@ -285,7 +283,7 @@
 
21052
          return;
 
21053
        }
 
21054
       else
 
21055
-       retarray->base_addr = xmalloc (alloc_size);
 
21056
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
21057
 
 
21058
     }
 
21059
   else
 
21060
@@ -430,8 +428,7 @@
 
21061
       retarray->offset = 0;
 
21062
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
21063
 
 
21064
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
21065
-                  * extent[rank-1];
 
21066
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
21067
 
 
21068
       if (alloc_size == 0)
 
21069
        {
 
21070
@@ -440,7 +437,7 @@
 
21071
          return;
 
21072
        }
 
21073
       else
 
21074
-       retarray->base_addr = xmalloc (alloc_size);
 
21075
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
21076
     }
 
21077
   else
 
21078
     {
 
21079
Index: libgfortran/generated/all_l8.c
 
21080
===================================================================
 
21081
--- a/src/libgfortran/generated/all_l8.c        (.../tags/gcc_4_8_3_release)
 
21082
+++ b/src/libgfortran/generated/all_l8.c        (.../branches/gcc-4_8-branch)
 
21083
@@ -101,8 +101,7 @@
 
21084
       retarray->offset = 0;
 
21085
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
21086
 
 
21087
-      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
21088
-                  * extent[rank-1];
 
21089
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
21090
 
 
21091
       if (alloc_size == 0)
 
21092
        {
 
21093
@@ -111,7 +110,7 @@
 
21094
          return;
 
21095
        }
 
21096
       else
 
21097
-       retarray->base_addr = xmalloc (alloc_size);
 
21098
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
 
21099
     }
 
21100
   else
 
21101
     {
 
21102
Index: libgfortran/generated/in_pack_r16.c
 
21103
===================================================================
 
21104
--- a/src/libgfortran/generated/in_pack_r16.c   (.../tags/gcc_4_8_3_release)
 
21105
+++ b/src/libgfortran/generated/in_pack_r16.c   (.../branches/gcc-4_8-branch)
 
21106
@@ -76,7 +76,7 @@
 
21107
     return source->base_addr;
 
21108
 
 
21109
   /* Allocate storage for the destination.  */
 
21110
-  destptr = (GFC_REAL_16 *)xmalloc (ssize * sizeof (GFC_REAL_16));
 
21111
+  destptr = xmallocarray (ssize, sizeof (GFC_REAL_16));
 
21112
   dest = destptr;
 
21113
   src = source->base_addr;
 
21114
   stride0 = stride[0];
 
21115
Index: libgfortran/generated/in_pack_i1.c
 
21116
===================================================================
 
21117
--- a/src/libgfortran/generated/in_pack_i1.c    (.../tags/gcc_4_8_3_release)
 
21118
+++ b/src/libgfortran/generated/in_pack_i1.c    (.../branches/gcc-4_8-branch)
 
21119
@@ -76,7 +76,7 @@
 
21120
     return source->base_addr;
 
21121
 
 
21122
   /* Allocate storage for the destination.  */
 
21123
-  destptr = (GFC_INTEGER_1 *)xmalloc (ssize * sizeof (GFC_INTEGER_1));
 
21124
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_1));
 
21125
   dest = destptr;
 
21126
   src = source->base_addr;
 
21127
   stride0 = stride[0];
 
21128
Index: libgfortran/libgfortran.h
 
21129
===================================================================
 
21130
--- a/src/libgfortran/libgfortran.h     (.../tags/gcc_4_8_3_release)
 
21131
+++ b/src/libgfortran/libgfortran.h     (.../branches/gcc-4_8-branch)
 
21132
@@ -751,6 +751,9 @@
 
21133
 extern void *xmalloc (size_t) __attribute__ ((malloc));
 
21134
 internal_proto(xmalloc);
 
21135
 
 
21136
+extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc));
 
21137
+internal_proto(xmallocarray);
 
21138
+
 
21139
 extern void *xcalloc (size_t, size_t) __attribute__ ((malloc));
 
21140
 internal_proto(xcalloc);
 
21141
 
 
21142
Index: libgfortran/io/list_read.c
 
21143
===================================================================
 
21144
--- a/src/libgfortran/io/list_read.c    (.../tags/gcc_4_8_3_release)
 
21145
+++ b/src/libgfortran/io/list_read.c    (.../branches/gcc-4_8-branch)
 
21146
@@ -2354,7 +2354,7 @@
 
21147
 {
 
21148
   index_type len = strlen (nl->var_name) + 1;
 
21149
   int dim;
 
21150
-  char * ext_name = (char*)xmalloc (len + 1);
 
21151
+  char * ext_name = xmalloc (len + 1);
 
21152
   memcpy (ext_name, nl->var_name, len-1);
 
21153
   memcpy (ext_name + len - 1, "%", 2);
 
21154
   for (nl = nl->next; nl; nl = nl->next)
 
21155
Index: libgfortran/io/unit.c
 
21156
===================================================================
 
21157
--- a/src/libgfortran/io/unit.c (.../tags/gcc_4_8_3_release)
 
21158
+++ b/src/libgfortran/io/unit.c (.../branches/gcc-4_8-branch)
 
21159
@@ -455,7 +455,7 @@
 
21160
     {
 
21161
       iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
 
21162
       iunit->ls = (array_loop_spec *)
 
21163
-       xmalloc (iunit->rank * sizeof (array_loop_spec));
 
21164
+       xmallocarray (iunit->rank, sizeof (array_loop_spec));
 
21165
       dtp->internal_unit_len *=
 
21166
        init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
 
21167
 
 
21168
Index: libgfortran/io/unix.c
 
21169
===================================================================
 
21170
--- a/src/libgfortran/io/unix.c (.../tags/gcc_4_8_3_release)
 
21171
+++ b/src/libgfortran/io/unix.c (.../branches/gcc-4_8-branch)
 
21172
@@ -407,7 +407,9 @@
 
21173
 {
 
21174
   int retval;
 
21175
   
 
21176
-  if (s->fd != STDOUT_FILENO
 
21177
+  if (s->fd == -1)
 
21178
+    retval = -1;
 
21179
+  else if (s->fd != STDOUT_FILENO
 
21180
       && s->fd != STDERR_FILENO
 
21181
       && s->fd != STDIN_FILENO)
 
21182
     retval = close (s->fd);
 
21183
@@ -983,7 +985,15 @@
 
21184
 
 
21185
   /* Get the current length of the file. */
 
21186
 
 
21187
-  fstat (fd, &statbuf);
 
21188
+  if (fstat (fd, &statbuf) == -1)
 
21189
+    {
 
21190
+      s->st_dev = s->st_ino = -1;
 
21191
+      s->file_length = 0;
 
21192
+      if (errno == EBADF)
 
21193
+       s->fd = -1;
 
21194
+      raw_init (s);
 
21195
+      return (stream *) s;
 
21196
+    }
 
21197
 
 
21198
   s->st_dev = statbuf.st_dev;
 
21199
   s->st_ino = statbuf.st_ino;
 
21200
Index: libgfortran/io/transfer.c
 
21201
===================================================================
 
21202
--- a/src/libgfortran/io/transfer.c     (.../tags/gcc_4_8_3_release)
 
21203
+++ b/src/libgfortran/io/transfer.c     (.../branches/gcc-4_8-branch)
 
21204
@@ -3776,9 +3776,9 @@
 
21205
   if (nml->var_rank > 0)
 
21206
     {
 
21207
       nml->dim = (descriptor_dimension*)
 
21208
-                  xmalloc (nml->var_rank * sizeof (descriptor_dimension));
 
21209
+       xmallocarray (nml->var_rank, sizeof (descriptor_dimension));
 
21210
       nml->ls = (array_loop_spec*)
 
21211
-                 xmalloc (nml->var_rank * sizeof (array_loop_spec));
 
21212
+       xmallocarray (nml->var_rank, sizeof (array_loop_spec));
 
21213
     }
 
21214
   else
 
21215
     {
 
21216
Index: libgfortran/io/write.c
 
21217
===================================================================
 
21218
--- a/src/libgfortran/io/write.c        (.../tags/gcc_4_8_3_release)
 
21219
+++ b/src/libgfortran/io/write.c        (.../branches/gcc-4_8-branch)
 
21220
@@ -1863,7 +1863,7 @@
 
21221
              base_var_name_len = base ? strlen (base->var_name) : 0;
 
21222
              ext_name_len = base_name_len + base_var_name_len 
 
21223
                + strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1;
 
21224
-             ext_name = (char*)xmalloc (ext_name_len);
 
21225
+             ext_name = xmalloc (ext_name_len);
 
21226
 
 
21227
              memcpy (ext_name, base_name, base_name_len);
 
21228
              clen = strlen (obj->var_name + base_var_name_len);
 
21229
@@ -1892,7 +1892,7 @@
 
21230
              /* Now obj_name.  */
 
21231
 
 
21232
              obj_name_len = strlen (obj->var_name) + 1;
 
21233
-             obj_name = xmalloc (obj_name_len+1);
 
21234
+             obj_name = xmalloc (obj_name_len + 1);
 
21235
              memcpy (obj_name, obj->var_name, obj_name_len-1);
 
21236
              memcpy (obj_name + obj_name_len-1, "%", 2);
 
21237
 
 
21238
Index: libada/Makefile.in
 
21239
===================================================================
 
21240
--- a/src/libada/Makefile.in    (.../tags/gcc_4_8_3_release)
 
21241
+++ b/src/libada/Makefile.in    (.../branches/gcc-4_8-branch)
 
21242
@@ -60,7 +60,7 @@
 
21243
 PICFLAG = @PICFLAG@
 
21244
 GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
 
21245
 GNATLIBCFLAGS= -g -O2
 
21246
-GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
 
21247
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
 
21248
        -fexceptions -DIN_RTS @have_getipinfo@
 
21249
 
 
21250
 host_subdir = @host_subdir@
 
21251
Index: libada/ChangeLog
 
21252
===================================================================
 
21253
--- a/src/libada/ChangeLog      (.../tags/gcc_4_8_3_release)
 
21254
+++ b/src/libada/ChangeLog      (.../branches/gcc-4_8-branch)
 
21255
@@ -1,3 +1,7 @@
 
21256
+2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
 
21257
+
 
21258
+       * Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.
 
21259
+
 
21260
 2014-05-22  Release Manager
 
21261
 
 
21262
        * GCC 4.8.3 released.
 
21263
Index: libffi/src/powerpc/linux64_closure.S
 
21264
===================================================================
 
21265
--- a/src/libffi/src/powerpc/linux64_closure.S  (.../tags/gcc_4_8_3_release)
 
21266
+++ b/src/libffi/src/powerpc/linux64_closure.S  (.../branches/gcc-4_8-branch)
 
21267
@@ -381,7 +381,8 @@
 
21268
        .align 3
 
21269
 .LEFDE1:
 
21270
 
 
21271
-# if defined __ELF__ && defined __linux__
 
21272
+#endif
 
21273
+
 
21274
+#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
 
21275
        .section        .note.GNU-stack,"",@progbits
 
21276
-# endif
 
21277
 #endif
 
21278
Index: libffi/src/powerpc/linux64.S
 
21279
===================================================================
 
21280
--- a/src/libffi/src/powerpc/linux64.S  (.../tags/gcc_4_8_3_release)
 
21281
+++ b/src/libffi/src/powerpc/linux64.S  (.../branches/gcc-4_8-branch)
 
21282
@@ -254,7 +254,8 @@
 
21283
        .align 3
 
21284
 .LEFDE1:
 
21285
 
 
21286
-# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
 
21287
+#endif
 
21288
+
 
21289
+#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
 
21290
        .section        .note.GNU-stack,"",@progbits
 
21291
-# endif
 
21292
 #endif
 
21293
Index: libffi/ChangeLog
 
21294
===================================================================
 
21295
--- a/src/libffi/ChangeLog      (.../tags/gcc_4_8_3_release)
 
21296
+++ b/src/libffi/ChangeLog      (.../branches/gcc-4_8-branch)
 
21297
@@ -1,3 +1,9 @@
 
21298
+2014-09-11  Jakub Jelinek  <jakub@redhat.com>
 
21299
+
 
21300
+       * src/powerpc/linux64.S: Emit .note.GNU-stack even when
 
21301
+       POWERPC64 is not defined.
 
21302
+       * src/powerpc/linux64_closure.S: Likewise.  Also test _CALL_ELF == 2.
 
21303
+
 
21304
 2014-05-22  Release Manager
 
21305
 
 
21306
        * GCC 4.8.3 released.
 
21307
Index: .
 
21308
===================================================================
 
21309
--- a/src/.     (.../tags/gcc_4_8_3_release)
 
21310
+++ b/src/.     (.../branches/gcc-4_8-branch)
 
21311
 
 
21312
Property changes on: .
 
21313
___________________________________________________________________
 
21314
Modified: svn:mergeinfo
 
21315
   Merged /trunk:r211733,215049