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

« back to all changes in this revision

Viewing changes to .svn/pristine/e5/e525781ddc00cd1843e4fb5c4a58c9427e29c152.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 20140831 (r214767).
 
2
 
 
3
last_updated()
 
4
{
 
5
        cat > ${dir}LAST_UPDATED <<EOF
 
6
Sat Sep 13 11:05:45 CEST 2014
 
7
Sat Sep 13 09:05:45 UTC 2014 (revision 215236)
 
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: gcc/tree-ssa-tail-merge.c
 
1003
===================================================================
 
1004
--- a/src/gcc/tree-ssa-tail-merge.c     (.../tags/gcc_4_8_3_release)
 
1005
+++ b/src/gcc/tree-ssa-tail-merge.c     (.../branches/gcc-4_8-branch)
 
1006
@@ -1060,6 +1060,24 @@
 
1007
     gcc_unreachable ();
 
1008
 }
 
1009
 
 
1010
+/* Return true if gimple operands T1 and T2 have the same value.  */
 
1011
+
 
1012
+static bool
 
1013
+gimple_operand_equal_value_p (tree t1, tree t2)
 
1014
+{
 
1015
+  if (t1 == t2)
 
1016
+    return true;
 
1017
+
 
1018
+  if (t1 == NULL_TREE
 
1019
+      || t2 == NULL_TREE)
 
1020
+    return false;
 
1021
+
 
1022
+  if (operand_equal_p (t1, t2, 0))
 
1023
+    return true;
 
1024
+
 
1025
+  return gvn_uses_equal (t1, t2);
 
1026
+}
 
1027
+
 
1028
 /* Return true if gimple statements S1 and S2 are equal.  Gimple_bb (s1) and
 
1029
    gimple_bb (s2) are members of SAME_SUCC.  */
 
1030
 
 
1031
@@ -1122,8 +1140,9 @@
 
1032
       lhs2 = gimple_get_lhs (s2);
 
1033
       if (TREE_CODE (lhs1) != SSA_NAME
 
1034
          && TREE_CODE (lhs2) != SSA_NAME)
 
1035
-       return (vn_valueize (gimple_vdef (s1))
 
1036
-               == vn_valueize (gimple_vdef (s2)));
 
1037
+       return (operand_equal_p (lhs1, lhs2, 0)
 
1038
+               && gimple_operand_equal_value_p (gimple_assign_rhs1 (s1),
 
1039
+                                                gimple_assign_rhs1 (s2)));
 
1040
       else if (TREE_CODE (lhs1) == SSA_NAME
 
1041
               && TREE_CODE (lhs2) == SSA_NAME)
 
1042
        return vn_valueize (lhs1) == vn_valueize (lhs2);
 
1043
Index: gcc/DATESTAMP
 
1044
===================================================================
 
1045
--- a/src/gcc/DATESTAMP (.../tags/gcc_4_8_3_release)
 
1046
+++ b/src/gcc/DATESTAMP (.../branches/gcc-4_8-branch)
 
1047
@@ -1 +1 @@
 
1048
-20140522
 
1049
+20140913
 
1050
Index: gcc/ipa-cp.c
 
1051
===================================================================
 
1052
--- a/src/gcc/ipa-cp.c  (.../tags/gcc_4_8_3_release)
 
1053
+++ b/src/gcc/ipa-cp.c  (.../branches/gcc-4_8-branch)
 
1054
@@ -447,6 +447,8 @@
 
1055
   else if (!opt_for_fn (node->symbol.decl, optimize)
 
1056
           || !opt_for_fn (node->symbol.decl, flag_ipa_cp))
 
1057
     reason = "non-optimized function";
 
1058
+  else if (node->tm_clone)
 
1059
+    reason = "transactional memory clone";
 
1060
 
 
1061
   if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
 
1062
     fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
 
1063
@@ -2902,6 +2904,11 @@
 
1064
                intersect_with_agg_replacements (cs->caller, src_idx,
 
1065
                                                 &inter, 0);
 
1066
            }
 
1067
+         else
 
1068
+           {
 
1069
+             inter.release ();
 
1070
+             return vNULL;
 
1071
+           }
 
1072
        }
 
1073
       else
 
1074
        {
 
1075
@@ -2917,6 +2924,11 @@
 
1076
              else
 
1077
                intersect_with_plats (src_plats, &inter, 0);
 
1078
            }
 
1079
+         else
 
1080
+           {
 
1081
+             inter.release ();
 
1082
+             return vNULL;
 
1083
+           }
 
1084
        }
 
1085
     }
 
1086
   else if (jfunc->type == IPA_JF_ANCESTOR
 
1087
@@ -3000,7 +3012,8 @@
 
1088
                                          vec<cgraph_edge_p> callers)
 
1089
 {
 
1090
   struct ipa_node_params *dest_info = IPA_NODE_REF (node);
 
1091
-  struct ipa_agg_replacement_value *res = NULL;
 
1092
+  struct ipa_agg_replacement_value *res;
 
1093
+  struct ipa_agg_replacement_value **tail = &res;
 
1094
   struct cgraph_edge *cs;
 
1095
   int i, j, count = ipa_get_param_count (dest_info);
 
1096
 
 
1097
@@ -3044,8 +3057,8 @@
 
1098
          v->offset = item->offset;
 
1099
          v->value = item->value;
 
1100
          v->by_ref = plats->aggs_by_ref;
 
1101
-         v->next = res;
 
1102
-         res = v;
 
1103
+         *tail = v;
 
1104
+         tail = &v->next;
 
1105
        }
 
1106
 
 
1107
     next_param:
 
1108
@@ -3052,6 +3065,7 @@
 
1109
       if (inter.exists ())
 
1110
        inter.release ();
 
1111
     }
 
1112
+  *tail = NULL;
 
1113
   return res;
 
1114
 }
 
1115
 
 
1116
@@ -3060,7 +3074,8 @@
 
1117
 static struct ipa_agg_replacement_value *
 
1118
 known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function_t> known_aggs)
 
1119
 {
 
1120
-  struct ipa_agg_replacement_value *res = NULL;
 
1121
+  struct ipa_agg_replacement_value *res;
 
1122
+  struct ipa_agg_replacement_value **tail = &res;
 
1123
   struct ipa_agg_jump_function *aggjf;
 
1124
   struct ipa_agg_jf_item *item;
 
1125
   int i, j;
 
1126
@@ -3074,9 +3089,10 @@
 
1127
        v->offset = item->offset;
 
1128
        v->value = item->value;
 
1129
        v->by_ref = aggjf->by_ref;
 
1130
-       v->next = res;
 
1131
-       res = v;
 
1132
+       *tail = v;
 
1133
+       tail = &v->next;
 
1134
       }
 
1135
+  *tail = NULL;
 
1136
   return res;
 
1137
 }
 
1138
 
 
1139
Index: gcc/fold-const.c
 
1140
===================================================================
 
1141
--- a/src/gcc/fold-const.c      (.../tags/gcc_4_8_3_release)
 
1142
+++ b/src/gcc/fold-const.c      (.../branches/gcc-4_8-branch)
 
1143
@@ -9213,7 +9213,7 @@
 
1144
   /* Transform comparisons of the form X +- C1 CMP Y +- C2 to
 
1145
      X CMP Y +- C2 +- C1 for signed X, Y.  This is valid if
 
1146
      the resulting offset is smaller in absolute value than the
 
1147
-     original one.  */
 
1148
+     original one and has the same sign.  */
 
1149
   if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0))
 
1150
       && (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR)
 
1151
       && (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
 
1152
@@ -9232,19 +9232,20 @@
 
1153
                                      "a comparison");
 
1154
 
 
1155
       /* Put the constant on the side where it doesn't overflow and is
 
1156
-        of lower absolute value than before.  */
 
1157
+        of lower absolute value and of same sign than before.  */
 
1158
       cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
 
1159
                             ? MINUS_EXPR : PLUS_EXPR,
 
1160
                             const2, const1);
 
1161
       if (!TREE_OVERFLOW (cst)
 
1162
-         && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2))
 
1163
+         && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2)
 
1164
+         && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const2))
 
1165
        {
 
1166
          fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
 
1167
          return fold_build2_loc (loc, code, type,
 
1168
-                             variable1,
 
1169
-                             fold_build2_loc (loc,
 
1170
-                                          TREE_CODE (arg1), TREE_TYPE (arg1),
 
1171
-                                          variable2, cst));
 
1172
+                                 variable1,
 
1173
+                                 fold_build2_loc (loc, TREE_CODE (arg1),
 
1174
+                                                  TREE_TYPE (arg1),
 
1175
+                                                  variable2, cst));
 
1176
        }
 
1177
 
 
1178
       cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
 
1179
@@ -9251,13 +9252,15 @@
 
1180
                             ? MINUS_EXPR : PLUS_EXPR,
 
1181
                             const1, const2);
 
1182
       if (!TREE_OVERFLOW (cst)
 
1183
-         && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1))
 
1184
+         && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1)
 
1185
+         && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const1))
 
1186
        {
 
1187
          fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
 
1188
          return fold_build2_loc (loc, code, type,
 
1189
-                             fold_build2_loc (loc, TREE_CODE (arg0), TREE_TYPE (arg0),
 
1190
-                                          variable1, cst),
 
1191
-                             variable2);
 
1192
+                                 fold_build2_loc (loc, TREE_CODE (arg0),
 
1193
+                                                  TREE_TYPE (arg0),
 
1194
+                                                  variable1, cst),
 
1195
+                                 variable2);
 
1196
        }
 
1197
     }
 
1198
 
 
1199
@@ -11218,7 +11221,6 @@
 
1200
        {
 
1201
          double_int c1, c2, c3, msk;
 
1202
          int width = TYPE_PRECISION (type), w;
 
1203
-         bool try_simplify = true;
 
1204
 
 
1205
          c1 = tree_to_double_int (TREE_OPERAND (arg0, 1));
 
1206
          c2 = tree_to_double_int (arg1);
 
1207
@@ -11255,20 +11257,7 @@
 
1208
                }
 
1209
            }
 
1210
 
 
1211
-         /* If X is a tree of the form (Y * K1) & K2, this might conflict
 
1212
-            with that optimization from the BIT_AND_EXPR optimizations.
 
1213
-            This could end up in an infinite recursion.  */
 
1214
-         if (TREE_CODE (TREE_OPERAND (arg0, 0)) == MULT_EXPR
 
1215
-             && TREE_CODE (TREE_OPERAND (TREE_OPERAND (arg0, 0), 1))
 
1216
-                           == INTEGER_CST)
 
1217
-         {
 
1218
-           tree t = TREE_OPERAND (TREE_OPERAND (arg0, 0), 1);
 
1219
-           double_int masked = mask_with_tz (type, c3, tree_to_double_int (t));
 
1220
-
 
1221
-           try_simplify = (masked != c1);
 
1222
-         }
 
1223
-
 
1224
-         if (try_simplify && c3 != c1)
 
1225
+         if (c3 != c1)
 
1226
            return fold_build2_loc (loc, BIT_IOR_EXPR, type,
 
1227
                                    fold_build2_loc (loc, BIT_AND_EXPR, type,
 
1228
                                                     TREE_OPERAND (arg0, 0),
 
1229
@@ -11658,16 +11647,25 @@
 
1230
          && TREE_CODE (arg0) == MULT_EXPR
 
1231
          && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
 
1232
        {
 
1233
+         double_int darg1 = tree_to_double_int (arg1);
 
1234
          double_int masked
 
1235
-           = mask_with_tz (type, tree_to_double_int (arg1),
 
1236
+           = mask_with_tz (type, darg1,
 
1237
                            tree_to_double_int (TREE_OPERAND (arg0, 1)));
 
1238
 
 
1239
          if (masked.is_zero ())
 
1240
            return omit_two_operands_loc (loc, type, build_zero_cst (type),
 
1241
                                          arg0, arg1);
 
1242
-         else if (masked != tree_to_double_int (arg1))
 
1243
-           return fold_build2_loc (loc, code, type, op0,
 
1244
-                                   double_int_to_tree (type, masked));
 
1245
+         else if (masked != darg1)
 
1246
+           {
 
1247
+             /* Avoid the transform if arg1 is a mask of some
 
1248
+                mode which allows further optimizations.  */
 
1249
+             int pop = darg1.popcount ();
 
1250
+             if (!(pop >= BITS_PER_UNIT
 
1251
+                   && exact_log2 (pop) != -1
 
1252
+                   && double_int::mask (pop) == darg1))
 
1253
+               return fold_build2_loc (loc, code, type, op0,
 
1254
+                                       double_int_to_tree (type, masked));
 
1255
+           }
 
1256
        }
 
1257
 
 
1258
       /* For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,
 
1259
Index: gcc/omp-low.c
 
1260
===================================================================
 
1261
--- a/src/gcc/omp-low.c (.../tags/gcc_4_8_3_release)
 
1262
+++ b/src/gcc/omp-low.c (.../branches/gcc-4_8-branch)
 
1263
@@ -1586,7 +1586,6 @@
 
1264
   TREE_STATIC (decl) = 1;
 
1265
   TREE_USED (decl) = 1;
 
1266
   DECL_ARTIFICIAL (decl) = 1;
 
1267
-  DECL_NAMELESS (decl) = 1;
 
1268
   DECL_IGNORED_P (decl) = 0;
 
1269
   TREE_PUBLIC (decl) = 0;
 
1270
   DECL_UNINLINABLE (decl) = 1;
 
1271
Index: gcc/toplev.c
 
1272
===================================================================
 
1273
--- a/src/gcc/toplev.c  (.../tags/gcc_4_8_3_release)
 
1274
+++ b/src/gcc/toplev.c  (.../branches/gcc-4_8-branch)
 
1275
@@ -1036,16 +1036,19 @@
 
1276
 
 
1277
   if (warn_stack_usage >= 0)
 
1278
     {
 
1279
+      const location_t loc = DECL_SOURCE_LOCATION (current_function_decl);
 
1280
+
 
1281
       if (stack_usage_kind == DYNAMIC)
 
1282
-       warning (OPT_Wstack_usage_, "stack usage might be unbounded");
 
1283
+       warning_at (loc, OPT_Wstack_usage_, "stack usage might be unbounded");
 
1284
       else if (stack_usage > warn_stack_usage)
 
1285
        {
 
1286
          if (stack_usage_kind == DYNAMIC_BOUNDED)
 
1287
-           warning (OPT_Wstack_usage_, "stack usage might be %wd bytes",
 
1288
-                    stack_usage);
 
1289
+           warning_at (loc,
 
1290
+                       OPT_Wstack_usage_, "stack usage might be %wd bytes",
 
1291
+                       stack_usage);
 
1292
          else
 
1293
-           warning (OPT_Wstack_usage_, "stack usage is %wd bytes",
 
1294
-                    stack_usage);
 
1295
+           warning_at (loc, OPT_Wstack_usage_, "stack usage is %wd bytes",
 
1296
+                       stack_usage);
 
1297
        }
 
1298
     }
 
1299
 }
 
1300
Index: gcc/tree-ssa-sccvn.c
 
1301
===================================================================
 
1302
--- a/src/gcc/tree-ssa-sccvn.c  (.../tags/gcc_4_8_3_release)
 
1303
+++ b/src/gcc/tree-ssa-sccvn.c  (.../branches/gcc-4_8-branch)
 
1304
@@ -3015,33 +3015,12 @@
 
1305
   /* If all value numbered to the same value, the phi node has that
 
1306
      value.  */
 
1307
   if (allsame)
 
1308
-    {
 
1309
-      if (is_gimple_min_invariant (sameval))
 
1310
-       {
 
1311
-         VN_INFO (PHI_RESULT (phi))->has_constants = true;
 
1312
-         VN_INFO (PHI_RESULT (phi))->expr = sameval;
 
1313
-       }
 
1314
-      else
 
1315
-       {
 
1316
-         VN_INFO (PHI_RESULT (phi))->has_constants = false;
 
1317
-         VN_INFO (PHI_RESULT (phi))->expr = sameval;
 
1318
-       }
 
1319
+    return set_ssa_val_to (PHI_RESULT (phi), sameval);
 
1320
 
 
1321
-      if (TREE_CODE (sameval) == SSA_NAME)
 
1322
-       return visit_copy (PHI_RESULT (phi), sameval);
 
1323
-
 
1324
-      return set_ssa_val_to (PHI_RESULT (phi), sameval);
 
1325
-    }
 
1326
-
 
1327
   /* Otherwise, see if it is equivalent to a phi node in this block.  */
 
1328
   result = vn_phi_lookup (phi);
 
1329
   if (result)
 
1330
-    {
 
1331
-      if (TREE_CODE (result) == SSA_NAME)
 
1332
-       changed = visit_copy (PHI_RESULT (phi), result);
 
1333
-      else
 
1334
-       changed = set_ssa_val_to (PHI_RESULT (phi), result);
 
1335
-    }
 
1336
+    changed = set_ssa_val_to (PHI_RESULT (phi), result);
 
1337
   else
 
1338
     {
 
1339
       vn_phi_insert (phi, PHI_RESULT (phi));
 
1340
@@ -3142,24 +3121,18 @@
 
1341
      catch those with constants.  The goal here is to simultaneously
 
1342
      combine constants between expressions, but avoid infinite
 
1343
      expansion of expressions during simplification.  */
 
1344
-  if (TREE_CODE (op0) == SSA_NAME)
 
1345
-    {
 
1346
-      if (VN_INFO (op0)->has_constants
 
1347
+  op0 = vn_valueize (op0);
 
1348
+  if (TREE_CODE (op0) == SSA_NAME
 
1349
+      && (VN_INFO (op0)->has_constants
 
1350
          || TREE_CODE_CLASS (code) == tcc_comparison
 
1351
-         || code == COMPLEX_EXPR)
 
1352
-       op0 = valueize_expr (vn_get_expr_for (op0));
 
1353
-      else
 
1354
-       op0 = vn_valueize (op0);
 
1355
-    }
 
1356
+         || code == COMPLEX_EXPR))
 
1357
+    op0 = valueize_expr (vn_get_expr_for (op0));
 
1358
 
 
1359
-  if (TREE_CODE (op1) == SSA_NAME)
 
1360
-    {
 
1361
-      if (VN_INFO (op1)->has_constants
 
1362
-         || code == COMPLEX_EXPR)
 
1363
-       op1 = valueize_expr (vn_get_expr_for (op1));
 
1364
-      else
 
1365
-       op1 = vn_valueize (op1);
 
1366
-    }
 
1367
+  op1 = vn_valueize (op1);
 
1368
+  if (TREE_CODE (op1) == SSA_NAME
 
1369
+      && (VN_INFO (op1)->has_constants
 
1370
+         || code == COMPLEX_EXPR))
 
1371
+    op1 = valueize_expr (vn_get_expr_for (op1));
 
1372
 
 
1373
   /* Pointer plus constant can be represented as invariant address.
 
1374
      Do so to allow further propatation, see also tree forwprop.  */
 
1375
@@ -3217,27 +3190,31 @@
 
1376
     return NULL_TREE;
 
1377
 
 
1378
   orig_op0 = op0;
 
1379
-  if (VN_INFO (op0)->has_constants)
 
1380
-    op0 = valueize_expr (vn_get_expr_for (op0));
 
1381
-  else if (CONVERT_EXPR_CODE_P (code)
 
1382
-          || code == REALPART_EXPR
 
1383
-          || code == IMAGPART_EXPR
 
1384
-          || code == VIEW_CONVERT_EXPR
 
1385
-          || code == BIT_FIELD_REF)
 
1386
+  op0 = vn_valueize (op0);
 
1387
+  if (TREE_CODE (op0) == SSA_NAME)
 
1388
     {
 
1389
-      /* We want to do tree-combining on conversion-like expressions.
 
1390
-         Make sure we feed only SSA_NAMEs or constants to fold though.  */
 
1391
-      tree tem = valueize_expr (vn_get_expr_for (op0));
 
1392
-      if (UNARY_CLASS_P (tem)
 
1393
-         || BINARY_CLASS_P (tem)
 
1394
-         || TREE_CODE (tem) == VIEW_CONVERT_EXPR
 
1395
-         || TREE_CODE (tem) == SSA_NAME
 
1396
-         || TREE_CODE (tem) == CONSTRUCTOR
 
1397
-         || is_gimple_min_invariant (tem))
 
1398
-       op0 = tem;
 
1399
+      if (VN_INFO (op0)->has_constants)
 
1400
+       op0 = valueize_expr (vn_get_expr_for (op0));
 
1401
+      else if (CONVERT_EXPR_CODE_P (code)
 
1402
+              || code == REALPART_EXPR
 
1403
+              || code == IMAGPART_EXPR
 
1404
+              || code == VIEW_CONVERT_EXPR
 
1405
+              || code == BIT_FIELD_REF)
 
1406
+       {
 
1407
+         /* We want to do tree-combining on conversion-like expressions.
 
1408
+            Make sure we feed only SSA_NAMEs or constants to fold though.  */
 
1409
+         tree tem = valueize_expr (vn_get_expr_for (op0));
 
1410
+         if (UNARY_CLASS_P (tem)
 
1411
+             || BINARY_CLASS_P (tem)
 
1412
+             || TREE_CODE (tem) == VIEW_CONVERT_EXPR
 
1413
+             || TREE_CODE (tem) == SSA_NAME
 
1414
+             || TREE_CODE (tem) == CONSTRUCTOR
 
1415
+             || is_gimple_min_invariant (tem))
 
1416
+           op0 = tem;
 
1417
+       }
 
1418
     }
 
1419
 
 
1420
-  /* Avoid folding if nothing changed, but remember the expression.  */
 
1421
+  /* Avoid folding if nothing changed.  */
 
1422
   if (op0 == orig_op0)
 
1423
     return NULL_TREE;
 
1424
 
 
1425
Index: gcc/cgraphunit.c
 
1426
===================================================================
 
1427
--- a/src/gcc/cgraphunit.c      (.../tags/gcc_4_8_3_release)
 
1428
+++ b/src/gcc/cgraphunit.c      (.../branches/gcc-4_8-branch)
 
1429
@@ -1097,7 +1097,7 @@
 
1430
          /* We use local aliases for C++ thunks to force the tailcall
 
1431
             to bind locally.  This is a hack - to keep it working do
 
1432
             the following (which is not strictly correct).  */
 
1433
-         && (! TREE_CODE (target_node->symbol.decl) == FUNCTION_DECL
 
1434
+         && (TREE_CODE (target_node->symbol.decl) != FUNCTION_DECL
 
1435
              || ! DECL_VIRTUAL_P (target_node->symbol.decl))
 
1436
          && ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
 
1437
        {
 
1438
Index: gcc/ChangeLog
 
1439
===================================================================
 
1440
--- a/src/gcc/ChangeLog (.../tags/gcc_4_8_3_release)
 
1441
+++ b/src/gcc/ChangeLog (.../branches/gcc-4_8-branch)
 
1442
@@ -1,3 +1,695 @@
 
1443
+2014-09-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1444
+
 
1445
+       * config/rs6000/vsx.md (vsx_fmav4sf4): Use correct constraints for
 
1446
+       V2DF, V4SF, DF, and DI modes.
 
1447
+       (vsx_fmav2df2): Likewise.
 
1448
+       (vsx_float_fix_<mode>2): Likewise.
 
1449
+       (vsx_reduc_<VEC_reduc_name>_v2df_scalar): Likewise.
 
1450
+
 
1451
+2014-09-10  Alan Modra  <amodra@gmail.com>
 
1452
+
 
1453
+       PR debug/60655
 
1454
+       * dwarf2out.c (mem_loc_descriptor <PLUS>): Return NULL if addend
 
1455
+       can't be output.
 
1456
+
 
1457
+2014-09-09  Richard Biener  <rguenther@suse.de>
 
1458
+
 
1459
+       Backport from mainline
 
1460
+       2014-06-11  Richard Biener  <rguenther@suse.de>
 
1461
+
 
1462
+       PR tree-optimization/61452
 
1463
+       * tree-ssa-sccvn.c (visit_phi): Remove pointless setting of
 
1464
+       expr and has_constants in case we found a leader.
 
1465
+       (simplify_binary_expression): Always valueize operands first.
 
1466
+       (simplify_unary_expression): Likewise.
 
1467
+
 
1468
+2014-09-09  Richard Biener  <rguenther@suse.de>
 
1469
+
 
1470
+       Backport from mainline
 
1471
+       2014-05-05  Richard Biener  <rguenther@suse.de>
 
1472
+
 
1473
+       PR middle-end/61010
 
1474
+       * fold-const.c (fold_binary_loc): Consistently avoid
 
1475
+       canonicalizing X & CST away from a CST that is the mask
 
1476
+       of a mode.
 
1477
+
 
1478
+       2014-05-28  Richard Biener  <rguenther@suse.de>
 
1479
+
 
1480
+       PR middle-end/61045
 
1481
+       * fold-const.c (fold_comparison): When folding
 
1482
+       X +- C1 CMP Y +- C2 to X CMP Y +- C2 +- C1 also ensure
 
1483
+       the sign of the remaining constant operand stays the same.
 
1484
+
 
1485
+       2014-08-11  Richard Biener  <rguenther@suse.de>
 
1486
+
 
1487
+       PR tree-optimization/62075
 
1488
+       * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Properly
 
1489
+       handle uses in patterns.
 
1490
+
 
1491
+2014-09-09  James Greenhalgh  <james.greenhalgh@arm.com>
 
1492
+
 
1493
+       Backport from mainline.
 
1494
+       2014-09-09  James Greenhalgh  <james.greenhalgh@arm.com>
 
1495
+
 
1496
+       * doc/invoke.texi (-march): Use GNU/Linux rather than Linux.
 
1497
+       (-mtune): Likewise.
 
1498
+       (-mcpu): Likewise.
 
1499
+
 
1500
+2014-09-08  Jakub Jelinek  <jakub@redhat.com>
 
1501
+
 
1502
+       PR tree-optimization/60196
 
1503
+       PR tree-optimization/63189
 
1504
+       Backported from mainline
 
1505
+       2013-09-17  Cong Hou  <congh@google.com>
 
1506
+
 
1507
+       * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Fix a bug
 
1508
+       when checking the dot production pattern. The type of rhs operand
 
1509
+       of multiply is now checked correctly.
 
1510
+
 
1511
+2014-09-08  Jakub Jelinek  <jakub@redhat.com>
 
1512
+
 
1513
+       Backported from mainline
 
1514
+       2014-08-06  Vladimir Makarov  <vmakarov@redhat.com>
 
1515
+
 
1516
+       PR debug/61923
 
1517
+       * haifa-sched.c (advance_one_cycle): Fix dump.
 
1518
+       (schedule_block): Don't advance cycle if we are already at the
 
1519
+       beginning of the cycle.
 
1520
+
 
1521
+2014-09-03  Martin Jambor  <mjambor@suse.cz>
 
1522
+
 
1523
+       PR ipa/62015
 
1524
+       * ipa-cp.c (intersect_aggregates_with_edge): Handle impermissible
 
1525
+       pass-trough jump functions correctly.
 
1526
+
 
1527
+2014-09-03  Martin Jambor  <mjambor@suse.cz>
 
1528
+
 
1529
+       PR ipa/61986
 
1530
+       * ipa-cp.c (find_aggregate_values_for_callers_subset): Chain
 
1531
+       created replacements in ascending order of offsets.
 
1532
+       (known_aggs_to_agg_replacement_list): Likewise.
 
1533
+
 
1534
+2014-09-01  Marek Polacek  <polacek@redhat.com>
 
1535
+
 
1536
+       Backport from mainline
 
1537
+       2014-08-21  Marek Polacek  <polacek@redhat.com>
 
1538
+
 
1539
+       PR c/61271
 
1540
+       * expr.c (is_aligning_offset): Remove logical not.
 
1541
+
 
1542
+2014-09-01  Marek Polacek  <polacek@redhat.com>
 
1543
+
 
1544
+       Backport from mainline
 
1545
+       2014-08-19  Marek Polacek  <polacek@redhat.com>
 
1546
+
 
1547
+       PR c/61271
 
1548
+       * cgraphunit.c (handle_alias_pairs): Fix condition.
 
1549
+
 
1550
+2014-08-30  John David Anglin  <danglin@gcc.gnu.org>
 
1551
+
 
1552
+       * config/pa/pa.c (pa_assemble_integer): Don't add PLABEL relocation
 
1553
+       prefix to function labels when generating fast indirect calls.
 
1554
+
 
1555
+2014-08-26  Joel Sherrill <joel.sherrill@oarcorp.com>
 
1556
+
 
1557
+       * doc/invoke.texi: -fno-cxa-atexit should be -fno-use-cxa-atexit.
 
1558
+
 
1559
+2014-08-26  Marek Polacek  <polacek@redhat.com>
 
1560
+
 
1561
+       Backport from mainline
 
1562
+       2014-08-26  Marek Polacek  <polacek@redhat.com>
 
1563
+
 
1564
+       PR c/61271
 
1565
+       * tree-vectorizer.h (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT,
 
1566
+       LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Wrap in parens.
 
1567
+
 
1568
+2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
 
1569
+
 
1570
+       Backport from mainline
 
1571
+       2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
 
1572
+
 
1573
+       PR target/61996
 
1574
+       * config/sh/sh.opt (musermode): Allow negative form.
 
1575
+       * config/sh/sh.c (sh_option_override): Disable TARGET_USERMODE for
 
1576
+       targets that don't support it.
 
1577
+       * doc/invoke.texi (SH Options): Rename sh-*-linux* to sh*-*-linux*.
 
1578
+       Document -mno-usermode option.
 
1579
+
 
1580
+2014-08-23  John David Anglin  <danglin@gcc.gnu.org>
 
1581
+
 
1582
+       PR target/62038
 
1583
+       * config/pa/pa.c (pa_output_function_epilogue): Don't set
 
1584
+       last_address when the current function is a thunk.
 
1585
+       (pa_asm_output_mi_thunk): When we don't have named sections or they
 
1586
+       are not being used, check that thunk can reach the stub table with a
 
1587
+       short branch.
 
1588
+
 
1589
+2014-08-22  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1590
+
 
1591
+       Backport fro mainline
 
1592
+       2014-08-22  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1593
+
 
1594
+       PR target/62195
 
1595
+       * doc/md.texi (Machine Constraints): Update PowerPC wi constraint
 
1596
+       documentation to state it is only for VSX operations.
 
1597
+
 
1598
+       * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Make wi
 
1599
+       constraint only active if VSX.
 
1600
+
 
1601
+       * config/rs6000/rs6000.md (lfiwax): Use wj constraint instead of
 
1602
+       wi cosntraint for ISA 2.07 lxsiwax/lxsiwzx instructions.
 
1603
+       (lfiwzx): Likewise.
 
1604
+
 
1605
+2014-08-15  Tom de Vries  <tom@codesourcery.com>
 
1606
+
 
1607
+       Backport from mainline:
 
1608
+       2014-08-14  Tom de Vries  <tom@codesourcery.com>
 
1609
+
 
1610
+       PR rtl-optimization/62004
 
1611
+       PR rtl-optimization/62030
 
1612
+       * ifcvt.c (rtx_interchangeable_p): New function.
 
1613
+       (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p.
 
1614
+
 
1615
+       2014-08-05  Richard Biener  <rguenther@suse.de>
 
1616
+
 
1617
+       * emit-rtl.h (mem_attrs_eq_p): Declare.
 
1618
+       * emit-rtl.c (mem_attrs_eq_p): Export.
 
1619
+
 
1620
+2014-08-16  John David Anglin  <danglin@gcc.gnu.org>
 
1621
+
 
1622
+       Backport from trunk:
 
1623
+       2014-04-06  John David Anglin  <danglin@gcc.gnu.org>
 
1624
+
 
1625
+       PR debug/55794
 
1626
+       * config/pa/pa.c (pa_output_function_epilogue): Skip address and code
 
1627
+       size accounting for thunks.
 
1628
+       (pa_asm_output_mi_thunk): Use final_start_function() and
 
1629
+       final_end_function() to output function start and end directives.
 
1630
+
 
1631
+2014-08-15  Oleg Endo  <olegendo@gcc.gnu.org>
 
1632
+
 
1633
+       Backport from mainline:
 
1634
+       2014-08-15  Oleg Endo  <olegendo@gcc.gnu.org>
 
1635
+
 
1636
+       * doc/invoke.texi (SH options): Document missing processor variant
 
1637
+       options.  Remove references to Hitachi.  Undocument deprecated mspace
 
1638
+       option.
 
1639
+
 
1640
+2014-08-13  Felix Yang  <fei.yang0953@gmail.com>
 
1641
+
 
1642
+       PR tree-optimization/62073
 
1643
+       * tree-vect-loop.c (vect_is_simple_reduction_1): Check that DEF1 has
 
1644
+       a basic block.
 
1645
+
 
1646
+2014-08-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1647
+
 
1648
+       Backport from mainline
 
1649
+       2014-08-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1650
+
 
1651
+       PR middle-end/62103
 
1652
+       * gimple-fold.c (fold_ctor_reference): Don't fold in presence of
 
1653
+       bitfields, that is when size doesn't match the size of type or the
 
1654
+       size of the constructor.
 
1655
+
 
1656
+2014-08-12  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1657
+
 
1658
+       Backport patch from mainline
 
1659
+       2014-08-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
1660
+
 
1661
+       * config/rs6000/constraints.md (wh constraint): New constraint,
 
1662
+       for FP registers if direct move is available.
 
1663
+       (wi constraint): New constraint, for VSX/FP registers that can
 
1664
+       handle 64-bit integers.
 
1665
+       (wj constraint): New constraint for VSX/FP registers that can
 
1666
+       handle 64-bit integers for direct moves.
 
1667
+       (wk constraint): New constraint for VSX/FP registers that can
 
1668
+       handle 64-bit doubles for direct moves.
 
1669
+       (wy constraint): Make documentation match implementation.
 
1670
+
 
1671
+       * config/rs6000/rs6000.c (struct rs6000_reg_addr): Add
 
1672
+       scalar_in_vmx_p field to simplify tests of whether SFmode or
 
1673
+       DFmode can go in the Altivec registers.
 
1674
+       (rs6000_hard_regno_mode_ok): Use scalar_in_vmx_p field.
 
1675
+       (rs6000_setup_reg_addr_masks): Likewise.
 
1676
+       (rs6000_debug_print_mode): Add debug support for scalar_in_vmx_p
 
1677
+       field, and wh/wi/wj/wk constraints.
 
1678
+       (rs6000_init_hard_regno_mode_ok): Setup scalar_in_vmx_p field, and
 
1679
+       the wh/wi/wj/wk constraints.
 
1680
+       (rs6000_preferred_reload_class): If SFmode/DFmode can go in the
 
1681
+       upper registers, prefer VSX registers unless the operation is a
 
1682
+       memory operation with REG+OFFSET addressing.
 
1683
+
 
1684
+       * config/rs6000/vsx.md (VSr mode attribute): Add support for
 
1685
+       DImode.  Change SFmode to use ww constraint instead of d to allow
 
1686
+       SF registers in the upper registers.
 
1687
+       (VSr2): Likewise.
 
1688
+       (VSr3): Likewise.
 
1689
+       (VSr5): Fix thinko in comment.
 
1690
+       (VSa): New mode attribute that is an alternative to wa, that
 
1691
+       returns the VSX register class that a mode can go in, but may not
 
1692
+       be the preferred register class.
 
1693
+       (VS_64dm): New mode attribute for appropriate register classes for
 
1694
+       referencing 64-bit elements of vectors for direct moves and normal
 
1695
+       moves.
 
1696
+       (VS_64reg): Likewise.
 
1697
+       (vsx_mov<mode>): Change wa constraint to <VSa> to limit the
 
1698
+       register allocator to only registers the data type can handle.
 
1699
+       (vsx_le_perm_load_<mode>): Likewise.
 
1700
+       (vsx_le_perm_store_<mode>): Likewise.
 
1701
+       (vsx_xxpermdi2_le_<mode>): Likewise.
 
1702
+       (vsx_xxpermdi4_le_<mode>): Likewise.
 
1703
+       (vsx_lxvd2x2_le_<mode>): Likewise.
 
1704
+       (vsx_lxvd2x4_le_<mode>): Likewise.
 
1705
+       (vsx_stxvd2x2_le_<mode>): Likewise.
 
1706
+       (vsx_add<mode>3): Likewise.
 
1707
+       (vsx_sub<mode>3): Likewise.
 
1708
+       (vsx_mul<mode>3): Likewise.
 
1709
+       (vsx_div<mode>3): Likewise.
 
1710
+       (vsx_tdiv<mode>3_internal): Likewise.
 
1711
+       (vsx_fre<mode>2): Likewise.
 
1712
+       (vsx_neg<mode>2): Likewise.
 
1713
+       (vsx_abs<mode>2): Likewise.
 
1714
+       (vsx_nabs<mode>2): Likewise.
 
1715
+       (vsx_smax<mode>3): Likewise.
 
1716
+       (vsx_smin<mode>3): Likewise.
 
1717
+       (vsx_sqrt<mode>2): Likewise.
 
1718
+       (vsx_rsqrte<mode>2): Likewise.
 
1719
+       (vsx_tsqrt<mode>2_internal): Likewise.
 
1720
+       (vsx_fms<mode>4): Likewise.
 
1721
+       (vsx_nfma<mode>4): Likewise.
 
1722
+       (vsx_eq<mode>): Likewise.
 
1723
+       (vsx_gt<mode>): Likewise.
 
1724
+       (vsx_ge<mode>): Likewise.
 
1725
+       (vsx_eq<mode>_p): Likewise.
 
1726
+       (vsx_gt<mode>_p): Likewise.
 
1727
+       (vsx_ge<mode>_p): Likewise.
 
1728
+       (vsx_xxsel<mode>): Likewise.
 
1729
+       (vsx_xxsel<mode>_uns): Likewise.
 
1730
+       (vsx_copysign<mode>3): Likewise.
 
1731
+       (vsx_float<VSi><mode>2): Likewise.
 
1732
+       (vsx_floatuns<VSi><mode>2): Likewise.
 
1733
+       (vsx_fix_trunc<mode><VSi>2): Likewise.
 
1734
+       (vsx_fixuns_trunc<mode><VSi>2): Likewise.
 
1735
+       (vsx_x<VSv>r<VSs>i): Likewise.
 
1736
+       (vsx_x<VSv>r<VSs>ic): Likewise.
 
1737
+       (vsx_btrunc<mode>2): Likewise.
 
1738
+       (vsx_b2trunc<mode>2): Likewise.
 
1739
+       (vsx_floor<mode>2): Likewise.
 
1740
+       (vsx_ceil<mode>2): Likewise.
 
1741
+       (vsx_<VS_spdp_insn>): Likewise.
 
1742
+       (vsx_xscvspdp): Likewise.
 
1743
+       (vsx_xvcvspuxds): Likewise.
 
1744
+       (vsx_float_fix_<mode>2): Likewise.
 
1745
+       (vsx_set_<mode>): Likewise.
 
1746
+       (vsx_extract_<mode>_internal1): Likewise.
 
1747
+       (vsx_extract_<mode>_internal2): Likewise.
 
1748
+       (vsx_extract_<mode>_load): Likewise.
 
1749
+       (vsx_extract_<mode>_store): Likewise.
 
1750
+       (vsx_splat_<mode>): Likewise.
 
1751
+       (vsx_xxspltw_<mode>): Likewise.
 
1752
+       (vsx_xxspltw_<mode>_direct): Likewise.
 
1753
+       (vsx_xxmrghw_<mode>): Likewise.
 
1754
+       (vsx_xxmrglw_<mode>): Likewise.
 
1755
+       (vsx_xxsldwi_<mode>): Likewise.
 
1756
+       (vsx_xscvdpspn): Tighten constraints to only use register classes
 
1757
+       the types use.
 
1758
+       (vsx_xscvspdpn): Likewise.
 
1759
+       (vsx_xscvdpspn_scalar): Likewise.
 
1760
+
 
1761
+       * config/rs6000/rs6000.h (enum rs6000_reg_class_enum): Add wh, wi,
 
1762
+       wj, and wk constraints.
 
1763
+       (GPR_REG_CLASS_P): New helper macro for register classes targeting
 
1764
+       general purpose registers.
 
1765
+
 
1766
+       * config/rs6000/rs6000.md (f32_dm): Use wh constraint for SDmode
 
1767
+       direct moves.
 
1768
+       (zero_extendsidi2_lfiwz): Use wj constraint for direct move of
 
1769
+       DImode instead of wm.  Use wk constraint for direct move of DFmode
 
1770
+       instead of wm.
 
1771
+       (extendsidi2_lfiwax): Likewise.
 
1772
+       (lfiwax): Likewise.
 
1773
+       (lfiwzx): Likewise.
 
1774
+       (movdi_internal64): Likewise.
 
1775
+
 
1776
+       * doc/md.texi (PowerPC and IBM RS6000): Document wh, wi, wj, and
 
1777
+       wk constraints. Make the wy constraint documentation match them
 
1778
+       implementation.
 
1779
+
 
1780
+2014-08-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1781
+
 
1782
+       Backport from mainline
 
1783
+       2014-06-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1784
+
 
1785
+       PR tree-optimization/61375
 
1786
+       * tree-ssa-math-opts.c (find_bswap_or_nop_1): Cancel optimization if
 
1787
+       symbolic number cannot be represented in an unsigned HOST_WIDE_INT.
 
1788
+       (execute_optimize_bswap): Cancel optimization if CHAR_BIT != 8.
 
1789
+
 
1790
+2014-08-01  Richard Biener  <rguenther@suse.de>
 
1791
+
 
1792
+       PR tree-optimization/61964
 
1793
+       * tree-ssa-tail-merge.c (gimple_operand_equal_value_p): New
 
1794
+       function merged from trunk.
 
1795
+       (gimple_equal_p): Handle non-SSA LHS solely by structural
 
1796
+       equality.
 
1797
+
 
1798
+2014-07-25  Uros Bizjak  <ubizjak@gmail.com>
 
1799
+
 
1800
+       * config/alpha/elf.h: Define TARGET_UNWIND_TABLES_DEFAULT.
 
1801
+
 
1802
+2014-07-24  Kyle McMartin  <kyle@redhat.com>
 
1803
+
 
1804
+       * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define.
 
1805
+
 
1806
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
1807
+
 
1808
+       * config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
 
1809
+       Add prototype.
 
1810
+       * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
 
1811
+       function.  Issue -Wpsabi warning if future GCC releases will use
 
1812
+       different field alignment rules for this type.
 
1813
+       * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
 
1814
+       * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
 
1815
+       * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
 
1816
+
 
1817
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
1818
+
 
1819
+       * config/rs6000/rs6000.c (rs6000_function_arg_boundary): Issue
 
1820
+       -Wpsabi note when encountering a type where future GCC releases
 
1821
+       will apply different alignment requirements.
 
1822
+
 
1823
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
1824
+
 
1825
+       * config/rs6000/rs6000.c (rs6000_function_arg): If a float argument
 
1826
+       does not fit fully into floating-point registers, and there is still
 
1827
+       space in the register parameter area, issue -Wpsabi note that the ABI
 
1828
+       will change in a future GCC release.
 
1829
+
 
1830
+2014-07-23  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
1831
+
 
1832
+       * config/arm/t-rtems-eabi: Add
 
1833
+       mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard,
 
1834
+       mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard,
 
1835
+       mbig-endian/mthumb/march=armv7-r, and
 
1836
+       mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
1837
+       multilibs.
 
1838
+
 
1839
+2014-07-21  Peter Bergner  <bergner@vnet.ibm.com>
 
1840
+
 
1841
+       * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define.
 
1842
+       (LIBTSAN_EARLY_SPEC): Likewise.
 
1843
+       (STATIC_LIBASAN_LIBS): Likewise.
 
1844
+       (STATIC_LIBTSAN_LIBS): Likewise.
 
1845
+
 
1846
+2014-07-19  Eric Botcazou  <ebotcazou@adacore.com>
 
1847
+
 
1848
+       * toplev.c (output_stack_usage): Adjust the location of the warning.
 
1849
+
 
1850
+2014-07-19  Daniel Cederman  <cederman@gaisler.com>
 
1851
+
 
1852
+       * config/sparc/sync.md (*membar_storeload_leon3): New insn.
 
1853
+       (*membar_storeload): Disable for LEON3.
 
1854
+
 
1855
+2014-07-17  Richard Biener  <rguenther@suse.de>
 
1856
+
 
1857
+       PR rtl-optimization/61801
 
1858
+       * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and
 
1859
+       ASM_INPUT don't set reg_pending_barrier if it appears in a
 
1860
+       debug-insn.
 
1861
+
 
1862
+2014-07-16  Jakub Jelinek  <jakub@redhat.com>
 
1863
+
 
1864
+       * omp-low.c (create_omp_child_function): Don't set DECL_NAMELESS
 
1865
+       on the FUNCTION_DECL.
 
1866
+
 
1867
+2014-07-10  Tom G. Christensen  <tgc@jupiterrise.com>
 
1868
+
 
1869
+       * doc/install.texi: Remove links to defunct package providers for
 
1870
+       Solaris.
 
1871
+
 
1872
+2014-07-10  Eric Botcazou  <ebotcazou@adacore.com>
 
1873
+
 
1874
+       PR middle-end/53590
 
1875
+       * function.c (allocate_struct_function): Revert r188667 change.
 
1876
+
 
1877
+2014-07-04  Jakub Jelinek  <jakub@redhat.com>
 
1878
+
 
1879
+       PR tree-optimization/61684
 
1880
+       * tree-ssa-ifcombine.c (recognize_single_bit_test): Make sure
 
1881
+       rhs1 of conversion is a SSA_NAME before using SSA_NAME_DEF_STMT on it.
 
1882
+
 
1883
+2014-06-30  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1884
+
 
1885
+       Backport from Mainline
 
1886
+       2014-06-20  Jakub Jelinek  <jakub@redhat.com>
 
1887
+       2014-06-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
1888
+
 
1889
+       PR tree-optimization/61306
 
1890
+       * tree-ssa-math-opts.c (struct symbolic_number): Store type of
 
1891
+       expression instead of its size.
 
1892
+       (do_shift_rotate): Adapt to change in struct symbolic_number. Return
 
1893
+       false to prevent optimization when the result is unpredictable due to
 
1894
+       arithmetic right shift of signed type with highest byte is set.
 
1895
+       (verify_symbolic_number_p): Adapt to change in struct symbolic_number.
 
1896
+       (find_bswap_1): Likewise. Return NULL to prevent optimization when the
 
1897
+       result is unpredictable due to sign extension.
 
1898
+       (find_bswap): Adapt to change in struct symbolic_number.
 
1899
+
 
1900
+2014-06-27  Uros Bizjak  <ubizjak@gmail.com>
 
1901
+
 
1902
+       Backport from mainline
 
1903
+       2014-06-26  Uros Bizjak  <ubizjak@gmail.com>
 
1904
+
 
1905
+       PR target/61586
 
1906
+       * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX.
 
1907
+
 
1908
+2014-06-26  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
1909
+
 
1910
+       PR target/61542
 
1911
+       * config/rs6000/vsx.md (vsx_extract_v4sf): Fix bug with element
 
1912
+       extraction other than index 3.
 
1913
+
 
1914
+2014-06-24  Jakub Jelinek  <jakub@redhat.com>
 
1915
+
 
1916
+       PR target/61570
 
1917
+       * config/i386/driver-i386.c (host_detect_local_cpu): For unknown
 
1918
+       model family 6 CPU with has_longmode never use a CPU without
 
1919
+       64-bit support.
 
1920
+
 
1921
+2014-06-20  Chung-Lin Tang  <cltang@codesourcery.com>
 
1922
+
 
1923
+       Backport from mainline
 
1924
+
 
1925
+       2014-06-20  Julian Brown  <julian@codesourcery.com>
 
1926
+                   Chung-Lin Tang  <cltang@codesourcery.com>
 
1927
+
 
1928
+       * config/arm/arm.c (arm_output_mi_thunk): Fix offset for
 
1929
+       TARGET_THUMB1_ONLY. Add comments.
 
1930
+
 
1931
+2014-06-18  Uros Bizjak  <ubizjak@gmail.com>
 
1932
+
 
1933
+       Backport from mainline
 
1934
+       2014-06-06  Uros Bizjak  <ubizjak@gmail.com>
 
1935
+
 
1936
+       PR target/61423
 
1937
+       * config/i386/i386.md (*floatunssi<mode>2_i387_with_xmm): New
 
1938
+       define_insn_and_split pattern, merged from *floatunssi<mode>2_1
 
1939
+       and corresponding splitters.  Zero extend general register
 
1940
+       or memory input operand to XMM temporary.  Enable for
 
1941
+       TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
 
1942
+       (floatunssi<mode>2): Update expander predicate.
 
1943
+
 
1944
+2014-06-18  Richard Henderson  <rth@redhat.com>
 
1945
+
 
1946
+       PR target/61545
 
1947
+       * config/aarch64/aarch64.md (tlsdesc_small): Clobber CC_REGNUM.
 
1948
+
 
1949
+2014-06-17  Nagaraju Mekala <nagaraju.mekala@xilinx.com>
 
1950
+
 
1951
+       Revert on gcc-4_8-branch.
 
1952
+       * config/microblaze/microblaze.md: Add movsi4_rev insn pattern.
 
1953
+       * config/microblaze/predicates.md: Add reg_or_mem_operand predicate.
 
1954
+
 
1955
+2014-06-17  Yufeng Zhang  <yufeng.zhang@arm.com>
 
1956
+
 
1957
+       Backport from mainline
 
1958
+
 
1959
+       PR target/61483
 
1960
+       * config/aarch64/aarch64.c (aarch64_layout_arg): Add new local
 
1961
+       variable 'size'; calculate 'size' right in the front; use
 
1962
+       'size' to compute 'nregs' (when 'allocate_ncrn != 0') and
 
1963
+       pcum->aapcs_stack_words.
 
1964
+
 
1965
+2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
 
1966
+
 
1967
+       Backport from mainline
 
1968
+
 
1969
+       2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
 
1970
+       PR target/61415
 
1971
+       * config/rs6000/rs6000-builtin.def (BU_MISC_1): Delete.
 
1972
+       (BU_MISC_2): Rename to ...
 
1973
+       (BU_LDBL128_2): ... this.
 
1974
+       * config/rs6000/rs6000.h (RS6000_BTM_LDBL128): New define.
 
1975
+       (RS6000_BTM_COMMON): Add RS6000_BTM_LDBL128.
 
1976
+       * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
 
1977
+       RS6000_BTM_LDBL128.
 
1978
+       (rs6000_invalid_builtin): Add long double 128-bit builtin support.
 
1979
+       (rs6000_builtin_mask_names): Add RS6000_BTM_LDBL128.
 
1980
+       * config/rs6000/rs6000.md (unpacktf_0): Remove define)expand.
 
1981
+       (unpacktf_1): Likewise.
 
1982
+       * doc/extend.texi (__builtin_longdouble_dw0): Remove documentation.
 
1983
+       (__builtin_longdouble_dw1): Likewise.
 
1984
+       * doc/sourcebuild.texi (longdouble128): Document.
 
1985
+
 
1986
+2014-06-13  Jason Merrill  <jason@redhat.com>
 
1987
+
 
1988
+       PR c++/60731
 
1989
+       * common.opt (-fno-gnu-unique): Add.
 
1990
+       * config/elfos.h (USE_GNU_UNIQUE_OBJECT): Check it.
 
1991
+
 
1992
+2014-06-12  Georg-Johann Lay  <avr@gjlay.de>
 
1993
+
 
1994
+       Backport from 2014-05-09 trunk r210272
 
1995
+
 
1996
+       * config/avr/avr-fixed.md (round<mode>3): Use -1U instead of -1 in
 
1997
+       unsigned int initializers for regno_in, regno_out.
 
1998
+
 
1999
+       Backport from 2014-05-14 trunk r210418
 
2000
+       * config/avr/avr.h (REG_CLASS_CONTENTS): Use unsigned suffix for
 
2001
+       shifted values to avoid build warning.
 
2002
+
 
2003
+       Backport from 2014-06-12 trunk r211491
 
2004
+
 
2005
+       PR target/61443
 
2006
+       * config/avr/avr.md (push<mode>1): Avoid (subreg(mem)) when
 
2007
+       loading from address spaces.
 
2008
+
 
2009
+2014-06-12  Alan Modra  <amodra@gmail.com>
 
2010
+
 
2011
+       PR target/61300
 
2012
+       * doc/tm.texi.in (INCOMING_REG_PARM_STACK_SPACE): Document.
 
2013
+       * doc/tm.texi: Regenerate.
 
2014
+       * function.c (INCOMING_REG_PARM_STACK_SPACE): Provide default.
 
2015
+       Use throughout in place of REG_PARM_STACK_SPACE.
 
2016
+       * config/rs6000/rs6000.c (rs6000_reg_parm_stack_space): Add
 
2017
+       "incoming" param.  Pass to rs6000_function_parms_need_stack.
 
2018
+       (rs6000_function_parms_need_stack): Add "incoming" param, ignore
 
2019
+       prototype_p when incoming.  Use function decl when incoming
 
2020
+       to handle K&R style functions.
 
2021
+       * config/rs6000/rs6000.h (REG_PARM_STACK_SPACE): Adjust.
 
2022
+       (INCOMING_REG_PARM_STACK_SPACE): Define.
 
2023
+
 
2024
+2014-06-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
2025
+
 
2026
+       Back port from trunk
 
2027
+       2014-06-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
2028
+
 
2029
+       PR target/61431
 
2030
+       * config/rs6000/vsx.md (VSX_LE): Split VSX_D into 2 separate
 
2031
+       iterators, VSX_D that handles 64-bit types, and VSX_LE that
 
2032
+       handles swapping the two 64-bit double words on little endian
 
2033
+       systems.  Include V1TImode and optionally TImode in VSX_LE so that
 
2034
+       these types are properly swapped.  Change all of the insns and
 
2035
+       splits that do the 64-bit swaps to use VSX_LE.
 
2036
+       (vsx_le_perm_load_<mode>): Likewise.
 
2037
+       (vsx_le_perm_store_<mode>): Likewise.
 
2038
+       (splitters for little endian memory operations): Likewise.
 
2039
+       (vsx_xxpermdi2_le_<mode>): Likewise.
 
2040
+       (vsx_lxvd2x2_le_<mode>): Likewise.
 
2041
+       (vsx_stxvd2x2_le_<mode>): Likewise.
 
2042
+
 
2043
+2014-06-05  Martin Jambor  <mjambor@suse.cz>
 
2044
+
 
2045
+       PR ipa/61393
 
2046
+       * ipa-cp.c (determine_versionability): Pretend that tm_clones are
 
2047
+       not versionable.
 
2048
+
 
2049
+2014-06-04  Richard Biener  <rguenther@suse.de>
 
2050
+
 
2051
+       PR tree-optimization/61383
 
2052
+       * tree-ssa-ifcombine.c (bb_no_side_effects_p): Make sure
 
2053
+       stmts can't trap.
 
2054
+
 
2055
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
2056
+
 
2057
+       Backport from mainline
 
2058
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
2059
+
 
2060
+       PR rtl-optimization/60866
 
2061
+       * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
 
2062
+       Default it to -1.  Pass it down to init_simplejump_data.
 
2063
+       (init_simplejump_data): New parameter old_seqno.  Pass it down
 
2064
+       to get_seqno_for_a_jump.
 
2065
+       (get_seqno_for_a_jump): New parameter old_seqno.  Use it for
 
2066
+       initializing new jump seqno as a last resort.  Add comment.
 
2067
+       (sel_redirect_edge_and_branch): Save old seqno of the conditional
 
2068
+       jump and pass it down to sel_init_new_insn.
 
2069
+       (sel_redirect_edge_and_branch_force): Likewise.
 
2070
+
 
2071
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
2072
+
 
2073
+       Backport from mainline
 
2074
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
2075
+
 
2076
+       PR rtl-optimization/60901
 
2077
+       * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
 
2078
+       bb predecessor belongs to the same scheduling region.  Adjust comment.
 
2079
+
 
2080
+2014-06-03  Uros Bizjak  <ubizjak@gmail.com>
 
2081
+
 
2082
+       Backport from mainline
 
2083
+       2014-06-02  Uros Bizjak  <ubizjak@gmail.com>
 
2084
+
 
2085
+       PR target/61239
 
2086
+       * config/i386/i386.c (ix86_expand_vec_perm) [case V32QImode]: Use
 
2087
+       GEN_INT (-128) instead of GEN_INT (128) to set MSB of QImode constant.
 
2088
+
 
2089
+2014-05-28  Guozhi Wei  <carrot@google.com>
 
2090
+
 
2091
+       PR target/61202
 
2092
+       * config/aarch64/arm_neon.h (vqdmulh_n_s16): Change the last operand's
 
2093
+       constraint.
 
2094
+       (vqdmulhq_n_s16): Likewise.
 
2095
+
 
2096
+2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
 
2097
+
 
2098
+       Backport from mainline
 
2099
+       2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
2100
+
 
2101
+       * double-int.c (div_and_round_double) <ROUND_DIV_EXPR>: Use the proper
 
2102
+       predicate to detect a negative quotient.
 
2103
+
 
2104
+2014-05-28  Georg-Johann Lay  <avr@gjlay.de>
 
2105
+
 
2106
+       PR target/61044
 
2107
+       * doc/extend.texi (Local Labels): Note that label differences are
 
2108
+       not supported for AVR.
 
2109
+
 
2110
+2014-05-26  Michael Tautschnig  <mt@debian.org>
 
2111
+
 
2112
+       PR target/61249
 
2113
+       * doc/extend.texi (X86 Built-in Functions): Fix parameter lists of
 
2114
+       __builtin_ia32_vfrczs[sd] and __builtin_ia32_mpsadbw256.
 
2115
+
 
2116
+2014-05-23  Alan Modra  <amodra@gmail.com>
 
2117
+
 
2118
+       PR target/61231
 
2119
+       * config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
 
2120
+       * config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
 
2121
+       Use "Y" constraint rather than "m".
 
2122
+
 
2123
+2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
2124
+
 
2125
+       Backport from mainline
 
2126
+       2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
2127
+
 
2128
+       * config/rs6000/htm.md (ttest): Use correct shift value to get CR0.
 
2129
+
 
2130
+2014-05-22  Richard Earnshaw  <rearnsha@arm.com>
 
2131
+
 
2132
+       PR target/61208
 
2133
+       * arm.md (arm_cmpdi_unsigned): Fix length calculation for Thumb2.
 
2134
+
 
2135
 2014-05-22  Release Manager
 
2136
 
 
2137
        * GCC 4.8.3 released.
 
2138
Index: gcc/testsuite/gcc.target/powerpc/tfmode_off.c
 
2139
===================================================================
 
2140
--- a/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../tags/gcc_4_8_3_release)
 
2141
+++ b/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../branches/gcc-4_8-branch)
 
2142
@@ -1,6 +1,7 @@
 
2143
 /* { dg-do assemble } */
 
2144
 /* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
 
2145
 /* { dg-skip-if "no TFmode" { powerpc-*-eabi* } { "*" } { "" } } */
 
2146
+/* { dg-require-effective-target longdouble128 } */
 
2147
 /* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
 
2148
 
 
2149
 typedef float TFmode __attribute__ ((mode (TF)));
 
2150
Index: gcc/testsuite/gcc.target/powerpc/pack02.c
 
2151
===================================================================
 
2152
--- a/src/gcc/testsuite/gcc.target/powerpc/pack02.c     (.../tags/gcc_4_8_3_release)
 
2153
+++ b/src/gcc/testsuite/gcc.target/powerpc/pack02.c     (.../branches/gcc-4_8-branch)
 
2154
@@ -2,6 +2,7 @@
 
2155
 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 
2156
 /* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
 
2157
 /* { dg-require-effective-target powerpc_fprs } */
 
2158
+/* { dg-require-effective-target longdouble128 } */
 
2159
 /* { dg-options "-O2 -mhard-float" } */
 
2160
 
 
2161
 #include <stddef.h>
 
2162
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
 
2163
===================================================================
 
2164
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c   (.../tags/gcc_4_8_3_release)
 
2165
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c   (.../branches/gcc-4_8-branch)
 
2166
@@ -0,0 +1,12 @@
 
2167
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
 
2168
+/* { dg-options "-mabi=elfv2" } */
 
2169
+
 
2170
+struct f8
 
2171
+  {
 
2172
+    float x[8];
 
2173
+  };
 
2174
+
 
2175
+void test (struct f8 a, struct f8 b) /* { dg-message "note: the ABI of passing homogeneous float aggregates will change" } */
 
2176
+{
 
2177
+}
 
2178
+
 
2179
Index: gcc/testsuite/gcc.target/powerpc/htm-ttest.c
 
2180
===================================================================
 
2181
--- a/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c  (.../tags/gcc_4_8_3_release)
 
2182
+++ b/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c  (.../branches/gcc-4_8-branch)
 
2183
@@ -0,0 +1,14 @@
 
2184
+/* { dg-do compile { target { powerpc*-*-* } } } */
 
2185
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 
2186
+/* { dg-require-effective-target powerpc_htm_ok } */
 
2187
+/* { dg-options "-O2 -mhtm" } */
 
2188
+
 
2189
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,3,30,31" { target { ilp32 } } } } */
 
2190
+/* { dg-final { scan-assembler "rldicl r?\[0-9\]+,r?\[0-9\]+,35,62" { target { lp64 } } } } */
 
2191
+
 
2192
+#include <htmintrin.h>
 
2193
+long
 
2194
+ttest (void)
 
2195
+{
 
2196
+  return _HTM_STATE(__builtin_ttest());
 
2197
+}
 
2198
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c
 
2199
===================================================================
 
2200
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c   (.../tags/gcc_4_8_3_release)
 
2201
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c   (.../branches/gcc-4_8-branch)
 
2202
@@ -0,0 +1,12 @@
 
2203
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
 
2204
+/* { dg-options "-mno-compat-align-parm" } */
 
2205
+
 
2206
+struct test
 
2207
+  {
 
2208
+    long a __attribute__((aligned (16)));
 
2209
+  };
 
2210
+
 
2211
+void test (struct test a) /* { dg-message "note: the ABI of passing aggregates with 16-byte alignment will change" } */
 
2212
+{
 
2213
+}
 
2214
+
 
2215
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
 
2216
===================================================================
 
2217
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c   (.../tags/gcc_4_8_3_release)
 
2218
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c   (.../branches/gcc-4_8-branch)
 
2219
@@ -0,0 +1,9 @@
 
2220
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
 
2221
+/* { dg-require-effective-target powerpc_altivec_ok } */
 
2222
+/* { dg-options "-maltivec" } */
 
2223
+
 
2224
+struct test
 
2225
+  {
 
2226
+    int a __attribute__((vector_size (8)));
 
2227
+  }; /* { dg-message "note: the layout of aggregates containing vectors with 8-byte alignment will change" } */
 
2228
+
 
2229
Index: gcc/testsuite/gcc.target/alpha/pr61586.c
 
2230
===================================================================
 
2231
--- a/src/gcc/testsuite/gcc.target/alpha/pr61586.c      (.../tags/gcc_4_8_3_release)
 
2232
+++ b/src/gcc/testsuite/gcc.target/alpha/pr61586.c      (.../branches/gcc-4_8-branch)
 
2233
@@ -0,0 +1,10 @@
 
2234
+/* { dg-do compile } */
 
2235
+/* { dg-options "-O2 -mieee" } */
 
2236
+
 
2237
+void foo (int *dimensions, double **params, int hh)
 
2238
+{
 
2239
+  if (params[hh])
 
2240
+    ;
 
2241
+  else if (dimensions[hh] > 0)
 
2242
+    params[hh][0] = 1.0f;
 
2243
+}
 
2244
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c
 
2245
===================================================================
 
2246
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c  (.../tags/gcc_4_8_3_release)
 
2247
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c  (.../branches/gcc-4_8-branch)
 
2248
@@ -0,0 +1,35 @@
 
2249
+/* Test AAPCS64 layout and __builtin_va_start.
 
2250
+
 
2251
+   Pass named HFA/HVA argument on stack.  */
 
2252
+
 
2253
+/* { dg-do run { target aarch64*-*-* } } */
 
2254
+
 
2255
+#ifndef IN_FRAMEWORK
 
2256
+#define AAPCS64_TEST_STDARG
 
2257
+#define TESTFILE "va_arg-14.c"
 
2258
+#include "type-def.h"
 
2259
+
 
2260
+struct hfa_fx2_t hfa_fx2 = {1.2f, 2.2f};
 
2261
+struct hfa_fx3_t hfa_fx3 = {3.2f, 4.2f, 5.2f};
 
2262
+vf4_t float32x4 = {6.2f, 7.2f, 8.2f, 9.2f};
 
2263
+vf4_t float32x4_2 = {10.2f, 11.2f, 12.2f, 13.2f};
 
2264
+
 
2265
+#include "abitest.h"
 
2266
+#else
 
2267
+  ARG (float, 1.0f, S0, 0)
 
2268
+  ARG (float, 2.0f, S1, 1)
 
2269
+  ARG (float, 3.0f, S2, 2)
 
2270
+  ARG (float, 4.0f, S3, 3)
 
2271
+  ARG (float, 5.0f, S4, 4)
 
2272
+  ARG (float, 6.0f, S5, 5)
 
2273
+  ARG (float, 7.0f, S6, 6)
 
2274
+  ARG (struct hfa_fx3_t, hfa_fx3, STACK, 7)
 
2275
+  /* Previous argument size has been rounded up to the nearest multiple of
 
2276
+     8 bytes.  */
 
2277
+  ARG (struct hfa_fx2_t, hfa_fx2, STACK + 16, 8)
 
2278
+  /* NSAA is rounded up to the nearest natural alignment of float32x4.  */
 
2279
+  ARG (vf4_t, float32x4, STACK + 32, 9)
 
2280
+  ARG (vf4_t, float32x4_2, STACK + 48, LAST_NAMED_ARG_ID)
 
2281
+  DOTS
 
2282
+  LAST_ANON (double, 123456789.987, STACK + 64, 11)
 
2283
+#endif
 
2284
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
 
2285
===================================================================
 
2286
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h   (.../tags/gcc_4_8_3_release)
 
2287
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h   (.../branches/gcc-4_8-branch)
 
2288
@@ -34,6 +34,13 @@
 
2289
   float b;
 
2290
 };
 
2291
 
 
2292
+struct hfa_fx3_t
 
2293
+{
 
2294
+  float a;
 
2295
+  float b;
 
2296
+  float c;
 
2297
+};
 
2298
+
 
2299
 struct hfa_dx2_t
 
2300
 {
 
2301
   double a;
 
2302
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c
 
2303
===================================================================
 
2304
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c  (.../tags/gcc_4_8_3_release)
 
2305
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c  (.../branches/gcc-4_8-branch)
 
2306
@@ -0,0 +1,59 @@
 
2307
+/* Test AAPCS64 layout and __builtin_va_start.
 
2308
+
 
2309
+   Pass named HFA/HVA argument on stack.  */
 
2310
+
 
2311
+/* { dg-do run { target aarch64*-*-* } } */
 
2312
+
 
2313
+#ifndef IN_FRAMEWORK
 
2314
+#define AAPCS64_TEST_STDARG
 
2315
+#define TESTFILE "va_arg-13.c"
 
2316
+
 
2317
+struct float_float_t
 
2318
+{
 
2319
+  float a;
 
2320
+  float b;
 
2321
+} float_float;
 
2322
+
 
2323
+union float_int_t
 
2324
+{
 
2325
+  float b8;
 
2326
+  int b5;
 
2327
+} float_int;
 
2328
+
 
2329
+#define HAS_DATA_INIT_FUNC
 
2330
+void
 
2331
+init_data ()
 
2332
+{
 
2333
+  float_float.a = 1.2f;
 
2334
+  float_float.b = 2.2f;
 
2335
+
 
2336
+  float_int.b8 = 4983.80f;
 
2337
+}
 
2338
+
 
2339
+#include "abitest.h"
 
2340
+#else
 
2341
+  ARG (float, 1.0f, S0, 0)
 
2342
+  ARG (float, 2.0f, S1, 1)
 
2343
+  ARG (float, 3.0f, S2, 2)
 
2344
+  ARG (float, 4.0f, S3, 3)
 
2345
+  ARG (float, 5.0f, S4, 4)
 
2346
+  ARG (float, 6.0f, S5, 5)
 
2347
+  ARG (float, 7.0f, S6, 6)
 
2348
+  ARG (struct float_float_t, float_float, STACK, 7)
 
2349
+  ARG (int,  9, W0, 8)
 
2350
+  ARG (int, 10, W1, 9)
 
2351
+  ARG (int, 11, W2, 10)
 
2352
+  ARG (int, 12, W3, 11)
 
2353
+  ARG (int, 13, W4, 12)
 
2354
+  ARG (int, 14, W5, 13)
 
2355
+  ARG (int, 15, W6, LAST_NAMED_ARG_ID)
 
2356
+  DOTS
 
2357
+  /* Note on the reason of using 'X7' instead of 'W7' here:
 
2358
+     Using 'X7' makes sure the test works in the big-endian mode.
 
2359
+     According to PCS rules B.4 and C.10, the size of float_int is rounded
 
2360
+     to 8 bytes and prepared in the register X7 as if loaded via LDR from
 
2361
+     the memory, with the content of the other 4 bytes unspecified.  The
 
2362
+     test framework will only compare the 4 relavent bytes.  */
 
2363
+  ANON (union float_int_t, float_int, X7, 15)
 
2364
+  LAST_ANON (long long, 12683143434LL, STACK + 8, 16)
 
2365
+#endif
 
2366
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c
 
2367
===================================================================
 
2368
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c  (.../tags/gcc_4_8_3_release)
 
2369
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c  (.../branches/gcc-4_8-branch)
 
2370
@@ -0,0 +1,39 @@
 
2371
+/* Test AAPCS64 layout and __builtin_va_start.
 
2372
+
 
2373
+   Pass named __128int argument on stack.  */
 
2374
+
 
2375
+/* { dg-do run { target aarch64*-*-* } } */
 
2376
+
 
2377
+#ifndef IN_FRAMEWORK
 
2378
+#define AAPCS64_TEST_STDARG
 
2379
+#define TESTFILE "va_arg-15.c"
 
2380
+#include "type-def.h"
 
2381
+
 
2382
+union int128_t qword;
 
2383
+
 
2384
+#define HAS_DATA_INIT_FUNC
 
2385
+void
 
2386
+init_data ()
 
2387
+{
 
2388
+  /* Init signed quad-word integer.  */
 
2389
+  qword.l64 = 0xfdb9753102468aceLL;
 
2390
+  qword.h64 = 0xeca8642013579bdfLL;
 
2391
+}
 
2392
+
 
2393
+#include "abitest.h"
 
2394
+#else
 
2395
+  ARG (int, 1, W0, 0)
 
2396
+  ARG (int, 2, W1, 1)
 
2397
+  ARG (int, 3, W2, 2)
 
2398
+  ARG (int, 4, W3, 3)
 
2399
+  ARG (int, 5, W4, 4)
 
2400
+  ARG (int, 6, W5, 5)
 
2401
+  ARG (int, 7, W6, 6)
 
2402
+  ARG (__int128, qword.i, STACK, LAST_NAMED_ARG_ID)
 
2403
+  DOTS
 
2404
+#ifndef __AAPCS64_BIG_ENDIAN__
 
2405
+  LAST_ANON (int, 8, STACK + 16, 8)
 
2406
+#else
 
2407
+  LAST_ANON (int, 8, STACK + 20, 8)
 
2408
+#endif
 
2409
+#endif
 
2410
Index: gcc/testsuite/gcc.target/avr/torture/pr61443.c
 
2411
===================================================================
 
2412
--- a/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c        (.../tags/gcc_4_8_3_release)
 
2413
+++ b/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c        (.../branches/gcc-4_8-branch)
 
2414
@@ -0,0 +1,134 @@
 
2415
+/* { dg-do run } */
 
2416
+/* { dg-options "-std=gnu99" } */
 
2417
+
 
2418
+#include <stdlib.h>
 
2419
+#include <stdarg.h>
 
2420
+
 
2421
+#define NC __attribute__((noinline,noclone))
 
2422
+
 
2423
+void NC vfun (char n, ...)
 
2424
+{
 
2425
+  va_list ap;
 
2426
+
 
2427
+  va_start (ap, n);
 
2428
+
 
2429
+  switch (n)
 
2430
+    {
 
2431
+    default:
 
2432
+      abort();
 
2433
+    case 1:
 
2434
+      if (11 != va_arg (ap, int))
 
2435
+        abort();
 
2436
+      break;
 
2437
+    case 2:
 
2438
+      if (2222 != va_arg (ap, int))
 
2439
+        abort();
 
2440
+      break;
 
2441
+    case 3:
 
2442
+      if (333333 != va_arg (ap, __int24))
 
2443
+        abort();
 
2444
+      break;
 
2445
+    case 4:
 
2446
+      if (44444444 != va_arg (ap, long))
 
2447
+        abort();
 
2448
+      break;
 
2449
+    case 8:
 
2450
+      if (8888888888888888 != va_arg (ap, long long))
 
2451
+        abort();
 
2452
+      break;
 
2453
+    }
 
2454
+
 
2455
+  va_end (ap);
 
2456
+}
 
2457
+
 
2458
+
 
2459
+void NC boo_qi (const __flash char *p)
 
2460
+{
 
2461
+  vfun (1, *p);
 
2462
+}
 
2463
+
 
2464
+void NC boox_qi (const __memx char *p)
 
2465
+{
 
2466
+  vfun (1, *p);
 
2467
+}
 
2468
+
 
2469
+void NC boo_hi (const __flash int *p)
 
2470
+{
 
2471
+  vfun (2, *p);
 
2472
+}
 
2473
+
 
2474
+void NC boox_hi (const __memx int *p)
 
2475
+{
 
2476
+  vfun (2, *p);
 
2477
+}
 
2478
+
 
2479
+void NC boo_psi (const __flash __int24 *p)
 
2480
+{
 
2481
+  vfun (3, *p);
 
2482
+}
 
2483
+
 
2484
+void NC boox_psi (const __memx __int24 *p)
 
2485
+{
 
2486
+  vfun (3, *p);
 
2487
+}
 
2488
+
 
2489
+void NC boo_si (const __flash long *p)
 
2490
+{
 
2491
+  vfun (4, *p);
 
2492
+}
 
2493
+
 
2494
+void NC boox_si (const __memx long *p)
 
2495
+{
 
2496
+  vfun (4, *p);
 
2497
+}
 
2498
+
 
2499
+void NC boo_di (const __flash long long *p)
 
2500
+{
 
2501
+  vfun (8, *p);
 
2502
+}
 
2503
+
 
2504
+void NC boox_di (const __memx long long *p)
 
2505
+{
 
2506
+  vfun (8, *p);
 
2507
+}
 
2508
+
 
2509
+const __flash char f_qi = 11;
 
2510
+const __flash int f_hi = 2222;
 
2511
+const __flash __int24 f_psi = 333333;
 
2512
+const __flash long f_si = 44444444;
 
2513
+const __flash long long f_di = 8888888888888888;
 
2514
+
 
2515
+const __memx char x_qi = 11;
 
2516
+const __memx int x_hi = 2222;
 
2517
+const __memx __int24 x_psi = 333333;
 
2518
+const __memx long x_si = 44444444;
 
2519
+const __memx long long x_di = 8888888888888888;
 
2520
+
 
2521
+char r_qi = 11;
 
2522
+int r_hi = 2222;
 
2523
+__int24 r_psi = 333333;
 
2524
+long r_si = 44444444;
 
2525
+long long r_di = 8888888888888888;
 
2526
+
 
2527
+int main (void)
 
2528
+{
 
2529
+  boo_qi (&f_qi);
 
2530
+  boo_hi (&f_hi);
 
2531
+  boo_psi (&f_psi);
 
2532
+  boo_si (&f_si);
 
2533
+  boo_di (&f_di);
 
2534
+
 
2535
+  boox_qi (&x_qi);
 
2536
+  boox_hi (&x_hi);
 
2537
+  boox_psi (&x_psi);
 
2538
+  boox_si (&x_si);
 
2539
+  boox_di (&x_di);
 
2540
+
 
2541
+  boox_qi (&r_qi);
 
2542
+  boox_hi (&r_hi);
 
2543
+  boox_psi (&r_psi);
 
2544
+  boox_si (&r_si);
 
2545
+  boox_di (&r_di);
 
2546
+
 
2547
+  exit (0);
 
2548
+}
 
2549
Index: gcc/testsuite/gcc.target/i386/pr61923.c
 
2550
===================================================================
 
2551
--- a/src/gcc/testsuite/gcc.target/i386/pr61923.c       (.../tags/gcc_4_8_3_release)
 
2552
+++ b/src/gcc/testsuite/gcc.target/i386/pr61923.c       (.../branches/gcc-4_8-branch)
 
2553
@@ -0,0 +1,36 @@
 
2554
+/* PR debug/61923 */
 
2555
+/* { dg-do compile } */
 
2556
+/* { dg-options "-O2 -fcompare-debug" } */
 
2557
+
 
2558
+typedef struct
 
2559
+{
 
2560
+  struct
 
2561
+  {
 
2562
+    struct
 
2563
+    {
 
2564
+      char head;
 
2565
+    } tickets;
 
2566
+  };
 
2567
+} arch_spinlock_t;
 
2568
+struct ext4_map_blocks
 
2569
+{
 
2570
+  int m_lblk;
 
2571
+  int m_len;
 
2572
+  int m_flags;
 
2573
+};
 
2574
+int ext4_da_map_blocks_ei_0;
 
2575
+void fn1 (int p1, struct ext4_map_blocks *p2)
 
2576
+{
 
2577
+  int ret;
 
2578
+  if (p2->m_flags)
 
2579
+    {
 
2580
+      ext4_da_map_blocks_ei_0++;
 
2581
+      arch_spinlock_t *lock;
 
2582
+      switch (sizeof *&lock->tickets.head)
 
2583
+      case 1:
 
2584
+      asm("" : "+m"(*&lock->tickets.head) : ""(0));
 
2585
+      __asm__("");
 
2586
+      ret = 0;
 
2587
+    }
 
2588
+  fn2 (p2->m_lblk, p2->m_len);
 
2589
+}
 
2590
Index: gcc/testsuite/gcc.target/i386/pr61423.c
 
2591
===================================================================
 
2592
--- a/src/gcc/testsuite/gcc.target/i386/pr61423.c       (.../tags/gcc_4_8_3_release)
 
2593
+++ b/src/gcc/testsuite/gcc.target/i386/pr61423.c       (.../branches/gcc-4_8-branch)
 
2594
@@ -0,0 +1,38 @@
 
2595
+/* PR target/61423 */
 
2596
+/* { dg-do run { target ia32 } } */
 
2597
+/* { dg-options "-O1 -ftree-vectorize -msse2 -mfpmath=387 -mtune=core2" } */
 
2598
+
 
2599
+#define N 1024
 
2600
+static unsigned int A[N];
 
2601
+
 
2602
+double
 
2603
+__attribute__((noinline))
 
2604
+func (void)
 
2605
+{
 
2606
+  unsigned int sum = 0;
 
2607
+  unsigned i;
 
2608
+  double t;
 
2609
+
 
2610
+  for (i = 0; i < N; i++)
 
2611
+    sum += A[i];
 
2612
+
 
2613
+  t = sum;
 
2614
+  return t;
 
2615
+}
 
2616
+
 
2617
+int
 
2618
+main ()
 
2619
+{
 
2620
+  unsigned i;
 
2621
+  double d;
 
2622
+
 
2623
+  for(i = 0; i < N; i++)
 
2624
+    A[i] = 1;
 
2625
+
 
2626
+  d = func();
 
2627
+
 
2628
+  if (d != 1024.0)
 
2629
+    __builtin_abort ();
 
2630
+
 
2631
+  return 0;
 
2632
+}
 
2633
Index: gcc/testsuite/gcc.target/i386/pr60901.c
 
2634
===================================================================
 
2635
--- a/src/gcc/testsuite/gcc.target/i386/pr60901.c       (.../tags/gcc_4_8_3_release)
 
2636
+++ b/src/gcc/testsuite/gcc.target/i386/pr60901.c       (.../branches/gcc-4_8-branch)
 
2637
@@ -0,0 +1,17 @@
 
2638
+/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts"  } */
 
2639
+
 
2640
+extern int n;
 
2641
+extern void bar (void);
 
2642
+extern int baz (int);
 
2643
+
 
2644
+void
 
2645
+foo (void)
 
2646
+{
 
2647
+  int i, j;
 
2648
+  for (j = 0; j < n; j++)
 
2649
+    {
 
2650
+      for (i = 1; i < j; i++)
 
2651
+       bar ();
 
2652
+      baz (0);
 
2653
+    }
 
2654
+}
 
2655
Index: gcc/testsuite/gcc.target/i386/pr61801.c
 
2656
===================================================================
 
2657
--- a/src/gcc/testsuite/gcc.target/i386/pr61801.c       (.../tags/gcc_4_8_3_release)
 
2658
+++ b/src/gcc/testsuite/gcc.target/i386/pr61801.c       (.../branches/gcc-4_8-branch)
 
2659
@@ -0,0 +1,21 @@
 
2660
+/* PR rtl-optimization/61801 */
 
2661
+/* { dg-do compile } */
 
2662
+/* { dg-options "-Os -fcompare-debug" } */
 
2663
+
 
2664
+int a, c;
 
2665
+int bar (void);
 
2666
+void baz (void);
 
2667
+
 
2668
+void
 
2669
+foo (void)
 
2670
+{
 
2671
+  int d;
 
2672
+  if (bar ())
 
2673
+    {
 
2674
+      int e;
 
2675
+      baz ();
 
2676
+      asm volatile ("" : "=a" (e) : "0" (a), "i" (0));
 
2677
+      d = e;
 
2678
+    }
 
2679
+  c = d;
 
2680
+}
 
2681
Index: gcc/testsuite/gcc.target/i386/pr61446.c
 
2682
===================================================================
 
2683
--- a/src/gcc/testsuite/gcc.target/i386/pr61446.c       (.../tags/gcc_4_8_3_release)
 
2684
+++ b/src/gcc/testsuite/gcc.target/i386/pr61446.c       (.../branches/gcc-4_8-branch)
 
2685
@@ -0,0 +1,14 @@
 
2686
+/* PR rtl-optimization/61446 */
 
2687
+
 
2688
+/* { dg-do compile { target { ia32 } } } */
 
2689
+/* { dg-options "-O2 -march=corei7 -mfpmath=387" } */
 
2690
+
 
2691
+unsigned long long
 
2692
+foo (float a)
 
2693
+{
 
2694
+  const double dfa = a;
 
2695
+  const unsigned int hi = dfa / 0x1p32f;
 
2696
+  const unsigned int lo = dfa - (double) hi * 0x1p32f;
 
2697
+
 
2698
+  return ((unsigned long long) hi << (4 * (8))) | lo;
 
2699
+}
 
2700
Index: gcc/testsuite/gcc.target/mips/pr62030-octeon.c
 
2701
===================================================================
 
2702
--- a/src/gcc/testsuite/gcc.target/mips/pr62030-octeon.c        (.../tags/gcc_4_8_3_release)
 
2703
+++ b/src/gcc/testsuite/gcc.target/mips/pr62030-octeon.c        (.../branches/gcc-4_8-branch)
 
2704
@@ -0,0 +1,50 @@
 
2705
+/* { dg-do run } */
 
2706
+/* { dg-options "-march=octeon" } */
 
2707
+
 
2708
+extern void abort (void);
 
2709
+
 
2710
+struct node
 
2711
+{
 
2712
+  struct node *next;
 
2713
+  struct node *prev;
 
2714
+};
 
2715
+
 
2716
+struct node node;
 
2717
+
 
2718
+struct head
 
2719
+{
 
2720
+  struct node *first;
 
2721
+};
 
2722
+
 
2723
+struct head heads[5];
 
2724
+
 
2725
+int k = 2;
 
2726
+
 
2727
+struct head *head = &heads[2];
 
2728
+
 
2729
+static int __attribute__((noinline))
 
2730
+foo (void)
 
2731
+{
 
2732
+  node.prev = (void *)head;
 
2733
+  head->first = &node;
 
2734
+
 
2735
+  struct node *n = head->first;
 
2736
+  struct head *h = &heads[k];
 
2737
+  struct node *next = n->next;
 
2738
+
 
2739
+  if (n->prev == (void *)h)
 
2740
+    h->first = next;
 
2741
+  else
 
2742
+    n->prev->next = next;
 
2743
+
 
2744
+  n->next = h->first;
 
2745
+  return n->next == &node;
 
2746
+}
 
2747
+
 
2748
+int
 
2749
+main (void)
 
2750
+{
 
2751
+  if (foo ())
 
2752
+    abort ();
 
2753
+  return 0;
 
2754
+}
 
2755
Index: gcc/testsuite/gcc.target/sh/pr61996.c
 
2756
===================================================================
 
2757
--- a/src/gcc/testsuite/gcc.target/sh/pr61996.c (.../tags/gcc_4_8_3_release)
 
2758
+++ b/src/gcc/testsuite/gcc.target/sh/pr61996.c (.../branches/gcc-4_8-branch)
 
2759
@@ -0,0 +1,12 @@
 
2760
+/* Check that the option -musermode has no effect on targets that do not
 
2761
+   support user/privileged mode and that it does not interfere with option
 
2762
+   -matomic-model=soft-imask.  */
 
2763
+/* { dg-do compile }  */
 
2764
+/* { dg-options "-matomic-model=soft-imask" }  */
 
2765
+/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m1*" "-m2*" } }  */
 
2766
+
 
2767
+int
 
2768
+test (void)
 
2769
+{
 
2770
+  return 0;
 
2771
+}
 
2772
Index: gcc/testsuite/lib/target-supports.exp
 
2773
===================================================================
 
2774
--- a/src/gcc/testsuite/lib/target-supports.exp (.../tags/gcc_4_8_3_release)
 
2775
+++ b/src/gcc/testsuite/lib/target-supports.exp (.../branches/gcc-4_8-branch)
 
2776
@@ -1790,6 +1790,15 @@
 
2777
     }]
 
2778
 }
 
2779
 
 
2780
+# Return 1 if the target supports long double of 128 bits,
 
2781
+# 0 otherwise.
 
2782
+
 
2783
+proc check_effective_target_longdouble128 { } {
 
2784
+    return [check_no_compiler_messages longdouble128 object {
 
2785
+       int dummy[sizeof(long double) == 16 ? 1 : -1];
 
2786
+    }]
 
2787
+}
 
2788
+
 
2789
 # Return 1 if the target supports double of 64 bits,
 
2790
 # 0 otherwise.
 
2791
 
 
2792
Index: gcc/testsuite/gfortran.dg/default_format_denormal_2.f90
 
2793
===================================================================
 
2794
--- a/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90       (.../tags/gcc_4_8_3_release)
 
2795
+++ b/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90       (.../branches/gcc-4_8-branch)
 
2796
@@ -1,6 +1,6 @@
 
2797
 ! { dg-require-effective-target fortran_large_real }
 
2798
-! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } }
 
2799
-! Test XFAILed on these platforms because the system's printf() lacks
 
2800
+! { dg-do run { xfail powerpc*-apple-darwin* } }
 
2801
+! Test XFAILed on this platform because the system's printf() lacks
 
2802
 ! proper support for denormalized long doubles. See PR24685
 
2803
 !
 
2804
 ! This tests that the default formats for formatted I/O of reals are
 
2805
Index: gcc/testsuite/gfortran.dg/dot_product_3.f90
 
2806
===================================================================
 
2807
--- a/src/gcc/testsuite/gfortran.dg/dot_product_3.f90   (.../tags/gcc_4_8_3_release)
 
2808
+++ b/src/gcc/testsuite/gfortran.dg/dot_product_3.f90   (.../branches/gcc-4_8-branch)
 
2809
@@ -0,0 +1,15 @@
 
2810
+! { dg-do compile }
 
2811
+! { dg-options "-fdump-tree-original" }
 
2812
+! PR 61999 - this used to ICE.
 
2813
+! Original test case by A. Kasahara
 
2814
+program main
 
2815
+   use, intrinsic:: iso_fortran_env, only: output_unit
 
2816
+
 
2817
+   implicit none
 
2818
+
 
2819
+   write(output_unit, *) dot_product([1, 2], [2.0, 3.0])
 
2820
+
 
2821
+   stop
 
2822
+end program main
 
2823
+! { dg-final { scan-tree-dump-times "8\\.0e\\+0" 1 "original" } }
 
2824
+! { dg-final { cleanup-tree-dump "original" } }
 
2825
Index: gcc/testsuite/gfortran.dg/cray_pointers_10.f90
 
2826
===================================================================
 
2827
--- a/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90        (.../tags/gcc_4_8_3_release)
 
2828
+++ b/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90        (.../branches/gcc-4_8-branch)
 
2829
@@ -0,0 +1,18 @@
 
2830
+! { dg-do run }
 
2831
+! { dg-options "-fcray-pointer" }
 
2832
+!
 
2833
+! PR fortran/45187
 
2834
+!
 
2835
+module foo
 
2836
+  implicit none
 
2837
+  real :: a
 
2838
+  pointer(c_a, a)
 
2839
+end module foo
 
2840
+
 
2841
+program test
 
2842
+  use foo
 
2843
+  real :: z
 
2844
+  c_a = loc(z)
 
2845
+  a = 42
 
2846
+  if (z /= 42) call abort
 
2847
+end program test
 
2848
Index: gcc/testsuite/gfortran.dg/dependency_44.f90
 
2849
===================================================================
 
2850
--- a/src/gcc/testsuite/gfortran.dg/dependency_44.f90   (.../tags/gcc_4_8_3_release)
 
2851
+++ b/src/gcc/testsuite/gfortran.dg/dependency_44.f90   (.../branches/gcc-4_8-branch)
 
2852
@@ -0,0 +1,36 @@
 
2853
+! { dg-do run }
 
2854
+! Tests fix for PR61780 in which the loop reversal mechanism was
 
2855
+! not accounting for the first index being an element so that no
 
2856
+! loop in this dimension is created.
 
2857
+!
 
2858
+! Contributed by Manfred Tietze on clf.
 
2859
+!
 
2860
+program prgm3
 
2861
+    implicit none
 
2862
+    integer, parameter :: n = 10, k = 3
 
2863
+    integer :: i, j
 
2864
+    integer, dimension(n,n) :: y
 
2865
+    integer :: res1(n), res2(n)
 
2866
+
 
2867
+1   format(10i5)
 
2868
+
 
2869
+!initialize
 
2870
+    do i=1,n
 
2871
+        do j=1,n
 
2872
+            y(i,j) = n*i + j
 
2873
+        end do
 
2874
+    end do
 
2875
+    res2 = y(k,:)
 
2876
+
 
2877
+!shift right
 
2878
+    y(k,4:n) = y(k,3:n-1)
 
2879
+    y(k,3) = 0
 
2880
+    res1 = y(k,:)
 
2881
+    y(k,:) = res2
 
2882
+    y(k,n:4:-1) = y(k,n-1:3:-1)
 
2883
+    y(k,3) = 0
 
2884
+    res2 = y(k,:)
 
2885
+!    print *, res1
 
2886
+!    print *, res2
 
2887
+    if (any(res1 /= res2)) call abort ()
 
2888
+end program prgm3
 
2889
Index: gcc/testsuite/gfortran.dg/oldstyle_5.f
 
2890
===================================================================
 
2891
--- a/src/gcc/testsuite/gfortran.dg/oldstyle_5.f        (.../tags/gcc_4_8_3_release)
 
2892
+++ b/src/gcc/testsuite/gfortran.dg/oldstyle_5.f        (.../branches/gcc-4_8-branch)
 
2893
@@ -0,0 +1,8 @@
 
2894
+C { dg-do compile }
 
2895
+      TYPE T
 
2896
+      INTEGER A(2)/1,2/ ! { dg-error "Invalid old style initialization for derived type component" }
 
2897
+      END TYPE
 
2898
+      TYPE S
 
2899
+      INTEGER B/1/ ! { dg-error "Invalid old style initialization for derived type component" }
 
2900
+      END TYPE
 
2901
+      END
 
2902
Index: gcc/testsuite/gfortran.dg/nint_2.f90
 
2903
===================================================================
 
2904
--- a/src/gcc/testsuite/gfortran.dg/nint_2.f90  (.../tags/gcc_4_8_3_release)
 
2905
+++ b/src/gcc/testsuite/gfortran.dg/nint_2.f90  (.../branches/gcc-4_8-branch)
 
2906
@@ -4,7 +4,8 @@
 
2907
 ! http://gcc.gnu.org/ml/fortran/2005-04/msg00139.html
 
2908
 !
 
2909
 ! { dg-do run }
 
2910
-! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc*-*-linux* *-*-mingw* } { "-O0" } { "" } }
 
2911
+! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc-*-linux* powerpc64-*-linux* *-*-mingw* } { "-O0" } { "" } }
 
2912
+! Note that this doesn't fail on powerpc64le-*-linux*.
 
2913
   real(kind=8) :: a
 
2914
   integer(kind=8) :: i1, i2
 
2915
   real :: b
 
2916
Index: gcc/testsuite/gfortran.dg/pointer_intent_7.f90
 
2917
===================================================================
 
2918
--- a/src/gcc/testsuite/gfortran.dg/pointer_intent_7.f90        (.../tags/gcc_4_8_3_release)
 
2919
+++ b/src/gcc/testsuite/gfortran.dg/pointer_intent_7.f90        (.../branches/gcc-4_8-branch)
 
2920
@@ -23,7 +23,7 @@
 
2921
     call bar2 (c)
 
2922
     call bar3 (c)
 
2923
     call bar2p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
 
2924
-    call bar3p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
 
2925
+    call bar3p (b) ! { dg-error "Actual argument to .n. at \\(1\\) must be polymorphic" }
 
2926
     call bar2p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
 
2927
     call bar3p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
 
2928
   end subroutine
 
2929
Index: gcc/testsuite/gfortran.dg/array_assignment_5.f90
 
2930
===================================================================
 
2931
--- a/src/gcc/testsuite/gfortran.dg/array_assignment_5.f90      (.../tags/gcc_4_8_3_release)
 
2932
+++ b/src/gcc/testsuite/gfortran.dg/array_assignment_5.f90      (.../branches/gcc-4_8-branch)
 
2933
@@ -0,0 +1,16 @@
 
2934
+! { dg-do run }
 
2935
+! { dg-options "-ffrontend-optimize" }
 
2936
+! PR 62214 - this used to give the wrong result.
 
2937
+! Original test case by Oliver Fuhrer
 
2938
+PROGRAM test
 
2939
+  IMPLICIT NONE
 
2940
+  CHARACTER(LEN=20)   :: fullNames(2)
 
2941
+  CHARACTER(LEN=255)  :: pathName
 
2942
+  CHARACTER(LEN=5)    :: fileNames(2)
 
2943
+  
 
2944
+  pathName = "/dir1/dir2/"
 
2945
+  fileNames = (/ "file1", "file2" /)
 
2946
+  fullNames = SPREAD(TRIM(pathName),1,2) // fileNames
 
2947
+  if (fullNames(1) /= '/dir1/dir2/file1' .or. &
 
2948
+       & fullnames(2) /= '/dir1/dir2/file2') call abort
 
2949
+END PROGRAM test
 
2950
Index: gcc/testsuite/gfortran.dg/pr45636.f90
 
2951
===================================================================
 
2952
--- a/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../tags/gcc_4_8_3_release)
 
2953
+++ b/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../branches/gcc-4_8-branch)
 
2954
@@ -10,5 +10,5 @@
 
2955
   b = y
 
2956
   call sub(a, b)
 
2957
 end program main
 
2958
-! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { mips*-*-* && { ! nomips16 } } } } }
 
2959
+! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { { hppa*-*-* && { ! lp64 } } || { mips*-*-* && { ! nomips16 } } } } } }
 
2960
 ! { dg-final { cleanup-tree-dump "forwprop2" } }
 
2961
Index: gcc/testsuite/gfortran.dg/allocatable_function_8.f90
 
2962
===================================================================
 
2963
--- a/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90  (.../tags/gcc_4_8_3_release)
 
2964
+++ b/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90  (.../branches/gcc-4_8-branch)
 
2965
@@ -0,0 +1,47 @@
 
2966
+! { dg-do run }
 
2967
+! Test the fix for PR61459.
 
2968
+!
 
2969
+! Contributed by John Wingate  <johnww@tds.net>
 
2970
+!
 
2971
+module a
 
2972
+
 
2973
+   implicit none
 
2974
+   private
 
2975
+   public :: f_segfault, f_segfault_plus, f_workaround
 
2976
+   integer, dimension(2,2) :: b = reshape([1,-1,1,1],[2,2])
 
2977
+
 
2978
+contains
 
2979
+
 
2980
+   function f_segfault(x)
 
2981
+      real, dimension(:), allocatable :: f_segfault
 
2982
+      real, dimension(:), intent(in)  :: x
 
2983
+      allocate(f_segfault(2))
 
2984
+      f_segfault = matmul(b,x)
 
2985
+   end function f_segfault
 
2986
+
 
2987
+! Sefaulted without the ALLOCATE as well.
 
2988
+   function f_segfault_plus(x)
 
2989
+      real, dimension(:), allocatable :: f_segfault_plus
 
2990
+      real, dimension(:), intent(in)  :: x
 
2991
+      f_segfault_plus = matmul(b,x)
 
2992
+   end function f_segfault_plus
 
2993
+
 
2994
+   function f_workaround(x)
 
2995
+      real, dimension(:), allocatable :: f_workaround
 
2996
+      real, dimension(:), intent(in)  :: x
 
2997
+      real, dimension(:), allocatable :: tmp
 
2998
+      allocate(f_workaround(2),tmp(2))
 
2999
+      tmp = matmul(b,x)
 
3000
+      f_workaround = tmp
 
3001
+   end function f_workaround
 
3002
+
 
3003
+end module a
 
3004
+
 
3005
+program main
 
3006
+   use a
 
3007
+   implicit none
 
3008
+   real, dimension(2) :: x = 1.0, y
 
3009
+   y = f_workaround (x)
 
3010
+   if (any (f_segfault (x) .ne. y)) call abort
 
3011
+   if (any (f_segfault_plus (x) .ne. y)) call abort
 
3012
+end program main
 
3013
Index: gcc/testsuite/gfortran.dg/bessel_7.f90
 
3014
===================================================================
 
3015
--- a/src/gcc/testsuite/gfortran.dg/bessel_7.f90        (.../tags/gcc_4_8_3_release)
 
3016
+++ b/src/gcc/testsuite/gfortran.dg/bessel_7.f90        (.../branches/gcc-4_8-branch)
 
3017
@@ -16,7 +16,7 @@
 
3018
 implicit none
 
3019
 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] 
 
3020
 real,parameter :: myeps(size(values)) = epsilon(0.0) &
 
3021
-                  * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ]
 
3022
+                  * [2, 3, 4, 5, 8, 2, 13, 6, 7, 6, 36, 168 ]
 
3023
 ! The following is sufficient for me - the values above are a bit
 
3024
 ! more tolerant
 
3025
 !                  * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ]
 
3026
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-1.c
 
3027
===================================================================
 
3028
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c       (.../tags/gcc_4_8_3_release)
 
3029
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c       (.../branches/gcc-4_8-branch)
 
3030
@@ -0,0 +1,39 @@
 
3031
+#ifdef __INT32_TYPE__
 
3032
+typedef __INT32_TYPE__ int32_t;
 
3033
+#else
 
3034
+typedef int int32_t;
 
3035
+#endif
 
3036
+
 
3037
+#ifdef __UINT32_TYPE__
 
3038
+typedef __UINT32_TYPE__ uint32_t;
 
3039
+#else
 
3040
+typedef unsigned uint32_t;
 
3041
+#endif
 
3042
+
 
3043
+#define __fake_const_swab32(x) ((uint32_t)(                  \
 
3044
+       (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) |    \
 
3045
+       (((uint32_t)(x) & (uint32_t)0x0000ff00UL) <<  8) |    \
 
3046
+       (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >>  8) |    \
 
3047
+       (( (int32_t)(x) &  (int32_t)0xff000000UL) >> 24)))
 
3048
+
 
3049
+/* Previous version of bswap optimization failed to consider sign extension
 
3050
+   and as a result would replace an expression *not* doing a bswap by a
 
3051
+   bswap.  */
 
3052
+
 
3053
+__attribute__ ((noinline, noclone)) uint32_t
 
3054
+fake_bswap32 (uint32_t in)
 
3055
+{
 
3056
+  return __fake_const_swab32 (in);
 
3057
+}
 
3058
+
 
3059
+int
 
3060
+main(void)
 
3061
+{
 
3062
+  if (sizeof (int32_t) * __CHAR_BIT__ != 32)
 
3063
+    return 0;
 
3064
+  if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
 
3065
+    return 0;
 
3066
+  if (fake_bswap32 (0x87654321) != 0xffffff87)
 
3067
+    __builtin_abort ();
 
3068
+  return 0;
 
3069
+}
 
3070
Index: gcc/testsuite/gcc.c-torture/execute/pr23135.x
 
3071
===================================================================
 
3072
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../tags/gcc_4_8_3_release)
 
3073
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../branches/gcc-4_8-branch)
 
3074
@@ -0,0 +1,2 @@
 
3075
+set additional_flags "-Wno-psabi"
 
3076
+return 0
 
3077
Index: gcc/testsuite/gcc.c-torture/execute/bitfld-6.c
 
3078
===================================================================
 
3079
--- a/src/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c        (.../tags/gcc_4_8_3_release)
 
3080
+++ b/src/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c        (.../branches/gcc-4_8-branch)
 
3081
@@ -0,0 +1,23 @@
 
3082
+union U
 
3083
+{
 
3084
+  const int a;
 
3085
+  unsigned b : 20;
 
3086
+};
 
3087
+
 
3088
+static union U u = { 0x12345678 };
 
3089
+
 
3090
+/* Constant folding used to fail to account for endianness when folding a
 
3091
+   union.  */
 
3092
+
 
3093
+int
 
3094
+main (void)
 
3095
+{
 
3096
+#ifdef __BYTE_ORDER__
 
3097
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 
3098
+  return u.b - 0x45678;
 
3099
+#else
 
3100
+  return u.b - 0x12345;
 
3101
+#endif
 
3102
+#endif
 
3103
+  return 0;
 
3104
+}
 
3105
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-3.c
 
3106
===================================================================
 
3107
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c       (.../tags/gcc_4_8_3_release)
 
3108
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c       (.../branches/gcc-4_8-branch)
 
3109
@@ -0,0 +1,13 @@
 
3110
+short a = -1;
 
3111
+int b;
 
3112
+char c;
 
3113
+
 
3114
+int
 
3115
+main ()
 
3116
+{
 
3117
+  c = a;
 
3118
+  b = a | c;
 
3119
+  if (b != -1)
 
3120
+    __builtin_abort ();
 
3121
+  return 0;
 
3122
+}
 
3123
Index: gcc/testsuite/gcc.c-torture/execute/20050604-1.x
 
3124
===================================================================
 
3125
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x      (.../tags/gcc_4_8_3_release)
 
3126
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x      (.../branches/gcc-4_8-branch)
 
3127
@@ -6,4 +6,5 @@
 
3128
        set additional_flags "-mno-mmx"
 
3129
 }
 
3130
 
 
3131
+set additional_flags "-Wno-psabi"
 
3132
 return 0
 
3133
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-2.c
 
3134
===================================================================
 
3135
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c       (.../tags/gcc_4_8_3_release)
 
3136
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c       (.../branches/gcc-4_8-branch)
 
3137
@@ -0,0 +1,40 @@
 
3138
+#ifdef __INT16_TYPE__
 
3139
+typedef __INT16_TYPE__ int16_t;
 
3140
+#else
 
3141
+typedef short int16_t;
 
3142
+#endif
 
3143
+
 
3144
+#ifdef __UINT32_TYPE__
 
3145
+typedef __UINT32_TYPE__ uint32_t;
 
3146
+#else
 
3147
+typedef unsigned uint32_t;
 
3148
+#endif
 
3149
+
 
3150
+#define __fake_const_swab32(x) ((uint32_t)(                          \
 
3151
+       (((uint32_t)         (x) & (uint32_t)0x000000ffUL) << 24) |   \
 
3152
+       (((uint32_t)(int16_t)(x) & (uint32_t)0x00ffff00UL) <<  8) |   \
 
3153
+       (((uint32_t)         (x) & (uint32_t)0x00ff0000UL) >>  8) |   \
 
3154
+       (((uint32_t)         (x) & (uint32_t)0xff000000UL) >> 24)))
 
3155
+
 
3156
+
 
3157
+/* Previous version of bswap optimization failed to consider sign extension
 
3158
+   and as a result would replace an expression *not* doing a bswap by a
 
3159
+   bswap.  */
 
3160
+
 
3161
+__attribute__ ((noinline, noclone)) uint32_t
 
3162
+fake_bswap32 (uint32_t in)
 
3163
+{
 
3164
+  return __fake_const_swab32 (in);
 
3165
+}
 
3166
+
 
3167
+int
 
3168
+main(void)
 
3169
+{
 
3170
+  if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
 
3171
+    return 0;
 
3172
+  if (sizeof (int16_t) * __CHAR_BIT__ != 16)
 
3173
+    return 0;
 
3174
+  if (fake_bswap32 (0x81828384) != 0xff838281)
 
3175
+    __builtin_abort ();
 
3176
+  return 0;
 
3177
+}
 
3178
Index: gcc/testsuite/gcc.c-torture/execute/pr61375.c
 
3179
===================================================================
 
3180
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../tags/gcc_4_8_3_release)
 
3181
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../branches/gcc-4_8-branch)
 
3182
@@ -0,0 +1,35 @@
 
3183
+#ifdef __UINT64_TYPE__
 
3184
+typedef __UINT64_TYPE__ uint64_t;
 
3185
+#else
 
3186
+typedef unsigned long long uint64_t;
 
3187
+#endif
 
3188
+
 
3189
+#ifndef __SIZEOF_INT128__
 
3190
+#define __int128 long long
 
3191
+#endif
 
3192
+
 
3193
+/* Some version of bswap optimization would ICE when analyzing a mask constant
 
3194
+   too big for an HOST_WIDE_INT (PR61375).  */
 
3195
+
 
3196
+__attribute__ ((noinline, noclone)) uint64_t
 
3197
+uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2)
 
3198
+{
 
3199
+  __int128 mask = (__int128)0xffff << 56;
 
3200
+  return ((in1 & mask) >> 56) | in2;
 
3201
+}
 
3202
+
 
3203
+int
 
3204
+main (int argc)
 
3205
+{
 
3206
+  __int128 in = 1;
 
3207
+#ifdef __SIZEOF_INT128__
 
3208
+  in <<= 64;
 
3209
+#endif
 
3210
+  if (sizeof (uint64_t) * __CHAR_BIT__ != 64)
 
3211
+    return 0;
 
3212
+  if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128)
 
3213
+    return 0;
 
3214
+  if (uint128_central_bitsi_ior (in, 2) != 0x102)
 
3215
+    __builtin_abort ();
 
3216
+  return 0;
 
3217
+}
 
3218
Index: gcc/testsuite/gcc.c-torture/execute/20050316-1.x
 
3219
===================================================================
 
3220
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x      (.../tags/gcc_4_8_3_release)
 
3221
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x      (.../branches/gcc-4_8-branch)
 
3222
@@ -4,4 +4,5 @@
 
3223
        return 1
 
3224
 }
 
3225
 
 
3226
+set additional_flags "-Wno-psabi"
 
3227
 return 0;
 
3228
Index: gcc/testsuite/gcc.c-torture/execute/20050316-3.x
 
3229
===================================================================
 
3230
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x      (.../tags/gcc_4_8_3_release)
 
3231
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x      (.../branches/gcc-4_8-branch)
 
3232
@@ -0,0 +1,2 @@
 
3233
+set additional_flags "-Wno-psabi"
 
3234
+return 0
 
3235
Index: gcc/testsuite/gcc.c-torture/compile/pr61684.c
 
3236
===================================================================
 
3237
--- a/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../tags/gcc_4_8_3_release)
 
3238
+++ b/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../branches/gcc-4_8-branch)
 
3239
@@ -0,0 +1,15 @@
 
3240
+/* PR tree-optimization/61684 */
 
3241
+
 
3242
+int a, c;
 
3243
+static int *b = 0;
 
3244
+short d;
 
3245
+static short **e = 0;
 
3246
+
 
3247
+void
 
3248
+foo ()
 
3249
+{
 
3250
+  for (; c < 1; c++)
 
3251
+    ;
 
3252
+  *e = &d;
 
3253
+  a = d && (c && 1) & *b;
 
3254
+}
 
3255
Index: gcc/testsuite/gnat.dg/opt39.adb
 
3256
===================================================================
 
3257
--- a/src/gcc/testsuite/gnat.dg/opt39.adb       (.../tags/gcc_4_8_3_release)
 
3258
+++ b/src/gcc/testsuite/gnat.dg/opt39.adb       (.../branches/gcc-4_8-branch)
 
3259
@@ -0,0 +1,31 @@
 
3260
+-- { dg-do compile }
 
3261
+-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" }
 
3262
+
 
3263
+procedure Opt39 (I : Integer) is
 
3264
+
 
3265
+  type Rec is record
 
3266
+    I1 : Integer;
 
3267
+    I2 : Integer;
 
3268
+    I3 : Integer;
 
3269
+    I4 : Integer;
 
3270
+    I5 : Integer;
 
3271
+  end record;
 
3272
+
 
3273
+  procedure Set (A : access Rec; I : Integer) is
 
3274
+    Tmp : Rec := A.all;
 
3275
+  begin
 
3276
+    Tmp.I1 := I;
 
3277
+    A.all := Tmp;
 
3278
+  end;
 
3279
+
 
3280
+  R : aliased Rec;
 
3281
+
 
3282
+begin
 
3283
+  Set (R'Access, I);
 
3284
+  if R.I1 /= I then
 
3285
+    raise Program_Error;
 
3286
+  end if;
 
3287
+end;
 
3288
+
 
3289
+-- { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } }
 
3290
+-- { dg-final { cleanup-tree-dump "optimized" } }
 
3291
Index: gcc/testsuite/gnat.dg/overflow_fixed.adb
 
3292
===================================================================
 
3293
--- a/src/gcc/testsuite/gnat.dg/overflow_fixed.adb      (.../tags/gcc_4_8_3_release)
 
3294
+++ b/src/gcc/testsuite/gnat.dg/overflow_fixed.adb      (.../branches/gcc-4_8-branch)
 
3295
@@ -0,0 +1,19 @@
 
3296
+-- { dg-do run }
 
3297
+-- { dg-options "-gnato -O" }
 
3298
+
 
3299
+procedure Overflow_Fixed is
 
3300
+
 
3301
+  type Unsigned_8_Bit is mod 2**8;
 
3302
+
 
3303
+  procedure Fixed_To_Eight (Value : Duration) is
 
3304
+    Item : Unsigned_8_Bit;
 
3305
+  begin
 
3306
+    Item := Unsigned_8_Bit(Value);
 
3307
+    raise Program_Error;
 
3308
+  exception
 
3309
+    when Constraint_Error => null; -- expected case
 
3310
+  end;
 
3311
+
 
3312
+begin
 
3313
+  Fixed_To_Eight (-0.5);
 
3314
+end;
 
3315
Index: gcc/testsuite/gnat.dg/aliasing1.adb
 
3316
===================================================================
 
3317
--- a/src/gcc/testsuite/gnat.dg/aliasing1.adb   (.../tags/gcc_4_8_3_release)
 
3318
+++ b/src/gcc/testsuite/gnat.dg/aliasing1.adb   (.../branches/gcc-4_8-branch)
 
3319
@@ -18,5 +18,5 @@
 
3320
 
 
3321
 end Aliasing1;
 
3322
 
 
3323
--- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } }
 
3324
+-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }
 
3325
 -- { dg-final { cleanup-tree-dump "optimized" } }
 
3326
Index: gcc/testsuite/gcc.dg/pr60866.c
 
3327
===================================================================
 
3328
--- a/src/gcc/testsuite/gcc.dg/pr60866.c        (.../tags/gcc_4_8_3_release)
 
3329
+++ b/src/gcc/testsuite/gcc.dg/pr60866.c        (.../branches/gcc-4_8-branch)
 
3330
@@ -0,0 +1,18 @@
 
3331
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
 
3332
+/* { dg-options "-O -fselective-scheduling -fno-if-conversion -fschedule-insns"  } */
 
3333
+
 
3334
+int n;
 
3335
+
 
3336
+void
 
3337
+foo (int w, int **dnroot, int **dn)
 
3338
+{
 
3339
+  int *child;
 
3340
+  int *xchild = xchild;
 
3341
+  for (; w < n; w++)
 
3342
+    if (!dnroot)
 
3343
+      {
 
3344
+       dnroot = dn;
 
3345
+       for (child = *dn; child; child = xchild)
 
3346
+         ;
 
3347
+      }
 
3348
+}
 
3349
Index: gcc/testsuite/gcc.dg/pr61045.c
 
3350
===================================================================
 
3351
--- a/src/gcc/testsuite/gcc.dg/pr61045.c        (.../tags/gcc_4_8_3_release)
 
3352
+++ b/src/gcc/testsuite/gcc.dg/pr61045.c        (.../branches/gcc-4_8-branch)
 
3353
@@ -0,0 +1,12 @@
 
3354
+/* { dg-do run } */
 
3355
+/* { dg-options "-fstrict-overflow" } */
 
3356
+
 
3357
+int main ()
 
3358
+{
 
3359
+  int a = 0;
 
3360
+  int b = __INT_MAX__;
 
3361
+  int t = (a - 2) > (b - 1);
 
3362
+  if (t != 0)
 
3363
+    __builtin_abort();
 
3364
+  return 0;
 
3365
+}
 
3366
Index: gcc/testsuite/gcc.dg/pr62004.c
 
3367
===================================================================
 
3368
--- a/src/gcc/testsuite/gcc.dg/pr62004.c        (.../tags/gcc_4_8_3_release)
 
3369
+++ b/src/gcc/testsuite/gcc.dg/pr62004.c        (.../branches/gcc-4_8-branch)
 
3370
@@ -0,0 +1,47 @@
 
3371
+/* { dg-do run } */
 
3372
+/* { dg-options "-O2 -fno-tree-tail-merge" } */
 
3373
+
 
3374
+struct node
 
3375
+{
 
3376
+  struct node *next;
 
3377
+  struct node *prev;
 
3378
+};
 
3379
+
 
3380
+struct node node;
 
3381
+
 
3382
+struct head
 
3383
+{
 
3384
+  struct node *first;
 
3385
+};
 
3386
+
 
3387
+struct head heads[5];
 
3388
+
 
3389
+int k = 2;
 
3390
+
 
3391
+struct head *head = &heads[2];
 
3392
+
 
3393
+int
 
3394
+main ()
 
3395
+{
 
3396
+  struct node *p;
 
3397
+
 
3398
+  node.next = (void*)0;
 
3399
+
 
3400
+  node.prev = (void *)head;
 
3401
+
 
3402
+  head->first = &node;
 
3403
+
 
3404
+  struct node *n = head->first;
 
3405
+
 
3406
+  struct head *h = &heads[k];
 
3407
+
 
3408
+  heads[2].first = n->next;
 
3409
+
 
3410
+  if ((void*)n->prev == (void *)h)
 
3411
+    p = h->first;
 
3412
+  else
 
3413
+    /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next.  */
 
3414
+    p = n->prev->next;
 
3415
+
 
3416
+  return !(p == (void*)0);
 
3417
+}
 
3418
Index: gcc/testsuite/gcc.dg/pr51879-18.c
 
3419
===================================================================
 
3420
--- a/src/gcc/testsuite/gcc.dg/pr51879-18.c     (.../tags/gcc_4_8_3_release)
 
3421
+++ b/src/gcc/testsuite/gcc.dg/pr51879-18.c     (.../branches/gcc-4_8-branch)
 
3422
@@ -13,5 +13,5 @@
 
3423
     *q = foo ();
 
3424
 }
 
3425
 
 
3426
-/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
 
3427
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre" { xfail *-*-* } } } */
 
3428
 /* { dg-final { cleanup-tree-dump "pre" } } */
 
3429
Index: gcc/testsuite/gcc.dg/torture/pr61964.c
 
3430
===================================================================
 
3431
--- a/src/gcc/testsuite/gcc.dg/torture/pr61964.c        (.../tags/gcc_4_8_3_release)
 
3432
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61964.c        (.../branches/gcc-4_8-branch)
 
3433
@@ -0,0 +1,33 @@
 
3434
+/* { dg-do run } */
 
3435
+
 
3436
+extern void abort (void);
 
3437
+
 
3438
+struct node { struct node *next, *prev; } node;
 
3439
+struct head { struct node *first; } heads[5];
 
3440
+int k = 2;
 
3441
+struct head *head = &heads[2];
 
3442
+
 
3443
+static int __attribute__((noinline))
 
3444
+foo()
 
3445
+{
 
3446
+  node.prev = (void *)head;
 
3447
+  head->first = &node;
 
3448
+
 
3449
+  struct node *n = head->first;
 
3450
+  struct head *h = &heads[k];
 
3451
+
 
3452
+  if (n->prev == (void *)h)
 
3453
+    h->first = n->next;
 
3454
+  else
 
3455
+    n->prev->next = n->next;
 
3456
+
 
3457
+  n->next = h->first;
 
3458
+  return n->next == &node;
 
3459
+}
 
3460
+
 
3461
+int main()
 
3462
+{
 
3463
+  if (foo ())
 
3464
+    abort ();
 
3465
+  return 0;
 
3466
+}
 
3467
Index: gcc/testsuite/gcc.dg/torture/pr61010.c
 
3468
===================================================================
 
3469
--- a/src/gcc/testsuite/gcc.dg/torture/pr61010.c        (.../tags/gcc_4_8_3_release)
 
3470
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61010.c        (.../branches/gcc-4_8-branch)
 
3471
@@ -0,0 +1,8 @@
 
3472
+/* { dg-do compile } */
 
3473
+
 
3474
+int main (void)
 
3475
+{
 
3476
+  int a = 0;
 
3477
+  unsigned b = (a * 64 & 192) | 63U;
 
3478
+  return 0;
 
3479
+}
 
3480
Index: gcc/testsuite/gcc.dg/torture/pr61452.c
 
3481
===================================================================
 
3482
--- a/src/gcc/testsuite/gcc.dg/torture/pr61452.c        (.../tags/gcc_4_8_3_release)
 
3483
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61452.c        (.../branches/gcc-4_8-branch)
 
3484
@@ -0,0 +1,31 @@
 
3485
+/* { dg-do run } */
 
3486
+
 
3487
+int a, b;
 
3488
+short c, d;
 
3489
+char e, f;
 
3490
+
 
3491
+int
 
3492
+fn1 (int p1, char p2)
 
3493
+{
 
3494
+  return p1 || p2 ? 0 : p2;
 
3495
+}
 
3496
+
 
3497
+void
 
3498
+fn2 ()
 
3499
+{
 
3500
+  for (; a;)
 
3501
+    {
 
3502
+      int g;
 
3503
+      g = c = e;
 
3504
+      for (; a;)
 
3505
+       b = fn1 (g = d = e, g);
 
3506
+      f = g; 
 
3507
+    }
 
3508
+}
 
3509
+
 
3510
+int
 
3511
+main ()
 
3512
+{
 
3513
+  fn2 (); 
 
3514
+  return 0;
 
3515
+}
 
3516
Index: gcc/testsuite/gcc.dg/torture/pr61383-1.c
 
3517
===================================================================
 
3518
--- a/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c      (.../tags/gcc_4_8_3_release)
 
3519
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c      (.../branches/gcc-4_8-branch)
 
3520
@@ -0,0 +1,35 @@
 
3521
+/* { dg-do run } */
 
3522
+
 
3523
+int a, b = 1, c, d, e, f, g;
 
3524
+
 
3525
+int
 
3526
+fn1 ()
 
3527
+{
 
3528
+  int h;
 
3529
+  for (;;)
 
3530
+    {
 
3531
+      g = b;
 
3532
+      g = g ? 0 : 1 % g;
 
3533
+      e = a + 1;
 
3534
+      for (; d < 1; d = e)
 
3535
+       {
 
3536
+         if (f == 0)
 
3537
+           h = 0;
 
3538
+         else
 
3539
+           h = 1 % f;
 
3540
+         if (f < 1)
 
3541
+           c = 0;
 
3542
+         else if (h)
 
3543
+           break;
 
3544
+       }
 
3545
+      if (b)
 
3546
+       return 0;
 
3547
+    }
 
3548
+}
 
3549
+
 
3550
+int
 
3551
+main ()
 
3552
+{
 
3553
+  fn1 ();
 
3554
+  return 0;
 
3555
+}
 
3556
Index: gcc/testsuite/gcc.dg/stack-usage-2.c
 
3557
===================================================================
 
3558
--- a/src/gcc/testsuite/gcc.dg/stack-usage-2.c  (.../tags/gcc_4_8_3_release)
 
3559
+++ b/src/gcc/testsuite/gcc.dg/stack-usage-2.c  (.../branches/gcc-4_8-branch)
 
3560
@@ -1,21 +1,21 @@
 
3561
 /* { dg-do compile } */
 
3562
 /* { dg-options "-Wstack-usage=512" } */
 
3563
 
 
3564
-int foo1 (void)
 
3565
+int foo1 (void)  /* { dg-bogus "stack usage" } */
 
3566
 {
 
3567
   char arr[16];
 
3568
   arr[0] = 1;
 
3569
   return 0;
 
3570
-} /* { dg-bogus "stack usage" } */
 
3571
+}
 
3572
 
 
3573
-int foo2 (void)
 
3574
+int foo2 (void)  /* { dg-warning "stack usage is \[0-9\]* bytes" } */
 
3575
 {
 
3576
   char arr[1024];
 
3577
   arr[0] = 1;
 
3578
   return 0;
 
3579
-} /* { dg-warning "stack usage is \[0-9\]* bytes" } */
 
3580
+}
 
3581
 
 
3582
-int foo3 (void)
 
3583
+int foo3 (void) /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
 
3584
 {
 
3585
   char arr[1024] __attribute__((aligned (512)));
 
3586
   arr[0] = 1;
 
3587
@@ -22,12 +22,11 @@
 
3588
   /* Force dynamic realignment of argument pointer.  */
 
3589
   __builtin_apply ((void (*)()) foo2, 0, 0);
 
3590
   return 0;
 
3591
+}
 
3592
 
 
3593
-} /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
 
3594
-
 
3595
-int foo4 (int n)
 
3596
+int foo4 (int n) /* { dg-warning "stack usage might be unbounded" } */
 
3597
 {
 
3598
   char arr[n];
 
3599
   arr[0] = 1;
 
3600
   return 0;
 
3601
-} /* { dg-warning "stack usage might be unbounded" } */
 
3602
+}
 
3603
Index: gcc/testsuite/gcc.dg/ipa/pr61986.c
 
3604
===================================================================
 
3605
--- a/src/gcc/testsuite/gcc.dg/ipa/pr61986.c    (.../tags/gcc_4_8_3_release)
 
3606
+++ b/src/gcc/testsuite/gcc.dg/ipa/pr61986.c    (.../branches/gcc-4_8-branch)
 
3607
@@ -0,0 +1,48 @@
 
3608
+/* { dg-do compile } */
 
3609
+/* { dg-options "-O3" } */
 
3610
+
 
3611
+int a, b, c;
 
3612
+
 
3613
+struct S
 
3614
+{
 
3615
+  int f0;
 
3616
+  int f1;
 
3617
+} d;
 
3618
+
 
3619
+static int fn2 (struct S);
 
3620
+void fn3 (struct S);
 
3621
+
 
3622
+void
 
3623
+fn1 (struct S p)
 
3624
+{
 
3625
+  struct S h = { 0, 0 };
 
3626
+  fn3 (p);
 
3627
+  fn2 (h);
 
3628
+}
 
3629
+
 
3630
+int
 
3631
+fn2 (struct S p)
 
3632
+{
 
3633
+  struct S j = { 0, 0 };
 
3634
+  fn3 (p);
 
3635
+  fn2 (j);
 
3636
+  return 0;
 
3637
+}
 
3638
+
 
3639
+void
 
3640
+fn3 (struct S p)
 
3641
+{
 
3642
+  for (; b; a++)
 
3643
+    c = p.f0;
 
3644
+  fn1 (d);
 
3645
+}
 
3646
+
 
3647
+void
 
3648
+fn4 ()
 
3649
+{
 
3650
+  for (;;)
 
3651
+    {
 
3652
+      struct S f = { 0, 0 };
 
3653
+      fn1 (f);
 
3654
+    }
 
3655
+}
 
3656
Index: gcc/testsuite/gcc.dg/pr62030.c
 
3657
===================================================================
 
3658
--- a/src/gcc/testsuite/gcc.dg/pr62030.c        (.../tags/gcc_4_8_3_release)
 
3659
+++ b/src/gcc/testsuite/gcc.dg/pr62030.c        (.../branches/gcc-4_8-branch)
 
3660
@@ -0,0 +1,50 @@
 
3661
+/* { dg-do run } */
 
3662
+/* { dg-options "-O2" } */
 
3663
+
 
3664
+extern void abort (void);
 
3665
+
 
3666
+struct node
 
3667
+{
 
3668
+  struct node *next;
 
3669
+  struct node *prev;
 
3670
+};
 
3671
+
 
3672
+struct node node;
 
3673
+
 
3674
+struct head
 
3675
+{
 
3676
+  struct node *first;
 
3677
+};
 
3678
+
 
3679
+struct head heads[5];
 
3680
+
 
3681
+int k = 2;
 
3682
+
 
3683
+struct head *head = &heads[2];
 
3684
+
 
3685
+static int __attribute__((noinline))
 
3686
+foo (void)
 
3687
+{
 
3688
+  node.prev = (void *)head;
 
3689
+  head->first = &node;
 
3690
+
 
3691
+  struct node *n = head->first;
 
3692
+  struct head *h = &heads[k];
 
3693
+  struct node *next = n->next;
 
3694
+
 
3695
+  if (n->prev == (void *)h)
 
3696
+    h->first = next;
 
3697
+  else
 
3698
+    n->prev->next = next;
 
3699
+
 
3700
+  n->next = h->first;
 
3701
+  return n->next == &node;
 
3702
+}
 
3703
+
 
3704
+int
 
3705
+main (void)
 
3706
+{
 
3707
+  if (foo ())
 
3708
+    abort ();
 
3709
+  return 0;
 
3710
+}
 
3711
Index: gcc/testsuite/gcc.dg/vect/pr63189.c
 
3712
===================================================================
 
3713
--- a/src/gcc/testsuite/gcc.dg/vect/pr63189.c   (.../tags/gcc_4_8_3_release)
 
3714
+++ b/src/gcc/testsuite/gcc.dg/vect/pr63189.c   (.../branches/gcc-4_8-branch)
 
3715
@@ -0,0 +1,26 @@
 
3716
+/* PR tree-optimization/63189 */
 
3717
+/* { dg-do run } */
 
3718
+
 
3719
+#include "tree-vect.h"
 
3720
+
 
3721
+short int d[16] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
 
3722
+
 
3723
+__attribute__((noinline, noclone)) void
 
3724
+foo (void)
 
3725
+{
 
3726
+  int j, s = 0;
 
3727
+  for (j = 0; j < 8; j++)
 
3728
+    s += d[j] * j;
 
3729
+  if (s != 7)
 
3730
+    abort ();
 
3731
+}
 
3732
+
 
3733
+int
 
3734
+main ()
 
3735
+{
 
3736
+  check_vect ();
 
3737
+  foo ();
 
3738
+  return 0;
 
3739
+}
 
3740
+
 
3741
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
3742
Index: gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c
 
3743
===================================================================
 
3744
--- a/src/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c       (.../tags/gcc_4_8_3_release)
 
3745
+++ b/src/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c       (.../branches/gcc-4_8-branch)
 
3746
@@ -0,0 +1,73 @@
 
3747
+/* { dg-require-effective-target vect_int } */
 
3748
+
 
3749
+#include <stdarg.h>
 
3750
+#include "tree-vect.h"
 
3751
+
 
3752
+#define N 64
 
3753
+#define DOT 43680
 
3754
+
 
3755
+signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
 
3756
+signed int   Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
 
3757
+
 
3758
+/* (short, int)->int->int dot product.
 
3759
+   Not detected as a dot-product pattern.  */
 
3760
+
 
3761
+__attribute__ ((noinline)) int
 
3762
+foo (int len)
 
3763
+{
 
3764
+  int i;
 
3765
+  int result = 0;
 
3766
+
 
3767
+  for (i = 0; i < len; i++)
 
3768
+    {
 
3769
+      result += (X[i] * Y[i]);
 
3770
+    }
 
3771
+  return result;
 
3772
+}
 
3773
+
 
3774
+
 
3775
+/* (int, short)->int->int dot product.
 
3776
+   Not detected as a dot-product pattern.  */
 
3777
+
 
3778
+__attribute__ ((noinline)) int
 
3779
+bar (int len)
 
3780
+{
 
3781
+  int i;
 
3782
+  int result = 0;
 
3783
+
 
3784
+  for (i = 0; i < len; i++)
 
3785
+    {
 
3786
+      result += (Y[i] * X[i]);
 
3787
+    }
 
3788
+  return result;
 
3789
+}
 
3790
+
 
3791
+int
 
3792
+main (void)
 
3793
+{
 
3794
+  int i;
 
3795
+  int dot;
 
3796
+
 
3797
+  check_vect ();
 
3798
+
 
3799
+  for (i = 0; i < N; i++)
 
3800
+    {
 
3801
+      X[i] = i;
 
3802
+      Y[i] = N - i;
 
3803
+      __asm__ volatile ("");
 
3804
+    }
 
3805
+
 
3806
+  dot = foo (N);
 
3807
+  if (dot != DOT)
 
3808
+    abort ();
 
3809
+
 
3810
+  dot = bar (N);
 
3811
+  if (dot != DOT)
 
3812
+    abort ();
 
3813
+
 
3814
+  return 0;
 
3815
+}
 
3816
+
 
3817
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
 
3818
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
3819
+
 
3820
Index: gcc/testsuite/gcc.dg/vect/pr62073.c
 
3821
===================================================================
 
3822
--- a/src/gcc/testsuite/gcc.dg/vect/pr62073.c   (.../tags/gcc_4_8_3_release)
 
3823
+++ b/src/gcc/testsuite/gcc.dg/vect/pr62073.c   (.../branches/gcc-4_8-branch)
 
3824
@@ -0,0 +1,40 @@
 
3825
+/* { dg-do compile } */
 
3826
+/* { dg-additional-options "-O1" } */
 
3827
+
 
3828
+struct S0
 
3829
+{
 
3830
+  int f7;
 
3831
+};
 
3832
+struct S0 g_50;
 
3833
+int g_70;
 
3834
+int g_76;
 
3835
+
 
3836
+int foo (long long p_56, int * p_57)
 
3837
+{
 
3838
+  int *l_77;
 
3839
+  int l_101;
 
3840
+
 
3841
+  for (; g_70;)
 
3842
+    {
 
3843
+      int **l_78 = &l_77;
 
3844
+      if (g_50.f7)
 
3845
+       continue;
 
3846
+      *l_78 = 0;
 
3847
+    }
 
3848
+  for (g_76 = 1; g_76 >= 0; g_76--)
 
3849
+    {
 
3850
+      int *l_90;
 
3851
+      for (l_101 = 4; l_101 >= 0; l_101--)
 
3852
+       if (l_101)
 
3853
+         *l_90 = 0;
 
3854
+       else
 
3855
+         {
 
3856
+           int **l_113 = &l_77;
 
3857
+           *l_113 = p_57;
 
3858
+         }
 
3859
+    }
 
3860
+
 
3861
+  return *l_77;
 
3862
+}
 
3863
+
 
3864
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
3865
Index: gcc/testsuite/gcc.dg/vect/pr60196-1.c
 
3866
===================================================================
 
3867
--- a/src/gcc/testsuite/gcc.dg/vect/pr60196-1.c (.../tags/gcc_4_8_3_release)
 
3868
+++ b/src/gcc/testsuite/gcc.dg/vect/pr60196-1.c (.../branches/gcc-4_8-branch)
 
3869
@@ -0,0 +1,34 @@
 
3870
+/* PR tree-optimization/63189 */
 
3871
+/* { dg-additional-options "-fwrapv" } */
 
3872
+/* { dg-do run } */
 
3873
+
 
3874
+#include "tree-vect.h"
 
3875
+
 
3876
+__attribute__((noinline, noclone)) static int
 
3877
+bar (const short *a, int len)
 
3878
+{
 
3879
+  int x;
 
3880
+  int x1 = 0;
 
3881
+
 
3882
+  for (x = 0; x < len; x++)
 
3883
+    x1 += x * a[x];
 
3884
+  return x1;
 
3885
+}
 
3886
+
 
3887
+__attribute__((noinline, noclone)) void
 
3888
+foo (void)
 
3889
+{
 
3890
+  short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 };
 
3891
+  if (bar (stuff, 9) != 36)
 
3892
+    abort ();
 
3893
+}
 
3894
+
 
3895
+int
 
3896
+main ()
 
3897
+{
 
3898
+  check_vect ();
 
3899
+  foo ();
 
3900
+  return 0;
 
3901
+}
 
3902
+
 
3903
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
3904
Index: gcc/testsuite/gcc.dg/vect/pr62075.c
 
3905
===================================================================
 
3906
--- a/src/gcc/testsuite/gcc.dg/vect/pr62075.c   (.../tags/gcc_4_8_3_release)
 
3907
+++ b/src/gcc/testsuite/gcc.dg/vect/pr62075.c   (.../branches/gcc-4_8-branch)
 
3908
@@ -0,0 +1,22 @@
 
3909
+/* { dg-do compile } */
 
3910
+
 
3911
+int a[16][2];
 
3912
+struct A
 
3913
+{
 
3914
+  int b[16][2];
 
3915
+  int c[16][1];
 
3916
+};
 
3917
+
 
3918
+void
 
3919
+foo (struct A *x)
 
3920
+{
 
3921
+  int i;
 
3922
+  for (i = 0; i < 16; ++i)
 
3923
+    {
 
3924
+      x->b[i][0] = a[i][0];
 
3925
+      x->c[i][0] = 0 != a[i][0];
 
3926
+      x->b[i][1] = a[i][1];
 
3927
+    }
 
3928
+}
 
3929
+
 
3930
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
3931
Index: gcc/testsuite/gcc.dg/vect/pr60196-2.c
 
3932
===================================================================
 
3933
--- a/src/gcc/testsuite/gcc.dg/vect/pr60196-2.c (.../tags/gcc_4_8_3_release)
 
3934
+++ b/src/gcc/testsuite/gcc.dg/vect/pr60196-2.c (.../branches/gcc-4_8-branch)
 
3935
@@ -0,0 +1,33 @@
 
3936
+/* PR tree-optimization/63189 */
 
3937
+/* { dg-do run } */
 
3938
+
 
3939
+#include "tree-vect.h"
 
3940
+
 
3941
+static const short a[8] = {1, 1, 1, 1, 1, 1, 1, 1 };
 
3942
+static const unsigned char b[8] = {0, 0, 0, 0, 0, 0, 0, 0 };
 
3943
+
 
3944
+__attribute__((noinline, noclone)) static int
 
3945
+bar (void)
 
3946
+{
 
3947
+  int sum = 0, i;
 
3948
+  for (i = 0; i < 8; ++i)
 
3949
+    sum += a[i] * b[i];
 
3950
+  return sum;
 
3951
+}
 
3952
+
 
3953
+__attribute__((noinline, noclone)) void
 
3954
+foo (void)
 
3955
+{
 
3956
+  if (bar () != 0)
 
3957
+    abort ();
 
3958
+}
 
3959
+
 
3960
+int
 
3961
+main ()
 
3962
+{
 
3963
+  check_vect ();
 
3964
+  foo ();
 
3965
+  return 0;
 
3966
+}
 
3967
+
 
3968
+/* { dg-final { cleanup-tree-dump "vect" } } */
 
3969
Index: gcc/testsuite/ChangeLog
 
3970
===================================================================
 
3971
--- a/src/gcc/testsuite/ChangeLog       (.../tags/gcc_4_8_3_release)
 
3972
+++ b/src/gcc/testsuite/ChangeLog       (.../branches/gcc-4_8-branch)
 
3973
@@ -1,3 +1,335 @@
 
3974
+2014-09-09  Richard Biener  <rguenther@suse.de>
 
3975
+
 
3976
+       Backport from mainline
 
3977
+       2014-06-11  Richard Biener  <rguenther@suse.de>
 
3978
+
 
3979
+       PR tree-optimization/61452
 
3980
+       * gcc.dg/torture/pr61452.c: New testcase.
 
3981
+
 
3982
+2014-09-09  Richard Biener  <rguenther@suse.de>
 
3983
+
 
3984
+       Backport from mainline
 
3985
+       2014-05-05  Richard Biener  <rguenther@suse.de>
 
3986
+
 
3987
+       PR middle-end/61010
 
3988
+       * gcc.dg/torture/pr61010.c: New testcase.
 
3989
+
 
3990
+       2014-05-28  Richard Biener  <rguenther@suse.de>
 
3991
+
 
3992
+       PR middle-end/61045
 
3993
+       * gcc.dg/pr61045.c: New testcase.
 
3994
+
 
3995
+       2014-08-11  Richard Biener  <rguenther@suse.de>
 
3996
+
 
3997
+       PR tree-optimization/62075
 
3998
+       * gcc.dg/vect/pr62075.c: New testcase.
 
3999
+
 
4000
+2014-09-08  Jakub Jelinek  <jakub@redhat.com>
 
4001
+
 
4002
+       PR tree-optimization/60196
 
4003
+       PR tree-optimization/63189
 
4004
+       * gcc.dg/vect/pr63189.c: New test.
 
4005
+       * gcc.dg/vect/pr60196-1.c: New test.
 
4006
+       * gcc.dg/vect/pr60196-2.c: New test.
 
4007
+
 
4008
+       Backported from mainline
 
4009
+       2013-09-17  Cong Hou  <congh@google.com>
 
4010
+
 
4011
+       * gcc.dg/vect/vect-reduc-dot-s16c.c: Add a test case with dot product 
 
4012
+       on two arrays with short and int types. This should not be recognized
 
4013
+       as a dot product pattern.
 
4014
+
 
4015
+2014-09-08  Jakub Jelinek  <jakub@redhat.com>
 
4016
+
 
4017
+       Backported from mainline
 
4018
+       2014-08-06  Vladimir Makarov  <vmakarov@redhat.com>
 
4019
+
 
4020
+       PR debug/61923
 
4021
+       * gcc.target/i386/pr61923.c: New test.
 
4022
+
 
4023
+2014-09-06  John David Anglin  <danglin@gcc.gnu.org>
 
4024
+
 
4025
+       PR testsuite/56194
 
4026
+       * g++.dg/init/const9.C: Skip scan-assembler-not "rodata" on hppa*-*-*.
 
4027
+
 
4028
+2014-09-03  Marek Polacek  <polacek@redhat.com>
 
4029
+
 
4030
+       Backport from mainline
 
4031
+       2014-09-02  Marek Polacek  <polacek@redhat.com>
 
4032
+
 
4033
+       PR fortran/62270
 
4034
+       * gfortran.dg/pointer_intent_7.f90: Adjust dg-error.
 
4035
+
 
4036
+2014-09-03  Martin Jambor  <mjambor@suse.cz>
 
4037
+
 
4038
+       PR ipa/62015
 
4039
+       * g++.dg/ipa/pr62015.C: New test.
 
4040
+
 
4041
+2014-09-03  Martin Jambor  <mjambor@suse.cz>
 
4042
+
 
4043
+       PR ipa/61986
 
4044
+       * gcc.dg/ipa/pr61986.c: New test.
 
4045
+
 
4046
+2014-08-26  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
4047
+
 
4048
+       * gfortran.dg/bessel_7.f90: Bump allowed precision to avoid
 
4049
+       failure on s390*-*-linux-gnu.
 
4050
+
 
4051
+2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
 
4052
+
 
4053
+       Backport from mainline
 
4054
+       2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
 
4055
+
 
4056
+       PR target/61996
 
4057
+       * gcc.target/sh/pr61996.c: New.
 
4058
+
 
4059
+2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
4060
+
 
4061
+       Backport from trunk
 
4062
+       PR fortran/62214
 
4063
+       * gfortran.dg/array_assignment_5.f90:  New test.
 
4064
+
 
4065
+2014-08-15  Tom de Vries  <tom@codesourcery.com>
 
4066
+
 
4067
+       Backport from mainline:
 
4068
+       2014-08-14  Tom de Vries  <tom@codesourcery.com>
 
4069
+
 
4070
+       PR rtl-optimization/62004
 
4071
+       PR rtl-optimization/62030
 
4072
+       * gcc.dg/pr62004.c: New test.
 
4073
+       * gcc.dg/pr62030.c: Same.
 
4074
+       * gcc.target/mips/pr62030-octeon.c: Same.
 
4075
+
 
4076
+2014-08-13  Felix Yang  <fei.yang0953@gmail.com>
 
4077
+
 
4078
+       PR tree-optimization/62073
 
4079
+       * gcc.dg/vect/pr62073.c: New test.
 
4080
+
 
4081
+2014-08-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4082
+
 
4083
+       Backport from mainline
 
4084
+       2014-08-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4085
+
 
4086
+       PR middle-end/62103
 
4087
+       * gcc.c-torture/execute/bitfld-6.c: New test.
 
4088
+
 
4089
+2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
4090
+
 
4091
+       Backport from trunk
 
4092
+       PR fortran/61999
 
4093
+       * gfortran.dg/dot_product_3.f90:  New test case.
 
4094
+
 
4095
+2014-08-07  John David Anglin  <danglin@gcc.gnu.org>
 
4096
+
 
4097
+       PR tree-optimization/60707
 
4098
+       * gfortran.dg/pr45636.f90: xfail on 32-bit hppa*-*-*.
 
4099
+
 
4100
+2014-08-06  Jakub Jelinek  <jakub@redhat.com>
 
4101
+
 
4102
+       PR rtl-optimization/61801
 
4103
+       * gcc.target/i386/pr61801.c: Rewritten.
 
4104
+
 
4105
+2014-08-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4106
+
 
4107
+       Backport from mainline
 
4108
+       2014-06-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4109
+
 
4110
+       PR tree-optimization/61375
 
4111
+       * gcc.c-torture/execute/pr61375-1.c: New test.
 
4112
+
 
4113
+2014-08-01  Richard Biener  <rguenther@suse.de>
 
4114
+
 
4115
+       PR tree-optimization/61964
 
4116
+       * gcc.dg/torture/pr61964.c: New testcase.
 
4117
+       * gcc.dg/pr51879-18.c: XFAIL.
 
4118
+
 
4119
+2014-07-28  Richard Biener  <rguenther@suse.de>
 
4120
+
 
4121
+       PR rtl-optimization/61801
 
4122
+       * gcc.target/i386/pr61801.c: Fix testcase.
 
4123
+
 
4124
+2014-07-28  Richard Biener  <rguenther@suse.de>
 
4125
+
 
4126
+       PR rtl-optimization/61801
 
4127
+       * gcc.target/i386/pr61801.c: New testcase.
 
4128
+
 
4129
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4130
+
 
4131
+       Backport from mainline:
 
4132
+       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4133
+
 
4134
+       * gcc.target/powerpc/ppc64-abi-warn-3.c: New test.
 
4135
+
 
4136
+       * gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
 
4137
+       * gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
 
4138
+       * gcc.c-torture/execute/20050316-3.x: New file.  Add -Wno-psabi.
 
4139
+       * gcc.c-torture/execute/pr23135.x: Likewise.
 
4140
+
 
4141
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4142
+
 
4143
+       Backport from mainline:
 
4144
+       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4145
+
 
4146
+       * gcc.target/powerpc/ppc64-abi-warn-2.c: New test.
 
4147
+
 
4148
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4149
+
 
4150
+       Backport from mainline:
 
4151
+       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4152
+
 
4153
+       * gcc.target/powerpc/ppc64-abi-warn-1.c: New test.
 
4154
+
 
4155
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4156
+
 
4157
+       Backport from mainline:
 
4158
+       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
4159
+
 
4160
+       * g++.dg/compat/struct-layout-1.exp: Load g++-dg.exp.
 
4161
+
 
4162
+2014-07-19  Eric Botcazou  <ebotcazou@adacore.com>
 
4163
+
 
4164
+       * gcc.dg/stack-usage-2.c: Adjust.
 
4165
+
 
4166
+2014-07-19  Paul Thomas  <pault@gcc.gnu.org>
 
4167
+
 
4168
+       Backport from trunk.
 
4169
+       PR fortran/61780
 
4170
+       * gfortran.dg/dependency_44.f90 : New test
 
4171
+
 
4172
+2014-07-10  Eric Botcazou  <ebotcazou@adacore.com>
 
4173
+
 
4174
+       * gnat.dg/opt39.adb: New test.
 
4175
+
 
4176
+2014-07-08  Paul Thomas  <pault@gcc.gnu.org>
 
4177
+
 
4178
+       PR fortran/61459
 
4179
+       PR fortran/58883
 
4180
+       * gfortran.dg/allocatable_function_8.f90 : New test
 
4181
+
 
4182
+2014-07-04  Jakub Jelinek  <jakub@redhat.com>
 
4183
+
 
4184
+       PR tree-optimization/61684
 
4185
+       * gcc.c-torture/compile/pr61684.c: New test.
 
4186
+
 
4187
+2014-07-02  Jakub Jelinek  <jakub@redhat.com>
 
4188
+           Fritz Reese  <Reese-Fritz@zai.com>
 
4189
+
 
4190
+       * gfortran.dg/oldstyle_5.f: New test.
 
4191
+
 
4192
+2014-06-30  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4193
+
 
4194
+       Backport from mainline
 
4195
+       2014-06-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
4196
+
 
4197
+       PR tree-optimization/61306
 
4198
+       * gcc.c-torture/execute/pr61306-1.c: New test.
 
4199
+       * gcc.c-torture/execute/pr61306-2.c: Likewise.
 
4200
+       * gcc.c-torture/execute/pr61306-3.c: Likewise.
 
4201
+
 
4202
+2014-06-27  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
4203
+
 
4204
+       * gfortran.dg/nint_2.f90: Don't XFAIL for powerpc64le-*-linux*.
 
4205
+
 
4206
+2014-06-27  Uros Bizjak  <ubizjak@gmail.com>
 
4207
+
 
4208
+       Backport from mainline
 
4209
+       2014-06-26  Uros Bizjak  <ubizjak@gmail.com>
 
4210
+
 
4211
+       PR target/61586
 
4212
+       * gcc.target/alpha/pr61586.c: New test.
 
4213
+
 
4214
+2014-06-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
4215
+
 
4216
+       * gfortran.dg/default_format_denormal_2.f90:  Remove xfail for
 
4217
+       powerpc*-*-linux*.
 
4218
+
 
4219
+2014-06-18  Uros Bizjak  <ubizjak@gmail.com>
 
4220
+
 
4221
+       Backport from mainline
 
4222
+       2014-06-13  Ilya Enkovich  <ilya.enkovich@intel.com>
 
4223
+
 
4224
+       PR rtl-optimization/61094
 
4225
+       PR rtl-optimization/61446
 
4226
+       * gcc.target/i386/pr61446.c : New.
 
4227
+
 
4228
+       Backport from mainline
 
4229
+       2014-06-06  Uros Bizjak  <ubizjak@gmail.com>
 
4230
+
 
4231
+       PR target/61423
 
4232
+       * gcc.target/i386/pr61423.c: New test.
 
4233
+
 
4234
+2014-06-17  Yufeng Zhang  <yufeng.zhang@arm.com>
 
4235
+
 
4236
+       Backport from mainline
 
4237
+
 
4238
+       PR target/61483
 
4239
+       * gcc.target/aarch64/aapcs64/type-def.h (struct hfa_fx2_t): New type.
 
4240
+       * gcc.target/aarch64/aapcs64/va_arg-13.c: New test.
 
4241
+       * gcc.target/aarch64/aapcs64/va_arg-14.c: Ditto.
 
4242
+       * gcc.target/aarch64/aapcs64/va_arg-15.c: Ditto.
 
4243
+
 
4244
+2014-06-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
4245
+
 
4246
+       Backport from trunk.
 
4247
+       PR fortran/45187
 
4248
+       * gfortran.dg/cray_pointers_10.f90: New file.
 
4249
+
 
4250
+2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
 
4251
+
 
4252
+       Backport from mainline
 
4253
+
 
4254
+       2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
 
4255
+       PR target/61415
 
4256
+       * lib/target-supports.exp (check_effective_target_longdouble128): New.
 
4257
+       * gcc.target/powerpc/pack02.c: Use it.
 
4258
+       * gcc.target/powerpc/tfmode_off.c: Likewise.
 
4259
+
 
4260
+2014-06-12  Georg-Johann Lay  <avr@gjlay.de>
 
4261
+
 
4262
+       Backport from 2014-06-12 trunk r211491
 
4263
+
 
4264
+       PR target/61443
 
4265
+       * gcc.target/avr/torture/pr61443.c: New test.
 
4266
+
 
4267
+2014-06-04  Richard Biener  <rguenther@suse.de>
 
4268
+
 
4269
+       PR tree-optimization/61383
 
4270
+       * gcc.dg/torture/pr61383-1.c: New testcase.
 
4271
+
 
4272
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
4273
+
 
4274
+       Backport from mainline
 
4275
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
4276
+
 
4277
+       PR rtl-optimization/60866
 
4278
+       * gcc.dg/pr60866.c: New test.
 
4279
+
 
4280
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
4281
+
 
4282
+       Backport from mainline
 
4283
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
4284
+
 
4285
+       PR rtl-optimization/60901
 
4286
+       * gcc.target/i386/pr60901.c: New test.
 
4287
+
 
4288
+2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
 
4289
+
 
4290
+       Backport from mainline
 
4291
+       2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
4292
+
 
4293
+       * gnat.dg/overflow_fixed.adb: New test.
 
4294
+
 
4295
+2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
4296
+
 
4297
+       * gnat.dg/aliasing1.adb (dg-final): Robustify pattern matching.
 
4298
+
 
4299
+2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
4300
+
 
4301
+       Backport from mainline
 
4302
+       2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
4303
+
 
4304
+       * gcc.target/powerpc/htm-ttest.c: New test.
 
4305
+
 
4306
 2014-05-22  Release Manager
 
4307
 
 
4308
        * GCC 4.8.3 released.
 
4309
Index: gcc/testsuite/g++.dg/expr/cond12.C
 
4310
===================================================================
 
4311
--- a/src/gcc/testsuite/g++.dg/expr/cond12.C    (.../tags/gcc_4_8_3_release)
 
4312
+++ b/src/gcc/testsuite/g++.dg/expr/cond12.C    (.../branches/gcc-4_8-branch)
 
4313
@@ -0,0 +1,12 @@
 
4314
+// PR c++/58714
 
4315
+// { dg-do run }
 
4316
+
 
4317
+struct X {
 
4318
+    X& operator=(const X&){}
 
4319
+    X& operator=(X&){__builtin_abort();}
 
4320
+};
 
4321
+
 
4322
+int main(int argv,char**) {
 
4323
+  X a, b;
 
4324
+  ((argv > 2) ? a : b) = X();
 
4325
+}
 
4326
Index: gcc/testsuite/g++.dg/init/const9.C
 
4327
===================================================================
 
4328
--- a/src/gcc/testsuite/g++.dg/init/const9.C    (.../tags/gcc_4_8_3_release)
 
4329
+++ b/src/gcc/testsuite/g++.dg/init/const9.C    (.../branches/gcc-4_8-branch)
 
4330
@@ -1,5 +1,5 @@
 
4331
 // PR c++/55893
 
4332
-// { dg-final { scan-assembler-not "rodata" } }
 
4333
+// { dg-final { scan-assembler-not "rodata" { target { ! hppa*-*-* } } } }
 
4334
 
 
4335
 struct foo
 
4336
 {
 
4337
Index: gcc/testsuite/g++.dg/parse/typename7.C
 
4338
===================================================================
 
4339
--- a/src/gcc/testsuite/g++.dg/parse/typename7.C        (.../tags/gcc_4_8_3_release)
 
4340
+++ b/src/gcc/testsuite/g++.dg/parse/typename7.C        (.../branches/gcc-4_8-branch)
 
4341
@@ -7,10 +7,9 @@
 
4342
 
 
4343
 struct A
 
4344
 {
 
4345
-  template<typename>   void foo(int); // { dg-message "note" }
 
4346
-  template<typename T> void bar(T t) { // { dg-message "note" }
 
4347
+  template<typename>   void foo(int);
 
4348
+  template<typename T> void bar(T t) {
 
4349
     this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
 
4350
-  // { dg-message "candidate" "candidate note" { target *-*-* } 12 }
 
4351
   template<typename T> void bad(T t) {
 
4352
     foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
 
4353
 };
 
4354
@@ -20,7 +19,6 @@
 
4355
 {
 
4356
   void bar(T t) {
 
4357
     A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
 
4358
-  // { dg-message "candidate" "candidate note" { target *-*-* } 22 }
 
4359
   void bad(T t) {
 
4360
     B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
 
4361
 };
 
4362
Index: gcc/testsuite/g++.dg/parse/parameter-declaration-2.C
 
4363
===================================================================
 
4364
--- a/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C  (.../tags/gcc_4_8_3_release)
 
4365
+++ b/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C  (.../branches/gcc-4_8-branch)
 
4366
@@ -1,2 +1,2 @@
 
4367
-void f (int i, int p[i]); // { dg-error "use of parameter .i. outside function body" }
 
4368
+void f (int i, int p[i]); // { dg-error "use of parameter.*outside function body" }
 
4369
 // { dg-prune-output "array bound" }
 
4370
Index: gcc/testsuite/g++.dg/parse/ambig7.C
 
4371
===================================================================
 
4372
--- a/src/gcc/testsuite/g++.dg/parse/ambig7.C   (.../tags/gcc_4_8_3_release)
 
4373
+++ b/src/gcc/testsuite/g++.dg/parse/ambig7.C   (.../branches/gcc-4_8-branch)
 
4374
@@ -0,0 +1,16 @@
 
4375
+// PR c++/60361
 
4376
+
 
4377
+struct Helper
 
4378
+{
 
4379
+  Helper(int a, void (*pfunc)());
 
4380
+};
 
4381
+
 
4382
+template <int I> void function();
 
4383
+
 
4384
+const int A = 1;
 
4385
+const int B = 2;
 
4386
+
 
4387
+Helper testOk(A, function<A>);
 
4388
+Helper testOk2(int(A), function<B>);
 
4389
+Helper testOk3((int(A)), function<A>);
 
4390
+Helper testFail(int(A), function<A>);
 
4391
Index: gcc/testsuite/g++.dg/compat/struct-layout-1.exp
 
4392
===================================================================
 
4393
--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp       (.../tags/gcc_4_8_3_release)
 
4394
+++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp       (.../branches/gcc-4_8-branch)
 
4395
@@ -89,6 +89,9 @@
 
4396
 # This must be done after the compat-use-*-compiler definitions.
 
4397
 load_lib compat.exp
 
4398
 
 
4399
+# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
 
4400
+load_lib g++-dg.exp
 
4401
+
 
4402
 g++_init
 
4403
 
 
4404
 # Save variables for the C++ compiler under test, which each test will
 
4405
Index: gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C
 
4406
===================================================================
 
4407
--- a/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../tags/gcc_4_8_3_release)
 
4408
+++ b/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../branches/gcc-4_8-branch)
 
4409
@@ -0,0 +1,28 @@
 
4410
+// PR c++/61959
 
4411
+// { dg-do compile { target c++11 } }
 
4412
+
 
4413
+template <class Coord> struct BasePoint
 
4414
+{
 
4415
+  Coord x, y;
 
4416
+  constexpr BasePoint (Coord, Coord) : x (0), y (0) {}
 
4417
+};
 
4418
+template <class T> struct BaseCoord
 
4419
+{
 
4420
+  int value;
 
4421
+  constexpr BaseCoord (T) : value (1) {}
 
4422
+};
 
4423
+template <class units> struct IntCoordTyped : BaseCoord<int>, units
 
4424
+{
 
4425
+  typedef BaseCoord Super;
 
4426
+  constexpr IntCoordTyped (int) : Super (0) {}
 
4427
+};
 
4428
+template <class units>
 
4429
+struct IntPointTyped : BasePoint<IntCoordTyped<units> >, units
 
4430
+{
 
4431
+  typedef BasePoint<IntCoordTyped<units> > Super;
 
4432
+  constexpr IntPointTyped (int, int) : Super (0, 0) {}
 
4433
+};
 
4434
+struct A
 
4435
+{
 
4436
+};
 
4437
+IntPointTyped<A> a (0, 0);
 
4438
Index: gcc/testsuite/g++.dg/cpp0x/variadic158.C
 
4439
===================================================================
 
4440
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C      (.../tags/gcc_4_8_3_release)
 
4441
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C      (.../branches/gcc-4_8-branch)
 
4442
@@ -0,0 +1,24 @@
 
4443
+// PR c++/61134
 
4444
+// { dg-do compile { target c++11 } }
 
4445
+
 
4446
+struct Base { };
 
4447
+
 
4448
+template <typename>
 
4449
+struct Fixed {
 
4450
+  typedef const char* name;
 
4451
+};
 
4452
+
 
4453
+template <typename VT, typename... Fields>
 
4454
+void New(const char* name,
 
4455
+         typename Fixed<Fields>::name... field_names);
 
4456
+
 
4457
+template <typename VT, typename... Fields>
 
4458
+void CreateMetric(const char* name,
 
4459
+                  typename Fixed<Fields>::name... field_names,
 
4460
+                  const Base&) { }
 
4461
+
 
4462
+
 
4463
+void Fn()
 
4464
+{
 
4465
+  CreateMetric<int, const char*>("abcd", "def", Base());
 
4466
+}
 
4467
Index: gcc/testsuite/g++.dg/cpp0x/variadic160.C
 
4468
===================================================================
 
4469
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C      (.../tags/gcc_4_8_3_release)
 
4470
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C      (.../branches/gcc-4_8-branch)
 
4471
@@ -0,0 +1,49 @@
 
4472
+// PR c++/61539
 
4473
+// { dg-do compile { target c++11 } }
 
4474
+
 
4475
+template <typename _CharT> class A;
 
4476
+template <typename> class B;
 
4477
+template <class charT> class C;
 
4478
+template <> class C<char>
 
4479
+{
 
4480
+  virtual void xparse (int &, const B<A<char> > &) const;
 
4481
+};
 
4482
+template <class T, class charT = char> class G : C<charT>
 
4483
+{
 
4484
+public:
 
4485
+  G (void *) {}
 
4486
+  void default_value (const T &);
 
4487
+  void xparse (int &, const B<A<charT> > &) const;
 
4488
+};
 
4489
+template <class T, class charT>
 
4490
+void validate (int &, const B<A<charT> > &, T *, int);
 
4491
+template <class T, class charT>
 
4492
+void G<T, charT>::xparse (int &p1, const B<A<charT> > &p2) const
 
4493
+{
 
4494
+  validate (p1, p2, (T *)0, 0);
 
4495
+}
 
4496
+template <class T> G<T> *value (T *) { return new G<T>(0); }
 
4497
+namespace Eigen
 
4498
+{
 
4499
+template <typename T> struct D;
 
4500
+template <typename, int, int, int = 0, int = 0, int = 0 > class F;
 
4501
+template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
 
4502
+          int _MaxCols>
 
4503
+struct D<F<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
 
4504
+{
 
4505
+  typedef _Scalar Scalar;
 
4506
+};
 
4507
+template <typename, int, int, int, int, int _MaxCols> class F
 
4508
+{
 
4509
+public:
 
4510
+  typedef typename Eigen::D<F>::Scalar Scalar;
 
4511
+  F (const Scalar &, const Scalar &, const Scalar &);
 
4512
+};
 
4513
+template <class... T>
 
4514
+void validate (int &, const B<A<char> > &, Eigen::F<T...> *);
 
4515
+}
 
4516
+int main (int, char *[])
 
4517
+{
 
4518
+  Eigen::F<double, 3, 1> a (0, 0, 0);
 
4519
+  value (&a)->default_value (Eigen::F<double, 3, 1>(0, 0, 0));
 
4520
+}
 
4521
Index: gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
 
4522
===================================================================
 
4523
--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../tags/gcc_4_8_3_release)
 
4524
+++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../branches/gcc-4_8-branch)
 
4525
@@ -0,0 +1,13 @@
 
4526
+// PR c++/58714
 
4527
+// { dg-do compile { target c++11 } }
 
4528
+
 
4529
+struct X {
 
4530
+  X& operator=(const X&) = delete;
 
4531
+  X& operator=(X&& ) = default;
 
4532
+};
 
4533
+
 
4534
+void f(bool t) {
 
4535
+  X a, b;
 
4536
+  *(t ? &a : &b) = X();
 
4537
+  (t ? a : b) = X();
 
4538
+}
 
4539
Index: gcc/testsuite/g++.dg/cpp0x/overload3.C
 
4540
===================================================================
 
4541
--- a/src/gcc/testsuite/g++.dg/cpp0x/overload3.C        (.../tags/gcc_4_8_3_release)
 
4542
+++ b/src/gcc/testsuite/g++.dg/cpp0x/overload3.C        (.../branches/gcc-4_8-branch)
 
4543
@@ -0,0 +1,17 @@
 
4544
+// PR c++/59823
 
4545
+// { dg-options "-std=c++11" }
 
4546
+
 
4547
+struct X { };
 
4548
+
 
4549
+void f(X&&);                   // { dg-message "void f" }
 
4550
+
 
4551
+struct wrap
 
4552
+{
 
4553
+  operator const X&() const;
 
4554
+};
 
4555
+
 
4556
+int main()
 
4557
+{
 
4558
+  wrap w;
 
4559
+  f(w);                                // { dg-error "lvalue" }
 
4560
+}
 
4561
Index: gcc/testsuite/g++.dg/ipa/pr62015.C
 
4562
===================================================================
 
4563
--- a/src/gcc/testsuite/g++.dg/ipa/pr62015.C    (.../tags/gcc_4_8_3_release)
 
4564
+++ b/src/gcc/testsuite/g++.dg/ipa/pr62015.C    (.../branches/gcc-4_8-branch)
 
4565
@@ -0,0 +1,55 @@
 
4566
+/* { dg-do run } */
 
4567
+/* { dg-options "-O3 -std=c++11"  } */
 
4568
+
 
4569
+
 
4570
+extern "C" int printf(const char *fmt, ...);
 
4571
+extern "C" void abort(void);
 
4572
+
 
4573
+struct Side {
 
4574
+    enum _Value { Left, Right, Invalid };
 
4575
+
 
4576
+    constexpr Side() : _value(Invalid) {}
 
4577
+    constexpr Side(_Value value) : _value(value) {}
 
4578
+    operator _Value() const { return (_Value)_value; }
 
4579
+
 
4580
+  private:
 
4581
+    char _value;
 
4582
+};
 
4583
+
 
4584
+struct A {
 
4585
+    void init();
 
4586
+    void adjust(Side side, bool final);
 
4587
+    void move(Side side);
 
4588
+};
 
4589
+
 
4590
+void A::init()
 
4591
+{
 
4592
+    adjust(Side::Invalid, false);
 
4593
+}
 
4594
+
 
4595
+static void __attribute__((noinline))
 
4596
+check (int v, int final)
 
4597
+{
 
4598
+    if (v != 0)
 
4599
+      abort();
 
4600
+}
 
4601
+
 
4602
+
 
4603
+__attribute__((noinline))
 
4604
+void A::adjust(Side side, bool final)
 
4605
+{
 
4606
+  check ((int)side, final);
 
4607
+}
 
4608
+
 
4609
+void A::move(Side side)
 
4610
+{
 
4611
+    adjust(side, false);
 
4612
+    adjust(side, true);
 
4613
+}
 
4614
+
 
4615
+int main()
 
4616
+{
 
4617
+    A t;
 
4618
+    t.move(Side::Left);
 
4619
+    return 0;
 
4620
+}
 
4621
Index: gcc/testsuite/g++.dg/template/local-fn1.C
 
4622
===================================================================
 
4623
--- a/src/gcc/testsuite/g++.dg/template/local-fn1.C     (.../tags/gcc_4_8_3_release)
 
4624
+++ b/src/gcc/testsuite/g++.dg/template/local-fn1.C     (.../branches/gcc-4_8-branch)
 
4625
@@ -0,0 +1,8 @@
 
4626
+// PR c++/60605
 
4627
+
 
4628
+template <typename T = int>
 
4629
+struct Foo {
 
4630
+    void bar() {
 
4631
+        void bug();
 
4632
+    }
 
4633
+};
 
4634
Index: gcc/testsuite/g++.dg/template/conv14.C
 
4635
===================================================================
 
4636
--- a/src/gcc/testsuite/g++.dg/template/conv14.C        (.../tags/gcc_4_8_3_release)
 
4637
+++ b/src/gcc/testsuite/g++.dg/template/conv14.C        (.../branches/gcc-4_8-branch)
 
4638
@@ -0,0 +1,30 @@
 
4639
+// PR c++/61647
 
4640
+
 
4641
+class XX;
 
4642
+
 
4643
+template<typename Container, typename Key>
 
4644
+struct Accessor;
 
4645
+
 
4646
+template<typename Container, typename Key, typename KeyStore = Key>
 
4647
+class Variant {
 
4648
+protected:
 
4649
+    KeyStore index;
 
4650
+    Container state;
 
4651
+public:
 
4652
+    Variant(Container st, const Key& i) : index(i), state(st) {}
 
4653
+
 
4654
+    template<typename T>
 
4655
+    operator T() const {
 
4656
+        return Accessor<Container, KeyStore>::template get<T>(state, index);
 
4657
+    }
 
4658
+};
 
4659
+
 
4660
+class AutoCleanVariant : public Variant<XX*, int> {
 
4661
+public:
 
4662
+    AutoCleanVariant(XX* st, int i) : Variant<XX*,int>(st,i) {}
 
4663
+
 
4664
+    template<typename T>
 
4665
+    operator T() const {
 
4666
+         return Variant<XX*, int>::operator T();
 
4667
+    }
 
4668
+};
 
4669
Index: gcc/testsuite/g++.dg/template/friend55.C
 
4670
===================================================================
 
4671
--- a/src/gcc/testsuite/g++.dg/template/friend55.C      (.../tags/gcc_4_8_3_release)
 
4672
+++ b/src/gcc/testsuite/g++.dg/template/friend55.C      (.../branches/gcc-4_8-branch)
 
4673
@@ -0,0 +1,18 @@
 
4674
+// PR c++/59956
 
4675
+
 
4676
+template <int I> struct A;
 
4677
+template <int I> class B {
 
4678
+  int i;
 
4679
+  template <int A_S> friend void A<A_S>::impl();
 
4680
+};
 
4681
+
 
4682
+B<0> b1;
 
4683
+template<int I>struct A { void impl(); };
 
4684
+B<1> b2;
 
4685
+
 
4686
+template<int I> void A<I>::impl() { ++b1.i; ++b2.i; }
 
4687
+
 
4688
+int main()
 
4689
+{
 
4690
+  A<0>().impl();
 
4691
+}
 
4692
Index: gcc/testsuite/g++.dg/template/memclass5.C
 
4693
===================================================================
 
4694
--- a/src/gcc/testsuite/g++.dg/template/memclass5.C     (.../tags/gcc_4_8_3_release)
 
4695
+++ b/src/gcc/testsuite/g++.dg/template/memclass5.C     (.../branches/gcc-4_8-branch)
 
4696
@@ -0,0 +1,26 @@
 
4697
+// PR c++/60241
 
4698
+
 
4699
+template <typename T>
 
4700
+struct x
 
4701
+{
 
4702
+    template <typename U>
 
4703
+    struct y
 
4704
+    {
 
4705
+        typedef T result2;
 
4706
+    };
 
4707
+
 
4708
+    typedef y<int> zy;
 
4709
+};
 
4710
+
 
4711
+template<>
 
4712
+template<class T>
 
4713
+struct x<int>::y
 
4714
+{
 
4715
+    typedef double result2;
 
4716
+};
 
4717
+
 
4718
+int main()
 
4719
+{
 
4720
+    x<int>::zy::result2 xxx;
 
4721
+    x<int>::y<int>::result2 xxx2;
 
4722
+}
 
4723
Index: gcc/testsuite/g++.dg/template/ptrmem27.C
 
4724
===================================================================
 
4725
--- a/src/gcc/testsuite/g++.dg/template/ptrmem27.C      (.../tags/gcc_4_8_3_release)
 
4726
+++ b/src/gcc/testsuite/g++.dg/template/ptrmem27.C      (.../branches/gcc-4_8-branch)
 
4727
@@ -0,0 +1,22 @@
 
4728
+// PR c++/61500
 
4729
+
 
4730
+struct X {
 
4731
+  int i;
 
4732
+  int j;
 
4733
+
 
4734
+  int foo(int X::* ptr);
 
4735
+
 
4736
+  template <int X::* ptr>
 
4737
+  int bar();
 
4738
+};
 
4739
+
 
4740
+int X::foo(int X::* ptr) {
 
4741
+  int* p = &(this->*ptr);  // OK.
 
4742
+  return *p;
 
4743
+}
 
4744
+
 
4745
+template <int X::* ptr>
 
4746
+int X::bar() {
 
4747
+  int* p = &(this->*ptr);  // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
 
4748
+  return *p;
 
4749
+}
 
4750
Index: gcc/cp/tree.c
 
4751
===================================================================
 
4752
--- a/src/gcc/cp/tree.c (.../tags/gcc_4_8_3_release)
 
4753
+++ b/src/gcc/cp/tree.c (.../branches/gcc-4_8-branch)
 
4754
@@ -97,6 +97,16 @@
 
4755
     case IMAGPART_EXPR:
 
4756
       return lvalue_kind (TREE_OPERAND (ref, 0));
 
4757
 
 
4758
+    case MEMBER_REF:
 
4759
+    case DOTSTAR_EXPR:
 
4760
+      if (TREE_CODE (ref) == MEMBER_REF)
 
4761
+       op1_lvalue_kind = clk_ordinary;
 
4762
+      else
 
4763
+       op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
 
4764
+      if (TYPE_PTRMEMFUNC_P (TREE_TYPE (TREE_OPERAND (ref, 1))))
 
4765
+       op1_lvalue_kind = clk_none;
 
4766
+      return op1_lvalue_kind;
 
4767
+
 
4768
     case COMPONENT_REF:
 
4769
       op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
 
4770
       /* Look at the member designator.  */
 
4771
@@ -3738,6 +3748,10 @@
 
4772
     {
 
4773
       init_expr = get_target_expr (exp);
 
4774
       exp = TARGET_EXPR_SLOT (init_expr);
 
4775
+      if (CLASS_TYPE_P (TREE_TYPE (exp)))
 
4776
+       exp = move (exp);
 
4777
+      else
 
4778
+       exp = rvalue (exp);
 
4779
     }
 
4780
   else
 
4781
     {
 
4782
Index: gcc/cp/ChangeLog
 
4783
===================================================================
 
4784
--- a/src/gcc/cp/ChangeLog      (.../tags/gcc_4_8_3_release)
 
4785
+++ b/src/gcc/cp/ChangeLog      (.../branches/gcc-4_8-branch)
 
4786
@@ -1,3 +1,67 @@
 
4787
+2014-08-07  Jason Merrill  <jason@redhat.com>
 
4788
+
 
4789
+       PR c++/61959
 
4790
+       * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
 
4791
+
 
4792
+       PR c++/58714
 
4793
+       * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
 
4794
+
 
4795
+2014-01-27  Jason Merrill  <jason@redhat.com>
 
4796
+
 
4797
+       PR c++/59823
 
4798
+       Core DR 1138
 
4799
+       * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
 
4800
+       list-initialization.  A conversion to rvalue ref that involves
 
4801
+       an lvalue-rvalue conversion is bad.
 
4802
+       (convert_like_real): Give helpful error message.
 
4803
+
 
4804
+2014-01-29  Jason Merrill  <jason@redhat.com>
 
4805
+
 
4806
+       PR c++/59956
 
4807
+       * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
 
4808
+       have a friend template in a class template.
 
4809
+       * pt.c (tsubst_friend_function): Look through it.
 
4810
+       (push_template_decl_real): A friend member template is
 
4811
+       primary.
 
4812
+
 
4813
+2014-02-21  Jason Merrill  <jason@redhat.com>
 
4814
+
 
4815
+       PR c++/60241
 
4816
+       * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
 
4817
+       of the partial instantiation, not the most general template.
 
4818
+       (maybe_process_partial_specialization): Reassign everything on
 
4819
+       that list.
 
4820
+
 
4821
+2014-03-05  Jason Merrill  <jason@redhat.com>
 
4822
+
 
4823
+       PR c++/60361
 
4824
+       * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
 
4825
+       if re-parsing might succeed.
 
4826
+       * semantics.c (finish_id_expression): Use of a parameter outside
 
4827
+       the function body is a parse error.
 
4828
+
 
4829
+2014-06-30  Jason Merrill  <jason@redhat.com>
 
4830
+
 
4831
+       PR c++/61647
 
4832
+       * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
 
4833
+
 
4834
+       PR c++/61539
 
4835
+       * pt.c (unify_one_argument): Type/expression mismatch just causes
 
4836
+       deduction failure.
 
4837
+
 
4838
+       PR c++/61500
 
4839
+       * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
 
4840
+
 
4841
+2014-06-17  Jason Merrill  <jason@redhat.com>
 
4842
+
 
4843
+       PR c++/60605
 
4844
+       * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
 
4845
+
 
4846
+2014-06-02  Jason Merrill  <jason@redhat.com>
 
4847
+
 
4848
+       PR c++/61134
 
4849
+       * pt.c (pack_deducible_p): Handle canonicalization.
 
4850
+
 
4851
 2014-05-22  Release Manager
 
4852
 
 
4853
        * GCC 4.8.3 released.
 
4854
Index: gcc/cp/pt.c
 
4855
===================================================================
 
4856
--- a/src/gcc/cp/pt.c   (.../tags/gcc_4_8_3_release)
 
4857
+++ b/src/gcc/cp/pt.c   (.../branches/gcc-4_8-branch)
 
4858
@@ -907,11 +907,13 @@
 
4859
               t; t = TREE_CHAIN (t))
 
4860
            {
 
4861
              tree inst = TREE_VALUE (t);
 
4862
-             if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst))
 
4863
+             if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)
 
4864
+                 || !COMPLETE_OR_OPEN_TYPE_P (inst))
 
4865
                {
 
4866
                  /* We already have a full specialization of this partial
 
4867
-                    instantiation.  Reassign it to the new member
 
4868
-                    specialization template.  */
 
4869
+                    instantiation, or a full specialization has been
 
4870
+                    looked up but not instantiated.  Reassign it to the
 
4871
+                    new member specialization template.  */
 
4872
                  spec_entry elt;
 
4873
                  spec_entry *entry;
 
4874
                  void **slot;
 
4875
@@ -930,7 +932,7 @@
 
4876
                  *entry = elt;
 
4877
                  *slot = entry;
 
4878
                }
 
4879
-             else if (COMPLETE_OR_OPEN_TYPE_P (inst))
 
4880
+             else
 
4881
                /* But if we've had an implicit instantiation, that's a
 
4882
                   problem ([temp.expl.spec]/6).  */
 
4883
                error ("specialization %qT after instantiation %qT",
 
4884
@@ -4308,7 +4310,8 @@
 
4885
      in the template-parameter-list of the definition of a member of a
 
4886
      class template.  */
 
4887
 
 
4888
-  if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL)
 
4889
+  if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL
 
4890
+      || (TREE_CODE (decl) == FUNCTION_DECL && DECL_LOCAL_FUNCTION_P (decl)))
 
4891
     /* You can't have a function template declaration in a local
 
4892
        scope, nor you can you define a member of a class template in a
 
4893
        local scope.  */
 
4894
@@ -4572,7 +4575,8 @@
 
4895
     DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
 
4896
 
 
4897
   /* See if this is a primary template.  */
 
4898
-  if (is_friend && ctx)
 
4899
+  if (is_friend && ctx
 
4900
+      && uses_template_parms_level (ctx, processing_template_decl))
 
4901
     /* A friend template that specifies a class context, i.e.
 
4902
          template <typename T> friend void A<T>::f();
 
4903
        is not primary.  */
 
4904
@@ -7454,7 +7458,7 @@
 
4905
        }
 
4906
 
 
4907
       /* Let's consider the explicit specialization of a member
 
4908
-         of a class template specialization that is implicitely instantiated,
 
4909
+         of a class template specialization that is implicitly instantiated,
 
4910
         e.g.:
 
4911
             template<class T>
 
4912
             struct S
 
4913
@@ -7552,9 +7556,9 @@
 
4914
 
 
4915
       /* Note this use of the partial instantiation so we can check it
 
4916
         later in maybe_process_partial_specialization.  */
 
4917
-      DECL_TEMPLATE_INSTANTIATIONS (templ)
 
4918
+      DECL_TEMPLATE_INSTANTIATIONS (found)
 
4919
        = tree_cons (arglist, t,
 
4920
-                    DECL_TEMPLATE_INSTANTIATIONS (templ));
 
4921
+                    DECL_TEMPLATE_INSTANTIATIONS (found));
 
4922
 
 
4923
       if (TREE_CODE (template_type) == ENUMERAL_TYPE && !is_dependent_type)
 
4924
        /* Now that the type has been registered on the instantiations
 
4925
@@ -8289,10 +8293,17 @@
 
4926
 
 
4927
       if (COMPLETE_TYPE_P (context))
 
4928
        {
 
4929
+         tree fn = new_friend;
 
4930
+         /* do_friend adds the TEMPLATE_DECL for any member friend
 
4931
+            template even if it isn't a member template, i.e.
 
4932
+              template <class T> friend A<T>::f();
 
4933
+            Look through it in that case.  */
 
4934
+         if (TREE_CODE (fn) == TEMPLATE_DECL
 
4935
+             && !PRIMARY_TEMPLATE_P (fn))
 
4936
+           fn = DECL_TEMPLATE_RESULT (fn);
 
4937
          /* Check to see that the declaration is really present, and,
 
4938
             possibly obtain an improved declaration.  */
 
4939
-         tree fn = check_classfn (context,
 
4940
-                                  new_friend, NULL_TREE);
 
4941
+         fn = check_classfn (context, fn, NULL_TREE);
 
4942
 
 
4943
          if (fn)
 
4944
            new_friend = fn;
 
4945
@@ -14934,7 +14945,7 @@
 
4946
        continue;
 
4947
       for (packs = PACK_EXPANSION_PARAMETER_PACKS (type);
 
4948
           packs; packs = TREE_CHAIN (packs))
 
4949
-       if (TREE_VALUE (packs) == parm)
 
4950
+       if (template_args_equal (TREE_VALUE (packs), parm))
 
4951
          {
 
4952
            /* The template parameter pack is used in a function parameter
 
4953
               pack.  If this is the end of the parameter list, the
 
4954
@@ -15502,8 +15513,9 @@
 
4955
        maybe_adjust_types_for_deduction (strict, &parm, &arg, arg_expr);
 
4956
     }
 
4957
   else
 
4958
-    gcc_assert ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
 
4959
-               == (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL));
 
4960
+    if ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
 
4961
+       != (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL))
 
4962
+      return unify_template_argument_mismatch (explain_p, parm, arg);
 
4963
 
 
4964
   /* For deduction from an init-list we need the actual list.  */
 
4965
   if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr))
 
4966
@@ -20009,7 +20021,12 @@
 
4967
        return true;
 
4968
 
 
4969
       if (BASELINK_P (expression))
 
4970
-       expression = BASELINK_FUNCTIONS (expression);
 
4971
+       {
 
4972
+         if (BASELINK_OPTYPE (expression)
 
4973
+             && dependent_type_p (BASELINK_OPTYPE (expression)))
 
4974
+           return true;
 
4975
+         expression = BASELINK_FUNCTIONS (expression);
 
4976
+       }
 
4977
 
 
4978
       if (TREE_CODE (expression) == TEMPLATE_ID_EXPR)
 
4979
        {
 
4980
Index: gcc/cp/semantics.c
 
4981
===================================================================
 
4982
--- a/src/gcc/cp/semantics.c    (.../tags/gcc_4_8_3_release)
 
4983
+++ b/src/gcc/cp/semantics.c    (.../branches/gcc-4_8-branch)
 
4984
@@ -3108,7 +3108,7 @@
 
4985
          && DECL_CONTEXT (decl) == NULL_TREE
 
4986
          && !cp_unevaluated_operand)
 
4987
        {
 
4988
-         error ("use of parameter %qD outside function body", decl);
 
4989
+         *error_msg = "use of parameter outside function body";
 
4990
          return error_mark_node;
 
4991
        }
 
4992
     }
 
4993
@@ -7296,7 +7296,9 @@
 
4994
          constructor_elt *inner = base_field_constructor_elt (n, ce->index);
 
4995
          inner->value = elt;
 
4996
        }
 
4997
-      else if (ce->index && TREE_CODE (ce->index) == NOP_EXPR)
 
4998
+      else if (ce->index
 
4999
+              && (TREE_CODE (ce->index) == NOP_EXPR
 
5000
+                  || TREE_CODE (ce->index) == POINTER_PLUS_EXPR))
 
5001
        {
 
5002
          /* This is an initializer for an empty base; now that we've
 
5003
             checked that it's constant, we can ignore it.  */
 
5004
Index: gcc/cp/parser.c
 
5005
===================================================================
 
5006
--- a/src/gcc/cp/parser.c       (.../tags/gcc_4_8_3_release)
 
5007
+++ b/src/gcc/cp/parser.c       (.../branches/gcc-4_8-branch)
 
5008
@@ -12831,7 +12831,12 @@
 
5009
      the effort required to do the parse, nor will we issue duplicate
 
5010
      error messages about problems during instantiation of the
 
5011
      template.  */
 
5012
-  if (start_of_id)
 
5013
+  if (start_of_id
 
5014
+      /* Don't do this if we had a parse error in a declarator; re-parsing
 
5015
+        might succeed if a name changes meaning (60361).  */
 
5016
+      && !(cp_parser_error_occurred (parser)
 
5017
+          && cp_parser_parsing_tentatively (parser)
 
5018
+          && parser->in_declarator_p))
 
5019
     {
 
5020
       cp_token *token = cp_lexer_token_at (parser->lexer, start_of_id);
 
5021
 
 
5022
Index: gcc/cp/call.c
 
5023
===================================================================
 
5024
--- a/src/gcc/cp/call.c (.../tags/gcc_4_8_3_release)
 
5025
+++ b/src/gcc/cp/call.c (.../branches/gcc-4_8-branch)
 
5026
@@ -1464,7 +1464,7 @@
 
5027
     {
 
5028
       maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
 
5029
       conv = implicit_conversion (to, from, expr, c_cast_p,
 
5030
-                                 flags, complain);
 
5031
+                                 flags|LOOKUP_NO_TEMP_BIND, complain);
 
5032
       if (!CLASS_TYPE_P (to)
 
5033
          && CONSTRUCTOR_NELTS (expr) == 1)
 
5034
        {
 
5035
@@ -1624,9 +1624,9 @@
 
5036
 
 
5037
   /* [dcl.init.ref]
 
5038
 
 
5039
-     Otherwise, the reference shall be to a non-volatile const type.
 
5040
-
 
5041
-     Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */
 
5042
+     Otherwise, the reference shall be an lvalue reference to a
 
5043
+     non-volatile const type, or the reference shall be an rvalue
 
5044
+     reference.  */
 
5045
   if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto))
 
5046
     return NULL;
 
5047
 
 
5048
@@ -1664,7 +1664,16 @@
 
5049
   /* This reference binding, unlike those above, requires the
 
5050
      creation of a temporary.  */
 
5051
   conv->need_temporary_p = true;
 
5052
-  conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto);
 
5053
+  if (TYPE_REF_IS_RVALUE (rto))
 
5054
+    {
 
5055
+      conv->rvaluedness_matches_p = 1;
 
5056
+      /* In the second case, if the reference is an rvalue reference and
 
5057
+        the second standard conversion sequence of the user-defined
 
5058
+        conversion sequence includes an lvalue-to-rvalue conversion, the
 
5059
+        program is ill-formed.  */
 
5060
+      if (conv->user_conv_p && next_conversion (conv)->kind == ck_rvalue)
 
5061
+       conv->bad_p = 1;
 
5062
+    }
 
5063
 
 
5064
   return conv;
 
5065
 }
 
5066
@@ -5811,7 +5820,7 @@
 
5067
       && convs->kind != ck_list
 
5068
       && convs->kind != ck_ambig
 
5069
       && (convs->kind != ck_ref_bind
 
5070
-         || convs->user_conv_p)
 
5071
+         || (convs->user_conv_p && next_conversion (convs)->bad_p))
 
5072
       && (convs->kind != ck_rvalue
 
5073
          || SCALAR_TYPE_P (totype))
 
5074
       && convs->kind != ck_base)
 
5075
@@ -6110,7 +6119,8 @@
 
5076
        if (convs->bad_p && !next_conversion (convs)->bad_p)
 
5077
          {
 
5078
            gcc_assert (TYPE_REF_IS_RVALUE (ref_type)
 
5079
-                       && real_lvalue_p (expr));
 
5080
+                       && (real_lvalue_p (expr)
 
5081
+                           || next_conversion(convs)->kind == ck_rvalue));
 
5082
 
 
5083
            error_at (loc, "cannot bind %qT lvalue to %qT",
 
5084
                      TREE_TYPE (expr), totype);
 
5085
Index: gcc/cp/friend.c
 
5086
===================================================================
 
5087
--- a/src/gcc/cp/friend.c       (.../tags/gcc_4_8_3_release)
 
5088
+++ b/src/gcc/cp/friend.c       (.../branches/gcc-4_8-branch)
 
5089
@@ -502,7 +502,13 @@
 
5090
                                  ? current_template_parms
 
5091
                                  : NULL_TREE);
 
5092
 
 
5093
-         if (template_member_p && decl && TREE_CODE (decl) == FUNCTION_DECL)
 
5094
+         if ((template_member_p
 
5095
+              /* Always pull out the TEMPLATE_DECL if we have a friend
 
5096
+                 template in a class template so that it gets tsubsted
 
5097
+                 properly later on (59956).  tsubst_friend_function knows
 
5098
+                 how to tell this apart from a member template.  */
 
5099
+              || (class_template_depth && friend_depth))
 
5100
+             && decl && TREE_CODE (decl) == FUNCTION_DECL)
 
5101
            decl = DECL_TI_TEMPLATE (decl);
 
5102
 
 
5103
          if (decl)
 
5104
Index: gcc/haifa-sched.c
 
5105
===================================================================
 
5106
--- a/src/gcc/haifa-sched.c     (.../tags/gcc_4_8_3_release)
 
5107
+++ b/src/gcc/haifa-sched.c     (.../branches/gcc-4_8-branch)
 
5108
@@ -2931,7 +2931,7 @@
 
5109
 {
 
5110
   advance_state (curr_state);
 
5111
   if (sched_verbose >= 6)
 
5112
-    fprintf (sched_dump, ";;\tAdvanced a state.\n");
 
5113
+    fprintf (sched_dump, ";;\tAdvance the current state.\n");
 
5114
 }
 
5115
 
 
5116
 /* Update register pressure after scheduling INSN.  */
 
5117
@@ -5964,6 +5964,7 @@
 
5118
   modulo_insns_scheduled = 0;
 
5119
 
 
5120
   ls.modulo_epilogue = false;
 
5121
+  ls.first_cycle_insn_p = true;
 
5122
 
 
5123
   /* Loop until all the insns in BB are scheduled.  */
 
5124
   while ((*current_sched_info->schedule_more_p) ())
 
5125
@@ -6034,7 +6035,6 @@
 
5126
       if (must_backtrack)
 
5127
        goto do_backtrack;
 
5128
 
 
5129
-      ls.first_cycle_insn_p = true;
 
5130
       ls.shadows_only_p = false;
 
5131
       cycle_issued_insns = 0;
 
5132
       ls.can_issue_more = issue_rate;
 
5133
@@ -6321,11 +6321,13 @@
 
5134
              break;
 
5135
            }
 
5136
        }
 
5137
+      ls.first_cycle_insn_p = true;
 
5138
     }
 
5139
   if (ls.modulo_epilogue)
 
5140
     success = true;
 
5141
  end_schedule:
 
5142
-  advance_one_cycle ();
 
5143
+  if (!ls.first_cycle_insn_p)
 
5144
+    advance_one_cycle ();
 
5145
   perform_replacements_new_cycle ();
 
5146
   if (modulo_ii > 0)
 
5147
     {
 
5148
Index: gcc/double-int.c
 
5149
===================================================================
 
5150
--- a/src/gcc/double-int.c      (.../tags/gcc_4_8_3_release)
 
5151
+++ b/src/gcc/double-int.c      (.../branches/gcc-4_8-branch)
 
5152
@@ -616,7 +616,7 @@
 
5153
                 == (unsigned HOST_WIDE_INT) htwice)
 
5154
                && (labs_den <= ltwice)))
 
5155
          {
 
5156
-           if (*hquo < 0)
 
5157
+           if (quo_neg)
 
5158
              /* quo = quo - 1;  */
 
5159
              add_double (*lquo, *hquo,
 
5160
                          (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
 
5161
Index: gcc/tree-ssa-math-opts.c
 
5162
===================================================================
 
5163
--- a/src/gcc/tree-ssa-math-opts.c      (.../tags/gcc_4_8_3_release)
 
5164
+++ b/src/gcc/tree-ssa-math-opts.c      (.../branches/gcc-4_8-branch)
 
5165
@@ -1537,7 +1537,7 @@
 
5166
 
 
5167
 struct symbolic_number {
 
5168
   unsigned HOST_WIDEST_INT n;
 
5169
-  int size;
 
5170
+  tree type;
 
5171
 };
 
5172
 
 
5173
 /* Perform a SHIFT or ROTATE operation by COUNT bits on symbolic
 
5174
@@ -1549,13 +1549,15 @@
 
5175
                 struct symbolic_number *n,
 
5176
                 int count)
 
5177
 {
 
5178
+  int bitsize = TYPE_PRECISION (n->type);
 
5179
+
 
5180
   if (count % 8 != 0)
 
5181
     return false;
 
5182
 
 
5183
   /* Zero out the extra bits of N in order to avoid them being shifted
 
5184
      into the significant bits.  */
 
5185
-  if (n->size < (int)sizeof (HOST_WIDEST_INT))
 
5186
-    n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
 
5187
+  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
 
5188
+    n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
 
5189
 
 
5190
   switch (code)
 
5191
     {
 
5192
@@ -1563,20 +1565,24 @@
 
5193
       n->n <<= count;
 
5194
       break;
 
5195
     case RSHIFT_EXPR:
 
5196
+      /* Arithmetic shift of signed type: result is dependent on the value.  */
 
5197
+      if (!TYPE_UNSIGNED (n->type)
 
5198
+         && (n->n & ((unsigned HOST_WIDEST_INT) 0xff << (bitsize - 8))))
 
5199
+       return false;
 
5200
       n->n >>= count;
 
5201
       break;
 
5202
     case LROTATE_EXPR:
 
5203
-      n->n = (n->n << count) | (n->n >> ((n->size * BITS_PER_UNIT) - count));
 
5204
+      n->n = (n->n << count) | (n->n >> (bitsize - count));
 
5205
       break;
 
5206
     case RROTATE_EXPR:
 
5207
-      n->n = (n->n >> count) | (n->n << ((n->size * BITS_PER_UNIT) - count));
 
5208
+      n->n = (n->n >> count) | (n->n << (bitsize - count));
 
5209
       break;
 
5210
     default:
 
5211
       return false;
 
5212
     }
 
5213
   /* Zero unused bits for size.  */
 
5214
-  if (n->size < (int)sizeof (HOST_WIDEST_INT))
 
5215
-    n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
 
5216
+  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
 
5217
+    n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
 
5218
   return true;
 
5219
 }
 
5220
 
 
5221
@@ -1593,7 +1599,7 @@
 
5222
   if (TREE_CODE (lhs_type) != INTEGER_TYPE)
 
5223
     return false;
 
5224
 
 
5225
-  if (TYPE_PRECISION (lhs_type) != n->size * BITS_PER_UNIT)
 
5226
+  if (TYPE_PRECISION (lhs_type) != TYPE_PRECISION (n->type))
 
5227
     return false;
 
5228
 
 
5229
   return true;
 
5230
@@ -1650,20 +1656,25 @@
 
5231
         to initialize the symbolic number.  */
 
5232
       if (!source_expr1)
 
5233
        {
 
5234
+         int size;
 
5235
+
 
5236
          /* Set up the symbolic number N by setting each byte to a
 
5237
             value between 1 and the byte size of rhs1.  The highest
 
5238
             order byte is set to n->size and the lowest order
 
5239
             byte to 1.  */
 
5240
-         n->size = TYPE_PRECISION (TREE_TYPE (rhs1));
 
5241
-         if (n->size % BITS_PER_UNIT != 0)
 
5242
+         n->type = TREE_TYPE (rhs1);
 
5243
+         size = TYPE_PRECISION (n->type);
 
5244
+         if (size % BITS_PER_UNIT != 0)
 
5245
            return NULL_TREE;
 
5246
-         n->size /= BITS_PER_UNIT;
 
5247
+         if (size > HOST_BITS_PER_WIDEST_INT)
 
5248
+           return NULL_TREE;
 
5249
+         size /= BITS_PER_UNIT;
 
5250
          n->n = (sizeof (HOST_WIDEST_INT) < 8 ? 0 :
 
5251
                  (unsigned HOST_WIDEST_INT)0x08070605 << 32 | 0x04030201);
 
5252
 
 
5253
-         if (n->size < (int)sizeof (HOST_WIDEST_INT))
 
5254
+         if (size < (int)sizeof (HOST_WIDEST_INT))
 
5255
            n->n &= ((unsigned HOST_WIDEST_INT)1 <<
 
5256
-                    (n->size * BITS_PER_UNIT)) - 1;
 
5257
+                    (size * BITS_PER_UNIT)) - 1;
 
5258
 
 
5259
          source_expr1 = rhs1;
 
5260
        }
 
5261
@@ -1672,12 +1683,12 @@
 
5262
        {
 
5263
        case BIT_AND_EXPR:
 
5264
          {
 
5265
-           int i;
 
5266
+           int i, size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
 
5267
            unsigned HOST_WIDEST_INT val = widest_int_cst_value (rhs2);
 
5268
            unsigned HOST_WIDEST_INT tmp = val;
 
5269
 
 
5270
            /* Only constants masking full bytes are allowed.  */
 
5271
-           for (i = 0; i < n->size; i++, tmp >>= BITS_PER_UNIT)
 
5272
+           for (i = 0; i < size; i++, tmp >>= BITS_PER_UNIT)
 
5273
              if ((tmp & 0xff) != 0 && (tmp & 0xff) != 0xff)
 
5274
                return NULL_TREE;
 
5275
 
 
5276
@@ -1693,12 +1704,24 @@
 
5277
          break;
 
5278
        CASE_CONVERT:
 
5279
          {
 
5280
-           int type_size;
 
5281
+           int type_size, old_type_size;
 
5282
+           tree type;
 
5283
 
 
5284
-           type_size = TYPE_PRECISION (gimple_expr_type (stmt));
 
5285
+           type = gimple_expr_type (stmt);
 
5286
+           type_size = TYPE_PRECISION (type);
 
5287
            if (type_size % BITS_PER_UNIT != 0)
 
5288
              return NULL_TREE;
 
5289
+           if (type_size > (int) HOST_BITS_PER_WIDEST_INT)
 
5290
+             return NULL_TREE;
 
5291
 
 
5292
+           /* Sign extension: result is dependent on the value.  */
 
5293
+           old_type_size = TYPE_PRECISION (n->type);
 
5294
+           if (!TYPE_UNSIGNED (n->type)
 
5295
+               && type_size > old_type_size
 
5296
+               && n->n &
 
5297
+                  ((unsigned HOST_WIDEST_INT) 0xff << (old_type_size - 8)))
 
5298
+             return NULL_TREE;
 
5299
+
 
5300
            if (type_size / BITS_PER_UNIT < (int)(sizeof (HOST_WIDEST_INT)))
 
5301
              {
 
5302
                /* If STMT casts to a smaller type mask out the bits not
 
5303
@@ -1705,7 +1728,7 @@
 
5304
                   belonging to the target type.  */
 
5305
                n->n &= ((unsigned HOST_WIDEST_INT)1 << type_size) - 1;
 
5306
              }
 
5307
-           n->size = type_size / BITS_PER_UNIT;
 
5308
+           n->type = type;
 
5309
          }
 
5310
          break;
 
5311
        default:
 
5312
@@ -1718,7 +1741,7 @@
 
5313
 
 
5314
   if (rhs_class == GIMPLE_BINARY_RHS)
 
5315
     {
 
5316
-      int i;
 
5317
+      int i, size;
 
5318
       struct symbolic_number n1, n2;
 
5319
       unsigned HOST_WIDEST_INT mask;
 
5320
       tree source_expr2;
 
5321
@@ -1742,11 +1765,12 @@
 
5322
          source_expr2 = find_bswap_1 (rhs2_stmt, &n2, limit - 1);
 
5323
 
 
5324
          if (source_expr1 != source_expr2
 
5325
-             || n1.size != n2.size)
 
5326
+             || TYPE_PRECISION (n1.type) != TYPE_PRECISION (n2.type))
 
5327
            return NULL_TREE;
 
5328
 
 
5329
-         n->size = n1.size;
 
5330
-         for (i = 0, mask = 0xff; i < n->size; i++, mask <<= BITS_PER_UNIT)
 
5331
+         n->type = n1.type;
 
5332
+         size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
 
5333
+         for (i = 0, mask = 0xff; i < size; i++, mask <<= BITS_PER_UNIT)
 
5334
            {
 
5335
              unsigned HOST_WIDEST_INT masked1, masked2;
 
5336
 
 
5337
@@ -1785,7 +1809,7 @@
 
5338
 
 
5339
   struct symbolic_number n;
 
5340
   tree source_expr;
 
5341
-  int limit;
 
5342
+  int limit, bitsize;
 
5343
 
 
5344
   /* The last parameter determines the depth search limit.  It usually
 
5345
      correlates directly to the number of bytes to be touched.  We
 
5346
@@ -1800,13 +1824,14 @@
 
5347
     return NULL_TREE;
 
5348
 
 
5349
   /* Zero out the extra bits of N and CMP.  */
 
5350
-  if (n.size < (int)sizeof (HOST_WIDEST_INT))
 
5351
+  bitsize = TYPE_PRECISION (n.type);
 
5352
+  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
 
5353
     {
 
5354
       unsigned HOST_WIDEST_INT mask =
 
5355
-       ((unsigned HOST_WIDEST_INT)1 << (n.size * BITS_PER_UNIT)) - 1;
 
5356
+       ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
 
5357
 
 
5358
       n.n &= mask;
 
5359
-      cmp >>= (sizeof (HOST_WIDEST_INT) - n.size) * BITS_PER_UNIT;
 
5360
+      cmp >>= sizeof (HOST_WIDEST_INT) * BITS_PER_UNIT - bitsize;
 
5361
     }
 
5362
 
 
5363
   /* A complete byte swap should make the symbolic number to start
 
5364
@@ -1828,7 +1853,7 @@
 
5365
   bool changed = false;
 
5366
   tree bswap16_type = NULL_TREE, bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
 
5367
 
 
5368
-  if (BITS_PER_UNIT != 8)
 
5369
+  if (BITS_PER_UNIT != 8 || CHAR_BIT != 8)
 
5370
     return 0;
 
5371
 
 
5372
   if (sizeof (HOST_WIDEST_INT) < 8)
 
5373
Index: gcc/ifcvt.c
 
5374
===================================================================
 
5375
--- a/src/gcc/ifcvt.c   (.../tags/gcc_4_8_3_release)
 
5376
+++ b/src/gcc/ifcvt.c   (.../branches/gcc-4_8-branch)
 
5377
@@ -294,6 +294,28 @@
 
5378
 
 
5379
   return (e) ? e->dest : NULL_BLOCK;
 
5380
 }
 
5381
+
 
5382
+/* Return true if RTXs A and B can be safely interchanged.  */
 
5383
+
 
5384
+static bool
 
5385
+rtx_interchangeable_p (const_rtx a, const_rtx b)
 
5386
+{
 
5387
+  if (!rtx_equal_p (a, b))
 
5388
+    return false;
 
5389
+
 
5390
+  if (GET_CODE (a) != MEM)
 
5391
+    return true;
 
5392
+
 
5393
+  /* A dead type-unsafe memory reference is legal, but a live type-unsafe memory
 
5394
+     reference is not.  Interchanging a dead type-unsafe memory reference with
 
5395
+     a live type-safe one creates a live type-unsafe memory reference, in other
 
5396
+     words, it makes the program illegal.
 
5397
+     We check here conservatively whether the two memory references have equal
 
5398
+     memory attributes.  */
 
5399
+
 
5400
+  return mem_attrs_eq_p (get_mem_attrs (a), get_mem_attrs (b));
 
5401
+}
 
5402
+
 
5403
 
 
5404
 /* Go through a bunch of insns, converting them to conditional
 
5405
    execution format if possible.  Return TRUE if all of the non-note
 
5406
@@ -1014,6 +1036,9 @@
 
5407
       || (rtx_equal_p (if_info->a, XEXP (cond, 1))
 
5408
          && rtx_equal_p (if_info->b, XEXP (cond, 0))))
 
5409
     {
 
5410
+      if (!rtx_interchangeable_p (if_info->a, if_info->b))
 
5411
+       return FALSE;
 
5412
+
 
5413
       y = (code == EQ) ? if_info->a : if_info->b;
 
5414
 
 
5415
       /* Avoid generating the move if the source is the destination.  */
 
5416
@@ -2483,7 +2508,7 @@
 
5417
       if (! insn_b
 
5418
          || insn_b != last_active_insn (else_bb, FALSE)
 
5419
          || (set_b = single_set (insn_b)) == NULL_RTX
 
5420
-         || ! rtx_equal_p (x, SET_DEST (set_b)))
 
5421
+         || ! rtx_interchangeable_p (x, SET_DEST (set_b)))
 
5422
        return FALSE;
 
5423
     }
 
5424
   else
 
5425
@@ -2496,7 +2521,7 @@
 
5426
          || BLOCK_FOR_INSN (insn_b) != BLOCK_FOR_INSN (if_info->cond_earliest)
 
5427
          || !NONJUMP_INSN_P (insn_b)
 
5428
          || (set_b = single_set (insn_b)) == NULL_RTX
 
5429
-         || ! rtx_equal_p (x, SET_DEST (set_b))
 
5430
+         || ! rtx_interchangeable_p (x, SET_DEST (set_b))
 
5431
          || ! noce_operand_ok (SET_SRC (set_b))
 
5432
          || reg_overlap_mentioned_p (x, SET_SRC (set_b))
 
5433
          || modified_between_p (SET_SRC (set_b), insn_b, jump)
 
5434
@@ -2562,7 +2587,7 @@
 
5435
 
 
5436
   /* Look and see if A and B are really the same.  Avoid creating silly
 
5437
      cmove constructs that no one will fix up later.  */
 
5438
-  if (rtx_equal_p (a, b))
 
5439
+  if (rtx_interchangeable_p (a, b))
 
5440
     {
 
5441
       /* If we have an INSN_B, we don't have to create any new rtl.  Just
 
5442
         move the instruction that we already have.  If we don't have an
 
5443
Index: gcc/dwarf2out.c
 
5444
===================================================================
 
5445
--- a/src/gcc/dwarf2out.c       (.../tags/gcc_4_8_3_release)
 
5446
+++ b/src/gcc/dwarf2out.c       (.../branches/gcc-4_8-branch)
 
5447
@@ -12234,7 +12234,7 @@
 
5448
              op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
 
5449
                                        VAR_INIT_STATUS_INITIALIZED);
 
5450
              if (op1 == 0)
 
5451
-               break;
 
5452
+               return NULL;
 
5453
              add_loc_descr (&mem_loc_result, op1);
 
5454
              add_loc_descr (&mem_loc_result,
 
5455
                             new_loc_descr (DW_OP_plus, 0, 0));
 
5456
Index: gcc/expr.c
 
5457
===================================================================
 
5458
--- a/src/gcc/expr.c    (.../tags/gcc_4_8_3_release)
 
5459
+++ b/src/gcc/expr.c    (.../branches/gcc-4_8-branch)
 
5460
@@ -10603,7 +10603,7 @@
 
5461
       || !host_integerp (TREE_OPERAND (offset, 1), 1)
 
5462
       || compare_tree_int (TREE_OPERAND (offset, 1),
 
5463
                           BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0
 
5464
-      || !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
 
5465
+      || exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
 
5466
     return 0;
 
5467
 
 
5468
   /* Look at the first operand of BIT_AND_EXPR and strip any conversion.
 
5469
Index: gcc/ada/socket.c
 
5470
===================================================================
 
5471
--- a/src/gcc/ada/socket.c      (.../tags/gcc_4_8_3_release)
 
5472
+++ b/src/gcc/ada/socket.c      (.../branches/gcc-4_8-branch)
 
5473
@@ -212,7 +212,7 @@
 
5474
   struct hostent *rh;
 
5475
   int ri;
 
5476
 
 
5477
-#if defined(__linux__) || defined(__GLIBC__)
 
5478
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
 
5479
   (void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
 
5480
 #else
 
5481
   rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);
 
5482
Index: gcc/ada/ChangeLog
 
5483
===================================================================
 
5484
--- a/src/gcc/ada/ChangeLog     (.../tags/gcc_4_8_3_release)
 
5485
+++ b/src/gcc/ada/ChangeLog     (.../branches/gcc-4_8-branch)
 
5486
@@ -1,3 +1,12 @@
 
5487
+2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
 
5488
+
 
5489
+       * socket.c: For RTEMS, use correct prototype of gethostbyname_r().
 
5490
+       * gsocket.h Add include of <unistd.h> on RTEMS.
 
5491
+
 
5492
+2014-08-11  Joel Sherrill <joel.sherrill@oarcorp.com>
 
5493
+
 
5494
+       * s-osinte-rtems.adb: Correct formatting of line in license block.
 
5495
+
 
5496
 2014-05-22  Release Manager
 
5497
 
 
5498
        * GCC 4.8.3 released.
 
5499
Index: gcc/ada/s-osinte-rtems.adb
 
5500
===================================================================
 
5501
--- a/src/gcc/ada/s-osinte-rtems.adb    (.../tags/gcc_4_8_3_release)
 
5502
+++ b/src/gcc/ada/s-osinte-rtems.adb    (.../branches/gcc-4_8-branch)
 
5503
@@ -22,7 +22,7 @@
 
5504
 -- You should have received a copy of the GNU General Public License and    --
 
5505
 -- a copy of the GCC Runtime Library Exception along with this program;     --
 
5506
 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
 
5507
--- <http://www.gnu.org/licenses/>.                                         
 
5508
+-- <http://www.gnu.org/licenses/>.                                          --
 
5509
 --                                                                          --
 
5510
 -- GNARL was developed by the GNARL team at Florida State University. It is --
 
5511
 -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
 
5512
Index: gcc/ada/gsocket.h
 
5513
===================================================================
 
5514
--- a/src/gcc/ada/gsocket.h     (.../tags/gcc_4_8_3_release)
 
5515
+++ b/src/gcc/ada/gsocket.h     (.../branches/gcc-4_8-branch)
 
5516
@@ -183,6 +183,11 @@
 
5517
 #include <sys/time.h>
 
5518
 #endif
 
5519
 
 
5520
+#if defined(__rtems__)
 
5521
+#include <unistd.h>
 
5522
+/* Required, for read(), write(), and close() */
 
5523
+#endif
 
5524
+
 
5525
 /*
 
5526
  * RTEMS has these .h files but not until you have built and installed RTEMS.
 
5527
  * When building a C/C++ toolset, you also build the newlib C library, so the
 
5528
Index: gcc/tree-ssa-ifcombine.c
 
5529
===================================================================
 
5530
--- a/src/gcc/tree-ssa-ifcombine.c      (.../tags/gcc_4_8_3_release)
 
5531
+++ b/src/gcc/tree-ssa-ifcombine.c      (.../branches/gcc-4_8-branch)
 
5532
@@ -105,7 +105,11 @@
 
5533
     {
 
5534
       gimple stmt = gsi_stmt (gsi);
 
5535
 
 
5536
+      if (is_gimple_debug (stmt))
 
5537
+       continue;
 
5538
+
 
5539
       if (gimple_has_side_effects (stmt)
 
5540
+         || gimple_could_trap_p (stmt)
 
5541
          || gimple_vuse (stmt))
 
5542
        return false;
 
5543
     }
 
5544
@@ -197,7 +201,8 @@
 
5545
       while (is_gimple_assign (stmt)
 
5546
             && ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
 
5547
                  && (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (stmt)))
 
5548
-                     <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
 
5549
+                     <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt))))
 
5550
+                 && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
 
5551
                 || gimple_assign_ssa_name_copy_p (stmt)))
 
5552
        stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
 
5553
 
 
5554
Index: gcc/sel-sched-ir.c
 
5555
===================================================================
 
5556
--- a/src/gcc/sel-sched-ir.c    (.../tags/gcc_4_8_3_release)
 
5557
+++ b/src/gcc/sel-sched-ir.c    (.../branches/gcc-4_8-branch)
 
5558
@@ -162,7 +162,7 @@
 
5559
 static void free_av_set (basic_block);
 
5560
 static void invalidate_av_set (basic_block);
 
5561
 static void extend_insn_data (void);
 
5562
-static void sel_init_new_insn (insn_t, int);
 
5563
+static void sel_init_new_insn (insn_t, int, int = -1);
 
5564
 static void finish_insns (void);
 
5565
 
 
5566
 /* Various list functions.  */
 
5567
@@ -4011,9 +4011,10 @@
 
5568
   return seqno;
 
5569
 }
 
5570
 
 
5571
-/* Compute seqno for INSN by its preds or succs.  */
 
5572
+/* Compute seqno for INSN by its preds or succs.  Use OLD_SEQNO to compute
 
5573
+   seqno in corner cases.  */
 
5574
 static int
 
5575
-get_seqno_for_a_jump (insn_t insn)
 
5576
+get_seqno_for_a_jump (insn_t insn, int old_seqno)
 
5577
 {
 
5578
   int seqno;
 
5579
 
 
5580
@@ -4069,8 +4070,16 @@
 
5581
   if (seqno < 0)
 
5582
     seqno = get_seqno_by_succs (insn);
 
5583
 
 
5584
+  if (seqno < 0)
 
5585
+    {
 
5586
+      /* The only case where this could be here legally is that the only
 
5587
+        unscheduled insn was a conditional jump that got removed and turned
 
5588
+        into this unconditional one.  Initialize from the old seqno
 
5589
+        of that jump passed down to here.  */
 
5590
+      seqno = old_seqno;
 
5591
+    }
 
5592
+
 
5593
   gcc_assert (seqno >= 0);
 
5594
-
 
5595
   return seqno;
 
5596
 }
 
5597
 
 
5598
@@ -4250,22 +4259,24 @@
 
5599
 }
 
5600
 
 
5601
 /* This is used to initialize spurious jumps generated by
 
5602
-   sel_redirect_edge ().  */
 
5603
+   sel_redirect_edge ().  OLD_SEQNO is used for initializing seqnos
 
5604
+   in corner cases within get_seqno_for_a_jump.  */
 
5605
 static void
 
5606
-init_simplejump_data (insn_t insn)
 
5607
+init_simplejump_data (insn_t insn, int old_seqno)
 
5608
 {
 
5609
   init_expr (INSN_EXPR (insn), vinsn_create (insn, false), 0,
 
5610
             REG_BR_PROB_BASE, 0, 0, 0, 0, 0, 0,
 
5611
             vNULL, true, false, false,
 
5612
             false, true);
 
5613
-  INSN_SEQNO (insn) = get_seqno_for_a_jump (insn);
 
5614
+  INSN_SEQNO (insn) = get_seqno_for_a_jump (insn, old_seqno);
 
5615
   init_first_time_insn_data (insn);
 
5616
 }
 
5617
 
 
5618
 /* Perform deferred initialization of insns.  This is used to process
 
5619
-   a new jump that may be created by redirect_edge.  */
 
5620
-void
 
5621
-sel_init_new_insn (insn_t insn, int flags)
 
5622
+   a new jump that may be created by redirect_edge.  OLD_SEQNO is used
 
5623
+   for initializing simplejumps in init_simplejump_data.  */
 
5624
+static void
 
5625
+sel_init_new_insn (insn_t insn, int flags, int old_seqno)
 
5626
 {
 
5627
   /* We create data structures for bb when the first insn is emitted in it.  */
 
5628
   if (INSN_P (insn)
 
5629
@@ -4292,7 +4303,7 @@
 
5630
   if (flags & INSN_INIT_TODO_SIMPLEJUMP)
 
5631
     {
 
5632
       extend_insn_data ();
 
5633
-      init_simplejump_data (insn);
 
5634
+      init_simplejump_data (insn, old_seqno);
 
5635
     }
 
5636
 
 
5637
   gcc_assert (CONTAINING_RGN (BLOCK_NUM (insn))
 
5638
@@ -5578,8 +5589,7 @@
 
5639
 }
 
5640
 
 
5641
 /* A wrapper for redirect_edge_and_branch_force, which also initializes
 
5642
-   data structures for possibly created bb and insns.  Returns the newly
 
5643
-   added bb or NULL, when a bb was not needed.  */
 
5644
+   data structures for possibly created bb and insns.  */
 
5645
 void
 
5646
 sel_redirect_edge_and_branch_force (edge e, basic_block to)
 
5647
 {
 
5648
@@ -5586,6 +5596,7 @@
 
5649
   basic_block jump_bb, src, orig_dest = e->dest;
 
5650
   int prev_max_uid;
 
5651
   rtx jump;
 
5652
+  int old_seqno = -1;
 
5653
 
 
5654
   /* This function is now used only for bookkeeping code creation, where
 
5655
      we'll never get the single pred of orig_dest block and thus will not
 
5656
@@ -5594,8 +5605,13 @@
 
5657
               && !single_pred_p (orig_dest));
 
5658
   src = e->src;
 
5659
   prev_max_uid = get_max_uid ();
 
5660
+  /* Compute and pass old_seqno down to sel_init_new_insn only for the case
 
5661
+     when the conditional jump being redirected may become unconditional.  */
 
5662
+  if (any_condjump_p (BB_END (src))
 
5663
+      && INSN_SEQNO (BB_END (src)) >= 0)
 
5664
+    old_seqno = INSN_SEQNO (BB_END (src));
 
5665
+
 
5666
   jump_bb = redirect_edge_and_branch_force (e, to);
 
5667
-
 
5668
   if (jump_bb != NULL)
 
5669
     sel_add_bb (jump_bb);
 
5670
 
 
5671
@@ -5607,7 +5623,8 @@
 
5672
 
 
5673
   jump = find_new_jump (src, jump_bb, prev_max_uid);
 
5674
   if (jump)
 
5675
-    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
 
5676
+    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP,
 
5677
+                      old_seqno);
 
5678
   set_immediate_dominator (CDI_DOMINATORS, to,
 
5679
                           recompute_dominator (CDI_DOMINATORS, to));
 
5680
   set_immediate_dominator (CDI_DOMINATORS, orig_dest,
 
5681
@@ -5626,6 +5643,7 @@
 
5682
   edge redirected;
 
5683
   bool recompute_toporder_p = false;
 
5684
   bool maybe_unreachable = single_pred_p (orig_dest);
 
5685
+  int old_seqno = -1;
 
5686
 
 
5687
   latch_edge_p = (pipelining_p
 
5688
                   && current_loop_nest
 
5689
@@ -5634,6 +5652,12 @@
 
5690
   src = e->src;
 
5691
   prev_max_uid = get_max_uid ();
 
5692
 
 
5693
+  /* Compute and pass old_seqno down to sel_init_new_insn only for the case
 
5694
+     when the conditional jump being redirected may become unconditional.  */
 
5695
+  if (any_condjump_p (BB_END (src))
 
5696
+      && INSN_SEQNO (BB_END (src)) >= 0)
 
5697
+    old_seqno = INSN_SEQNO (BB_END (src));
 
5698
+
 
5699
   redirected = redirect_edge_and_branch (e, to);
 
5700
 
 
5701
   gcc_assert (redirected && !last_added_blocks.exists ());
 
5702
@@ -5654,7 +5678,7 @@
 
5703
 
 
5704
   jump = find_new_jump (src, NULL, prev_max_uid);
 
5705
   if (jump)
 
5706
-    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
 
5707
+    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP, old_seqno);
 
5708
 
 
5709
   /* Only update dominator info when we don't have unreachable blocks.
 
5710
      Otherwise we'll update in maybe_tidy_empty_bb.  */
 
5711
Index: gcc/fortran/interface.c
 
5712
===================================================================
 
5713
--- a/src/gcc/fortran/interface.c       (.../tags/gcc_4_8_3_release)
 
5714
+++ b/src/gcc/fortran/interface.c       (.../branches/gcc-4_8-branch)
 
5715
@@ -1923,7 +1923,7 @@
 
5716
   /* F2008, 12.5.2.5; IR F08/0073.  */
 
5717
   if (formal->ts.type == BT_CLASS && actual->expr_type != EXPR_NULL
 
5718
       && ((CLASS_DATA (formal)->attr.class_pointer
 
5719
-          && !formal->attr.intent == INTENT_IN)
 
5720
+          && formal->attr.intent != INTENT_IN)
 
5721
           || CLASS_DATA (formal)->attr.allocatable))
 
5722
     {
 
5723
       if (actual->ts.type != BT_CLASS)
 
5724
Index: gcc/fortran/trans-expr.c
 
5725
===================================================================
 
5726
--- a/src/gcc/fortran/trans-expr.c      (.../tags/gcc_4_8_3_release)
 
5727
+++ b/src/gcc/fortran/trans-expr.c      (.../branches/gcc-4_8-branch)
 
5728
@@ -7096,7 +7096,7 @@
 
5729
 
 
5730
   res_desc = gfc_evaluate_now (desc, &se->pre);
 
5731
   gfc_conv_descriptor_data_set (&se->pre, res_desc, null_pointer_node);
 
5732
-  se->expr = gfc_build_addr_expr (TREE_TYPE (se->expr), res_desc);
 
5733
+  se->expr = gfc_build_addr_expr (NULL_TREE, res_desc);
 
5734
 
 
5735
   /* Free the lhs after the function call and copy the result data to
 
5736
      the lhs descriptor.  */
 
5737
Index: gcc/fortran/decl.c
 
5738
===================================================================
 
5739
--- a/src/gcc/fortran/decl.c    (.../tags/gcc_4_8_3_release)
 
5740
+++ b/src/gcc/fortran/decl.c    (.../branches/gcc-4_8-branch)
 
5741
@@ -1996,6 +1996,13 @@
 
5742
       if (gfc_notify_std (GFC_STD_GNU, "Old-style "
 
5743
                          "initialization at %C") == FAILURE)
 
5744
        return MATCH_ERROR;
 
5745
+      else if (gfc_current_state () == COMP_DERIVED)
 
5746
+       {
 
5747
+         gfc_error ("Invalid old style initialization for derived type "
 
5748
+                    "component at %C");
 
5749
+         m = MATCH_ERROR;
 
5750
+         goto cleanup;
 
5751
+       }
 
5752
 
 
5753
       return match_old_style_init (name);
 
5754
     }
 
5755
Index: gcc/fortran/ChangeLog
 
5756
===================================================================
 
5757
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_8_3_release)
 
5758
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch)
 
5759
@@ -1,3 +1,57 @@
 
5760
+2014-09-03  Marek Polacek  <polacek@redhat.com>
 
5761
+
 
5762
+       Backport from trunk
 
5763
+       PR fortran/62270
 
5764
+       * interface.c (compare_parameter): Fix condition.
 
5765
+
 
5766
+2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
5767
+
 
5768
+       Backport from trunk
 
5769
+       PR fortran/62214
 
5770
+       * gfortran.dg/array_assignment_5.f90:  New test.
 
5771
+
 
5772
+2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
5773
+
 
5774
+       Backport from trunk
 
5775
+       PR fortran/61999
 
5776
+       * simplify.c (gfc_simplify_dot_product): Convert types of
 
5777
+       vectors before calculating the result.
 
5778
+
 
5779
+2014-07-19  Paul Thomas  <pault@gcc.gnu.org>
 
5780
+
 
5781
+       Backport from trunk.
 
5782
+       PR fortran/61780
 
5783
+       * dependency.c (gfc_dep_resolver): Index the 'reverse' array so
 
5784
+       that elements are skipped. This then correctly aligns 'reverse'
 
5785
+       with the scalarizer loops.
 
5786
+
 
5787
+2014-07-08  Paul Thomas  <pault@gcc.gnu.org>
 
5788
+
 
5789
+       PR fortran/61459
 
5790
+       PR fortran/58883
 
5791
+       * trans-expr.c (fcncall_realloc_result): Use the natural type
 
5792
+       for the address expression of 'res_desc'.
 
5793
+
 
5794
+2014-07-02  Jakub Jelinek  <jakub@redhat.com>
 
5795
+           Fritz Reese  <Reese-Fritz@zai.com>
 
5796
+
 
5797
+       * decl.c (variable_decl): Reject old style initialization
 
5798
+       for derived type components.
 
5799
+
 
5800
+2014-06-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
5801
+
 
5802
+       Backport from trunk.
 
5803
+       PR fortran/45187
 
5804
+       * trans-decl.c (gfc_create_module_variable): Don't create
 
5805
+       Cray-pointee decls twice.
 
5806
+
 
5807
+2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
 
5808
+
 
5809
+       Backport from mainline
 
5810
+       PR libfortran/61310
 
5811
+       * intrinsics.texi (CTIME): Remove mention of locale-dependent
 
5812
+       behavior.
 
5813
+
 
5814
 2014-05-22  Release Manager
 
5815
 
 
5816
        * GCC 4.8.3 released.
 
5817
Index: gcc/fortran/frontend-passes.c
 
5818
===================================================================
 
5819
--- a/src/gcc/fortran/frontend-passes.c (.../tags/gcc_4_8_3_release)
 
5820
+++ b/src/gcc/fortran/frontend-passes.c (.../branches/gcc-4_8-branch)
 
5821
@@ -874,6 +874,10 @@
 
5822
            return true;
 
5823
          break;
 
5824
 
 
5825
+       case INTRINSIC_CONCAT:
 
5826
+         /* Do not do string concatenations.  */
 
5827
+         break;
 
5828
+
 
5829
        default:
 
5830
          /* Binary operators.  */
 
5831
          if (optimize_binop_array_assignment (c, &e->value.op.op1, true))
 
5832
Index: gcc/fortran/trans-decl.c
 
5833
===================================================================
 
5834
--- a/src/gcc/fortran/trans-decl.c      (.../tags/gcc_4_8_3_release)
 
5835
+++ b/src/gcc/fortran/trans-decl.c      (.../branches/gcc-4_8-branch)
 
5836
@@ -4084,8 +4084,8 @@
 
5837
     }
 
5838
 
 
5839
   /* Don't generate variables from other modules. Variables from
 
5840
-     COMMONs will already have been generated.  */
 
5841
-  if (sym->attr.use_assoc || sym->attr.in_common)
 
5842
+     COMMONs and Cray pointees will already have been generated.  */
 
5843
+  if (sym->attr.use_assoc || sym->attr.in_common || sym->attr.cray_pointee)
 
5844
     return;
 
5845
 
 
5846
   /* Equivalenced variables arrive here after creation.  */
 
5847
Index: gcc/fortran/dependency.c
 
5848
===================================================================
 
5849
--- a/src/gcc/fortran/dependency.c      (.../tags/gcc_4_8_3_release)
 
5850
+++ b/src/gcc/fortran/dependency.c      (.../branches/gcc-4_8-branch)
 
5851
@@ -1779,6 +1779,7 @@
 
5852
 gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
 
5853
 {
 
5854
   int n;
 
5855
+  int m;
 
5856
   gfc_dependency fin_dep;
 
5857
   gfc_dependency this_dep;
 
5858
 
 
5859
@@ -1828,6 +1829,8 @@
 
5860
              break;
 
5861
            }
 
5862
 
 
5863
+         /* Index for the reverse array.  */
 
5864
+         m = -1;
 
5865
          for (n=0; n < lref->u.ar.dimen; n++)
 
5866
            {
 
5867
              /* Assume dependency when either of array reference is vector
 
5868
@@ -1862,31 +1865,37 @@
 
5869
                 The ability to reverse or not is set by previous conditions
 
5870
                 in this dimension.  If reversal is not activated, the
 
5871
                 value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP.  */
 
5872
+
 
5873
+             /* Get the indexing right for the scalarizing loop. If this
 
5874
+                is an element, there is no corresponding loop.  */
 
5875
+             if (lref->u.ar.dimen_type[n] != DIMEN_ELEMENT)
 
5876
+               m++;
 
5877
+
 
5878
              if (rref->u.ar.dimen_type[n] == DIMEN_RANGE
 
5879
                    && lref->u.ar.dimen_type[n] == DIMEN_RANGE)
 
5880
                {
 
5881
                  /* Set reverse if backward dependence and not inhibited.  */
 
5882
-                 if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
 
5883
-                   reverse[n] = (this_dep == GFC_DEP_BACKWARD) ?
 
5884
-                                GFC_REVERSE_SET : reverse[n];
 
5885
+                 if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
 
5886
+                   reverse[m] = (this_dep == GFC_DEP_BACKWARD) ?
 
5887
+                                GFC_REVERSE_SET : reverse[m];
 
5888
 
 
5889
                  /* Set forward if forward dependence and not inhibited.  */
 
5890
-                 if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
 
5891
-                   reverse[n] = (this_dep == GFC_DEP_FORWARD) ?
 
5892
-                                GFC_FORWARD_SET : reverse[n];
 
5893
+                 if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
 
5894
+                   reverse[m] = (this_dep == GFC_DEP_FORWARD) ?
 
5895
+                                GFC_FORWARD_SET : reverse[m];
 
5896
 
 
5897
                  /* Flag up overlap if dependence not compatible with
 
5898
                     the overall state of the expression.  */
 
5899
-                 if (reverse && reverse[n] == GFC_REVERSE_SET
 
5900
+                 if (reverse && reverse[m] == GFC_REVERSE_SET
 
5901
                        && this_dep == GFC_DEP_FORWARD)
 
5902
                    {
 
5903
-                     reverse[n] = GFC_INHIBIT_REVERSE;
 
5904
+                     reverse[m] = GFC_INHIBIT_REVERSE;
 
5905
                      this_dep = GFC_DEP_OVERLAP;
 
5906
                    }
 
5907
-                 else if (reverse && reverse[n] == GFC_FORWARD_SET
 
5908
+                 else if (reverse && reverse[m] == GFC_FORWARD_SET
 
5909
                        && this_dep == GFC_DEP_BACKWARD)
 
5910
                    {
 
5911
-                     reverse[n] = GFC_INHIBIT_REVERSE;
 
5912
+                     reverse[m] = GFC_INHIBIT_REVERSE;
 
5913
                      this_dep = GFC_DEP_OVERLAP;
 
5914
                    }
 
5915
 
 
5916
@@ -1893,7 +1902,7 @@
 
5917
                  /* If no intention of reversing or reversing is explicitly
 
5918
                     inhibited, convert backward dependence to overlap.  */
 
5919
                  if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
 
5920
-                     || (reverse != NULL && reverse[n] == GFC_INHIBIT_REVERSE))
 
5921
+                     || (reverse != NULL && reverse[m] == GFC_INHIBIT_REVERSE))
 
5922
                    this_dep = GFC_DEP_OVERLAP;
 
5923
                }
 
5924
 
 
5925
Index: gcc/fortran/simplify.c
 
5926
===================================================================
 
5927
--- a/src/gcc/fortran/simplify.c        (.../tags/gcc_4_8_3_release)
 
5928
+++ b/src/gcc/fortran/simplify.c        (.../branches/gcc-4_8-branch)
 
5929
@@ -1877,6 +1877,9 @@
 
5930
 gfc_expr*
 
5931
 gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
 
5932
 {
 
5933
+
 
5934
+  gfc_expr temp;
 
5935
+
 
5936
   if (!is_constant_array_expr (vector_a)
 
5937
       || !is_constant_array_expr (vector_b))
 
5938
     return NULL;
 
5939
@@ -1883,8 +1886,14 @@
 
5940
 
 
5941
   gcc_assert (vector_a->rank == 1);
 
5942
   gcc_assert (vector_b->rank == 1);
 
5943
-  gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts));
 
5944
 
 
5945
+  temp.expr_type = EXPR_OP;
 
5946
+  gfc_clear_ts (&temp.ts);
 
5947
+  temp.value.op.op = INTRINSIC_NONE;
 
5948
+  temp.value.op.op1 = vector_a;
 
5949
+  temp.value.op.op2 = vector_b;
 
5950
+  gfc_type_convert_binary (&temp, 1);
 
5951
+
 
5952
   return compute_dot_product (vector_a, 1, 0, vector_b, 1, 0, true);
 
5953
 }
 
5954
 
 
5955
Index: gcc/function.c
 
5956
===================================================================
 
5957
--- a/src/gcc/function.c        (.../tags/gcc_4_8_3_release)
 
5958
+++ b/src/gcc/function.c        (.../branches/gcc-4_8-branch)
 
5959
@@ -1354,9 +1354,13 @@
 
5960
 #define STACK_POINTER_OFFSET   0
 
5961
 #endif
 
5962
 
 
5963
+#if defined (REG_PARM_STACK_SPACE) && !defined (INCOMING_REG_PARM_STACK_SPACE)
 
5964
+#define INCOMING_REG_PARM_STACK_SPACE REG_PARM_STACK_SPACE
 
5965
+#endif
 
5966
+
 
5967
 /* If not defined, pick an appropriate default for the offset of dynamically
 
5968
    allocated memory depending on the value of ACCUMULATE_OUTGOING_ARGS,
 
5969
-   REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE.  */
 
5970
+   INCOMING_REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE.  */
 
5971
 
 
5972
 #ifndef STACK_DYNAMIC_OFFSET
 
5973
 
 
5974
@@ -1368,12 +1372,12 @@
 
5975
    `crtl->outgoing_args_size'.  Nevertheless, we must allow
 
5976
    for it when allocating stack dynamic objects.  */
 
5977
 
 
5978
-#if defined(REG_PARM_STACK_SPACE)
 
5979
+#ifdef INCOMING_REG_PARM_STACK_SPACE
 
5980
 #define STACK_DYNAMIC_OFFSET(FNDECL)   \
 
5981
 ((ACCUMULATE_OUTGOING_ARGS                                                   \
 
5982
   ? (crtl->outgoing_args_size                                \
 
5983
      + (OUTGOING_REG_PARM_STACK_SPACE ((!(FNDECL) ? NULL_TREE : TREE_TYPE (FNDECL))) ? 0 \
 
5984
-                                              : REG_PARM_STACK_SPACE (FNDECL))) \
 
5985
+                                              : INCOMING_REG_PARM_STACK_SPACE (FNDECL))) \
 
5986
   : 0) + (STACK_POINTER_OFFSET))
 
5987
 #else
 
5988
 #define STACK_DYNAMIC_OFFSET(FNDECL)   \
 
5989
@@ -2211,8 +2215,9 @@
 
5990
 #endif
 
5991
   all->args_so_far = pack_cumulative_args (&all->args_so_far_v);
 
5992
 
 
5993
-#ifdef REG_PARM_STACK_SPACE
 
5994
-  all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl);
 
5995
+#ifdef INCOMING_REG_PARM_STACK_SPACE
 
5996
+  all->reg_parm_stack_space
 
5997
+    = INCOMING_REG_PARM_STACK_SPACE (current_function_decl);
 
5998
 #endif
 
5999
 }
 
6000
 
 
6001
@@ -4518,6 +4523,7 @@
 
6002
       /* ??? This could be set on a per-function basis by the front-end
 
6003
          but is this worth the hassle?  */
 
6004
       cfun->can_throw_non_call_exceptions = flag_non_call_exceptions;
 
6005
+      cfun->can_delete_dead_exceptions = flag_delete_dead_exceptions;
 
6006
     }
 
6007
 }
 
6008
 
 
6009
Index: gcc/tree-vectorizer.h
 
6010
===================================================================
 
6011
--- a/src/gcc/tree-vectorizer.h (.../tags/gcc_4_8_3_release)
 
6012
+++ b/src/gcc/tree-vectorizer.h (.../branches/gcc-4_8-branch)
 
6013
@@ -324,9 +324,9 @@
 
6014
 #define LOOP_VINFO_OPERANDS_SWAPPED(L)     (L)->operands_swapped
 
6015
 
 
6016
 #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
 
6017
-(L)->may_misalign_stmts.length () > 0
 
6018
+((L)->may_misalign_stmts.length () > 0)
 
6019
 #define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L)     \
 
6020
-(L)->may_alias_ddrs.length () > 0
 
6021
+((L)->may_alias_ddrs.length () > 0)
 
6022
 
 
6023
 #define NITERS_KNOWN_P(n)                     \
 
6024
 (host_integerp ((n),0)                        \
 
6025
Index: gcc/tree-vect-loop.c
 
6026
===================================================================
 
6027
--- a/src/gcc/tree-vect-loop.c  (.../tags/gcc_4_8_3_release)
 
6028
+++ b/src/gcc/tree-vect-loop.c  (.../branches/gcc-4_8-branch)
 
6029
@@ -2205,7 +2205,8 @@
 
6030
         }
 
6031
 
 
6032
       def1 = SSA_NAME_DEF_STMT (op1);
 
6033
-      if (flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
 
6034
+      if (gimple_bb (def1)
 
6035
+         && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
 
6036
           && loop->inner
 
6037
           && flow_bb_inside_loop_p (loop->inner, gimple_bb (def1))
 
6038
           && is_gimple_assign (def1))
 
6039
Index: gcc/emit-rtl.c
 
6040
===================================================================
 
6041
--- a/src/gcc/emit-rtl.c        (.../tags/gcc_4_8_3_release)
 
6042
+++ b/src/gcc/emit-rtl.c        (.../branches/gcc-4_8-branch)
 
6043
@@ -263,7 +263,7 @@
 
6044
 
 
6045
 /* Return true if the given memory attributes are equal.  */
 
6046
 
 
6047
-static bool
 
6048
+bool
 
6049
 mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
 
6050
 {
 
6051
   return (p->alias == q->alias
 
6052
Index: gcc/gimple-fold.c
 
6053
===================================================================
 
6054
--- a/src/gcc/gimple-fold.c     (.../tags/gcc_4_8_3_release)
 
6055
+++ b/src/gcc/gimple-fold.c     (.../branches/gcc-4_8-branch)
 
6056
@@ -2955,8 +2955,8 @@
 
6057
      result.  */
 
6058
   if (!AGGREGATE_TYPE_P (TREE_TYPE (ctor)) && !offset
 
6059
       /* VIEW_CONVERT_EXPR is defined only for matching sizes.  */
 
6060
-      && operand_equal_p (TYPE_SIZE (type),
 
6061
-                         TYPE_SIZE (TREE_TYPE (ctor)), 0))
 
6062
+      && !compare_tree_int (TYPE_SIZE (type), size)
 
6063
+      && !compare_tree_int (TYPE_SIZE (TREE_TYPE (ctor)), size))
 
6064
     {
 
6065
       ret = canonicalize_constructor_val (unshare_expr (ctor), from_decl);
 
6066
       ret = fold_unary (VIEW_CONVERT_EXPR, type, ret);
 
6067
Index: gcc/emit-rtl.h
 
6068
===================================================================
 
6069
--- a/src/gcc/emit-rtl.h        (.../tags/gcc_4_8_3_release)
 
6070
+++ b/src/gcc/emit-rtl.h        (.../branches/gcc-4_8-branch)
 
6071
@@ -20,6 +20,9 @@
 
6072
 #ifndef GCC_EMIT_RTL_H
 
6073
 #define GCC_EMIT_RTL_H
 
6074
 
 
6075
+/* Return whether two MEM_ATTRs are equal.  */
 
6076
+bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
 
6077
+
 
6078
 /* Set the alias set of MEM to SET.  */
 
6079
 extern void set_mem_alias_set (rtx, alias_set_type);
 
6080
 
 
6081
Index: gcc/common.opt
 
6082
===================================================================
 
6083
--- a/src/gcc/common.opt        (.../tags/gcc_4_8_3_release)
 
6084
+++ b/src/gcc/common.opt        (.../branches/gcc-4_8-branch)
 
6085
@@ -1226,6 +1226,10 @@
 
6086
 Common Report Var(flag_tm)
 
6087
 Enable support for GNU transactional memory
 
6088
 
 
6089
+fgnu-unique
 
6090
+Common Report Var(flag_gnu_unique) Init(1)
 
6091
+Use STB_GNU_UNIQUE if supported by the assembler
 
6092
+
 
6093
 floop-flatten
 
6094
 Common Ignore
 
6095
 Does nothing. Preserved for backward compatibility.
 
6096
Index: gcc/tree-vect-patterns.c
 
6097
===================================================================
 
6098
--- a/src/gcc/tree-vect-patterns.c      (.../tags/gcc_4_8_3_release)
 
6099
+++ b/src/gcc/tree-vect-patterns.c      (.../branches/gcc-4_8-branch)
 
6100
@@ -395,7 +395,7 @@
 
6101
           || !promotion)
 
6102
         return NULL;
 
6103
       oprnd00 = gimple_assign_rhs1 (def_stmt);
 
6104
-      if (!type_conversion_p (oprnd0, stmt, true, &half_type1, &def_stmt,
 
6105
+      if (!type_conversion_p (oprnd1, stmt, true, &half_type1, &def_stmt,
 
6106
                                 &promotion)
 
6107
           || !promotion)
 
6108
         return NULL;
 
6109
Index: gcc/sched-deps.c
 
6110
===================================================================
 
6111
--- a/src/gcc/sched-deps.c      (.../tags/gcc_4_8_3_release)
 
6112
+++ b/src/gcc/sched-deps.c      (.../branches/gcc-4_8-branch)
 
6113
@@ -2744,7 +2744,8 @@
 
6114
           Consider for instance a volatile asm that changes the fpu rounding
 
6115
           mode.  An insn should not be moved across this even if it only uses
 
6116
           pseudo-regs because it might give an incorrectly rounded result.  */
 
6117
-       if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
 
6118
+       if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
 
6119
+           && !DEBUG_INSN_P (insn))
 
6120
          reg_pending_barrier = TRUE_BARRIER;
 
6121
 
 
6122
        /* For all ASM_OPERANDS, we must traverse the vector of input operands.
 
6123
Index: gcc/config/alpha/elf.h
 
6124
===================================================================
 
6125
--- a/src/gcc/config/alpha/elf.h        (.../tags/gcc_4_8_3_release)
 
6126
+++ b/src/gcc/config/alpha/elf.h        (.../branches/gcc-4_8-branch)
 
6127
@@ -126,6 +126,10 @@
 
6128
   "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
 
6129
    %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
6130
 
 
6131
+/* This variable should be set to 'true' if the target ABI requires
 
6132
+   unwinding tables even when exceptions are not used.  */
 
6133
+#define TARGET_UNWIND_TABLES_DEFAULT true
 
6134
+
 
6135
 /* Select a format to encode pointers in exception handling data.  CODE
 
6136
    is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
 
6137
    true if the symbol may be affected by dynamic relocations.
 
6138
Index: gcc/config/alpha/alpha.c
 
6139
===================================================================
 
6140
--- a/src/gcc/config/alpha/alpha.c      (.../tags/gcc_4_8_3_release)
 
6141
+++ b/src/gcc/config/alpha/alpha.c      (.../branches/gcc-4_8-branch)
 
6142
@@ -8658,6 +8658,11 @@
 
6143
                        }
 
6144
                      break;
 
6145
 
 
6146
+                   case BARRIER:
 
6147
+                     /* __builtin_unreachable can expand to no code at all,
 
6148
+                        leaving (barrier) RTXes in the instruction stream.  */
 
6149
+                     goto close_shadow_notrapb;
 
6150
+
 
6151
                    case JUMP_INSN:
 
6152
                    case CALL_INSN:
 
6153
                    case CODE_LABEL:
 
6154
@@ -8673,6 +8678,7 @@
 
6155
                  n = emit_insn_before (gen_trapb (), i);
 
6156
                  PUT_MODE (n, TImode);
 
6157
                  PUT_MODE (i, TImode);
 
6158
+               close_shadow_notrapb:
 
6159
                  trap_pending = 0;
 
6160
                  shadow.used.i = 0;
 
6161
                  shadow.used.fp = 0;
 
6162
Index: gcc/config/elfos.h
 
6163
===================================================================
 
6164
--- a/src/gcc/config/elfos.h    (.../tags/gcc_4_8_3_release)
 
6165
+++ b/src/gcc/config/elfos.h    (.../branches/gcc-4_8-branch)
 
6166
@@ -287,7 +287,7 @@
 
6167
 /* Write the extra assembler code needed to declare an object properly.  */
 
6168
 
 
6169
 #ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
 
6170
-#define USE_GNU_UNIQUE_OBJECT 1
 
6171
+#define USE_GNU_UNIQUE_OBJECT flag_gnu_unique
 
6172
 #else
 
6173
 #define USE_GNU_UNIQUE_OBJECT 0
 
6174
 #endif
 
6175
Index: gcc/config/sparc/sync.md
 
6176
===================================================================
 
6177
--- a/src/gcc/config/sparc/sync.md      (.../tags/gcc_4_8_3_release)
 
6178
+++ b/src/gcc/config/sparc/sync.md      (.../branches/gcc-4_8-branch)
 
6179
@@ -64,11 +64,19 @@
 
6180
   "stbar"
 
6181
   [(set_attr "type" "multi")])
 
6182
 
 
6183
+;; For LEON3, STB has the effect of membar #StoreLoad.
 
6184
+(define_insn "*membar_storeload_leon3"
 
6185
+  [(set (match_operand:BLK 0 "" "")
 
6186
+       (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
 
6187
+  "TARGET_LEON3"
 
6188
+  "stb\t%%g0, [%%sp-1]"
 
6189
+  [(set_attr "type" "store")])
 
6190
+
 
6191
 ;; For V8, LDSTUB has the effect of membar #StoreLoad.
 
6192
 (define_insn "*membar_storeload"
 
6193
   [(set (match_operand:BLK 0 "" "")
 
6194
        (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
 
6195
-  "TARGET_V8"
 
6196
+  "TARGET_V8 && !TARGET_LEON3"
 
6197
   "ldstub\t[%%sp-1], %%g0"
 
6198
   [(set_attr "type" "multi")])
 
6199
 
 
6200
Index: gcc/config/i386/i386.md
 
6201
===================================================================
 
6202
--- a/src/gcc/config/i386/i386.md       (.../tags/gcc_4_8_3_release)
 
6203
+++ b/src/gcc/config/i386/i386.md       (.../branches/gcc-4_8-branch)
 
6204
@@ -5339,66 +5339,37 @@
 
6205
 
 
6206
 ;; Avoid store forwarding (partial memory) stall penalty by extending
 
6207
 ;; SImode value to DImode through XMM register instead of pushing two
 
6208
-;; SImode values to stack. Note that even !TARGET_INTER_UNIT_MOVES
 
6209
-;; targets benefit from this optimization. Also note that fild
 
6210
-;; loads from memory only.
 
6211
+;; SImode values to stack. Also note that fild loads from memory only.
 
6212
 
 
6213
-(define_insn "*floatunssi<mode>2_1"
 
6214
-  [(set (match_operand:X87MODEF 0 "register_operand" "=f,f")
 
6215
+(define_insn_and_split "*floatunssi<mode>2_i387_with_xmm"
 
6216
+  [(set (match_operand:X87MODEF 0 "register_operand" "=f")
 
6217
        (unsigned_float:X87MODEF
 
6218
-         (match_operand:SI 1 "nonimmediate_operand" "x,m")))
 
6219
-   (clobber (match_operand:DI 2 "memory_operand" "=m,m"))
 
6220
-   (clobber (match_scratch:SI 3 "=X,x"))]
 
6221
+         (match_operand:SI 1 "nonimmediate_operand" "rm")))
 
6222
+   (clobber (match_scratch:DI 3 "=x"))
 
6223
+   (clobber (match_operand:DI 2 "memory_operand" "=m"))]
 
6224
   "!TARGET_64BIT
 
6225
    && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
 
6226
-   && TARGET_SSE"
 
6227
+   && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES"
 
6228
   "#"
 
6229
+  "&& reload_completed"
 
6230
+  [(set (match_dup 3) (zero_extend:DI (match_dup 1)))
 
6231
+   (set (match_dup 2) (match_dup 3))
 
6232
+   (set (match_dup 0)
 
6233
+       (float:X87MODEF (match_dup 2)))]
 
6234
+  ""
 
6235
   [(set_attr "type" "multi")
 
6236
    (set_attr "mode" "<MODE>")])
 
6237
 
 
6238
-(define_split
 
6239
-  [(set (match_operand:X87MODEF 0 "register_operand")
 
6240
-       (unsigned_float:X87MODEF
 
6241
-         (match_operand:SI 1 "register_operand")))
 
6242
-   (clobber (match_operand:DI 2 "memory_operand"))
 
6243
-   (clobber (match_scratch:SI 3))]
 
6244
-  "!TARGET_64BIT
 
6245
-   && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
 
6246
-   && TARGET_SSE
 
6247
-   && reload_completed"
 
6248
-  [(set (match_dup 2) (match_dup 1))
 
6249
-   (set (match_dup 0)
 
6250
-       (float:X87MODEF (match_dup 2)))]
 
6251
-  "operands[1] = simplify_gen_subreg (DImode, operands[1], SImode, 0);")
 
6252
-
 
6253
-(define_split
 
6254
-  [(set (match_operand:X87MODEF 0 "register_operand")
 
6255
-       (unsigned_float:X87MODEF
 
6256
-         (match_operand:SI 1 "memory_operand")))
 
6257
-   (clobber (match_operand:DI 2 "memory_operand"))
 
6258
-   (clobber (match_scratch:SI 3))]
 
6259
-  "!TARGET_64BIT
 
6260
-   && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
 
6261
-   && TARGET_SSE
 
6262
-   && reload_completed"
 
6263
-  [(set (match_dup 2) (match_dup 3))
 
6264
-   (set (match_dup 0)
 
6265
-       (float:X87MODEF (match_dup 2)))]
 
6266
-{
 
6267
-  emit_move_insn (operands[3], operands[1]);
 
6268
-  operands[3] = simplify_gen_subreg (DImode, operands[3], SImode, 0);
 
6269
-})
 
6270
-
 
6271
 (define_expand "floatunssi<mode>2"
 
6272
   [(parallel
 
6273
      [(set (match_operand:X87MODEF 0 "register_operand")
 
6274
           (unsigned_float:X87MODEF
 
6275
             (match_operand:SI 1 "nonimmediate_operand")))
 
6276
-      (clobber (match_dup 2))
 
6277
-      (clobber (match_scratch:SI 3))])]
 
6278
+      (clobber (match_scratch:DI 3))
 
6279
+      (clobber (match_dup 2))])]
 
6280
   "!TARGET_64BIT
 
6281
    && ((TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
 
6282
-       && TARGET_SSE)
 
6283
+       && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES)
 
6284
        || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))"
 
6285
 {
 
6286
   if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
 
6287
Index: gcc/config/i386/driver-i386.c
 
6288
===================================================================
 
6289
--- a/src/gcc/config/i386/driver-i386.c (.../tags/gcc_4_8_3_release)
 
6290
+++ b/src/gcc/config/i386/driver-i386.c (.../branches/gcc-4_8-branch)
 
6291
@@ -713,6 +713,11 @@
 
6292
                    /* Assume Core 2.  */
 
6293
                    cpu = "core2";
 
6294
                }
 
6295
+             else if (has_longmode)
 
6296
+               /* Perhaps some emulator?  Assume x86-64, otherwise gcc
 
6297
+                  -march=native would be unusable for 64-bit compilations,
 
6298
+                  as all the CPUs below are 32-bit only.  */
 
6299
+               cpu = "x86-64";
 
6300
              else if (has_sse3)
 
6301
                /* It is Core Duo.  */
 
6302
                cpu = "pentium-m";
 
6303
Index: gcc/config/i386/i386.c
 
6304
===================================================================
 
6305
--- a/src/gcc/config/i386/i386.c        (.../tags/gcc_4_8_3_release)
 
6306
+++ b/src/gcc/config/i386/i386.c        (.../branches/gcc-4_8-branch)
 
6307
@@ -20505,7 +20505,7 @@
 
6308
          t1 = gen_reg_rtx (V32QImode);
 
6309
          t2 = gen_reg_rtx (V32QImode);
 
6310
          t3 = gen_reg_rtx (V32QImode);
 
6311
-         vt2 = GEN_INT (128);
 
6312
+         vt2 = GEN_INT (-128);
 
6313
          for (i = 0; i < 32; i++)
 
6314
            vec[i] = vt2;
 
6315
          vt = gen_rtx_CONST_VECTOR (V32QImode, gen_rtvec_v (32, vec));
 
6316
@@ -24640,13 +24640,17 @@
 
6317
              {
 
6318
                edge e;
 
6319
                edge_iterator ei;
 
6320
-               /* Assume that region is SCC, i.e. all immediate predecessors
 
6321
-                  of non-head block are in the same region.  */
 
6322
+
 
6323
+               /* Regions are SCCs with the exception of selective
 
6324
+                  scheduling with pipelining of outer blocks enabled.
 
6325
+                  So also check that immediate predecessors of a non-head
 
6326
+                  block are in the same region.  */
 
6327
                FOR_EACH_EDGE (e, ei, bb->preds)
 
6328
                  {
 
6329
                    /* Avoid creating of loop-carried dependencies through
 
6330
-                      using topological odering in region.  */
 
6331
-                   if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
 
6332
+                      using topological ordering in the region.  */
 
6333
+                   if (rgn == CONTAINING_RGN (e->src->index)
 
6334
+                       && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
 
6335
                      add_dependee_for_func_arg (first_arg, e->src); 
 
6336
                  }
 
6337
              }
 
6338
Index: gcc/config/sh/sh.c
 
6339
===================================================================
 
6340
--- a/src/gcc/config/sh/sh.c    (.../tags/gcc_4_8_3_release)
 
6341
+++ b/src/gcc/config/sh/sh.c    (.../branches/gcc-4_8-branch)
 
6342
@@ -808,6 +808,12 @@
 
6343
        targetm.asm_out.aligned_op.di = NULL;
 
6344
        targetm.asm_out.unaligned_op.di = NULL;
 
6345
     }
 
6346
+
 
6347
+  /* User/priviledged mode is supported only on SH3*, SH4* and SH5*.
 
6348
+     Disable it for everything else.  */
 
6349
+  if (! (TARGET_SH3 || TARGET_SH5) && TARGET_USERMODE)
 
6350
+    TARGET_USERMODE = false;
 
6351
+
 
6352
   if (TARGET_SH1)
 
6353
     {
 
6354
       if (! strcmp (sh_div_str, "call-div1"))
 
6355
Index: gcc/config/sh/sh.opt
 
6356
===================================================================
 
6357
--- a/src/gcc/config/sh/sh.opt  (.../tags/gcc_4_8_3_release)
 
6358
+++ b/src/gcc/config/sh/sh.opt  (.../branches/gcc-4_8-branch)
 
6359
@@ -343,7 +343,7 @@
 
6360
 Cost to assume for a multiply insn
 
6361
 
 
6362
 musermode
 
6363
-Target Report RejectNegative Var(TARGET_USERMODE)
 
6364
+Target Var(TARGET_USERMODE)
 
6365
 Don't generate privileged-mode only code; implies -mno-inline-ic_invalidate if the inline code would not work in user mode.
 
6366
 
 
6367
 ;; We might want to enable this by default for TARGET_HARD_SH4, because
 
6368
Index: gcc/config/microblaze/predicates.md
 
6369
===================================================================
 
6370
--- a/src/gcc/config/microblaze/predicates.md   (.../tags/gcc_4_8_3_release)
 
6371
+++ b/src/gcc/config/microblaze/predicates.md   (.../branches/gcc-4_8-branch)
 
6372
@@ -85,10 +85,6 @@
 
6373
   (ior (match_operand 0 "const_0_operand")
 
6374
        (match_operand 0 "register_operand")))
 
6375
 
 
6376
-(define_predicate "reg_or_mem_operand"
 
6377
-  (ior (match_operand 0 "memory_operand")
 
6378
-       (match_operand 0 "register_operand")))
 
6379
-
 
6380
 ;;  Return if the operand is either the PC or a label_ref.  
 
6381
 (define_special_predicate "pc_or_label_operand"
 
6382
   (ior (match_code "pc,label_ref")
 
6383
Index: gcc/config/microblaze/microblaze.md
 
6384
===================================================================
 
6385
--- a/src/gcc/config/microblaze/microblaze.md   (.../tags/gcc_4_8_3_release)
 
6386
+++ b/src/gcc/config/microblaze/microblaze.md   (.../branches/gcc-4_8-branch)
 
6387
@@ -1119,18 +1119,6 @@
 
6388
   }
 
6389
 )
 
6390
 
 
6391
-;;Load and store reverse
 
6392
-(define_insn "movsi4_rev"
 
6393
-  [(set (match_operand:SI 0 "reg_or_mem_operand" "=r,Q")
 
6394
-        (bswap:SI (match_operand:SF 1 "reg_or_mem_operand" "Q,r")))]
 
6395
-  "TARGET_REORDER"
 
6396
-  "@
 
6397
-   lwr\t%0,%y1,r0
 
6398
-   swr\t%1,%y0,r0"
 
6399
-  [(set_attr "type"     "load,store")
 
6400
-  (set_attr "mode"      "SI")
 
6401
-  (set_attr "length"    "4,4")])
 
6402
-
 
6403
 ;; 32-bit floating point moves
 
6404
 
 
6405
 (define_expand "movsf"
 
6406
Index: gcc/config/avr/avr-fixed.md
 
6407
===================================================================
 
6408
--- a/src/gcc/config/avr/avr-fixed.md   (.../tags/gcc_4_8_3_release)
 
6409
+++ b/src/gcc/config/avr/avr-fixed.md   (.../branches/gcc-4_8-branch)
 
6410
@@ -430,8 +430,8 @@
 
6411
       }
 
6412
 
 
6413
     // Input and output of the libgcc function
 
6414
-    const unsigned int regno_in[]  = { -1, 22, 22, -1, 18 };
 
6415
-    const unsigned int regno_out[] = { -1, 24, 24, -1, 22 };
 
6416
+    const unsigned int regno_in[]  = { -1U, 22, 22, -1U, 18 };
 
6417
+    const unsigned int regno_out[] = { -1U, 24, 24, -1U, 22 };
 
6418
 
 
6419
     operands[3] = gen_rtx_REG (<MODE>mode, regno_out[(size_t) GET_MODE_SIZE (<MODE>mode)]);
 
6420
     operands[4] = gen_rtx_REG (<MODE>mode,  regno_in[(size_t) GET_MODE_SIZE (<MODE>mode)]);
 
6421
Index: gcc/config/avr/avr.md
 
6422
===================================================================
 
6423
--- a/src/gcc/config/avr/avr.md (.../tags/gcc_4_8_3_release)
 
6424
+++ b/src/gcc/config/avr/avr.md (.../branches/gcc-4_8-branch)
 
6425
@@ -367,6 +367,15 @@
 
6426
   ""
 
6427
   {
 
6428
     int i;
 
6429
+
 
6430
+    // Avoid (subreg (mem)) for non-generic address spaces below.  Because
 
6431
+    // of the poor addressing capabilities of these spaces it's better to
 
6432
+    // load them in one chunk.  And it avoids PR61443.
 
6433
+
 
6434
+    if (MEM_P (operands[0])
 
6435
+        && !ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[0])))
 
6436
+      operands[0] = copy_to_mode_reg (<MODE>mode, operands[0]);
 
6437
+
 
6438
     for (i = GET_MODE_SIZE (<MODE>mode) - 1; i >= 0; --i)
 
6439
       {
 
6440
         rtx part = simplify_gen_subreg (QImode, operands[0], <MODE>mode, i);
 
6441
Index: gcc/config/avr/avr.h
 
6442
===================================================================
 
6443
--- a/src/gcc/config/avr/avr.h  (.../tags/gcc_4_8_3_release)
 
6444
+++ b/src/gcc/config/avr/avr.h  (.../branches/gcc-4_8-branch)
 
6445
@@ -250,18 +250,18 @@
 
6446
 #define REG_CLASS_CONTENTS {                                           \
 
6447
   {0x00000000,0x00000000},     /* NO_REGS */                           \
 
6448
   {0x00000001,0x00000000},     /* R0_REG */                            \
 
6449
-  {3 << REG_X,0x00000000},      /* POINTER_X_REGS, r26 - r27 */                \
 
6450
-  {3 << REG_Y,0x00000000},      /* POINTER_Y_REGS, r28 - r29 */                \
 
6451
-  {3 << REG_Z,0x00000000},      /* POINTER_Z_REGS, r30 - r31 */                \
 
6452
+  {3u << REG_X,0x00000000},     /* POINTER_X_REGS, r26 - r27 */                \
 
6453
+  {3u << REG_Y,0x00000000},     /* POINTER_Y_REGS, r28 - r29 */                \
 
6454
+  {3u << REG_Z,0x00000000},     /* POINTER_Z_REGS, r30 - r31 */                \
 
6455
   {0x00000000,0x00000003},     /* STACK_REG, STACK */                  \
 
6456
-  {(3 << REG_Y) | (3 << REG_Z),                                                \
 
6457
+  {(3u << REG_Y) | (3u << REG_Z),                                      \
 
6458
      0x00000000},              /* BASE_POINTER_REGS, r28 - r31 */      \
 
6459
-  {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z),                         \
 
6460
+  {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z),                      \
 
6461
      0x00000000},              /* POINTER_REGS, r26 - r31 */           \
 
6462
-  {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W),          \
 
6463
+  {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z) | (3u << REG_W),      \
 
6464
      0x00000000},              /* ADDW_REGS, r24 - r31 */              \
 
6465
   {0x00ff0000,0x00000000},     /* SIMPLE_LD_REGS r16 - r23 */          \
 
6466
-  {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16),   \
 
6467
+  {(3u << REG_X)|(3u << REG_Y)|(3u << REG_Z)|(3u << REG_W)|(0xffu << 16),\
 
6468
      0x00000000},      /* LD_REGS, r16 - r31 */                        \
 
6469
   {0x0000ffff,0x00000000},     /* NO_LD_REGS  r0 - r15 */              \
 
6470
   {0xffffffff,0x00000000},     /* GENERAL_REGS, r0 - r31 */            \
 
6471
Index: gcc/config/aarch64/arm_neon.h
 
6472
===================================================================
 
6473
--- a/src/gcc/config/aarch64/arm_neon.h (.../tags/gcc_4_8_3_release)
 
6474
+++ b/src/gcc/config/aarch64/arm_neon.h (.../branches/gcc-4_8-branch)
 
6475
@@ -13815,7 +13815,7 @@
 
6476
   int16x4_t result;
 
6477
   __asm__ ("sqdmulh %0.4h,%1.4h,%2.h[0]"
 
6478
            : "=w"(result)
 
6479
-           : "w"(a), "w"(b)
 
6480
+           : "w"(a), "x"(b)
 
6481
            : /* No clobbers */);
 
6482
   return result;
 
6483
 }
 
6484
@@ -13837,7 +13837,7 @@
 
6485
   int16x8_t result;
 
6486
   __asm__ ("sqdmulh %0.8h,%1.8h,%2.h[0]"
 
6487
            : "=w"(result)
 
6488
-           : "w"(a), "w"(b)
 
6489
+           : "w"(a), "x"(b)
 
6490
            : /* No clobbers */);
 
6491
   return result;
 
6492
 }
 
6493
Index: gcc/config/aarch64/aarch64.md
 
6494
===================================================================
 
6495
--- a/src/gcc/config/aarch64/aarch64.md (.../tags/gcc_4_8_3_release)
 
6496
+++ b/src/gcc/config/aarch64/aarch64.md (.../branches/gcc-4_8-branch)
 
6497
@@ -3292,6 +3292,7 @@
 
6498
         (unspec:DI [(match_operand:DI 0 "aarch64_valid_symref" "S")]
 
6499
                   UNSPEC_TLSDESC))
 
6500
    (clobber (reg:DI LR_REGNUM))
 
6501
+   (clobber (reg:CC CC_REGNUM))
 
6502
    (clobber (match_scratch:DI 1 "=r"))]
 
6503
   "TARGET_TLS_DESC"
 
6504
   "adrp\\tx0, %A0\;ldr\\t%1, [x0, #%L0]\;add\\tx0, x0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"
 
6505
Index: gcc/config/aarch64/aarch64.c
 
6506
===================================================================
 
6507
--- a/src/gcc/config/aarch64/aarch64.c  (.../tags/gcc_4_8_3_release)
 
6508
+++ b/src/gcc/config/aarch64/aarch64.c  (.../branches/gcc-4_8-branch)
 
6509
@@ -1201,6 +1201,7 @@
 
6510
   CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v);
 
6511
   int ncrn, nvrn, nregs;
 
6512
   bool allocate_ncrn, allocate_nvrn;
 
6513
+  HOST_WIDE_INT size;
 
6514
 
 
6515
   /* We need to do this once per argument.  */
 
6516
   if (pcum->aapcs_arg_processed)
 
6517
@@ -1208,6 +1209,11 @@
 
6518
 
 
6519
   pcum->aapcs_arg_processed = true;
 
6520
 
 
6521
+  /* Size in bytes, rounded to the nearest multiple of 8 bytes.  */
 
6522
+  size
 
6523
+    = AARCH64_ROUND_UP (type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode),
 
6524
+                       UNITS_PER_WORD);
 
6525
+
 
6526
   allocate_ncrn = (type) ? !(FLOAT_TYPE_P (type)) : !FLOAT_MODE_P (mode);
 
6527
   allocate_nvrn = aarch64_vfp_is_call_candidate (pcum_v,
 
6528
                                                 mode,
 
6529
@@ -1258,10 +1264,8 @@
 
6530
     }
 
6531
 
 
6532
   ncrn = pcum->aapcs_ncrn;
 
6533
-  nregs = ((type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode))
 
6534
-          + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 
6535
+  nregs = size / UNITS_PER_WORD;
 
6536
 
 
6537
-
 
6538
   /* C6 - C9.  though the sign and zero extension semantics are
 
6539
      handled elsewhere.  This is the case where the argument fits
 
6540
      entirely general registers.  */
 
6541
@@ -1309,13 +1313,12 @@
 
6542
   pcum->aapcs_nextncrn = NUM_ARG_REGS;
 
6543
 
 
6544
   /* The argument is passed on stack; record the needed number of words for
 
6545
-     this argument (we can re-use NREGS) and align the total size if
 
6546
-     necessary.  */
 
6547
+     this argument and align the total size if necessary.  */
 
6548
 on_stack:
 
6549
-  pcum->aapcs_stack_words = nregs;
 
6550
+  pcum->aapcs_stack_words = size / UNITS_PER_WORD;
 
6551
   if (aarch64_function_arg_alignment (mode, type) == 16 * BITS_PER_UNIT)
 
6552
     pcum->aapcs_stack_size = AARCH64_ROUND_UP (pcum->aapcs_stack_size,
 
6553
-                                              16 / UNITS_PER_WORD) + 1;
 
6554
+                                              16 / UNITS_PER_WORD);
 
6555
   return;
 
6556
 }
 
6557
 
 
6558
Index: gcc/config/aarch64/aarch64-linux.h
 
6559
===================================================================
 
6560
--- a/src/gcc/config/aarch64/aarch64-linux.h    (.../tags/gcc_4_8_3_release)
 
6561
+++ b/src/gcc/config/aarch64/aarch64-linux.h    (.../branches/gcc-4_8-branch)
 
6562
@@ -43,4 +43,6 @@
 
6563
     }                                          \
 
6564
   while (0)
 
6565
 
 
6566
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
6567
+
 
6568
 #endif  /* GCC_AARCH64_LINUX_H */
 
6569
Index: gcc/config/rs6000/constraints.md
 
6570
===================================================================
 
6571
--- a/src/gcc/config/rs6000/constraints.md      (.../tags/gcc_4_8_3_release)
 
6572
+++ b/src/gcc/config/rs6000/constraints.md      (.../branches/gcc-4_8-branch)
 
6573
@@ -65,6 +65,20 @@
 
6574
 (define_register_constraint "wg" "rs6000_constraints[RS6000_CONSTRAINT_wg]"
 
6575
   "If -mmfpgpr was used, a floating point register or NO_REGS.")
 
6576
 
 
6577
+(define_register_constraint "wh" "rs6000_constraints[RS6000_CONSTRAINT_wh]"
 
6578
+  "Floating point register if direct moves are available, or NO_REGS.")
 
6579
+
 
6580
+;; At present, DImode is not allowed in the Altivec registers.  If in the
 
6581
+;; future it is allowed, wi/wj can be set to VSX_REGS instead of FLOAT_REGS.
 
6582
+(define_register_constraint "wi" "rs6000_constraints[RS6000_CONSTRAINT_wi]"
 
6583
+  "FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS.")
 
6584
+
 
6585
+(define_register_constraint "wj" "rs6000_constraints[RS6000_CONSTRAINT_wj]"
 
6586
+  "FP or VSX register to hold 64-bit integers for direct moves or NO_REGS.")
 
6587
+
 
6588
+(define_register_constraint "wk" "rs6000_constraints[RS6000_CONSTRAINT_wk]"
 
6589
+  "FP or VSX register to hold 64-bit doubles for direct moves or NO_REGS.")
 
6590
+
 
6591
 (define_register_constraint "wl" "rs6000_constraints[RS6000_CONSTRAINT_wl]"
 
6592
   "Floating point register if the LFIWAX instruction is enabled or NO_REGS.")
 
6593
 
 
6594
@@ -98,7 +112,7 @@
 
6595
   "Floating point register if the STFIWX instruction is enabled or NO_REGS.")
 
6596
 
 
6597
 (define_register_constraint "wy" "rs6000_constraints[RS6000_CONSTRAINT_wy]"
 
6598
-  "VSX vector register to hold scalar float values or NO_REGS.")
 
6599
+  "FP or VSX register to perform ISA 2.07 float ops or NO_REGS.")
 
6600
 
 
6601
 (define_register_constraint "wz" "rs6000_constraints[RS6000_CONSTRAINT_wz]"
 
6602
   "Floating point register if the LFIWZX instruction is enabled or NO_REGS.")
 
6603
Index: gcc/config/rs6000/htm.md
 
6604
===================================================================
 
6605
--- a/src/gcc/config/rs6000/htm.md      (.../tags/gcc_4_8_3_release)
 
6606
+++ b/src/gcc/config/rs6000/htm.md      (.../branches/gcc-4_8-branch)
 
6607
@@ -179,7 +179,7 @@
 
6608
                             (const_int 0)]
 
6609
                            UNSPECV_HTM_TABORTWCI))
 
6610
    (set (subreg:CC (match_dup 2) 0) (match_dup 1))
 
6611
-   (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 24)))
 
6612
+   (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 28)))
 
6613
    (parallel [(set (match_operand:SI 0 "int_reg_operand" "")
 
6614
                   (and:SI (match_dup 3) (const_int 15)))
 
6615
               (clobber (scratch:CC))])]
 
6616
Index: gcc/config/rs6000/freebsd64.h
 
6617
===================================================================
 
6618
--- a/src/gcc/config/rs6000/freebsd64.h (.../tags/gcc_4_8_3_release)
 
6619
+++ b/src/gcc/config/rs6000/freebsd64.h (.../branches/gcc-4_8-branch)
 
6620
@@ -367,7 +367,7 @@
 
6621
 /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given.  */
 
6622
 #undef  ADJUST_FIELD_ALIGN
 
6623
 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
 
6624
-  ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
 
6625
+  (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))           \
 
6626
    ? 128                                                                \
 
6627
    : (TARGET_64BIT                                                      \
 
6628
       && TARGET_ALIGN_NATURAL == 0                                      \
 
6629
Index: gcc/config/rs6000/rs6000-protos.h
 
6630
===================================================================
 
6631
--- a/src/gcc/config/rs6000/rs6000-protos.h     (.../tags/gcc_4_8_3_release)
 
6632
+++ b/src/gcc/config/rs6000/rs6000-protos.h     (.../branches/gcc-4_8-branch)
 
6633
@@ -153,6 +153,7 @@
 
6634
 
 
6635
 #ifdef TREE_CODE
 
6636
 extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
 
6637
+extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
 
6638
 extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
 
6639
                                                     unsigned int);
 
6640
 extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
 
6641
@@ -161,7 +162,7 @@
 
6642
 extern rtx rs6000_libcall_value (enum machine_mode);
 
6643
 extern rtx rs6000_va_arg (tree, tree);
 
6644
 extern int function_ok_for_sibcall (tree);
 
6645
-extern int rs6000_reg_parm_stack_space (tree);
 
6646
+extern int rs6000_reg_parm_stack_space (tree, bool);
 
6647
 extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
 
6648
 extern bool rs6000_elf_in_small_data_p (const_tree);
 
6649
 #ifdef ARGS_SIZE_RTX
 
6650
Index: gcc/config/rs6000/rs6000-builtin.def
 
6651
===================================================================
 
6652
--- a/src/gcc/config/rs6000/rs6000-builtin.def  (.../tags/gcc_4_8_3_release)
 
6653
+++ b/src/gcc/config/rs6000/rs6000-builtin.def  (.../branches/gcc-4_8-branch)
 
6654
@@ -622,20 +622,13 @@
 
6655
                     | RS6000_BTC_TERNARY),                             \
 
6656
                    CODE_FOR_ ## ICODE)                 /* ICODE */
 
6657
 
 
6658
-/* Miscellaneous builtins.  */
 
6659
-#define BU_MISC_1(ENUM, NAME, ATTR, ICODE)                             \
 
6660
+/* 128-bit long double floating point builtins.  */
 
6661
+#define BU_LDBL128_2(ENUM, NAME, ATTR, ICODE)                          \
 
6662
   RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM,             /* ENUM */      \
 
6663
                    "__builtin_" NAME,                  /* NAME */      \
 
6664
-                   RS6000_BTM_HARD_FLOAT,              /* MASK */      \
 
6665
+                   (RS6000_BTM_HARD_FLOAT              /* MASK */      \
 
6666
+                    | RS6000_BTM_LDBL128),                             \
 
6667
                    (RS6000_BTC_ ## ATTR                /* ATTR */      \
 
6668
-                    | RS6000_BTC_UNARY),                               \
 
6669
-                   CODE_FOR_ ## ICODE)                 /* ICODE */
 
6670
-
 
6671
-#define BU_MISC_2(ENUM, NAME, ATTR, ICODE)                             \
 
6672
-  RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM,             /* ENUM */      \
 
6673
-                   "__builtin_" NAME,                  /* NAME */      \
 
6674
-                   RS6000_BTM_HARD_FLOAT,              /* MASK */      \
 
6675
-                   (RS6000_BTC_ ## ATTR                /* ATTR */      \
 
6676
                     | RS6000_BTC_BINARY),                              \
 
6677
                    CODE_FOR_ ## ICODE)                 /* ICODE */
 
6678
 
 
6679
@@ -1593,10 +1586,8 @@
 
6680
 BU_DFP_MISC_2 (PACK_TD,                "pack_dec128",          CONST,  packtd)
 
6681
 BU_DFP_MISC_2 (UNPACK_TD,      "unpack_dec128",        CONST,  unpacktd)
 
6682
 
 
6683
-BU_MISC_2 (PACK_TF,            "pack_longdouble",      CONST,  packtf)
 
6684
-BU_MISC_2 (UNPACK_TF,          "unpack_longdouble",    CONST,  unpacktf)
 
6685
-BU_MISC_1 (UNPACK_TF_0,                "longdouble_dw0",       CONST,  unpacktf_0)
 
6686
-BU_MISC_1 (UNPACK_TF_1,                "longdouble_dw1",       CONST,  unpacktf_1)
 
6687
+BU_LDBL128_2 (PACK_TF,         "pack_longdouble",      CONST,  packtf)
 
6688
+BU_LDBL128_2 (UNPACK_TF,       "unpack_longdouble",    CONST,  unpacktf)
 
6689
 
 
6690
 BU_P7_MISC_2 (PACK_V1TI,       "pack_vector_int128",   CONST,  packv1ti)
 
6691
 BU_P7_MISC_2 (UNPACK_V1TI,     "unpack_vector_int128", CONST,  unpackv1ti)
 
6692
Index: gcc/config/rs6000/linux64.h
 
6693
===================================================================
 
6694
--- a/src/gcc/config/rs6000/linux64.h   (.../tags/gcc_4_8_3_release)
 
6695
+++ b/src/gcc/config/rs6000/linux64.h   (.../branches/gcc-4_8-branch)
 
6696
@@ -246,7 +246,7 @@
 
6697
 /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given.  */
 
6698
 #undef  ADJUST_FIELD_ALIGN
 
6699
 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
 
6700
-  ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)    \
 
6701
+  (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))           \
 
6702
    ? 128                                                               \
 
6703
    : (TARGET_64BIT                                                     \
 
6704
       && TARGET_ALIGN_NATURAL == 0                                     \
 
6705
Index: gcc/config/rs6000/rs6000.c
 
6706
===================================================================
 
6707
--- a/src/gcc/config/rs6000/rs6000.c    (.../tags/gcc_4_8_3_release)
 
6708
+++ b/src/gcc/config/rs6000/rs6000.c    (.../branches/gcc-4_8-branch)
 
6709
@@ -369,6 +369,7 @@
 
6710
   enum insn_code reload_gpr_vsx;       /* INSN to move from GPR to VSX.  */
 
6711
   enum insn_code reload_vsx_gpr;       /* INSN to move from VSX to GPR.  */
 
6712
   addr_mask_type addr_mask[(int)N_RELOAD_REG]; /* Valid address masks.  */
 
6713
+  bool scalar_in_vmx_p;                        /* Scalar value can go in VMX.  */
 
6714
 };
 
6715
 
 
6716
 static struct rs6000_reg_addr reg_addr[NUM_MACHINE_MODES];
 
6717
@@ -1704,8 +1705,7 @@
 
6718
      asked for it.  */
 
6719
   if (TARGET_VSX && VSX_REGNO_P (regno)
 
6720
       && (VECTOR_MEM_VSX_P (mode)
 
6721
-         || (TARGET_VSX_SCALAR_FLOAT && mode == SFmode)
 
6722
-         || (TARGET_VSX_SCALAR_DOUBLE && (mode == DFmode || mode == DImode))
 
6723
+         || reg_addr[mode].scalar_in_vmx_p
 
6724
          || (TARGET_VSX_TIMODE && mode == TImode)
 
6725
          || (TARGET_VADDUQM && mode == V1TImode)))
 
6726
     {
 
6727
@@ -1714,12 +1714,9 @@
 
6728
 
 
6729
       if (ALTIVEC_REGNO_P (regno))
 
6730
        {
 
6731
-         if (mode == SFmode && !TARGET_UPPER_REGS_SF)
 
6732
+         if (GET_MODE_SIZE (mode) != 16 && !reg_addr[mode].scalar_in_vmx_p)
 
6733
            return 0;
 
6734
 
 
6735
-         if ((mode == DFmode || mode == DImode) && !TARGET_UPPER_REGS_DF)
 
6736
-           return 0;
 
6737
-
 
6738
          return ALTIVEC_REGNO_P (last_regno);
 
6739
        }
 
6740
     }
 
6741
@@ -1897,14 +1894,16 @@
 
6742
   if (rs6000_vector_unit[m] != VECTOR_NONE
 
6743
       || rs6000_vector_mem[m] != VECTOR_NONE
 
6744
       || (reg_addr[m].reload_store != CODE_FOR_nothing)
 
6745
-      || (reg_addr[m].reload_load != CODE_FOR_nothing))
 
6746
+      || (reg_addr[m].reload_load != CODE_FOR_nothing)
 
6747
+      || reg_addr[m].scalar_in_vmx_p)
 
6748
     {
 
6749
       fprintf (stderr,
 
6750
-              "  Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c",
 
6751
+              "  Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c Upper=%c",
 
6752
               rs6000_debug_vector_unit (rs6000_vector_unit[m]),
 
6753
               rs6000_debug_vector_unit (rs6000_vector_mem[m]),
 
6754
               (reg_addr[m].reload_store != CODE_FOR_nothing) ? 's' : '*',
 
6755
-              (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*');
 
6756
+              (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*',
 
6757
+              (reg_addr[m].scalar_in_vmx_p) ? 'y' : 'n');
 
6758
     }
 
6759
 
 
6760
   fputs ("\n", stderr);
 
6761
@@ -2021,6 +2020,10 @@
 
6762
           "wd reg_class = %s\n"
 
6763
           "wf reg_class = %s\n"
 
6764
           "wg reg_class = %s\n"
 
6765
+          "wh reg_class = %s\n"
 
6766
+          "wi reg_class = %s\n"
 
6767
+          "wj reg_class = %s\n"
 
6768
+          "wk reg_class = %s\n"
 
6769
           "wl reg_class = %s\n"
 
6770
           "wm reg_class = %s\n"
 
6771
           "wr reg_class = %s\n"
 
6772
@@ -2040,6 +2043,10 @@
 
6773
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wd]],
 
6774
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wf]],
 
6775
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wg]],
 
6776
+          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wh]],
 
6777
+          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wi]],
 
6778
+          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wj]],
 
6779
+          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wk]],
 
6780
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wl]],
 
6781
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wm]],
 
6782
           reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wr]],
 
6783
@@ -2324,6 +2331,8 @@
 
6784
 
 
6785
   for (m = 0; m < NUM_MACHINE_MODES; ++m)
 
6786
     {
 
6787
+      enum machine_mode m2 = (enum machine_mode)m;
 
6788
+
 
6789
       /* SDmode is special in that we want to access it only via REG+REG
 
6790
         addressing on power7 and above, since we want to use the LFIWZX and
 
6791
         STFIWZX instructions to load it.  */
 
6792
@@ -2358,13 +2367,12 @@
 
6793
 
 
6794
              if (TARGET_UPDATE
 
6795
                  && (rc == RELOAD_REG_GPR || rc == RELOAD_REG_FPR)
 
6796
-                 && GET_MODE_SIZE (m) <= 8
 
6797
-                 && !VECTOR_MODE_P (m)
 
6798
-                 && !COMPLEX_MODE_P (m)
 
6799
+                 && GET_MODE_SIZE (m2) <= 8
 
6800
+                 && !VECTOR_MODE_P (m2)
 
6801
+                 && !COMPLEX_MODE_P (m2)
 
6802
                  && !indexed_only_p
 
6803
-                 && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m) == 8)
 
6804
-                 && !(m == DFmode && TARGET_UPPER_REGS_DF)
 
6805
-                 && !(m == SFmode && TARGET_UPPER_REGS_SF))
 
6806
+                 && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m2) == 8)
 
6807
+                 && !reg_addr[m2].scalar_in_vmx_p)
 
6808
                {
 
6809
                  addr_mask |= RELOAD_REG_PRE_INCDEC;
 
6810
 
 
6811
@@ -2595,16 +2603,22 @@
 
6812
        f  - Register class to use with traditional SFmode instructions.
 
6813
        v  - Altivec register.
 
6814
        wa - Any VSX register.
 
6815
+       wc - Reserved to represent individual CR bits (used in LLVM).
 
6816
        wd - Preferred register class for V2DFmode.
 
6817
        wf - Preferred register class for V4SFmode.
 
6818
        wg - Float register for power6x move insns.
 
6819
+       wh - FP register for direct move instructions.
 
6820
+       wi - FP or VSX register to hold 64-bit integers for VSX insns.
 
6821
+       wj - FP or VSX register to hold 64-bit integers for direct moves.
 
6822
+       wk - FP or VSX register to hold 64-bit doubles for direct moves.
 
6823
        wl - Float register if we can do 32-bit signed int loads.
 
6824
        wm - VSX register for ISA 2.07 direct move operations.
 
6825
+       wn - always NO_REGS.
 
6826
        wr - GPR if 64-bit mode is permitted.
 
6827
        ws - Register class to do ISA 2.06 DF operations.
 
6828
+       wt - VSX register for TImode in VSX registers.
 
6829
        wu - Altivec register for ISA 2.07 VSX SF/SI load/stores.
 
6830
        wv - Altivec register for ISA 2.06 VSX DF/DI load/stores.
 
6831
-       wt - VSX register for TImode in VSX registers.
 
6832
        ww - Register class to do SF conversions in with VSX operations.
 
6833
        wx - Float register if we can do 32-bit int stores.
 
6834
        wy - Register class to do ISA 2.07 SF operations.
 
6835
@@ -2611,21 +2625,22 @@
 
6836
        wz - Float register if we can do 32-bit unsigned int loads.  */
 
6837
 
 
6838
   if (TARGET_HARD_FLOAT && TARGET_FPRS)
 
6839
-    rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;
 
6840
+    rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;      /* SFmode  */
 
6841
 
 
6842
   if (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT)
 
6843
-    rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS;
 
6844
+    rs6000_constraints[RS6000_CONSTRAINT_d]  = FLOAT_REGS;     /* DFmode  */
 
6845
 
 
6846
   if (TARGET_VSX)
 
6847
     {
 
6848
       rs6000_constraints[RS6000_CONSTRAINT_wa] = VSX_REGS;
 
6849
-      rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;
 
6850
-      rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;
 
6851
+      rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;     /* V2DFmode  */
 
6852
+      rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;     /* V4SFmode  */
 
6853
+      rs6000_constraints[RS6000_CONSTRAINT_wi] = FLOAT_REGS;   /* DImode  */
 
6854
 
 
6855
       if (TARGET_VSX_TIMODE)
 
6856
-       rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;
 
6857
+       rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;    /* TImode  */
 
6858
 
 
6859
-      if (TARGET_UPPER_REGS_DF)
 
6860
+      if (TARGET_UPPER_REGS_DF)                                        /* DFmode  */
 
6861
        {
 
6862
          rs6000_constraints[RS6000_CONSTRAINT_ws] = VSX_REGS;
 
6863
          rs6000_constraints[RS6000_CONSTRAINT_wv] = ALTIVEC_REGS;
 
6864
@@ -2639,19 +2654,26 @@
 
6865
   if (TARGET_ALTIVEC)
 
6866
     rs6000_constraints[RS6000_CONSTRAINT_v] = ALTIVEC_REGS;
 
6867
 
 
6868
-  if (TARGET_MFPGPR)
 
6869
+  if (TARGET_MFPGPR)                                           /* DFmode  */
 
6870
     rs6000_constraints[RS6000_CONSTRAINT_wg] = FLOAT_REGS;
 
6871
 
 
6872
   if (TARGET_LFIWAX)
 
6873
-    rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;
 
6874
+    rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;     /* DImode  */
 
6875
 
 
6876
   if (TARGET_DIRECT_MOVE)
 
6877
-    rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
 
6878
+    {
 
6879
+      rs6000_constraints[RS6000_CONSTRAINT_wh] = FLOAT_REGS;
 
6880
+      rs6000_constraints[RS6000_CONSTRAINT_wj]                 /* DImode  */
 
6881
+       = rs6000_constraints[RS6000_CONSTRAINT_wi];
 
6882
+      rs6000_constraints[RS6000_CONSTRAINT_wk]                 /* DFmode  */
 
6883
+       = rs6000_constraints[RS6000_CONSTRAINT_ws];
 
6884
+      rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
 
6885
+    }
 
6886
 
 
6887
   if (TARGET_POWERPC64)
 
6888
     rs6000_constraints[RS6000_CONSTRAINT_wr] = GENERAL_REGS;
 
6889
 
 
6890
-  if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)
 
6891
+  if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)                        /* SFmode  */
 
6892
     {
 
6893
       rs6000_constraints[RS6000_CONSTRAINT_wu] = ALTIVEC_REGS;
 
6894
       rs6000_constraints[RS6000_CONSTRAINT_wy] = VSX_REGS;
 
6895
@@ -2666,10 +2688,10 @@
 
6896
     rs6000_constraints[RS6000_CONSTRAINT_ww] = FLOAT_REGS;
 
6897
 
 
6898
   if (TARGET_STFIWX)
 
6899
-    rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;
 
6900
+    rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;     /* DImode  */
 
6901
 
 
6902
   if (TARGET_LFIWZX)
 
6903
-    rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;
 
6904
+    rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;     /* DImode  */
 
6905
 
 
6906
   /* Set up the reload helper and direct move functions.  */
 
6907
   if (TARGET_VSX || TARGET_ALTIVEC)
 
6908
@@ -2692,10 +2714,11 @@
 
6909
          reg_addr[V2DFmode].reload_load   = CODE_FOR_reload_v2df_di_load;
 
6910
          if (TARGET_VSX && TARGET_UPPER_REGS_DF)
 
6911
            {
 
6912
-             reg_addr[DFmode].reload_store  = CODE_FOR_reload_df_di_store;
 
6913
-             reg_addr[DFmode].reload_load   = CODE_FOR_reload_df_di_load;
 
6914
-             reg_addr[DDmode].reload_store  = CODE_FOR_reload_dd_di_store;
 
6915
-             reg_addr[DDmode].reload_load   = CODE_FOR_reload_dd_di_load;
 
6916
+             reg_addr[DFmode].reload_store    = CODE_FOR_reload_df_di_store;
 
6917
+             reg_addr[DFmode].reload_load     = CODE_FOR_reload_df_di_load;
 
6918
+             reg_addr[DFmode].scalar_in_vmx_p = true;
 
6919
+             reg_addr[DDmode].reload_store    = CODE_FOR_reload_dd_di_store;
 
6920
+             reg_addr[DDmode].reload_load     = CODE_FOR_reload_dd_di_load;
 
6921
            }
 
6922
          if (TARGET_P8_VECTOR)
 
6923
            {
 
6924
@@ -2703,6 +2726,8 @@
 
6925
              reg_addr[SFmode].reload_load   = CODE_FOR_reload_sf_di_load;
 
6926
              reg_addr[SDmode].reload_store  = CODE_FOR_reload_sd_di_store;
 
6927
              reg_addr[SDmode].reload_load   = CODE_FOR_reload_sd_di_load;
 
6928
+             if (TARGET_UPPER_REGS_SF)
 
6929
+               reg_addr[SFmode].scalar_in_vmx_p = true;
 
6930
            }
 
6931
          if (TARGET_VSX_TIMODE)
 
6932
            {
 
6933
@@ -2759,10 +2784,11 @@
 
6934
          reg_addr[V2DFmode].reload_load   = CODE_FOR_reload_v2df_si_load;
 
6935
          if (TARGET_VSX && TARGET_UPPER_REGS_DF)
 
6936
            {
 
6937
-             reg_addr[DFmode].reload_store  = CODE_FOR_reload_df_si_store;
 
6938
-             reg_addr[DFmode].reload_load   = CODE_FOR_reload_df_si_load;
 
6939
-             reg_addr[DDmode].reload_store  = CODE_FOR_reload_dd_si_store;
 
6940
-             reg_addr[DDmode].reload_load   = CODE_FOR_reload_dd_si_load;
 
6941
+             reg_addr[DFmode].reload_store    = CODE_FOR_reload_df_si_store;
 
6942
+             reg_addr[DFmode].reload_load     = CODE_FOR_reload_df_si_load;
 
6943
+             reg_addr[DFmode].scalar_in_vmx_p = true;
 
6944
+             reg_addr[DDmode].reload_store    = CODE_FOR_reload_dd_si_store;
 
6945
+             reg_addr[DDmode].reload_load     = CODE_FOR_reload_dd_si_load;
 
6946
            }
 
6947
          if (TARGET_P8_VECTOR)
 
6948
            {
 
6949
@@ -2770,6 +2796,8 @@
 
6950
              reg_addr[SFmode].reload_load   = CODE_FOR_reload_sf_si_load;
 
6951
              reg_addr[SDmode].reload_store  = CODE_FOR_reload_sd_si_store;
 
6952
              reg_addr[SDmode].reload_load   = CODE_FOR_reload_sd_si_load;
 
6953
+             if (TARGET_UPPER_REGS_SF)
 
6954
+               reg_addr[SFmode].scalar_in_vmx_p = true;
 
6955
            }
 
6956
          if (TARGET_VSX_TIMODE)
 
6957
            {
 
6958
@@ -2810,6 +2838,7 @@
 
6959
 
 
6960
       for (m = 0; m < NUM_MACHINE_MODES; ++m)
 
6961
        {
 
6962
+         enum machine_mode m2 = (enum machine_mode)m;
 
6963
          int reg_size2 = reg_size;
 
6964
 
 
6965
          /* TFmode/TDmode always takes 2 registers, even in VSX.  */
 
6966
@@ -2818,7 +2847,7 @@
 
6967
            reg_size2 = UNITS_PER_FP_WORD;
 
6968
 
 
6969
          rs6000_class_max_nregs[m][c]
 
6970
-           = (GET_MODE_SIZE (m) + reg_size2 - 1) / reg_size2;
 
6971
+           = (GET_MODE_SIZE (m2) + reg_size2 - 1) / reg_size2;
 
6972
        }
 
6973
     }
 
6974
 
 
6975
@@ -3014,7 +3043,8 @@
 
6976
          | ((TARGET_CRYPTO)                ? RS6000_BTM_CRYPTO    : 0)
 
6977
          | ((TARGET_HTM)                   ? RS6000_BTM_HTM       : 0)
 
6978
          | ((TARGET_DFP)                   ? RS6000_BTM_DFP       : 0)
 
6979
-         | ((TARGET_HARD_FLOAT)            ? RS6000_BTM_HARD_FLOAT : 0));
 
6980
+         | ((TARGET_HARD_FLOAT)            ? RS6000_BTM_HARD_FLOAT : 0)
 
6981
+         | ((TARGET_LONG_DOUBLE_128)       ? RS6000_BTM_LDBL128 : 0));
 
6982
 }
 
6983
 
 
6984
 /* Override command line options.  Mostly we process the processor type and
 
6985
@@ -5861,6 +5891,34 @@
 
6986
   return align;
 
6987
 }
 
6988
 
 
6989
+/* Previous GCC releases forced all vector types to have 16-byte alignment.  */
 
6990
+
 
6991
+bool
 
6992
+rs6000_special_adjust_field_align_p (tree field, unsigned int computed)
 
6993
+{
 
6994
+  if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE)
 
6995
+    {
 
6996
+      if (computed != 128)
 
6997
+       {
 
6998
+         static bool warned;
 
6999
+         if (!warned && warn_psabi)
 
7000
+           {
 
7001
+             warned = true;
 
7002
+             inform (input_location,
 
7003
+                     "the layout of aggregates containing vectors with"
 
7004
+                     " %d-byte alignment will change in a future GCC release",
 
7005
+                     computed / BITS_PER_UNIT);
 
7006
+           }
 
7007
+       }
 
7008
+      /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
 
7009
+        keep the special treatment of vector types, but warn if there will
 
7010
+        be differences in future GCC releases.  */
 
7011
+      return true;
 
7012
+    }
 
7013
+
 
7014
+  return false;
 
7015
+}
 
7016
+
 
7017
 /* AIX increases natural record alignment to doubleword if the first
 
7018
    field is an FP double while the FP fields remain word aligned.  */
 
7019
 
 
7020
@@ -6109,7 +6167,8 @@
 
7021
     return false;
 
7022
 
 
7023
   extra = GET_MODE_SIZE (mode) - UNITS_PER_WORD;
 
7024
-  gcc_assert (extra >= 0);
 
7025
+  if (extra < 0)
 
7026
+    extra = 0;
 
7027
 
 
7028
   if (GET_CODE (addr) == LO_SUM)
 
7029
     /* For lo_sum addresses, we must allow any offset except one that
 
7030
@@ -9198,14 +9257,51 @@
 
7031
           || (type && TREE_CODE (type) == VECTOR_TYPE
 
7032
               && int_size_in_bytes (type) >= 16))
 
7033
     return 128;
 
7034
-  else if (((TARGET_MACHO && rs6000_darwin64_abi)
 
7035
-           || DEFAULT_ABI == ABI_ELFv2
 
7036
-            || (DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm))
 
7037
-          && mode == BLKmode
 
7038
-          && type && TYPE_ALIGN (type) > 64)
 
7039
+
 
7040
+  /* Aggregate types that need > 8 byte alignment are quadword-aligned
 
7041
+     in the parameter area in the ELFv2 ABI, and in the AIX ABI unless
 
7042
+     -mcompat-align-parm is used.  */
 
7043
+  if (((DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm)
 
7044
+       || DEFAULT_ABI == ABI_ELFv2)
 
7045
+      && type && TYPE_ALIGN (type) > 64)
 
7046
+    {
 
7047
+      /* "Aggregate" means any AGGREGATE_TYPE except for single-element
 
7048
+         or homogeneous float/vector aggregates here.  We already handled
 
7049
+         vector aggregates above, but still need to check for float here. */
 
7050
+      bool aggregate_p = (AGGREGATE_TYPE_P (type)
 
7051
+                         && !SCALAR_FLOAT_MODE_P (elt_mode));
 
7052
+
 
7053
+      /* We used to check for BLKmode instead of the above aggregate type
 
7054
+        check.  Warn when this results in any difference to the ABI.  */
 
7055
+      if (aggregate_p != (mode == BLKmode))
 
7056
+       {
 
7057
+         static bool warned;
 
7058
+         if (!warned && warn_psabi)
 
7059
+           {
 
7060
+             warned = true;
 
7061
+             inform (input_location,
 
7062
+                     "the ABI of passing aggregates with %d-byte alignment"
 
7063
+                     " will change in a future GCC release",
 
7064
+                     (int) TYPE_ALIGN (type) / BITS_PER_UNIT);
 
7065
+           }
 
7066
+       }
 
7067
+
 
7068
+      /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
 
7069
+        keep using the BLKmode check, but warn if there will be differences
 
7070
+        in future GCC releases.  */
 
7071
+      if (mode == BLKmode)
 
7072
+       return 128;
 
7073
+    }
 
7074
+
 
7075
+  /* Similar for the Darwin64 ABI.  Note that for historical reasons we
 
7076
+     implement the "aggregate type" check as a BLKmode check here; this
 
7077
+     means certain aggregate types are in fact not aligned.  */
 
7078
+  if (TARGET_MACHO && rs6000_darwin64_abi
 
7079
+      && mode == BLKmode
 
7080
+      && type && TYPE_ALIGN (type) > 64)
 
7081
     return 128;
 
7082
-  else
 
7083
-    return PARM_BOUNDARY;
 
7084
+
 
7085
+  return PARM_BOUNDARY;
 
7086
 }
 
7087
 
 
7088
 /* The offset in words to the start of the parameter save area.  */
 
7089
@@ -10243,6 +10339,7 @@
 
7090
          rtx r, off;
 
7091
          int i, k = 0;
 
7092
          unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
 
7093
+         int fpr_words;
 
7094
 
 
7095
          /* Do we also need to pass this argument in the parameter
 
7096
             save area?  */
 
7097
@@ -10271,6 +10368,37 @@
 
7098
              rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off);
 
7099
            }
 
7100
 
 
7101
+         /* If there were not enough FPRs to hold the argument, the rest
 
7102
+            usually goes into memory.  However, if the current position
 
7103
+            is still within the register parameter area, a portion may
 
7104
+            actually have to go into GPRs.
 
7105
+
 
7106
+            Note that it may happen that the portion of the argument
 
7107
+            passed in the first "half" of the first GPR was already
 
7108
+            passed in the last FPR as well.
 
7109
+
 
7110
+            For unnamed arguments, we already set up GPRs to cover the
 
7111
+            whole argument in rs6000_psave_function_arg, so there is
 
7112
+            nothing further to do at this point.
 
7113
+
 
7114
+            GCC 4.8/4.9 Note: This was implemented incorrectly in earlier
 
7115
+            GCC releases.  To avoid any ABI change on the release branch,
 
7116
+            we retain that original implementation here, but warn if we
 
7117
+            encounter a case where the ABI will change in the future.  */
 
7118
+         fpr_words = (i * GET_MODE_SIZE (elt_mode)) / (TARGET_32BIT ? 4 : 8);
 
7119
+         if (i < n_elts && align_words + fpr_words < GP_ARG_NUM_REG
 
7120
+             && cum->nargs_prototype > 0)
 
7121
+            {
 
7122
+             static bool warned;
 
7123
+             if (!warned && warn_psabi)
 
7124
+               {
 
7125
+                 warned = true;
 
7126
+                 inform (input_location,
 
7127
+                         "the ABI of passing homogeneous float aggregates"
 
7128
+                         " will change in a future GCC release");
 
7129
+               }
 
7130
+           }
 
7131
+
 
7132
          return rs6000_finish_function_arg (mode, rvec, k);
 
7133
        }
 
7134
       else if (align_words < GP_ARG_NUM_REG)
 
7135
@@ -10497,10 +10625,9 @@
 
7136
    list, or passes any parameter in memory.  */
 
7137
 
 
7138
 static bool
 
7139
-rs6000_function_parms_need_stack (tree fun)
 
7140
+rs6000_function_parms_need_stack (tree fun, bool incoming)
 
7141
 {
 
7142
-  function_args_iterator args_iter;
 
7143
-  tree arg_type;
 
7144
+  tree fntype, result;
 
7145
   CUMULATIVE_ARGS args_so_far_v;
 
7146
   cumulative_args_t args_so_far;
 
7147
 
 
7148
@@ -10507,26 +10634,57 @@
 
7149
   if (!fun)
 
7150
     /* Must be a libcall, all of which only use reg parms.  */
 
7151
     return false;
 
7152
+
 
7153
+  fntype = fun;
 
7154
   if (!TYPE_P (fun))
 
7155
-    fun = TREE_TYPE (fun);
 
7156
+    fntype = TREE_TYPE (fun);
 
7157
 
 
7158
   /* Varargs functions need the parameter save area.  */
 
7159
-  if (!prototype_p (fun) || stdarg_p (fun))
 
7160
+  if ((!incoming && !prototype_p (fntype)) || stdarg_p (fntype))
 
7161
     return true;
 
7162
 
 
7163
-  INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fun, NULL_RTX);
 
7164
+  INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fntype, NULL_RTX);
 
7165
   args_so_far = pack_cumulative_args (&args_so_far_v);
 
7166
 
 
7167
-  if (aggregate_value_p (TREE_TYPE (fun), fun))
 
7168
+  /* When incoming, we will have been passed the function decl.
 
7169
+     It is necessary to use the decl to handle K&R style functions,
 
7170
+     where TYPE_ARG_TYPES may not be available.  */
 
7171
+  if (incoming)
 
7172
     {
 
7173
-      tree type = build_pointer_type (TREE_TYPE (fun));
 
7174
-      rs6000_parm_needs_stack (args_so_far, type);
 
7175
+      gcc_assert (DECL_P (fun));
 
7176
+      result = DECL_RESULT (fun);
 
7177
     }
 
7178
+  else
 
7179
+    result = TREE_TYPE (fntype);
 
7180
 
 
7181
-  FOREACH_FUNCTION_ARGS (fun, arg_type, args_iter)
 
7182
-    if (rs6000_parm_needs_stack (args_so_far, arg_type))
 
7183
-      return true;
 
7184
+  if (result && aggregate_value_p (result, fntype))
 
7185
+    {
 
7186
+      if (!TYPE_P (result))
 
7187
+       result = TREE_TYPE (result);
 
7188
+      result = build_pointer_type (result);
 
7189
+      rs6000_parm_needs_stack (args_so_far, result);
 
7190
+    }
 
7191
 
 
7192
+  if (incoming)
 
7193
+    {
 
7194
+      tree parm;
 
7195
+
 
7196
+      for (parm = DECL_ARGUMENTS (fun);
 
7197
+          parm && parm != void_list_node;
 
7198
+          parm = TREE_CHAIN (parm))
 
7199
+       if (rs6000_parm_needs_stack (args_so_far, TREE_TYPE (parm)))
 
7200
+         return true;
 
7201
+    }
 
7202
+  else
 
7203
+    {
 
7204
+      function_args_iterator args_iter;
 
7205
+      tree arg_type;
 
7206
+
 
7207
+      FOREACH_FUNCTION_ARGS (fntype, arg_type, args_iter)
 
7208
+       if (rs6000_parm_needs_stack (args_so_far, arg_type))
 
7209
+         return true;
 
7210
+    }
 
7211
+
 
7212
   return false;
 
7213
 }
 
7214
 
 
7215
@@ -10537,7 +10695,7 @@
 
7216
    all parameters in registers.  */
 
7217
 
 
7218
 int
 
7219
-rs6000_reg_parm_stack_space (tree fun)
 
7220
+rs6000_reg_parm_stack_space (tree fun, bool incoming)
 
7221
 {
 
7222
   int reg_parm_stack_space;
 
7223
 
 
7224
@@ -10555,7 +10713,7 @@
 
7225
     case ABI_ELFv2:
 
7226
       /* ??? Recomputing this every time is a bit expensive.  Is there
 
7227
         a place to cache this information?  */
 
7228
-      if (rs6000_function_parms_need_stack (fun))
 
7229
+      if (rs6000_function_parms_need_stack (fun, incoming))
 
7230
        reg_parm_stack_space = TARGET_64BIT ? 64 : 32;
 
7231
       else
 
7232
        reg_parm_stack_space = 0;
 
7233
@@ -13544,11 +13702,15 @@
 
7234
   else if ((fnmask & (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
 
7235
           == (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
 
7236
     error ("Builtin function %s requires the -mhard-dfp and"
 
7237
-          "-mpower8-vector options", name);
 
7238
+          " -mpower8-vector options", name);
 
7239
   else if ((fnmask & RS6000_BTM_DFP) != 0)
 
7240
     error ("Builtin function %s requires the -mhard-dfp option", name);
 
7241
   else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
 
7242
     error ("Builtin function %s requires the -mpower8-vector option", name);
 
7243
+  else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
 
7244
+          == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
 
7245
+    error ("Builtin function %s requires the -mhard-float and"
 
7246
+          " -mlong-double-128 options", name);
 
7247
   else if ((fnmask & RS6000_BTM_HARD_FLOAT) != 0)
 
7248
     error ("Builtin function %s requires the -mhard-float option", name);
 
7249
   else
 
7250
@@ -17099,7 +17261,14 @@
 
7251
      prefer Altivec loads..  */
 
7252
   if (rclass == VSX_REGS)
 
7253
     {
 
7254
-      if (GET_MODE_SIZE (mode) <= 8)
 
7255
+      if (MEM_P (x) && reg_addr[mode].scalar_in_vmx_p)
 
7256
+       {
 
7257
+         rtx addr = XEXP (x, 0);
 
7258
+         if (rs6000_legitimate_offset_address_p (mode, addr, false, true)
 
7259
+             || legitimate_lo_sum_address_p (mode, addr, false))
 
7260
+           return FLOAT_REGS;
 
7261
+       }
 
7262
+      else if (GET_MODE_SIZE (mode) <= 8 && !reg_addr[mode].scalar_in_vmx_p)
 
7263
        return FLOAT_REGS;
 
7264
 
 
7265
       if (VECTOR_UNIT_ALTIVEC_P (mode) || VECTOR_MEM_ALTIVEC_P (mode)
 
7266
@@ -31413,6 +31582,7 @@
 
7267
   { "htm",              RS6000_BTM_HTM,        false, false },
 
7268
   { "hard-dfp",                 RS6000_BTM_DFP,        false, false },
 
7269
   { "hard-float",       RS6000_BTM_HARD_FLOAT, false, false },
 
7270
+  { "long-double-128",  RS6000_BTM_LDBL128,    false, false },
 
7271
 };
 
7272
 
 
7273
 /* Option variables that we want to support inside attribute((target)) and
 
7274
Index: gcc/config/rs6000/vsx.md
 
7275
===================================================================
 
7276
--- a/src/gcc/config/rs6000/vsx.md      (.../tags/gcc_4_8_3_release)
 
7277
+++ b/src/gcc/config/rs6000/vsx.md      (.../branches/gcc-4_8-branch)
 
7278
@@ -24,6 +24,13 @@
 
7279
 ;; Iterator for the 2 64-bit vector types
 
7280
 (define_mode_iterator VSX_D [V2DF V2DI])
 
7281
 
 
7282
+;; Iterator for the 2 64-bit vector types + 128-bit types that are loaded with
 
7283
+;; lxvd2x to properly handle swapping words on little endian
 
7284
+(define_mode_iterator VSX_LE [V2DF
 
7285
+                             V2DI
 
7286
+                             V1TI
 
7287
+                             (TI       "VECTOR_MEM_VSX_P (TImode)")])
 
7288
+
 
7289
 ;; Iterator for the 2 32-bit vector types
 
7290
 (define_mode_iterator VSX_W [V4SF V4SI])
 
7291
 
 
7292
@@ -79,19 +86,26 @@
 
7293
                         (V4SF  "wf")
 
7294
                         (V2DI  "wd")
 
7295
                         (V2DF  "wd")
 
7296
+                        (DI    "wi")
 
7297
                         (DF    "ws")
 
7298
-                        (SF    "d")
 
7299
+                        (SF    "ww")
 
7300
                         (V1TI  "v")
 
7301
                         (TI    "wt")])
 
7302
 
 
7303
-;; Map the register class used for float<->int conversions
 
7304
+;; Map the register class used for float<->int conversions (floating point side)
 
7305
+;; VSr2 is the preferred register class, VSr3 is any register class that will
 
7306
+;; hold the data
 
7307
 (define_mode_attr VSr2 [(V2DF  "wd")
 
7308
                         (V4SF  "wf")
 
7309
-                        (DF    "ws")])
 
7310
+                        (DF    "ws")
 
7311
+                        (SF    "ww")
 
7312
+                        (DI    "wi")])
 
7313
 
 
7314
 (define_mode_attr VSr3 [(V2DF  "wa")
 
7315
                         (V4SF  "wa")
 
7316
-                        (DF    "ws")])
 
7317
+                        (DF    "ws")
 
7318
+                        (SF    "ww")
 
7319
+                        (DI    "wi")])
 
7320
 
 
7321
 ;; Map the register class for sp<->dp float conversions, destination
 
7322
 (define_mode_attr VSr4 [(SF    "ws")
 
7323
@@ -99,12 +113,27 @@
 
7324
                         (V2DF  "wd")
 
7325
                         (V4SF  "v")])
 
7326
 
 
7327
-;; Map the register class for sp<->dp float conversions, destination
 
7328
+;; Map the register class for sp<->dp float conversions, source
 
7329
 (define_mode_attr VSr5 [(SF    "ws")
 
7330
                         (DF    "f")
 
7331
                         (V2DF  "v")
 
7332
                         (V4SF  "wd")])
 
7333
 
 
7334
+;; The VSX register class that a type can occupy, even if it is not the
 
7335
+;; preferred register class (VSr is the preferred register class that will get
 
7336
+;; allocated first).
 
7337
+(define_mode_attr VSa  [(V16QI "wa")
 
7338
+                        (V8HI  "wa")
 
7339
+                        (V4SI  "wa")
 
7340
+                        (V4SF  "wa")
 
7341
+                        (V2DI  "wa")
 
7342
+                        (V2DF  "wa")
 
7343
+                        (DI    "wi")
 
7344
+                        (DF    "ws")
 
7345
+                        (SF    "ww")
 
7346
+                        (V1TI  "wa")
 
7347
+                        (TI    "wt")])
 
7348
+
 
7349
 ;; Same size integer type for floating point data
 
7350
 (define_mode_attr VSi [(V4SF  "v4si")
 
7351
                       (V2DF  "v2di")
 
7352
@@ -200,6 +229,16 @@
 
7353
                             (V2DF      "V4DF")
 
7354
                             (V1TI      "V2TI")])
 
7355
 
 
7356
+;; Map register class for 64-bit element in 128-bit vector for direct moves
 
7357
+;; to/from gprs
 
7358
+(define_mode_attr VS_64dm [(V2DF       "wk")
 
7359
+                          (V2DI        "wj")])
 
7360
+
 
7361
+;; Map register class for 64-bit element in 128-bit vector for normal register
 
7362
+;; to register moves
 
7363
+(define_mode_attr VS_64reg [(V2DF      "ws")
 
7364
+                           (V2DI       "wi")])
 
7365
+
 
7366
 ;; Constants for creating unspecs
 
7367
 (define_c_enum "unspec"
 
7368
   [UNSPEC_VSX_CONCAT
 
7369
@@ -228,8 +267,8 @@
 
7370
 ;; The patterns for LE permuted loads and stores come before the general
 
7371
 ;; VSX moves so they match first.
 
7372
 (define_insn_and_split "*vsx_le_perm_load_<mode>"
 
7373
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
7374
-        (match_operand:VSX_D 1 "memory_operand" "Z"))]
 
7375
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
 
7376
+        (match_operand:VSX_LE 1 "memory_operand" "Z"))]
 
7377
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
7378
   "#"
 
7379
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
7380
@@ -251,7 +290,7 @@
 
7381
    (set_attr "length" "8")])
 
7382
 
 
7383
 (define_insn_and_split "*vsx_le_perm_load_<mode>"
 
7384
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
 
7385
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
 
7386
         (match_operand:VSX_W 1 "memory_operand" "Z"))]
 
7387
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
7388
   "#"
 
7389
@@ -342,8 +381,8 @@
 
7390
    (set_attr "length" "8")])
 
7391
 
 
7392
 (define_insn "*vsx_le_perm_store_<mode>"
 
7393
-  [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
 
7394
-        (match_operand:VSX_D 1 "vsx_register_operand" "+wa"))]
 
7395
+  [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
 
7396
+        (match_operand:VSX_LE 1 "vsx_register_operand" "+<VSa>"))]
 
7397
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
7398
   "#"
 
7399
   [(set_attr "type" "vecstore")
 
7400
@@ -350,8 +389,8 @@
 
7401
    (set_attr "length" "12")])
 
7402
 
 
7403
 (define_split
 
7404
-  [(set (match_operand:VSX_D 0 "memory_operand" "")
 
7405
-        (match_operand:VSX_D 1 "vsx_register_operand" ""))]
 
7406
+  [(set (match_operand:VSX_LE 0 "memory_operand" "")
 
7407
+        (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
 
7408
   "!BYTES_BIG_ENDIAN && TARGET_VSX && !reload_completed"
 
7409
   [(set (match_dup 2)
 
7410
         (vec_select:<MODE>
 
7411
@@ -369,8 +408,8 @@
 
7412
 ;; The post-reload split requires that we re-permute the source
 
7413
 ;; register in case it is still live.
 
7414
 (define_split
 
7415
-  [(set (match_operand:VSX_D 0 "memory_operand" "")
 
7416
-        (match_operand:VSX_D 1 "vsx_register_operand" ""))]
 
7417
+  [(set (match_operand:VSX_LE 0 "memory_operand" "")
 
7418
+        (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
 
7419
   "!BYTES_BIG_ENDIAN && TARGET_VSX && reload_completed"
 
7420
   [(set (match_dup 1)
 
7421
         (vec_select:<MODE>
 
7422
@@ -388,7 +427,7 @@
 
7423
 
 
7424
 (define_insn "*vsx_le_perm_store_<mode>"
 
7425
   [(set (match_operand:VSX_W 0 "memory_operand" "=Z")
 
7426
-        (match_operand:VSX_W 1 "vsx_register_operand" "+wa"))]
 
7427
+        (match_operand:VSX_W 1 "vsx_register_operand" "+<VSa>"))]
 
7428
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
7429
   "#"
 
7430
   [(set_attr "type" "vecstore")
 
7431
@@ -578,8 +617,8 @@
 
7432
 
 
7433
 
 
7434
 (define_insn "*vsx_mov<mode>"
 
7435
-  [(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")
 
7436
-       (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
 
7437
+  [(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")
 
7438
+       (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,<VSa>,Z,<VSa>,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
 
7439
   "VECTOR_MEM_VSX_P (<MODE>mode)
 
7440
    && (register_operand (operands[0], <MODE>mode) 
 
7441
        || register_operand (operands[1], <MODE>mode))"
 
7442
@@ -681,9 +720,9 @@
 
7443
 ;; instructions are now combined with the insn for the traditional floating
 
7444
 ;; point unit.
 
7445
 (define_insn "*vsx_add<mode>3"
 
7446
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7447
-        (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7448
-                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7449
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7450
+        (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7451
+                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7452
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7453
   "xvadd<VSs> %x0,%x1,%x2"
 
7454
   [(set_attr "type" "<VStype_simple>")
 
7455
@@ -690,9 +729,9 @@
 
7456
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7457
 
 
7458
 (define_insn "*vsx_sub<mode>3"
 
7459
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7460
-        (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7461
-                    (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7462
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7463
+        (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7464
+                    (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7465
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7466
   "xvsub<VSs> %x0,%x1,%x2"
 
7467
   [(set_attr "type" "<VStype_simple>")
 
7468
@@ -699,9 +738,9 @@
 
7469
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7470
 
 
7471
 (define_insn "*vsx_mul<mode>3"
 
7472
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7473
-        (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7474
-                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7475
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7476
+        (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7477
+                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7478
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7479
   "xvmul<VSs> %x0,%x1,%x2"
 
7480
   [(set_attr "type" "<VStype_simple>")
 
7481
@@ -708,9 +747,9 @@
 
7482
    (set_attr "fp_type" "<VSfptype_mul>")])
 
7483
 
 
7484
 (define_insn "*vsx_div<mode>3"
 
7485
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7486
-        (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7487
-                  (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7488
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7489
+        (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7490
+                  (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7491
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7492
   "xvdiv<VSs> %x0,%x1,%x2"
 
7493
   [(set_attr "type" "<VStype_div>")
 
7494
@@ -746,8 +785,8 @@
 
7495
 
 
7496
 (define_insn "*vsx_tdiv<mode>3_internal"
 
7497
   [(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
 
7498
-       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")
 
7499
-                     (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,wa")]
 
7500
+       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7501
+                     (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,<VSa>")]
 
7502
                   UNSPEC_VSX_TDIV))]
 
7503
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7504
   "x<VSv>tdiv<VSs> %0,%x1,%x2"
 
7505
@@ -755,8 +794,8 @@
 
7506
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7507
 
 
7508
 (define_insn "vsx_fre<mode>2"
 
7509
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7510
-       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
 
7511
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7512
+       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
7513
                      UNSPEC_FRES))]
 
7514
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7515
   "xvre<VSs> %x0,%x1"
 
7516
@@ -764,8 +803,8 @@
 
7517
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7518
 
 
7519
 (define_insn "*vsx_neg<mode>2"
 
7520
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7521
-        (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
 
7522
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7523
+        (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7524
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7525
   "xvneg<VSs> %x0,%x1"
 
7526
   [(set_attr "type" "<VStype_simple>")
 
7527
@@ -772,8 +811,8 @@
 
7528
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7529
 
 
7530
 (define_insn "*vsx_abs<mode>2"
 
7531
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7532
-        (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
 
7533
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7534
+        (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7535
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7536
   "xvabs<VSs> %x0,%x1"
 
7537
   [(set_attr "type" "<VStype_simple>")
 
7538
@@ -780,10 +819,10 @@
 
7539
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7540
 
 
7541
 (define_insn "vsx_nabs<mode>2"
 
7542
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7543
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7544
         (neg:VSX_F
 
7545
         (abs:VSX_F
 
7546
-         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa"))))]
 
7547
+         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>"))))]
 
7548
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7549
   "xvnabs<VSs> %x0,%x1"
 
7550
   [(set_attr "type" "<VStype_simple>")
 
7551
@@ -790,9 +829,9 @@
 
7552
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7553
 
 
7554
 (define_insn "vsx_smax<mode>3"
 
7555
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7556
-        (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7557
-                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7558
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7559
+        (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7560
+                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7561
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7562
   "xvmax<VSs> %x0,%x1,%x2"
 
7563
   [(set_attr "type" "<VStype_simple>")
 
7564
@@ -799,9 +838,9 @@
 
7565
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7566
 
 
7567
 (define_insn "*vsx_smin<mode>3"
 
7568
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7569
-        (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7570
-                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7571
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7572
+        (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7573
+                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7574
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7575
   "xvmin<VSs> %x0,%x1,%x2"
 
7576
   [(set_attr "type" "<VStype_simple>")
 
7577
@@ -808,8 +847,8 @@
 
7578
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7579
 
 
7580
 (define_insn "*vsx_sqrt<mode>2"
 
7581
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7582
-        (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
 
7583
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7584
+        (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7585
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7586
   "xvsqrt<VSs> %x0,%x1"
 
7587
   [(set_attr "type" "<VStype_sqrt>")
 
7588
@@ -816,8 +855,8 @@
 
7589
    (set_attr "fp_type" "<VSfptype_sqrt>")])
 
7590
 
 
7591
 (define_insn "*vsx_rsqrte<mode>2"
 
7592
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7593
-       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
 
7594
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7595
+       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
7596
                      UNSPEC_RSQRT))]
 
7597
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7598
   "xvrsqrte<VSs> %x0,%x1"
 
7599
@@ -852,7 +891,7 @@
 
7600
 
 
7601
 (define_insn "*vsx_tsqrt<mode>2_internal"
 
7602
   [(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
 
7603
-       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
 
7604
+       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
7605
                     UNSPEC_VSX_TSQRT))]
 
7606
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7607
   "x<VSv>tsqrt<VSs> %0,%x1"
 
7608
@@ -865,11 +904,11 @@
 
7609
 ;; multiply.
 
7610
 
 
7611
 (define_insn "*vsx_fmav4sf4"
 
7612
-  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,v")
 
7613
+  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,wf,?wa,?wa,v")
 
7614
        (fma:V4SF
 
7615
-         (match_operand:V4SF 1 "vsx_register_operand" "%ws,ws,wa,wa,v")
 
7616
-         (match_operand:V4SF 2 "vsx_register_operand" "ws,0,wa,0,v")
 
7617
-         (match_operand:V4SF 3 "vsx_register_operand" "0,ws,0,wa,v")))]
 
7618
+         (match_operand:V4SF 1 "vsx_register_operand" "%wf,wf,wa,wa,v")
 
7619
+         (match_operand:V4SF 2 "vsx_register_operand" "wf,0,wa,0,v")
 
7620
+         (match_operand:V4SF 3 "vsx_register_operand" "0,wf,0,wa,v")))]
 
7621
   "VECTOR_UNIT_VSX_P (V4SFmode)"
 
7622
   "@
 
7623
    xvmaddasp %x0,%x1,%x2
 
7624
@@ -880,11 +919,11 @@
 
7625
   [(set_attr "type" "vecfloat")])
 
7626
 
 
7627
 (define_insn "*vsx_fmav2df4"
 
7628
-  [(set (match_operand:V2DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa")
 
7629
+  [(set (match_operand:V2DF 0 "vsx_register_operand" "=wd,wd,?wa,?wa")
 
7630
        (fma:V2DF
 
7631
-         (match_operand:V2DF 1 "vsx_register_operand" "%ws,ws,wa,wa")
 
7632
-         (match_operand:V2DF 2 "vsx_register_operand" "ws,0,wa,0")
 
7633
-         (match_operand:V2DF 3 "vsx_register_operand" "0,ws,0,wa")))]
 
7634
+         (match_operand:V2DF 1 "vsx_register_operand" "%wd,wd,wa,wa")
 
7635
+         (match_operand:V2DF 2 "vsx_register_operand" "wd,0,wa,0")
 
7636
+         (match_operand:V2DF 3 "vsx_register_operand" "0,wd,0,wa")))]
 
7637
   "VECTOR_UNIT_VSX_P (V2DFmode)"
 
7638
   "@
 
7639
    xvmaddadp %x0,%x1,%x2
 
7640
@@ -894,12 +933,12 @@
 
7641
   [(set_attr "type" "vecdouble")])
 
7642
 
 
7643
 (define_insn "*vsx_fms<mode>4"
 
7644
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
 
7645
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
 
7646
        (fma:VSX_F
 
7647
-         (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
 
7648
-         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
 
7649
+         (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,<VSa>,<VSa>")
 
7650
+         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
 
7651
          (neg:VSX_F
 
7652
-           (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
 
7653
+           (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
 
7654
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7655
   "@
 
7656
    xvmsuba<VSs> %x0,%x1,%x2
 
7657
@@ -909,12 +948,12 @@
 
7658
   [(set_attr "type" "<VStype_mul>")])
 
7659
 
 
7660
 (define_insn "*vsx_nfma<mode>4"
 
7661
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
 
7662
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
 
7663
        (neg:VSX_F
 
7664
         (fma:VSX_F
 
7665
-         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,wa,wa")
 
7666
-         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
 
7667
-         (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
 
7668
+         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,<VSa>,<VSa>")
 
7669
+         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
 
7670
+         (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
 
7671
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7672
   "@
 
7673
    xvnmadda<VSs> %x0,%x1,%x2
 
7674
@@ -959,9 +998,9 @@
 
7675
 
 
7676
 ;; Vector conditional expressions (no scalar version for these instructions)
 
7677
 (define_insn "vsx_eq<mode>"
 
7678
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7679
-       (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7680
-                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7681
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7682
+       (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7683
+                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7684
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7685
   "xvcmpeq<VSs> %x0,%x1,%x2"
 
7686
   [(set_attr "type" "<VStype_simple>")
 
7687
@@ -968,9 +1007,9 @@
 
7688
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7689
 
 
7690
 (define_insn "vsx_gt<mode>"
 
7691
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7692
-       (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7693
-                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7694
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7695
+       (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7696
+                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7697
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7698
   "xvcmpgt<VSs> %x0,%x1,%x2"
 
7699
   [(set_attr "type" "<VStype_simple>")
 
7700
@@ -977,9 +1016,9 @@
 
7701
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7702
 
 
7703
 (define_insn "*vsx_ge<mode>"
 
7704
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7705
-       (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7706
-                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
 
7707
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7708
+       (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7709
+                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7710
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7711
   "xvcmpge<VSs> %x0,%x1,%x2"
 
7712
   [(set_attr "type" "<VStype_simple>")
 
7713
@@ -990,10 +1029,10 @@
 
7714
 (define_insn "*vsx_eq_<mode>_p"
 
7715
   [(set (reg:CC 74)
 
7716
        (unspec:CC
 
7717
-        [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
 
7718
-                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
 
7719
+        [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
 
7720
+                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
 
7721
         UNSPEC_PREDICATE))
 
7722
-   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7723
+   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7724
        (eq:VSX_F (match_dup 1)
 
7725
                  (match_dup 2)))]
 
7726
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7727
@@ -1003,10 +1042,10 @@
 
7728
 (define_insn "*vsx_gt_<mode>_p"
 
7729
   [(set (reg:CC 74)
 
7730
        (unspec:CC
 
7731
-        [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
 
7732
-                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
 
7733
+        [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
 
7734
+                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
 
7735
         UNSPEC_PREDICATE))
 
7736
-   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7737
+   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7738
        (gt:VSX_F (match_dup 1)
 
7739
                  (match_dup 2)))]
 
7740
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7741
@@ -1016,10 +1055,10 @@
 
7742
 (define_insn "*vsx_ge_<mode>_p"
 
7743
   [(set (reg:CC 74)
 
7744
        (unspec:CC
 
7745
-        [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
 
7746
-                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
 
7747
+        [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
 
7748
+                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
 
7749
         UNSPEC_PREDICATE))
 
7750
-   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7751
+   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7752
        (ge:VSX_F (match_dup 1)
 
7753
                  (match_dup 2)))]
 
7754
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7755
@@ -1028,23 +1067,23 @@
 
7756
 
 
7757
 ;; Vector select
 
7758
 (define_insn "*vsx_xxsel<mode>"
 
7759
-  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
 
7760
+  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7761
        (if_then_else:VSX_L
 
7762
-        (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
 
7763
+        (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7764
                (match_operand:VSX_L 4 "zero_constant" ""))
 
7765
-        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
 
7766
-        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
 
7767
+        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
 
7768
+        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7769
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
7770
   "xxsel %x0,%x3,%x2,%x1"
 
7771
   [(set_attr "type" "vecperm")])
 
7772
 
 
7773
 (define_insn "*vsx_xxsel<mode>_uns"
 
7774
-  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
 
7775
+  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7776
        (if_then_else:VSX_L
 
7777
-        (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
 
7778
+        (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7779
                   (match_operand:VSX_L 4 "zero_constant" ""))
 
7780
-        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
 
7781
-        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
 
7782
+        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
 
7783
+        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7784
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
7785
   "xxsel %x0,%x3,%x2,%x1"
 
7786
   [(set_attr "type" "vecperm")])
 
7787
@@ -1051,10 +1090,10 @@
 
7788
 
 
7789
 ;; Copy sign
 
7790
 (define_insn "vsx_copysign<mode>3"
 
7791
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7792
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7793
        (unspec:VSX_F
 
7794
-        [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
 
7795
-         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")]
 
7796
+        [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
 
7797
+         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")]
 
7798
         UNSPEC_COPYSIGN))]
 
7799
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7800
   "xvcpsgn<VSs> %x0,%x2,%x1"
 
7801
@@ -1067,7 +1106,7 @@
 
7802
 ;; in rs6000.md so don't test VECTOR_UNIT_VSX_P, just test against VSX.
 
7803
 ;; Don't use vsx_register_operand here, use gpc_reg_operand to match rs6000.md.
 
7804
 (define_insn "vsx_float<VSi><mode>2"
 
7805
-  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
 
7806
+  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
 
7807
        (float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
 
7808
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7809
   "x<VSv>cvsx<VSc><VSs> %x0,%x1"
 
7810
@@ -1075,7 +1114,7 @@
 
7811
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7812
 
 
7813
 (define_insn "vsx_floatuns<VSi><mode>2"
 
7814
-  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
 
7815
+  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
 
7816
        (unsigned_float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
 
7817
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7818
   "x<VSv>cvux<VSc><VSs> %x0,%x1"
 
7819
@@ -1084,7 +1123,7 @@
 
7820
 
 
7821
 (define_insn "vsx_fix_trunc<mode><VSi>2"
 
7822
   [(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
 
7823
-       (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
 
7824
+       (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
 
7825
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7826
   "x<VSv>cv<VSs>sx<VSc>s %x0,%x1"
 
7827
   [(set_attr "type" "<VStype_simple>")
 
7828
@@ -1092,7 +1131,7 @@
 
7829
 
 
7830
 (define_insn "vsx_fixuns_trunc<mode><VSi>2"
 
7831
   [(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
 
7832
-       (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
 
7833
+       (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
 
7834
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7835
   "x<VSv>cv<VSs>ux<VSc>s %x0,%x1"
 
7836
   [(set_attr "type" "<VStype_simple>")
 
7837
@@ -1100,8 +1139,8 @@
 
7838
 
 
7839
 ;; Math rounding functions
 
7840
 (define_insn "vsx_x<VSv>r<VSs>i"
 
7841
-  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
 
7842
-       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
 
7843
+  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7844
+       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
7845
                      UNSPEC_VSX_ROUND_I))]
 
7846
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7847
   "x<VSv>r<VSs>i %x0,%x1"
 
7848
@@ -1109,8 +1148,8 @@
 
7849
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7850
 
 
7851
 (define_insn "vsx_x<VSv>r<VSs>ic"
 
7852
-  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
 
7853
-       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
 
7854
+  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7855
+       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
7856
                      UNSPEC_VSX_ROUND_IC))]
 
7857
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7858
   "x<VSv>r<VSs>ic %x0,%x1"
 
7859
@@ -1118,8 +1157,8 @@
 
7860
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7861
 
 
7862
 (define_insn "vsx_btrunc<mode>2"
 
7863
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7864
-       (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
 
7865
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7866
+       (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
 
7867
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7868
   "xvr<VSs>iz %x0,%x1"
 
7869
   [(set_attr "type" "<VStype_simple>")
 
7870
@@ -1126,8 +1165,8 @@
 
7871
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7872
 
 
7873
 (define_insn "*vsx_b2trunc<mode>2"
 
7874
-  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
 
7875
-       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
 
7876
+  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7877
+       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
7878
                      UNSPEC_FRIZ))]
 
7879
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7880
   "x<VSv>r<VSs>iz %x0,%x1"
 
7881
@@ -1135,8 +1174,8 @@
 
7882
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7883
 
 
7884
 (define_insn "vsx_floor<mode>2"
 
7885
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7886
-       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
 
7887
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7888
+       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
7889
                      UNSPEC_FRIM))]
 
7890
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7891
   "xvr<VSs>im %x0,%x1"
 
7892
@@ -1144,8 +1183,8 @@
 
7893
    (set_attr "fp_type" "<VSfptype_simple>")])
 
7894
 
 
7895
 (define_insn "vsx_ceil<mode>2"
 
7896
-  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
 
7897
-       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
 
7898
+  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7899
+       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
 
7900
                      UNSPEC_FRIP))]
 
7901
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7902
   "xvr<VSs>ip %x0,%x1"
 
7903
@@ -1160,8 +1199,8 @@
 
7904
 ;; scalar single precision instructions internally use the double format.
 
7905
 ;; Prefer the altivec registers, since we likely will need to do a vperm
 
7906
 (define_insn "vsx_<VS_spdp_insn>"
 
7907
-  [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?wa")
 
7908
-       (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,wa")]
 
7909
+  [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?<VSa>")
 
7910
+       (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,<VSa>")]
 
7911
                              UNSPEC_VSX_CVSPDP))]
 
7912
   "VECTOR_UNIT_VSX_P (<MODE>mode)"
 
7913
   "<VS_spdp_insn> %x0,%x1"
 
7914
@@ -1169,8 +1208,8 @@
 
7915
 
 
7916
 ;; xscvspdp, represent the scalar SF type as V4SF
 
7917
 (define_insn "vsx_xscvspdp"
 
7918
-  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
 
7919
-       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
 
7920
+  [(set (match_operand:DF 0 "vsx_register_operand" "=ws")
 
7921
+       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa")]
 
7922
                   UNSPEC_VSX_CVSPDP))]
 
7923
   "VECTOR_UNIT_VSX_P (V4SFmode)"
 
7924
   "xscvspdp %x0,%x1"
 
7925
@@ -1197,7 +1236,7 @@
 
7926
 
 
7927
 ;; ISA 2.07 xscvdpspn/xscvspdpn that does not raise an error on signalling NaNs
 
7928
 (define_insn "vsx_xscvdpspn"
 
7929
-  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,?wa")
 
7930
+  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ww,?ww")
 
7931
        (unspec:V4SF [(match_operand:DF 1 "vsx_register_operand" "wd,wa")]
 
7932
                     UNSPEC_VSX_CVDPSPN))]
 
7933
   "TARGET_XSCVDPSPN"
 
7934
@@ -1205,8 +1244,8 @@
 
7935
   [(set_attr "type" "fp")])
 
7936
 
 
7937
 (define_insn "vsx_xscvspdpn"
 
7938
-  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
 
7939
-       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
 
7940
+  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?ws")
 
7941
+       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wf,wa")]
 
7942
                   UNSPEC_VSX_CVSPDPN))]
 
7943
   "TARGET_XSCVSPDPN"
 
7944
   "xscvspdpn %x0,%x1"
 
7945
@@ -1213,8 +1252,8 @@
 
7946
   [(set_attr "type" "fp")])
 
7947
 
 
7948
 (define_insn "vsx_xscvdpspn_scalar"
 
7949
-  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa")
 
7950
-       (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "f")]
 
7951
+  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,?wa")
 
7952
+       (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "ww,ww")]
 
7953
                     UNSPEC_VSX_CVDPSPN))]
 
7954
   "TARGET_XSCVDPSPN"
 
7955
   "xscvdpspn %x0,%x1"
 
7956
@@ -1302,10 +1341,10 @@
 
7957
 ;; since the xsrdpiz instruction does not truncate the value if the floating
 
7958
 ;; point value is < LONG_MIN or > LONG_MAX.
 
7959
 (define_insn "*vsx_float_fix_<mode>2"
 
7960
-  [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?wa")
 
7961
+  [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7962
        (float:VSX_DF
 
7963
         (fix:<VSI>
 
7964
-         (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?wa"))))]
 
7965
+         (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?<VSa>"))))]
 
7966
   "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
 
7967
    && VECTOR_UNIT_VSX_P (<MODE>mode) && flag_unsafe_math_optimizations
 
7968
    && !flag_trapping_math && TARGET_FRIZ"
 
7969
@@ -1318,10 +1357,10 @@
 
7970
 
 
7971
 ;; Build a V2DF/V2DI vector from two scalars
 
7972
 (define_insn "vsx_concat_<mode>"
 
7973
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?wa")
 
7974
+  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?<VSa>")
 
7975
        (vec_concat:VSX_D
 
7976
-        (match_operand:<VS_scalar> 1 "vsx_register_operand" "ws,wa")
 
7977
-        (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")))]
 
7978
+        (match_operand:<VS_scalar> 1 "vsx_register_operand" "<VS_64reg>,<VSa>")
 
7979
+        (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")))]
 
7980
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
7981
 {
 
7982
   if (BYTES_BIG_ENDIAN)
 
7983
@@ -1352,9 +1391,9 @@
 
7984
 ;; xxpermdi for little endian loads and stores.  We need several of
 
7985
 ;; these since the form of the PARALLEL differs by mode.
 
7986
 (define_insn "*vsx_xxpermdi2_le_<mode>"
 
7987
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
7988
-        (vec_select:VSX_D
 
7989
-          (match_operand:VSX_D 1 "vsx_register_operand" "wa")
 
7990
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
 
7991
+        (vec_select:VSX_LE
 
7992
+          (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
 
7993
           (parallel [(const_int 1) (const_int 0)])))]
 
7994
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
7995
   "xxpermdi %x0,%x1,%x1,2"
 
7996
@@ -1361,9 +1400,9 @@
 
7997
   [(set_attr "type" "vecperm")])
 
7998
 
 
7999
 (define_insn "*vsx_xxpermdi4_le_<mode>"
 
8000
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
 
8001
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
 
8002
         (vec_select:VSX_W
 
8003
-          (match_operand:VSX_W 1 "vsx_register_operand" "wa")
 
8004
+          (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
 
8005
           (parallel [(const_int 2) (const_int 3)
 
8006
                      (const_int 0) (const_int 1)])))]
 
8007
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
8008
@@ -1401,9 +1440,9 @@
 
8009
 ;; lxvd2x for little endian loads.  We need several of
 
8010
 ;; these since the form of the PARALLEL differs by mode.
 
8011
 (define_insn "*vsx_lxvd2x2_le_<mode>"
 
8012
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
8013
-        (vec_select:VSX_D
 
8014
-          (match_operand:VSX_D 1 "memory_operand" "Z")
 
8015
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
 
8016
+        (vec_select:VSX_LE
 
8017
+          (match_operand:VSX_LE 1 "memory_operand" "Z")
 
8018
           (parallel [(const_int 1) (const_int 0)])))]
 
8019
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
8020
   "lxvd2x %x0,%y1"
 
8021
@@ -1410,7 +1449,7 @@
 
8022
   [(set_attr "type" "vecload")])
 
8023
 
 
8024
 (define_insn "*vsx_lxvd2x4_le_<mode>"
 
8025
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
 
8026
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
 
8027
         (vec_select:VSX_W
 
8028
           (match_operand:VSX_W 1 "memory_operand" "Z")
 
8029
           (parallel [(const_int 2) (const_int 3)
 
8030
@@ -1450,9 +1489,9 @@
 
8031
 ;; stxvd2x for little endian stores.  We need several of
 
8032
 ;; these since the form of the PARALLEL differs by mode.
 
8033
 (define_insn "*vsx_stxvd2x2_le_<mode>"
 
8034
-  [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
 
8035
-        (vec_select:VSX_D
 
8036
-          (match_operand:VSX_D 1 "vsx_register_operand" "wa")
 
8037
+  [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
 
8038
+        (vec_select:VSX_LE
 
8039
+          (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
 
8040
           (parallel [(const_int 1) (const_int 0)])))]
 
8041
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
8042
   "stxvd2x %x1,%y0"
 
8043
@@ -1461,7 +1500,7 @@
 
8044
 (define_insn "*vsx_stxvd2x4_le_<mode>"
 
8045
   [(set (match_operand:VSX_W 0 "memory_operand" "=Z")
 
8046
         (vec_select:VSX_W
 
8047
-          (match_operand:VSX_W 1 "vsx_register_operand" "wa")
 
8048
+          (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
 
8049
           (parallel [(const_int 2) (const_int 3)
 
8050
                      (const_int 0) (const_int 1)])))]
 
8051
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
8052
@@ -1513,11 +1552,12 @@
 
8053
 
 
8054
 ;; Set the element of a V2DI/VD2F mode
 
8055
 (define_insn "vsx_set_<mode>"
 
8056
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?wa")
 
8057
-       (unspec:VSX_D [(match_operand:VSX_D 1 "vsx_register_operand" "wd,wa")
 
8058
-                      (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")
 
8059
-                      (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
 
8060
-                     UNSPEC_VSX_SET))]
 
8061
+  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?<VSa>")
 
8062
+       (unspec:VSX_D
 
8063
+        [(match_operand:VSX_D 1 "vsx_register_operand" "wd,<VSa>")
 
8064
+         (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")
 
8065
+         (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
 
8066
+        UNSPEC_VSX_SET))]
 
8067
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8068
 {
 
8069
   int idx_first = BYTES_BIG_ENDIAN ? 0 : 1;
 
8070
@@ -1582,7 +1622,7 @@
 
8071
 (define_insn_and_split "vsx_extract_v4sf"
 
8072
   [(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
 
8073
        (vec_select:SF
 
8074
-        (match_operand:V4SF 1 "vsx_register_operand" "wa,wa")
 
8075
+        (match_operand:V4SF 1 "vsx_register_operand" "<VSa>,<VSa>")
 
8076
         (parallel [(match_operand:QI 2 "u5bit_cint_operand" "O,i")])))
 
8077
    (clobber (match_scratch:V4SF 3 "=X,0"))]
 
8078
   "VECTOR_UNIT_VSX_P (V4SFmode)"
 
8079
@@ -1606,7 +1646,7 @@
 
8080
     {
 
8081
       if (GET_CODE (op3) == SCRATCH)
 
8082
        op3 = gen_reg_rtx (V4SFmode);
 
8083
-      emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, op2));
 
8084
+      emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, GEN_INT (ele)));
 
8085
       tmp = op3;
 
8086
     }
 
8087
   emit_insn (gen_vsx_xscvspdp_scalar2 (op0, tmp));
 
8088
@@ -1765,9 +1805,9 @@
 
8089
 
 
8090
 ;; V2DF/V2DI splat
 
8091
 (define_insn "vsx_splat_<mode>"
 
8092
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?wa,?wa,?wa")
 
8093
+  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?<VSa>,?<VSa>,?<VSa>")
 
8094
        (vec_duplicate:VSX_D
 
8095
-        (match_operand:<VS_scalar> 1 "splat_input_operand" "ws,f,Z,wa,wa,Z")))]
 
8096
+        (match_operand:<VS_scalar> 1 "splat_input_operand" "<VS_64reg>,f,Z,<VSa>,<VSa>,Z")))]
 
8097
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8098
   "@
 
8099
    xxpermdi %x0,%x1,%x1,0
 
8100
@@ -1780,10 +1820,10 @@
 
8101
 
 
8102
 ;; V4SF/V4SI splat
 
8103
 (define_insn "vsx_xxspltw_<mode>"
 
8104
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
 
8105
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
 
8106
        (vec_duplicate:VSX_W
 
8107
         (vec_select:<VS_scalar>
 
8108
-         (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
 
8109
+         (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
 
8110
          (parallel
 
8111
           [(match_operand:QI 2 "u5bit_cint_operand" "i,i")]))))]
 
8112
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8113
@@ -1796,8 +1836,8 @@
 
8114
   [(set_attr "type" "vecperm")])
 
8115
 
 
8116
 (define_insn "vsx_xxspltw_<mode>_direct"
 
8117
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
 
8118
-        (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
 
8119
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
 
8120
+        (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
 
8121
                        (match_operand:QI 2 "u5bit_cint_operand" "i,i")]
 
8122
                       UNSPEC_VSX_XXSPLTW))]
 
8123
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8124
@@ -1806,11 +1846,11 @@
 
8125
 
 
8126
 ;; V4SF/V4SI interleave
 
8127
 (define_insn "vsx_xxmrghw_<mode>"
 
8128
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
 
8129
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
 
8130
         (vec_select:VSX_W
 
8131
          (vec_concat:<VS_double>
 
8132
-           (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
 
8133
-           (match_operand:VSX_W 2 "vsx_register_operand" "wf,wa"))
 
8134
+           (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
 
8135
+           (match_operand:VSX_W 2 "vsx_register_operand" "wf,<VSa>"))
 
8136
          (parallel [(const_int 0) (const_int 4)
 
8137
                     (const_int 1) (const_int 5)])))]
 
8138
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8139
@@ -1823,11 +1863,11 @@
 
8140
   [(set_attr "type" "vecperm")])
 
8141
 
 
8142
 (define_insn "vsx_xxmrglw_<mode>"
 
8143
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
 
8144
+  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
 
8145
        (vec_select:VSX_W
 
8146
          (vec_concat:<VS_double>
 
8147
-           (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
 
8148
-           (match_operand:VSX_W 2 "vsx_register_operand" "wf,?wa"))
 
8149
+           (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
 
8150
+           (match_operand:VSX_W 2 "vsx_register_operand" "wf,?<VSa>"))
 
8151
          (parallel [(const_int 2) (const_int 6)
 
8152
                     (const_int 3) (const_int 7)])))]
 
8153
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8154
@@ -1841,9 +1881,9 @@
 
8155
 
 
8156
 ;; Shift left double by word immediate
 
8157
 (define_insn "vsx_xxsldwi_<mode>"
 
8158
-  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=wa")
 
8159
-       (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "wa")
 
8160
-                      (match_operand:VSX_L 2 "vsx_register_operand" "wa")
 
8161
+  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSa>")
 
8162
+       (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "<VSa>")
 
8163
+                      (match_operand:VSX_L 2 "vsx_register_operand" "<VSa>")
 
8164
                       (match_operand:QI 3 "u5bit_cint_operand" "i")]
 
8165
                      UNSPEC_VSX_SLDWI))]
 
8166
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 
8167
@@ -1924,7 +1964,7 @@
 
8168
 ;; to the top element of the V2DF array without doing an extract.
 
8169
 
 
8170
 (define_insn_and_split "*vsx_reduc_<VEC_reduc_name>_v2df_scalar"
 
8171
-  [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?wa,ws,?wa")
 
8172
+  [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?ws,ws,?ws")
 
8173
        (vec_select:DF
 
8174
         (VEC_reduc:V2DF
 
8175
          (vec_concat:V2DF
 
8176
Index: gcc/config/rs6000/rs6000.h
 
8177
===================================================================
 
8178
--- a/src/gcc/config/rs6000/rs6000.h    (.../tags/gcc_4_8_3_release)
 
8179
+++ b/src/gcc/config/rs6000/rs6000.h    (.../branches/gcc-4_8-branch)
 
8180
@@ -1438,6 +1438,10 @@
 
8181
   RS6000_CONSTRAINT_wd,                /* VSX register for V2DF */
 
8182
   RS6000_CONSTRAINT_wf,                /* VSX register for V4SF */
 
8183
   RS6000_CONSTRAINT_wg,                /* FPR register for -mmfpgpr */
 
8184
+  RS6000_CONSTRAINT_wh,                /* FPR register for direct moves.  */
 
8185
+  RS6000_CONSTRAINT_wi,                /* FPR/VSX register to hold DImode */
 
8186
+  RS6000_CONSTRAINT_wj,                /* FPR/VSX register for DImode direct moves. */
 
8187
+  RS6000_CONSTRAINT_wk,                /* FPR/VSX register for DFmode direct moves. */
 
8188
   RS6000_CONSTRAINT_wl,                /* FPR register for LFIWAX */
 
8189
   RS6000_CONSTRAINT_wm,                /* VSX register for direct move */
 
8190
   RS6000_CONSTRAINT_wr,                /* GPR register if 64-bit  */
 
8191
@@ -1462,6 +1466,9 @@
 
8192
 #define VSX_REG_CLASS_P(CLASS)                 \
 
8193
   ((CLASS) == VSX_REGS || (CLASS) == FLOAT_REGS || (CLASS) == ALTIVEC_REGS)
 
8194
 
 
8195
+/* Return whether a given register class targets general purpose registers.  */
 
8196
+#define GPR_REG_CLASS_P(CLASS) ((CLASS) == GENERAL_REGS || (CLASS) == BASE_REGS)
 
8197
+
 
8198
 /* Given an rtx X being reloaded into a reg required to be
 
8199
    in class CLASS, return the class of reg to actually use.
 
8200
    In general this is just CLASS; but on some machines
 
8201
@@ -1593,8 +1600,15 @@
 
8202
 /* Define this if stack space is still allocated for a parameter passed
 
8203
    in a register.  The value is the number of bytes allocated to this
 
8204
    area.  */
 
8205
-#define REG_PARM_STACK_SPACE(FNDECL) rs6000_reg_parm_stack_space((FNDECL))
 
8206
+#define REG_PARM_STACK_SPACE(FNDECL) \
 
8207
+  rs6000_reg_parm_stack_space ((FNDECL), false)
 
8208
 
 
8209
+/* Define this macro if space guaranteed when compiling a function body
 
8210
+   is different to space required when making a call, a situation that
 
8211
+   can arise with K&R style function definitions.  */
 
8212
+#define INCOMING_REG_PARM_STACK_SPACE(FNDECL) \
 
8213
+  rs6000_reg_parm_stack_space ((FNDECL), true)
 
8214
+
 
8215
 /* Define this if the above stack space is to be considered part of the
 
8216
    space allocated by the caller.  */
 
8217
 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
 
8218
@@ -2483,8 +2497,8 @@
 
8219
 #define RS6000_BTC_SAT         RS6000_BTC_MISC /* saturate sets VSCR.  */
 
8220
 
 
8221
 /* Builtin targets.  For now, we reuse the masks for those options that are in
 
8222
-   target flags, and pick two random bits for SPE and paired which aren't in
 
8223
-   target_flags.  */
 
8224
+   target flags, and pick three random bits for SPE, paired and ldbl128 which
 
8225
+   aren't in target_flags.  */
 
8226
 #define RS6000_BTM_ALWAYS      0               /* Always enabled.  */
 
8227
 #define RS6000_BTM_ALTIVEC     MASK_ALTIVEC    /* VMX/altivec vectors.  */
 
8228
 #define RS6000_BTM_VSX         MASK_VSX        /* VSX (vector/scalar).  */
 
8229
@@ -2501,6 +2515,7 @@
 
8230
 #define RS6000_BTM_CELL                MASK_FPRND      /* Target is cell powerpc.  */
 
8231
 #define RS6000_BTM_DFP         MASK_DFP        /* Decimal floating point.  */
 
8232
 #define RS6000_BTM_HARD_FLOAT  MASK_SOFT_FLOAT /* Hardware floating point.  */
 
8233
+#define RS6000_BTM_LDBL128     MASK_MULTIPLE   /* 128-bit long double.  */
 
8234
 
 
8235
 #define RS6000_BTM_COMMON      (RS6000_BTM_ALTIVEC                     \
 
8236
                                 | RS6000_BTM_VSX                       \
 
8237
@@ -2514,7 +2529,8 @@
 
8238
                                 | RS6000_BTM_POPCNTD                   \
 
8239
                                 | RS6000_BTM_CELL                      \
 
8240
                                 | RS6000_BTM_DFP                       \
 
8241
-                                | RS6000_BTM_HARD_FLOAT)
 
8242
+                                | RS6000_BTM_HARD_FLOAT                \
 
8243
+                                | RS6000_BTM_LDBL128)
 
8244
 
 
8245
 /* Define builtin enum index.  */
 
8246
 
 
8247
Index: gcc/config/rs6000/rs6000.md
 
8248
===================================================================
 
8249
--- a/src/gcc/config/rs6000/rs6000.md   (.../tags/gcc_4_8_3_release)
 
8250
+++ b/src/gcc/config/rs6000/rs6000.md   (.../branches/gcc-4_8-branch)
 
8251
@@ -317,7 +317,7 @@
 
8252
 (define_mode_attr f32_sv [(SF "stxsspx %x1,%y0")  (SD "stxsiwzx %x1,%y0")])
 
8253
 
 
8254
 ; Definitions for 32-bit fpr direct move
 
8255
-(define_mode_attr f32_dm [(SF "wn") (SD "wm")])
 
8256
+(define_mode_attr f32_dm [(SF "wn") (SD "wh")])
 
8257
 
 
8258
 ; These modes do not fit in integer registers in 32-bit mode.
 
8259
 ; but on e500v2, the gpr are 64 bit registers
 
8260
@@ -566,7 +566,7 @@
 
8261
   "")
 
8262
 
 
8263
 (define_insn "*zero_extendsidi2_lfiwzx"
 
8264
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wz,!wu")
 
8265
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wz,!wu")
 
8266
        (zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r,r,Z,Z")))]
 
8267
   "TARGET_POWERPC64 && TARGET_LFIWZX"
 
8268
   "@
 
8269
@@ -736,8 +736,8 @@
 
8270
   "")
 
8271
 
 
8272
 (define_insn "*extendsidi2_lfiwax"
 
8273
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
 
8274
-       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
 
8275
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wl,!wu")
 
8276
+       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
 
8277
   "TARGET_POWERPC64 && TARGET_LFIWAX"
 
8278
   "@
 
8279
    lwa%U1%X1 %0,%1
 
8280
@@ -760,7 +760,7 @@
 
8281
 
 
8282
 (define_insn "*extendsidi2_nocell"
 
8283
   [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
 
8284
-       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
 
8285
+       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r")))]
 
8286
   "TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
 
8287
   "@
 
8288
    lwa%U1%X1 %0,%1
 
8289
@@ -5614,7 +5614,7 @@
 
8290
 ; We don't define lfiwax/lfiwzx with the normal definition, because we
 
8291
 ; don't want to support putting SImode in FPR registers.
 
8292
 (define_insn "lfiwax"
 
8293
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
 
8294
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
 
8295
        (unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
 
8296
                   UNSPEC_LFIWAX))]
 
8297
   "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWAX"
 
8298
@@ -5694,7 +5694,7 @@
 
8299
    (set_attr "type" "fpload")])
 
8300
 
 
8301
 (define_insn "lfiwzx"
 
8302
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
 
8303
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
 
8304
        (unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
 
8305
                   UNSPEC_LFIWZX))]
 
8306
   "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWZX"
 
8307
@@ -9491,8 +9491,8 @@
 
8308
 ; ld/std require word-aligned displacements -> 'Y' constraint.
 
8309
 ; List Y->r and r->Y before r->r for reload.
 
8310
 (define_insn "*mov<mode>_hardfloat64"
 
8311
-  [(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")
 
8312
-       (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"))]
 
8313
+  [(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,wk")
 
8314
+       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,r,h,0,G,H,F,wg,r,wk,r"))]
 
8315
   "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
 
8316
    && (gpc_reg_operand (operands[0], <MODE>mode)
 
8317
        || gpc_reg_operand (operands[1], <MODE>mode))"
 
8318
@@ -10272,8 +10272,8 @@
 
8319
 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
 
8320
 
 
8321
 (define_insn "*movdi_internal64"
 
8322
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wm")
 
8323
-       (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wm,r"))]
 
8324
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wj,?*wi")
 
8325
+       (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wj,r,O"))]
 
8326
   "TARGET_POWERPC64
 
8327
    && (gpc_reg_operand (operands[0], DImode)
 
8328
        || gpc_reg_operand (operands[1], DImode))"
 
8329
@@ -10293,7 +10293,8 @@
 
8330
    mftgpr %0,%1
 
8331
    mffgpr %0,%1
 
8332
    mfvsrd %0,%x1
 
8333
-   mtvsrd %x0,%1"
 
8334
+   mtvsrd %x0,%1
 
8335
+   xxlxor %x0,%x0,%x0"
 
8336
   [(set_attr_alternative "type"
 
8337
       [(if_then_else
 
8338
         (match_test "update_indexed_address_mem (operands[0], VOIDmode)")
 
8339
@@ -10334,8 +10335,9 @@
 
8340
        (const_string "mftgpr")
 
8341
        (const_string "mffgpr")
 
8342
        (const_string "mftgpr")
 
8343
-       (const_string "mffgpr")])
 
8344
-   (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4")])
 
8345
+       (const_string "mffgpr")
 
8346
+       (const_string "vecsimple")])
 
8347
+   (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4,4")])
 
8348
 
 
8349
 ;; immediate value valid for a single instruction hiding in a const_double
 
8350
 (define_insn ""
 
8351
@@ -15847,26 +15849,6 @@
 
8352
   ""
 
8353
   "")
 
8354
 
 
8355
-;; The Advance Toolchain 7.0-3 added private builtins: __builtin_longdouble_dw0
 
8356
-;; and __builtin_longdouble_dw1 to optimize glibc.  Add support for these
 
8357
-;; builtins here.
 
8358
-
 
8359
-(define_expand "unpacktf_0"
 
8360
-  [(set (match_operand:DF 0 "nonimmediate_operand" "")
 
8361
-       (unspec:DF [(match_operand:TF 1 "register_operand" "")
 
8362
-                   (const_int 0)]
 
8363
-        UNSPEC_UNPACK_128BIT))]
 
8364
-  ""
 
8365
-  "")
 
8366
-
 
8367
-(define_expand "unpacktf_1"
 
8368
-  [(set (match_operand:DF 0 "nonimmediate_operand" "")
 
8369
-       (unspec:DF [(match_operand:TF 1 "register_operand" "")
 
8370
-                   (const_int 1)]
 
8371
-        UNSPEC_UNPACK_128BIT))]
 
8372
-  ""
 
8373
-  "")
 
8374
-
 
8375
 (define_insn_and_split "unpack<mode>_dm"
 
8376
   [(set (match_operand:<FP128_64> 0 "nonimmediate_operand" "=d,m,d,r,m")
 
8377
        (unspec:<FP128_64>
 
8378
Index: gcc/config/rs6000/sysv4.h
 
8379
===================================================================
 
8380
--- a/src/gcc/config/rs6000/sysv4.h     (.../tags/gcc_4_8_3_release)
 
8381
+++ b/src/gcc/config/rs6000/sysv4.h     (.../branches/gcc-4_8-branch)
 
8382
@@ -292,7 +292,7 @@
 
8383
 /* An expression for the alignment of a structure field FIELD if the
 
8384
    alignment computed in the usual way is COMPUTED.  */
 
8385
 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                                  \
 
8386
-       ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
 
8387
+       (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))            \
 
8388
         ? 128 : COMPUTED)
 
8389
 
 
8390
 #undef  BIGGEST_FIELD_ALIGNMENT
 
8391
@@ -949,3 +949,27 @@
 
8392
 #define TARGET_USES_SYSV4_OPT 1
 
8393
 
 
8394
 #undef DBX_REGISTER_NUMBER
 
8395
+
 
8396
+/* Link -lasan early on the command line.  For -static-libasan, don't link
 
8397
+   it for -shared link, the executable should be compiled with -static-libasan
 
8398
+   in that case, and for executable link link with --{,no-}whole-archive around
 
8399
+   it to force everything into the executable.  And similarly for -ltsan.  */
 
8400
+#if defined(HAVE_LD_STATIC_DYNAMIC)
 
8401
+#undef LIBASAN_EARLY_SPEC
 
8402
+#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
 
8403
+  "%{static-libasan:%{!shared:" \
 
8404
+  LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
 
8405
+  LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
 
8406
+#undef LIBTSAN_EARLY_SPEC
 
8407
+#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
 
8408
+  LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
 
8409
+  LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
 
8410
+#endif
 
8411
+
 
8412
+/* Additional libraries needed by -static-libasan.  */
 
8413
+#undef STATIC_LIBASAN_LIBS
 
8414
+#define STATIC_LIBASAN_LIBS "-ldl -lpthread"
 
8415
+
 
8416
+/* Additional libraries needed by -static-libtsan.  */
 
8417
+#undef STATIC_LIBTSAN_LIBS
 
8418
+#define STATIC_LIBTSAN_LIBS "-ldl -lpthread"
 
8419
Index: gcc/config/arm/arm.c
 
8420
===================================================================
 
8421
--- a/src/gcc/config/arm/arm.c  (.../tags/gcc_4_8_3_release)
 
8422
+++ b/src/gcc/config/arm/arm.c  (.../branches/gcc-4_8-branch)
 
8423
@@ -24476,9 +24476,13 @@
 
8424
       fputs (":\n", file);
 
8425
       if (flag_pic)
 
8426
        {
 
8427
-         /* Output ".word .LTHUNKn-7-.LTHUNKPCn".  */
 
8428
+         /* Output ".word .LTHUNKn-[3,7]-.LTHUNKPCn".  */
 
8429
          rtx tem = XEXP (DECL_RTL (function), 0);
 
8430
-         tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
 
8431
+         /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC
 
8432
+            pipeline offset is four rather than eight.  Adjust the offset
 
8433
+            accordingly.  */
 
8434
+         tem = plus_constant (GET_MODE (tem), tem,
 
8435
+                              TARGET_THUMB1_ONLY ? -3 : -7);
 
8436
          tem = gen_rtx_MINUS (GET_MODE (tem),
 
8437
                               tem,
 
8438
                               gen_rtx_SYMBOL_REF (Pmode,
 
8439
Index: gcc/config/arm/arm.md
 
8440
===================================================================
 
8441
--- a/src/gcc/config/arm/arm.md (.../tags/gcc_4_8_3_release)
 
8442
+++ b/src/gcc/config/arm/arm.md (.../branches/gcc-4_8-branch)
 
8443
@@ -7630,12 +7630,13 @@
 
8444
 
 
8445
 (define_insn "*arm_cmpdi_unsigned"
 
8446
   [(set (reg:CC_CZ CC_REGNUM)
 
8447
-       (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
 
8448
-                      (match_operand:DI 1 "arm_di_operand"     "rDi")))]
 
8449
+       (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r,r")
 
8450
+                      (match_operand:DI 1 "arm_di_operand"     "rDi,rDi")))]
 
8451
   "TARGET_32BIT"
 
8452
   "cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
 
8453
   [(set_attr "conds" "set")
 
8454
-   (set_attr "length" "8")]
 
8455
+   (set_attr "arch" "a,t2")
 
8456
+   (set_attr "length" "8,10")]
 
8457
 )
 
8458
 
 
8459
 (define_insn "*arm_cmpdi_zero"
 
8460
Index: gcc/config/arm/t-rtems-eabi
 
8461
===================================================================
 
8462
--- a/src/gcc/config/arm/t-rtems-eabi   (.../tags/gcc_4_8_3_release)
 
8463
+++ b/src/gcc/config/arm/t-rtems-eabi   (.../branches/gcc-4_8-branch)
 
8464
@@ -1,47 +1,167 @@
 
8465
 # Custom RTEMS EABI multilibs
 
8466
 
 
8467
-MULTILIB_OPTIONS  = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard
 
8468
-MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard
 
8469
+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
 
8470
+MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard
 
8471
 
 
8472
 # Enumeration of multilibs
 
8473
 
 
8474
 MULTILIB_EXCEPTIONS =
 
8475
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
 
8476
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon
 
8477
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
8478
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16
 
8479
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8480
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16
 
8481
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard
 
8482
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m
 
8483
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
 
8484
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon
 
8485
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
 
8486
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16
 
8487
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8488
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16
 
8489
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard
 
8490
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a
 
8491
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
 
8492
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon
 
8493
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
8494
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16
 
8495
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8496
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16
 
8497
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard
 
8498
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r
 
8499
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
 
8500
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon
 
8501
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
8502
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16
 
8503
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8504
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16
 
8505
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard
 
8506
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m
 
8507
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard
 
8508
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon
 
8509
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
 
8510
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16
 
8511
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8512
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16
 
8513
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard
 
8514
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb
 
8515
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard
 
8516
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon
 
8517
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
8518
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16
 
8519
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8520
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16
 
8521
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard
 
8522
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m
 
8523
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard
 
8524
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon
 
8525
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
 
8526
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16
 
8527
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8528
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16
 
8529
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfloat-abi=hard
 
8530
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a
 
8531
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon/mfloat-abi=hard
 
8532
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon
 
8533
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
8534
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16
 
8535
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8536
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16
 
8537
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfloat-abi=hard
 
8538
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r
 
8539
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon/mfloat-abi=hard
 
8540
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon
 
8541
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
8542
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16
 
8543
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8544
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16
 
8545
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfloat-abi=hard
 
8546
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m
 
8547
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon/mfloat-abi=hard
 
8548
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon
 
8549
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16/mfloat-abi=hard
 
8550
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16
 
8551
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8552
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16
 
8553
+MULTILIB_EXCEPTIONS += mbig-endian/mfloat-abi=hard
 
8554
+MULTILIB_EXCEPTIONS += mbig-endian
 
8555
 MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
 
8556
 MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon
 
8557
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
8558
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16
 
8559
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8560
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16
 
8561
 MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfloat-abi=hard
 
8562
 # MULTILIB_EXCEPTIONS += mthumb/march=armv6-m
 
8563
 # MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
 
8564
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon
 
8565
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
 
8566
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16
 
8567
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8568
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16
 
8569
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfloat-abi=hard
 
8570
 # MULTILIB_EXCEPTIONS += mthumb/march=armv7-a
 
8571
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
 
8572
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon
 
8573
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
8574
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16
 
8575
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8576
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16
 
8577
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfloat-abi=hard
 
8578
 # MULTILIB_EXCEPTIONS += mthumb/march=armv7-r
 
8579
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
 
8580
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon
 
8581
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
8582
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16
 
8583
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8584
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16
 
8585
 MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfloat-abi=hard
 
8586
 # MULTILIB_EXCEPTIONS += mthumb/march=armv7-m
 
8587
 MULTILIB_EXCEPTIONS += mthumb/mfpu=neon/mfloat-abi=hard
 
8588
 MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
 
8589
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
 
8590
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16
 
8591
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8592
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16
 
8593
 MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard
 
8594
 # MULTILIB_EXCEPTIONS += mthumb
 
8595
 MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon/mfloat-abi=hard
 
8596
 MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon
 
8597
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
8598
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16
 
8599
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8600
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16
 
8601
 MULTILIB_EXCEPTIONS += march=armv6-m/mfloat-abi=hard
 
8602
 MULTILIB_EXCEPTIONS += march=armv6-m
 
8603
 MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon/mfloat-abi=hard
 
8604
 MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon
 
8605
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
 
8606
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16
 
8607
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8608
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16
 
8609
 MULTILIB_EXCEPTIONS += march=armv7-a/mfloat-abi=hard
 
8610
 MULTILIB_EXCEPTIONS += march=armv7-a
 
8611
 MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon/mfloat-abi=hard
 
8612
 MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon
 
8613
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
 
8614
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16
 
8615
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8616
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16
 
8617
 MULTILIB_EXCEPTIONS += march=armv7-r/mfloat-abi=hard
 
8618
 MULTILIB_EXCEPTIONS += march=armv7-r
 
8619
 MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon/mfloat-abi=hard
 
8620
 MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon
 
8621
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
 
8622
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16
 
8623
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8624
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16
 
8625
 MULTILIB_EXCEPTIONS += march=armv7-m/mfloat-abi=hard
 
8626
 MULTILIB_EXCEPTIONS += march=armv7-m
 
8627
 MULTILIB_EXCEPTIONS += mfpu=neon/mfloat-abi=hard
 
8628
 MULTILIB_EXCEPTIONS += mfpu=neon
 
8629
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16/mfloat-abi=hard
 
8630
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16
 
8631
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16/mfloat-abi=hard
 
8632
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16
 
8633
 MULTILIB_EXCEPTIONS += mfloat-abi=hard
 
8634
Index: gcc/config/pa/pa.c
 
8635
===================================================================
 
8636
--- a/src/gcc/config/pa/pa.c    (.../tags/gcc_4_8_3_release)
 
8637
+++ b/src/gcc/config/pa/pa.c    (.../branches/gcc-4_8-branch)
 
8638
@@ -3237,7 +3237,12 @@
 
8639
       && aligned_p
 
8640
       && function_label_operand (x, VOIDmode))
 
8641
     {
 
8642
-      fputs (size == 8? "\t.dword\tP%" : "\t.word\tP%", asm_out_file);
 
8643
+      fputs (size == 8? "\t.dword\t" : "\t.word\t", asm_out_file);
 
8644
+
 
8645
+      /* We don't want an OPD when generating fast indirect calls.  */
 
8646
+      if (!TARGET_FAST_INDIRECT_CALLS)
 
8647
+       fputs ("P%", asm_out_file);
 
8648
+
 
8649
       output_addr_const (asm_out_file, x);
 
8650
       fputc ('\n', asm_out_file);
 
8651
       return true;
 
8652
@@ -4160,9 +4165,8 @@
 
8653
 pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
 
8654
 {
 
8655
   rtx insn = get_last_insn ();
 
8656
+  bool extra_nop;
 
8657
 
 
8658
-  last_address = 0;
 
8659
-
 
8660
   /* pa_expand_epilogue does the dirty work now.  We just need
 
8661
      to output the assembler directives which denote the end
 
8662
      of a function.
 
8663
@@ -4185,14 +4189,16 @@
 
8664
   if (insn && GET_CODE (insn) == CALL_INSN)
 
8665
     {
 
8666
       fputs ("\tnop\n", file);
 
8667
-      last_address += 4;
 
8668
+      extra_nop = true;
 
8669
     }
 
8670
+  else
 
8671
+    extra_nop = false;
 
8672
 
 
8673
   fputs ("\t.EXIT\n\t.PROCEND\n", file);
 
8674
 
 
8675
   if (TARGET_SOM && TARGET_GAS)
 
8676
     {
 
8677
-      /* We done with this subspace except possibly for some additional
 
8678
+      /* We are done with this subspace except possibly for some additional
 
8679
         debug information.  Forget that we are in this subspace to ensure
 
8680
         that the next function is output in its own subspace.  */
 
8681
       in_section = NULL;
 
8682
@@ -4199,8 +4205,13 @@
 
8683
       cfun->machine->in_nsubspa = 2;
 
8684
     }
 
8685
 
 
8686
+  /* Thunks do their own insn accounting.  */
 
8687
+  if (cfun->is_thunk)
 
8688
+    return;
 
8689
+
 
8690
   if (INSN_ADDRESSES_SET_P ())
 
8691
     {
 
8692
+      last_address = extra_nop ? 4 : 0;
 
8693
       insn = get_last_nonnote_insn ();
 
8694
       last_address += INSN_ADDRESSES (INSN_UID (insn));
 
8695
       if (INSN_P (insn))
 
8696
@@ -8270,8 +8281,7 @@
 
8697
   xoperands[1] = XEXP (DECL_RTL (thunk_fndecl), 0);
 
8698
   xoperands[2] = GEN_INT (delta);
 
8699
 
 
8700
-  ASM_OUTPUT_LABEL (file, XSTR (xoperands[1], 0));
 
8701
-  fprintf (file, "\t.PROC\n\t.CALLINFO FRAME=0,NO_CALLS\n\t.ENTRY\n");
 
8702
+  final_start_function (emit_barrier (), file, 1);
 
8703
 
 
8704
   /* Output the thunk.  We know that the function is in the same
 
8705
      translation unit (i.e., the same space) as the thunk, and that
 
8706
@@ -8301,12 +8311,16 @@
 
8707
                   || ((DECL_SECTION_NAME (thunk_fndecl)
 
8708
                        == DECL_SECTION_NAME (function))
 
8709
                       && last_address < 262132)))
 
8710
+             /* In this case, we need to be able to reach the start of
 
8711
+                the stub table even though the function is likely closer
 
8712
+                and can be jumped to directly.  */
 
8713
              || (targetm_common.have_named_sections
 
8714
                  && DECL_SECTION_NAME (thunk_fndecl) == NULL
 
8715
                  && DECL_SECTION_NAME (function) == NULL
 
8716
-                 && last_address < 262132)
 
8717
+                 && total_code_bytes < MAX_PCREL17F_OFFSET)
 
8718
+             /* Likewise.  */
 
8719
              || (!targetm_common.have_named_sections
 
8720
-                 && last_address < 262132))))
 
8721
+                 && total_code_bytes < MAX_PCREL17F_OFFSET))))
 
8722
     {
 
8723
       if (!val_14)
 
8724
        output_asm_insn ("addil L'%2,%%r26", xoperands);
 
8725
@@ -8477,17 +8491,8 @@
 
8726
        }
 
8727
     }
 
8728
 
 
8729
-  fprintf (file, "\t.EXIT\n\t.PROCEND\n");
 
8730
+  final_end_function ();
 
8731
 
 
8732
-  if (TARGET_SOM && TARGET_GAS)
 
8733
-    {
 
8734
-      /* We done with this subspace except possibly for some additional
 
8735
-        debug information.  Forget that we are in this subspace to ensure
 
8736
-        that the next function is output in its own subspace.  */
 
8737
-      in_section = NULL;
 
8738
-      cfun->machine->in_nsubspa = 2;
 
8739
-    }
 
8740
-
 
8741
   if (TARGET_SOM && flag_pic && TREE_PUBLIC (function))
 
8742
     {
 
8743
       switch_to_section (data_section);
 
8744
Index: gcc/tree-vect-slp.c
 
8745
===================================================================
 
8746
--- a/src/gcc/tree-vect-slp.c   (.../tags/gcc_4_8_3_release)
 
8747
+++ b/src/gcc/tree-vect-slp.c   (.../branches/gcc-4_8-branch)
 
8748
@@ -1837,7 +1837,10 @@
 
8749
            && (stmt_vinfo = vinfo_for_stmt (use_stmt))
 
8750
            && !STMT_SLP_TYPE (stmt_vinfo)
 
8751
             && (STMT_VINFO_RELEVANT (stmt_vinfo)
 
8752
-                || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo)))
 
8753
+                || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo))
 
8754
+               || (STMT_VINFO_IN_PATTERN_P (stmt_vinfo)
 
8755
+                   && STMT_VINFO_RELATED_STMT (stmt_vinfo)
 
8756
+                   && !STMT_SLP_TYPE (vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_vinfo)))))
 
8757
            && !(gimple_code (use_stmt) == GIMPLE_PHI
 
8758
                  && STMT_VINFO_DEF_TYPE (stmt_vinfo)
 
8759
                   == vect_reduction_def))
 
8760
Index: libobjc/encoding.c
 
8761
===================================================================
 
8762
--- a/src/libobjc/encoding.c    (.../tags/gcc_4_8_3_release)
 
8763
+++ b/src/libobjc/encoding.c    (.../branches/gcc-4_8-branch)
 
8764
@@ -192,6 +192,8 @@
 
8765
    ? MAX (MAX (COMPUTED, SPECIFIED), 64)                               \
 
8766
    : MAX (COMPUTED, SPECIFIED));})
 
8767
 
 
8768
+#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
 
8769
+ (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
 
8770
 
 
8771
 /* Skip a variable name, enclosed in quotes (").  */
 
8772
 static inline
 
8773
Index: libobjc/ChangeLog
 
8774
===================================================================
 
8775
--- a/src/libobjc/ChangeLog     (.../tags/gcc_4_8_3_release)
 
8776
+++ b/src/libobjc/ChangeLog     (.../branches/gcc-4_8-branch)
 
8777
@@ -1,3 +1,16 @@
 
8778
+2014-07-27  Ulrich Weigand  <uweigand@de.ibm.com>
 
8779
+
 
8780
+       PR libobjc/61920
 
8781
+       * encoding.c (rs6000_special_adjust_field_align_p): Use definition
 
8782
+       that matches the 4.8 branch ABI.
 
8783
+
 
8784
+2014-07-27  Alan Modra  <amodra@gmail.com>
 
8785
+           Matthias Klose  <doko@ubuntu.com>
 
8786
+
 
8787
+       PR libobjc/61920
 
8788
+
 
8789
+       * encoding.c: Define rs6000_special_adjust_field_align_p.
 
8790
+
 
8791
 2014-05-22  Release Manager
 
8792
 
 
8793
        * GCC 4.8.3 released.
 
8794
Index: libgfortran/m4/in_pack.m4
 
8795
===================================================================
 
8796
--- a/src/libgfortran/m4/in_pack.m4     (.../tags/gcc_4_8_3_release)
 
8797
+++ b/src/libgfortran/m4/in_pack.m4     (.../branches/gcc-4_8-branch)
 
8798
@@ -79,7 +79,7 @@
 
8799
     return source->base_addr;
 
8800
 
 
8801
   /* Allocate storage for the destination.  */
 
8802
-  destptr = ('rtype_name` *)xmalloc (ssize * sizeof ('rtype_name`));
 
8803
+  destptr = xmallocarray (ssize, sizeof ('rtype_name`));
 
8804
   dest = destptr;
 
8805
   src = source->base_addr;
 
8806
   stride0 = stride[0];
 
8807
Index: libgfortran/m4/pack.m4
 
8808
===================================================================
 
8809
--- a/src/libgfortran/m4/pack.m4        (.../tags/gcc_4_8_3_release)
 
8810
+++ b/src/libgfortran/m4/pack.m4        (.../branches/gcc-4_8-branch)
 
8811
@@ -168,8 +168,8 @@
 
8812
 
 
8813
          ret->offset = 0;
 
8814
 
 
8815
-         /* xmalloc allocates a single byte for zero size.  */
 
8816
-         ret->base_addr = xmalloc (sizeof ('rtype_name`) * total);
 
8817
+         /* xmallocarray allocates a single byte for zero size.  */
 
8818
+         ret->base_addr = xmallocarray (total, sizeof ('rtype_name`));
 
8819
 
 
8820
          if (total == 0)
 
8821
            return;
 
8822
Index: libgfortran/m4/spread.m4
 
8823
===================================================================
 
8824
--- a/src/libgfortran/m4/spread.m4      (.../tags/gcc_4_8_3_release)
 
8825
+++ b/src/libgfortran/m4/spread.m4      (.../branches/gcc-4_8-branch)
 
8826
@@ -102,8 +102,8 @@
 
8827
        }
 
8828
       ret->offset = 0;
 
8829
 
 
8830
-      /* xmalloc allocates a single byte for zero size.  */
 
8831
-      ret->base_addr = xmalloc (rs * sizeof('rtype_name`));
 
8832
+      /* xmallocarray allocates a single byte for zero size.  */
 
8833
+      ret->base_addr = xmallocarray (rs, sizeof('rtype_name`));
 
8834
       if (rs <= 0)
 
8835
         return;
 
8836
     }
 
8837
@@ -245,7 +245,7 @@
 
8838
 
 
8839
   if (ret->base_addr == NULL)
 
8840
     {
 
8841
-      ret->base_addr = xmalloc (ncopies * sizeof ('rtype_name`));
 
8842
+      ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`));
 
8843
       ret->offset = 0;
 
8844
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
8845
     }
 
8846
Index: libgfortran/m4/transpose.m4
 
8847
===================================================================
 
8848
--- a/src/libgfortran/m4/transpose.m4   (.../tags/gcc_4_8_3_release)
 
8849
+++ b/src/libgfortran/m4/transpose.m4   (.../branches/gcc-4_8-branch)
 
8850
@@ -61,7 +61,8 @@
 
8851
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
8852
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
8853
 
 
8854
-      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) ret));
 
8855
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
8856
+                                     sizeof ('rtype_name`));
 
8857
       ret->offset = 0;
 
8858
     } else if (unlikely (compile_options.bounds_check))
 
8859
     {
 
8860
Index: libgfortran/m4/iforeach.m4
 
8861
===================================================================
 
8862
--- a/src/libgfortran/m4/iforeach.m4    (.../tags/gcc_4_8_3_release)
 
8863
+++ b/src/libgfortran/m4/iforeach.m4    (.../branches/gcc-4_8-branch)
 
8864
@@ -30,7 +30,7 @@
 
8865
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
8866
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
8867
       retarray->offset = 0;
 
8868
-      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
 
8869
+      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
 
8870
     }
 
8871
   else
 
8872
     {
 
8873
@@ -133,7 +133,7 @@
 
8874
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
8875
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
8876
       retarray->offset = 0;
 
8877
-      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
 
8878
+      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
 
8879
     }
 
8880
   else
 
8881
     {
 
8882
@@ -264,7 +264,7 @@
 
8883
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
8884
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
8885
       retarray->offset = 0;
 
8886
-      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
 
8887
+      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
 
8888
     }
 
8889
   else if (unlikely (compile_options.bounds_check))
 
8890
     {
 
8891
Index: libgfortran/m4/eoshift1.m4
 
8892
===================================================================
 
8893
--- a/src/libgfortran/m4/eoshift1.m4    (.../tags/gcc_4_8_3_release)
 
8894
+++ b/src/libgfortran/m4/eoshift1.m4    (.../branches/gcc-4_8-branch)
 
8895
@@ -106,8 +106,8 @@
 
8896
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
8897
 
 
8898
         }
 
8899
-      /* xmalloc allocates a single byte for zero size.  */
 
8900
-      ret->base_addr = xmalloc (size * arraysize);
 
8901
+      /* xmallocarray allocates a single byte for zero size.  */
 
8902
+      ret->base_addr = xmallocarray (arraysize, size);
 
8903
 
 
8904
     }
 
8905
   else if (unlikely (compile_options.bounds_check))
 
8906
Index: libgfortran/m4/eoshift3.m4
 
8907
===================================================================
 
8908
--- a/src/libgfortran/m4/eoshift3.m4    (.../tags/gcc_4_8_3_release)
 
8909
+++ b/src/libgfortran/m4/eoshift3.m4    (.../branches/gcc-4_8-branch)
 
8910
@@ -90,7 +90,7 @@
 
8911
     {
 
8912
       int i;
 
8913
 
 
8914
-      ret->base_addr = xmalloc (size * arraysize);
 
8915
+      ret->base_addr = xmallocarray (arraysize, size);
 
8916
       ret->offset = 0;
 
8917
       ret->dtype = array->dtype;
 
8918
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
8919
@@ -108,8 +108,8 @@
 
8920
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
8921
 
 
8922
         }
 
8923
-      /* xmalloc allocates a single byte for zero size.  */
 
8924
-      ret->base_addr = xmalloc (size * arraysize);
 
8925
+      /* xmallocarray allocates a single byte for zero size.  */
 
8926
+      ret->base_addr = xmallocarray (arraysize, size);
 
8927
 
 
8928
     }
 
8929
   else if (unlikely (compile_options.bounds_check))
 
8930
Index: libgfortran/m4/shape.m4
 
8931
===================================================================
 
8932
--- a/src/libgfortran/m4/shape.m4       (.../tags/gcc_4_8_3_release)
 
8933
+++ b/src/libgfortran/m4/shape.m4       (.../branches/gcc-4_8-branch)
 
8934
@@ -50,7 +50,7 @@
 
8935
     {
 
8936
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
 
8937
       ret->offset = 0;
 
8938
-      ret->base_addr = xmalloc (sizeof ('rtype_name`) * rank);
 
8939
+      ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`));
 
8940
     }
 
8941
 
 
8942
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
8943
Index: libgfortran/m4/cshift1.m4
 
8944
===================================================================
 
8945
--- a/src/libgfortran/m4/cshift1.m4     (.../tags/gcc_4_8_3_release)
 
8946
+++ b/src/libgfortran/m4/cshift1.m4     (.../branches/gcc-4_8-branch)
 
8947
@@ -81,7 +81,7 @@
 
8948
     {
 
8949
       int i;
 
8950
 
 
8951
-      ret->base_addr = xmalloc (size * arraysize);
 
8952
+      ret->base_addr = xmallocarray (arraysize, size);
 
8953
       ret->offset = 0;
 
8954
       ret->dtype = array->dtype;
 
8955
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
8956
Index: libgfortran/m4/matmull.m4
 
8957
===================================================================
 
8958
--- a/src/libgfortran/m4/matmull.m4     (.../tags/gcc_4_8_3_release)
 
8959
+++ b/src/libgfortran/m4/matmull.m4     (.../branches/gcc-4_8-branch)
 
8960
@@ -89,7 +89,7 @@
 
8961
         }
 
8962
           
 
8963
       retarray->base_addr
 
8964
-       = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
 
8965
+       = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
 
8966
       retarray->offset = 0;
 
8967
     }
 
8968
     else if (unlikely (compile_options.bounds_check))
 
8969
Index: libgfortran/m4/bessel.m4
 
8970
===================================================================
 
8971
--- a/src/libgfortran/m4/bessel.m4      (.../tags/gcc_4_8_3_release)
 
8972
+++ b/src/libgfortran/m4/bessel.m4      (.../branches/gcc-4_8-branch)
 
8973
@@ -56,7 +56,7 @@
 
8974
     {
 
8975
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
8976
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
8977
-      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
 
8978
+      ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
 
8979
       ret->offset = 0;
 
8980
     }
 
8981
 
 
8982
@@ -123,7 +123,7 @@
 
8983
     {
 
8984
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
8985
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
8986
-      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
 
8987
+      ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
 
8988
       ret->offset = 0;
 
8989
     }
 
8990
 
 
8991
@@ -163,7 +163,7 @@
 
8992
 
 
8993
   x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
 
8994
 
 
8995
-  for (i = 2; i <= n1+n2; i++)
 
8996
+  for (i = 2; i <= n2 - n1; i++)
 
8997
     {
 
8998
 #if defined('rtype_name`_INFINITY)
 
8999
       if (unlikely (last2 == -'rtype_name`_INFINITY))
 
9000
Index: libgfortran/m4/unpack.m4
 
9001
===================================================================
 
9002
--- a/src/libgfortran/m4/unpack.m4      (.../tags/gcc_4_8_3_release)
 
9003
+++ b/src/libgfortran/m4/unpack.m4      (.../branches/gcc-4_8-branch)
 
9004
@@ -100,7 +100,7 @@
 
9005
          rs *= extent[n];
 
9006
        }
 
9007
       ret->offset = 0;
 
9008
-      ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
 
9009
+      ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
 
9010
     }
 
9011
   else
 
9012
     {
 
9013
@@ -245,7 +245,7 @@
 
9014
          rs *= extent[n];
 
9015
        }
 
9016
       ret->offset = 0;
 
9017
-      ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
 
9018
+      ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
 
9019
     }
 
9020
   else
 
9021
     {
 
9022
Index: libgfortran/m4/reshape.m4
 
9023
===================================================================
 
9024
--- a/src/libgfortran/m4/reshape.m4     (.../tags/gcc_4_8_3_release)
 
9025
+++ b/src/libgfortran/m4/reshape.m4     (.../branches/gcc-4_8-branch)
 
9026
@@ -115,11 +115,11 @@
 
9027
       ret->offset = 0;
 
9028
 
 
9029
       if (unlikely (rs < 1))
 
9030
-        alloc_size = 1;
 
9031
+        alloc_size = 0;
 
9032
       else
 
9033
-        alloc_size = rs * sizeof ('rtype_name`);
 
9034
+        alloc_size = rs;
 
9035
 
 
9036
-      ret->base_addr = xmalloc (alloc_size);
 
9037
+      ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`));
 
9038
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
9039
     }
 
9040
 
 
9041
Index: libgfortran/m4/ifunction_logical.m4
 
9042
===================================================================
 
9043
--- a/src/libgfortran/m4/ifunction_logical.m4   (.../tags/gcc_4_8_3_release)
 
9044
+++ b/src/libgfortran/m4/ifunction_logical.m4   (.../branches/gcc-4_8-branch)
 
9045
@@ -89,8 +89,7 @@
 
9046
       retarray->offset = 0;
 
9047
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9048
 
 
9049
-      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9050
-                  * extent[rank-1];
 
9051
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9052
 
 
9053
       if (alloc_size == 0)
 
9054
        {
 
9055
@@ -99,7 +98,7 @@
 
9056
          return;
 
9057
        }
 
9058
       else
 
9059
-       retarray->base_addr = xmalloc (alloc_size);
 
9060
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
9061
     }
 
9062
   else
 
9063
     {
 
9064
Index: libgfortran/m4/ifunction.m4
 
9065
===================================================================
 
9066
--- a/src/libgfortran/m4/ifunction.m4   (.../tags/gcc_4_8_3_release)
 
9067
+++ b/src/libgfortran/m4/ifunction.m4   (.../branches/gcc-4_8-branch)
 
9068
@@ -85,10 +85,9 @@
 
9069
       retarray->offset = 0;
 
9070
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9071
 
 
9072
-      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9073
-                  * extent[rank-1];
 
9074
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9075
 
 
9076
-      retarray->base_addr = xmalloc (alloc_size);
 
9077
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
9078
       if (alloc_size == 0)
 
9079
        {
 
9080
          /* Make sure we have a zero-sized array.  */
 
9081
@@ -260,8 +259,7 @@
 
9082
 
 
9083
        }
 
9084
 
 
9085
-      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9086
-                  * extent[rank-1];
 
9087
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9088
 
 
9089
       retarray->offset = 0;
 
9090
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9091
@@ -273,7 +271,7 @@
 
9092
          return;
 
9093
        }
 
9094
       else
 
9095
-       retarray->base_addr = xmalloc (alloc_size);
 
9096
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
9097
 
 
9098
     }
 
9099
   else
 
9100
@@ -417,8 +415,7 @@
 
9101
       retarray->offset = 0;
 
9102
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9103
 
 
9104
-      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9105
-                  * extent[rank-1];
 
9106
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9107
 
 
9108
       if (alloc_size == 0)
 
9109
        {
 
9110
@@ -427,7 +424,7 @@
 
9111
          return;
 
9112
        }
 
9113
       else
 
9114
-       retarray->base_addr = xmalloc (alloc_size);
 
9115
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
9116
     }
 
9117
   else
 
9118
     {
 
9119
Index: libgfortran/m4/matmul.m4
 
9120
===================================================================
 
9121
--- a/src/libgfortran/m4/matmul.m4      (.../tags/gcc_4_8_3_release)
 
9122
+++ b/src/libgfortran/m4/matmul.m4      (.../branches/gcc-4_8-branch)
 
9123
@@ -125,7 +125,7 @@
 
9124
         }
 
9125
 
 
9126
       retarray->base_addr
 
9127
-       = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
 
9128
+       = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
 
9129
       retarray->offset = 0;
 
9130
     }
 
9131
     else if (unlikely (compile_options.bounds_check))
 
9132
Index: libgfortran/runtime/in_pack_generic.c
 
9133
===================================================================
 
9134
--- a/src/libgfortran/runtime/in_pack_generic.c (.../tags/gcc_4_8_3_release)
 
9135
+++ b/src/libgfortran/runtime/in_pack_generic.c (.../branches/gcc-4_8-branch)
 
9136
@@ -180,7 +180,7 @@
 
9137
     return source->base_addr;
 
9138
 
 
9139
    /* Allocate storage for the destination.  */
 
9140
-  destptr = xmalloc (ssize * size);
 
9141
+  destptr = xmallocarray (ssize, size);
 
9142
   dest = (char *)destptr;
 
9143
   src = source->base_addr;
 
9144
   stride0 = stride[0] * size;
 
9145
Index: libgfortran/runtime/memory.c
 
9146
===================================================================
 
9147
--- a/src/libgfortran/runtime/memory.c  (.../tags/gcc_4_8_3_release)
 
9148
+++ b/src/libgfortran/runtime/memory.c  (.../branches/gcc-4_8-branch)
 
9149
@@ -25,8 +25,13 @@
 
9150
 
 
9151
 #include "libgfortran.h"
 
9152
 #include <stdlib.h>
 
9153
+#include <errno.h>
 
9154
 
 
9155
+#ifndef SIZE_MAX
 
9156
+#define SIZE_MAX ((size_t)-1)
 
9157
+#endif
 
9158
 
 
9159
+
 
9160
 void *
 
9161
 xmalloc (size_t n)
 
9162
 {
 
9163
@@ -44,12 +49,34 @@
 
9164
 }
 
9165
 
 
9166
 
 
9167
+void *
 
9168
+xmallocarray (size_t nmemb, size_t size)
 
9169
+{
 
9170
+  void *p;
 
9171
+
 
9172
+  if (!nmemb || !size)
 
9173
+    size = nmemb = 1;
 
9174
+  else if (nmemb > SIZE_MAX / size)
 
9175
+    {
 
9176
+      errno = ENOMEM;
 
9177
+      os_error ("Integer overflow in xmallocarray");
 
9178
+    }
 
9179
+
 
9180
+  p = malloc (nmemb * size);
 
9181
+
 
9182
+  if (!p)
 
9183
+    os_error ("Memory allocation failed in xmallocarray");
 
9184
+
 
9185
+  return p;
 
9186
+}
 
9187
+
 
9188
+
 
9189
 /* calloc wrapper that aborts on error.  */
 
9190
 
 
9191
 void *
 
9192
 xcalloc (size_t nmemb, size_t size)
 
9193
 {
 
9194
-  if (nmemb * size == 0)
 
9195
+  if (!nmemb || !size)
 
9196
     nmemb = size = 1;
 
9197
 
 
9198
   void *p = calloc (nmemb, size);
 
9199
Index: libgfortran/runtime/convert_char.c
 
9200
===================================================================
 
9201
--- a/src/libgfortran/runtime/convert_char.c    (.../tags/gcc_4_8_3_release)
 
9202
+++ b/src/libgfortran/runtime/convert_char.c    (.../branches/gcc-4_8-branch)
 
9203
@@ -44,7 +44,7 @@
 
9204
   gfc_charlen_type i, l;
 
9205
 
 
9206
   l = len > 0 ? len : 0;
 
9207
-  *dst = xmalloc ((l + 1) * sizeof (gfc_char4_t));
 
9208
+  *dst = xmallocarray ((l + 1), sizeof (gfc_char4_t));
 
9209
 
 
9210
   for (i = 0; i < l; i++)
 
9211
     (*dst)[i] = src[i];
 
9212
@@ -60,7 +60,7 @@
 
9213
   gfc_charlen_type i, l;
 
9214
 
 
9215
   l = len > 0 ? len : 0;
 
9216
-  *dst = xmalloc ((l + 1) * sizeof (unsigned char));
 
9217
+  *dst = xmalloc (l + 1);
 
9218
 
 
9219
   for (i = 0; i < l; i++)
 
9220
     (*dst)[i] = src[i];
 
9221
Index: libgfortran/runtime/environ.c
 
9222
===================================================================
 
9223
--- a/src/libgfortran/runtime/environ.c (.../tags/gcc_4_8_3_release)
 
9224
+++ b/src/libgfortran/runtime/environ.c (.../branches/gcc-4_8-branch)
 
9225
@@ -833,7 +833,7 @@
 
9226
     }
 
9227
   else
 
9228
     {
 
9229
-      elist = xmalloc (unit_count * sizeof (exception_t));
 
9230
+      elist = xmallocarray (unit_count, sizeof (exception_t));
 
9231
       do_count = 0;
 
9232
       p = val;
 
9233
       do_parse ();
 
9234
Index: libgfortran/intrinsics/string_intrinsics_inc.c
 
9235
===================================================================
 
9236
--- a/src/libgfortran/intrinsics/string_intrinsics_inc.c        (.../tags/gcc_4_8_3_release)
 
9237
+++ b/src/libgfortran/intrinsics/string_intrinsics_inc.c        (.../branches/gcc-4_8-branch)
 
9238
@@ -164,7 +164,7 @@
 
9239
   else
 
9240
     {
 
9241
       /* Allocate space for result string.  */
 
9242
-      *dest = xmalloc (*len * sizeof (CHARTYPE));
 
9243
+      *dest = xmallocarray (*len, sizeof (CHARTYPE));
 
9244
 
 
9245
       /* Copy string if necessary.  */
 
9246
       memcpy (*dest, src, *len * sizeof (CHARTYPE));
 
9247
@@ -442,7 +442,7 @@
 
9248
     *dest = &zero_length_string;
 
9249
   else
 
9250
     {
 
9251
-      CHARTYPE *tmp = xmalloc (*rlen * sizeof (CHARTYPE));
 
9252
+      CHARTYPE *tmp = xmallocarray (*rlen, sizeof (CHARTYPE));
 
9253
       memcpy (tmp, res, reslen * sizeof (CHARTYPE));
 
9254
       MEMSET (&tmp[reslen], ' ', *rlen - reslen);
 
9255
       *dest = tmp;
 
9256
Index: libgfortran/intrinsics/pack_generic.c
 
9257
===================================================================
 
9258
--- a/src/libgfortran/intrinsics/pack_generic.c (.../tags/gcc_4_8_3_release)
 
9259
+++ b/src/libgfortran/intrinsics/pack_generic.c (.../branches/gcc-4_8-branch)
 
9260
@@ -152,8 +152,8 @@
 
9261
          GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
 
9262
 
 
9263
          ret->offset = 0;
 
9264
-         /* xmalloc allocates a single byte for zero size.  */
 
9265
-         ret->base_addr = xmalloc (size * total);
 
9266
+         /* xmallocarray allocates a single byte for zero size.  */
 
9267
+         ret->base_addr = xmallocarray (total, size);
 
9268
 
 
9269
          if (total == 0)
 
9270
            return;      /* In this case, nothing remains to be done.  */
 
9271
@@ -519,7 +519,7 @@
 
9272
 
 
9273
       ret->offset = 0;
 
9274
 
 
9275
-      ret->base_addr = xmalloc (size * total);
 
9276
+      ret->base_addr = xmallocarray (total, size);
 
9277
 
 
9278
       if (total == 0)
 
9279
        return;
 
9280
Index: libgfortran/intrinsics/transpose_generic.c
 
9281
===================================================================
 
9282
--- a/src/libgfortran/intrinsics/transpose_generic.c    (.../tags/gcc_4_8_3_release)
 
9283
+++ b/src/libgfortran/intrinsics/transpose_generic.c    (.../branches/gcc-4_8-branch)
 
9284
@@ -60,7 +60,7 @@
 
9285
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
9286
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
9287
 
 
9288
-      ret->base_addr = xmalloc (size * size0 ((array_t*)ret));
 
9289
+      ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
 
9290
       ret->offset = 0;
 
9291
     }
 
9292
   else if (unlikely (compile_options.bounds_check))
 
9293
Index: libgfortran/intrinsics/cshift0.c
 
9294
===================================================================
 
9295
--- a/src/libgfortran/intrinsics/cshift0.c      (.../tags/gcc_4_8_3_release)
 
9296
+++ b/src/libgfortran/intrinsics/cshift0.c      (.../branches/gcc-4_8-branch)
 
9297
@@ -79,8 +79,8 @@
 
9298
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
9299
         }
 
9300
 
 
9301
-      /* xmalloc allocates a single byte for zero size.  */
 
9302
-      ret->base_addr = xmalloc (size * arraysize);
 
9303
+      /* xmallocarray allocates a single byte for zero size.  */
 
9304
+      ret->base_addr = xmallocarray (arraysize, size);
 
9305
     }
 
9306
   else if (unlikely (compile_options.bounds_check))
 
9307
     {
 
9308
Index: libgfortran/intrinsics/ctime.c
 
9309
===================================================================
 
9310
--- a/src/libgfortran/intrinsics/ctime.c        (.../tags/gcc_4_8_3_release)
 
9311
+++ b/src/libgfortran/intrinsics/ctime.c        (.../branches/gcc-4_8-branch)
 
9312
@@ -31,31 +31,53 @@
 
9313
 #include <string.h>
 
9314
 
 
9315
 
 
9316
-/* strftime-like function that fills a C string with %c format which
 
9317
-   is identical to ctime in the default locale. As ctime and ctime_r
 
9318
-   are poorly specified and their usage not recommended, the
 
9319
-   implementation instead uses strftime.  */
 
9320
+/* Maximum space a ctime-like string might need. A "normal" ctime
 
9321
+   string is 26 bytes, and in our case 24 bytes as we don't include
 
9322
+   the trailing newline and null. However, the longest possible year
 
9323
+   number is -2,147,481,748 (1900 - 2,147,483,648, since tm_year is a
 
9324
+   32-bit signed integer) so an extra 7 bytes are needed. */
 
9325
+#define CTIME_BUFSZ 31
 
9326
 
 
9327
-static size_t
 
9328
-strctime (char *s, size_t max, const time_t *timep)
 
9329
+
 
9330
+/* Thread-safe ctime-like function that fills a Fortran
 
9331
+   string. ctime_r is a portability headache and marked as obsolescent
 
9332
+   in POSIX 2008, which recommends strftime in its place. However,
 
9333
+   strftime(..., "%c",...)  doesn't produce ctime-like output on
 
9334
+   MinGW, so do it manually with snprintf.  */
 
9335
+
 
9336
+static int
 
9337
+gf_ctime (char *s, size_t max, const time_t timev)
 
9338
 {
 
9339
   struct tm ltm;
 
9340
   int failed;
 
9341
+  char buf[CTIME_BUFSZ + 1];
 
9342
   /* Some targets provide a localtime_r based on a draft of the POSIX
 
9343
      standard where the return type is int rather than the
 
9344
      standardized struct tm*.  */
 
9345
-  __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, &ltm)) 
 
9346
+  __builtin_choose_expr (__builtin_classify_type (localtime_r (&timev, &ltm)) 
 
9347
                         == 5,
 
9348
-                        failed = localtime_r (timep, &ltm) == NULL,
 
9349
-                        failed = localtime_r (timep, &ltm) != 0);
 
9350
+                        failed = localtime_r (&timev, &ltm) == NULL,
 
9351
+                        failed = localtime_r (&timev, &ltm) != 0);
 
9352
   if (failed)
 
9353
-    return 0;
 
9354
-  return strftime (s, max, "%c", &ltm);
 
9355
+    goto blank;
 
9356
+  int n = snprintf (buf, sizeof (buf), 
 
9357
+                   "%3.3s %3.3s%3d %.2d:%.2d:%.2d %d",
 
9358
+                   "SunMonTueWedThuFriSat" + ltm.tm_wday * 3,
 
9359
+                   "JanFebMarAprMayJunJulAugSepOctNovDec" + ltm.tm_mon * 3,
 
9360
+                   ltm.tm_mday, ltm.tm_hour, ltm.tm_min, ltm.tm_sec, 
 
9361
+                   1900 + ltm.tm_year);
 
9362
+  if (n < 0)
 
9363
+    goto blank;
 
9364
+  if ((size_t) n <= max)
 
9365
+    {
 
9366
+      cf_strcpy (s, max, buf);
 
9367
+      return n;
 
9368
+    }
 
9369
+ blank:
 
9370
+  memset (s, ' ', max);
 
9371
+  return 0;
 
9372
 }
 
9373
 
 
9374
-/* In the default locale, the date and time representation fits in 26
 
9375
-   bytes. However, other locales might need more space.  */
 
9376
-#define CSZ 100
 
9377
 
 
9378
 extern void fdate (char **, gfc_charlen_type *);
 
9379
 export_proto(fdate);
 
9380
@@ -64,8 +86,8 @@
 
9381
 fdate (char ** date, gfc_charlen_type * date_len)
 
9382
 {
 
9383
   time_t now = time(NULL);
 
9384
-  *date = xmalloc (CSZ);
 
9385
-  *date_len = strctime (*date, CSZ, &now);
 
9386
+  *date = xmalloc (CTIME_BUFSZ);
 
9387
+  *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
 
9388
 }
 
9389
 
 
9390
 
 
9391
@@ -76,10 +98,7 @@
 
9392
 fdate_sub (char * date, gfc_charlen_type date_len)
 
9393
 {
 
9394
   time_t now = time(NULL);
 
9395
-  char *s = xmalloc (date_len + 1);
 
9396
-  size_t n = strctime (s, date_len + 1, &now);
 
9397
-  fstrcpy (date, date_len, s, n);
 
9398
-  free (s);
 
9399
+  gf_ctime (date, date_len, now);
 
9400
 }
 
9401
 
 
9402
 
 
9403
@@ -91,8 +110,8 @@
 
9404
 PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t)
 
9405
 {
 
9406
   time_t now = t;
 
9407
-  *date = xmalloc (CSZ);
 
9408
-  *date_len = strctime (*date, CSZ, &now);
 
9409
+  *date = xmalloc (CTIME_BUFSZ);
 
9410
+  *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
 
9411
 }
 
9412
 
 
9413
 
 
9414
@@ -103,8 +122,5 @@
 
9415
 ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len)
 
9416
 {
 
9417
   time_t now = *t;
 
9418
-  char *s = xmalloc (date_len + 1);
 
9419
-  size_t n = strctime (s, date_len + 1, &now);
 
9420
-  fstrcpy (date, date_len, s, n);
 
9421
-  free (s);
 
9422
+  gf_ctime (date, date_len, now);
 
9423
 }
 
9424
Index: libgfortran/intrinsics/spread_generic.c
 
9425
===================================================================
 
9426
--- a/src/libgfortran/intrinsics/spread_generic.c       (.../tags/gcc_4_8_3_release)
 
9427
+++ b/src/libgfortran/intrinsics/spread_generic.c       (.../branches/gcc-4_8-branch)
 
9428
@@ -100,7 +100,7 @@
 
9429
          GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
 
9430
        }
 
9431
       ret->offset = 0;
 
9432
-      ret->base_addr = xmalloc (rs * size);
 
9433
+      ret->base_addr = xmallocarray (rs, size);
 
9434
 
 
9435
       if (rs <= 0)
 
9436
        return;
 
9437
@@ -245,7 +245,7 @@
 
9438
 
 
9439
   if (ret->base_addr == NULL)
 
9440
     {
 
9441
-      ret->base_addr = xmalloc (ncopies * size);
 
9442
+      ret->base_addr = xmallocarray (ncopies, size);
 
9443
       ret->offset = 0;
 
9444
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
9445
     }
 
9446
Index: libgfortran/intrinsics/unpack_generic.c
 
9447
===================================================================
 
9448
--- a/src/libgfortran/intrinsics/unpack_generic.c       (.../tags/gcc_4_8_3_release)
 
9449
+++ b/src/libgfortran/intrinsics/unpack_generic.c       (.../branches/gcc-4_8-branch)
 
9450
@@ -125,7 +125,7 @@
 
9451
          rs *= extent[n];
 
9452
        }
 
9453
       ret->offset = 0;
 
9454
-      ret->base_addr = xmalloc (rs * size);
 
9455
+      ret->base_addr = xmallocarray (rs, size);
 
9456
     }
 
9457
   else
 
9458
     {
 
9459
Index: libgfortran/intrinsics/eoshift0.c
 
9460
===================================================================
 
9461
--- a/src/libgfortran/intrinsics/eoshift0.c     (.../tags/gcc_4_8_3_release)
 
9462
+++ b/src/libgfortran/intrinsics/eoshift0.c     (.../branches/gcc-4_8-branch)
 
9463
@@ -86,8 +86,8 @@
 
9464
 
 
9465
         }
 
9466
 
 
9467
-      /* xmalloc allocates a single byte for zero size.  */
 
9468
-      ret->base_addr = xmalloc (size * arraysize);
 
9469
+      /* xmallocarray allocates a single byte for zero size.  */
 
9470
+      ret->base_addr = xmallocarray (arraysize, size);
 
9471
     }
 
9472
   else if (unlikely (compile_options.bounds_check))
 
9473
     {
 
9474
Index: libgfortran/intrinsics/eoshift2.c
 
9475
===================================================================
 
9476
--- a/src/libgfortran/intrinsics/eoshift2.c     (.../tags/gcc_4_8_3_release)
 
9477
+++ b/src/libgfortran/intrinsics/eoshift2.c     (.../branches/gcc-4_8-branch)
 
9478
@@ -78,8 +78,8 @@
 
9479
       ret->offset = 0;
 
9480
       ret->dtype = array->dtype;
 
9481
 
 
9482
-      /* xmalloc allocates a single byte for zero size.  */
 
9483
-      ret->base_addr = xmalloc (size * arraysize);
 
9484
+      /* xmallocarray allocates a single byte for zero size.  */
 
9485
+      ret->base_addr = xmallocarray (arraysize, size);
 
9486
 
 
9487
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
9488
         {
 
9489
Index: libgfortran/intrinsics/reshape_generic.c
 
9490
===================================================================
 
9491
--- a/src/libgfortran/intrinsics/reshape_generic.c      (.../tags/gcc_4_8_3_release)
 
9492
+++ b/src/libgfortran/intrinsics/reshape_generic.c      (.../branches/gcc-4_8-branch)
 
9493
@@ -99,11 +99,11 @@
 
9494
       ret->offset = 0;
 
9495
 
 
9496
       if (unlikely (rs < 1))
 
9497
-       alloc_size = 1;
 
9498
+       alloc_size = 0; /* xmalloc will allocate 1 byte.  */
 
9499
       else
 
9500
-       alloc_size = rs * size;
 
9501
+       alloc_size = rs;
 
9502
 
 
9503
-      ret->base_addr = xmalloc (alloc_size);
 
9504
+      ret->base_addr = xmallocarray (alloc_size, size);
 
9505
 
 
9506
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
9507
     }
 
9508
Index: libgfortran/ChangeLog
 
9509
===================================================================
 
9510
--- a/src/libgfortran/ChangeLog (.../tags/gcc_4_8_3_release)
 
9511
+++ b/src/libgfortran/ChangeLog (.../branches/gcc-4_8-branch)
 
9512
@@ -1,3 +1,84 @@
 
9513
+2014-08-20  Steven G. Kargl  <kargl@gcc.gnu.org>
 
9514
+
 
9515
+       PR libgfortran/62188
 
9516
+       * m4/bessel.m4: Avoid indexing off the end of an array.
 
9517
+       * generated/bessel_r10.c: Regenerated.
 
9518
+       * generated/bessel_r16.c: Ditto.
 
9519
+       * generated/bessel_r4.c: Ditto.
 
9520
+       * generated/bessel_r8.c: Ditto.
 
9521
+
 
9522
+2014-07-31  Janne Blomqvist  <jb@gcc.gnu.org>
 
9523
+
 
9524
+       Backport from mainline
 
9525
+       CVE-2014-5044
 
9526
+        * libgfortran.h (xmallocarray): New prototype.
 
9527
+        * runtime/memory.c (xmallocarray): New function.
 
9528
+        (xcalloc): Check for nonzero separately instead of multiplying.
 
9529
+        * generated/*.c: Regenerated.
 
9530
+        * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of
 
9531
+        xmalloc.
 
9532
+        * intrinsics/eoshift0.c (eoshift0): Likewise.
 
9533
+        * intrinsics/eoshift2.c (eoshift2): Likewise.
 
9534
+        * intrinsics/pack_generic.c (pack_internal): Likewise.
 
9535
+        (pack_s_internal): Likewise.
 
9536
+        * intrinsics/reshape_generic.c (reshape_internal): Likewise.
 
9537
+        * intrinsics/spread_generic.c (spread_internal): Likewise.
 
9538
+        (spread_internal_scalar): Likewise.
 
9539
+        * intrinsics/string_intrinsics_inc.c (string_trim): Likewise.
 
9540
+        (string_minmax): Likewise.
 
9541
+        * intrinsics/transpose_generic.c (transpose_internal): Likewise.
 
9542
+        * intrinsics/unpack_generic.c (unpack_internal): Likewise.
 
9543
+        * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value.
 
9544
+        * io/transfer.c (st_set_nml_var): Call xmallocarray instead of
 
9545
+        xmalloc.
 
9546
+        * io/unit.c (get_internal_unit): Likewise.
 
9547
+        (filename_from_unit): Don't cast xmalloc return value.
 
9548
+        * io/write.c (nml_write_obj): Likewise, formatting.
 
9549
+        * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray
 
9550
+        instead of xmalloc.
 
9551
+        (besse_yn_r'rtype_kind`): Likewise.
 
9552
+        * m4/cshift1.m4 (cshift1): Likewise.
 
9553
+        * m4/eoshift1.m4 (eoshift1): Likewise.
 
9554
+        * m4/eoshift3.m4 (eoshift3): Likewise.
 
9555
+        * m4/iforeach.m4: Likewise.
 
9556
+        * m4/ifunction.m4: Likewise.
 
9557
+        * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
 
9558
+        Likewise.
 
9559
+        * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise.
 
9560
+        * m4/matmul.m4 (matmul_'rtype_code`): Likewise.
 
9561
+        * m4/matmull.m4 (matmul_'rtype_code`): Likewise.
 
9562
+        * m4/pack.m4 (pack_'rtype_code`): Likewise.
 
9563
+        * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise.
 
9564
+        * m4/shape.m4 (shape_'rtype_kind`): Likewise.
 
9565
+        * m4/spread.m4 (spread_'rtype_code`): Likewise.
 
9566
+        (spread_scalar_'rtype_code`): Likewise.
 
9567
+        * m4/transpose.m4 (transpose_'rtype_code`): Likewise.
 
9568
+        * m4/unpack.m4 (unpack0_'rtype_code`): Likewise.
 
9569
+        (unpack1_'rtype_code`): Likewise.
 
9570
+        * runtime/convert_char.c (convert_char1_to_char4): Likewise.
 
9571
+        (convert_char4_to_char1): Simplify.
 
9572
+        * runtime/environ.c (init_unformatted): Call xmallocarray instead
 
9573
+        of xmalloc.
 
9574
+        * runtime/in_pack_generic.c (internal_pack): Likewise.
 
9575
+
 
9576
+2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
 
9577
+
 
9578
+       Backport from mainline
 
9579
+       PR libfortran/61310
 
9580
+       * intrinsics/ctime.c (strctime): Rename to gf_ctime, use snprintf
 
9581
+       instead of strftime.
 
9582
+       (fdate): Use gf_ctime.
 
9583
+       (fdate_sub): Likewise.
 
9584
+       (ctime): Likewise.
 
9585
+       (ctime_sub): Likewise.
 
9586
+
 
9587
+2014-05-25  Janne Blomqvist  <jb@gcc.gnu.org>
 
9588
+
 
9589
+       Backport from trunk.
 
9590
+       PR libfortran/61187
 
9591
+       * io/unix.c (raw_close): Check if s->fd is -1.
 
9592
+       (fd_to_stream): Check return value of fstat(), handle error.
 
9593
+
 
9594
 2014-05-22  Release Manager
 
9595
 
 
9596
        * GCC 4.8.3 released.
 
9597
Index: libgfortran/generated/spread_r10.c
 
9598
===================================================================
 
9599
--- a/src/libgfortran/generated/spread_r10.c    (.../tags/gcc_4_8_3_release)
 
9600
+++ b/src/libgfortran/generated/spread_r10.c    (.../branches/gcc-4_8-branch)
 
9601
@@ -101,8 +101,8 @@
 
9602
        }
 
9603
       ret->offset = 0;
 
9604
 
 
9605
-      /* xmalloc allocates a single byte for zero size.  */
 
9606
-      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_10));
 
9607
+      /* xmallocarray allocates a single byte for zero size.  */
 
9608
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_10));
 
9609
       if (rs <= 0)
 
9610
         return;
 
9611
     }
 
9612
@@ -244,7 +244,7 @@
 
9613
 
 
9614
   if (ret->base_addr == NULL)
 
9615
     {
 
9616
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_10));
 
9617
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_10));
 
9618
       ret->offset = 0;
 
9619
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
9620
     }
 
9621
Index: libgfortran/generated/maxloc1_4_r8.c
 
9622
===================================================================
 
9623
--- a/src/libgfortran/generated/maxloc1_4_r8.c  (.../tags/gcc_4_8_3_release)
 
9624
+++ b/src/libgfortran/generated/maxloc1_4_r8.c  (.../branches/gcc-4_8-branch)
 
9625
@@ -98,10 +98,9 @@
 
9626
       retarray->offset = 0;
 
9627
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9628
 
 
9629
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9630
-                  * extent[rank-1];
 
9631
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9632
 
 
9633
-      retarray->base_addr = xmalloc (alloc_size);
 
9634
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
9635
       if (alloc_size == 0)
 
9636
        {
 
9637
          /* Make sure we have a zero-sized array.  */
 
9638
@@ -294,8 +293,7 @@
 
9639
 
 
9640
        }
 
9641
 
 
9642
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9643
-                  * extent[rank-1];
 
9644
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9645
 
 
9646
       retarray->offset = 0;
 
9647
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9648
@@ -307,7 +305,7 @@
 
9649
          return;
 
9650
        }
 
9651
       else
 
9652
-       retarray->base_addr = xmalloc (alloc_size);
 
9653
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
9654
 
 
9655
     }
 
9656
   else
 
9657
@@ -485,8 +483,7 @@
 
9658
       retarray->offset = 0;
 
9659
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9660
 
 
9661
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9662
-                  * extent[rank-1];
 
9663
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9664
 
 
9665
       if (alloc_size == 0)
 
9666
        {
 
9667
@@ -495,7 +492,7 @@
 
9668
          return;
 
9669
        }
 
9670
       else
 
9671
-       retarray->base_addr = xmalloc (alloc_size);
 
9672
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
9673
     }
 
9674
   else
 
9675
     {
 
9676
Index: libgfortran/generated/norm2_r4.c
 
9677
===================================================================
 
9678
--- a/src/libgfortran/generated/norm2_r4.c      (.../tags/gcc_4_8_3_release)
 
9679
+++ b/src/libgfortran/generated/norm2_r4.c      (.../branches/gcc-4_8-branch)
 
9680
@@ -101,10 +101,9 @@
 
9681
       retarray->offset = 0;
 
9682
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9683
 
 
9684
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9685
-                  * extent[rank-1];
 
9686
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9687
 
 
9688
-      retarray->base_addr = xmalloc (alloc_size);
 
9689
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
9690
       if (alloc_size == 0)
 
9691
        {
 
9692
          /* Make sure we have a zero-sized array.  */
 
9693
Index: libgfortran/generated/parity_l2.c
 
9694
===================================================================
 
9695
--- a/src/libgfortran/generated/parity_l2.c     (.../tags/gcc_4_8_3_release)
 
9696
+++ b/src/libgfortran/generated/parity_l2.c     (.../branches/gcc-4_8-branch)
 
9697
@@ -98,10 +98,9 @@
 
9698
       retarray->offset = 0;
 
9699
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9700
 
 
9701
-      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9702
-                  * extent[rank-1];
 
9703
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9704
 
 
9705
-      retarray->base_addr = xmalloc (alloc_size);
 
9706
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
 
9707
       if (alloc_size == 0)
 
9708
        {
 
9709
          /* Make sure we have a zero-sized array.  */
 
9710
Index: libgfortran/generated/eoshift3_4.c
 
9711
===================================================================
 
9712
--- a/src/libgfortran/generated/eoshift3_4.c    (.../tags/gcc_4_8_3_release)
 
9713
+++ b/src/libgfortran/generated/eoshift3_4.c    (.../branches/gcc-4_8-branch)
 
9714
@@ -89,7 +89,7 @@
 
9715
     {
 
9716
       int i;
 
9717
 
 
9718
-      ret->base_addr = xmalloc (size * arraysize);
 
9719
+      ret->base_addr = xmallocarray (arraysize, size);
 
9720
       ret->offset = 0;
 
9721
       ret->dtype = array->dtype;
 
9722
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
9723
@@ -107,8 +107,8 @@
 
9724
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
9725
 
 
9726
         }
 
9727
-      /* xmalloc allocates a single byte for zero size.  */
 
9728
-      ret->base_addr = xmalloc (size * arraysize);
 
9729
+      /* xmallocarray allocates a single byte for zero size.  */
 
9730
+      ret->base_addr = xmallocarray (arraysize, size);
 
9731
 
 
9732
     }
 
9733
   else if (unlikely (compile_options.bounds_check))
 
9734
Index: libgfortran/generated/transpose_c8.c
 
9735
===================================================================
 
9736
--- a/src/libgfortran/generated/transpose_c8.c  (.../tags/gcc_4_8_3_release)
 
9737
+++ b/src/libgfortran/generated/transpose_c8.c  (.../branches/gcc-4_8-branch)
 
9738
@@ -60,7 +60,8 @@
 
9739
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
9740
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
9741
 
 
9742
-      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
 
9743
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
9744
+                                     sizeof (GFC_COMPLEX_8));
 
9745
       ret->offset = 0;
 
9746
     } else if (unlikely (compile_options.bounds_check))
 
9747
     {
 
9748
Index: libgfortran/generated/eoshift1_8.c
 
9749
===================================================================
 
9750
--- a/src/libgfortran/generated/eoshift1_8.c    (.../tags/gcc_4_8_3_release)
 
9751
+++ b/src/libgfortran/generated/eoshift1_8.c    (.../branches/gcc-4_8-branch)
 
9752
@@ -105,8 +105,8 @@
 
9753
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
9754
 
 
9755
         }
 
9756
-      /* xmalloc allocates a single byte for zero size.  */
 
9757
-      ret->base_addr = xmalloc (size * arraysize);
 
9758
+      /* xmallocarray allocates a single byte for zero size.  */
 
9759
+      ret->base_addr = xmallocarray (arraysize, size);
 
9760
 
 
9761
     }
 
9762
   else if (unlikely (compile_options.bounds_check))
 
9763
Index: libgfortran/generated/reshape_r16.c
 
9764
===================================================================
 
9765
--- a/src/libgfortran/generated/reshape_r16.c   (.../tags/gcc_4_8_3_release)
 
9766
+++ b/src/libgfortran/generated/reshape_r16.c   (.../branches/gcc-4_8-branch)
 
9767
@@ -111,11 +111,11 @@
 
9768
       ret->offset = 0;
 
9769
 
 
9770
       if (unlikely (rs < 1))
 
9771
-        alloc_size = 1;
 
9772
+        alloc_size = 0;
 
9773
       else
 
9774
-        alloc_size = rs * sizeof (GFC_REAL_16);
 
9775
+        alloc_size = rs;
 
9776
 
 
9777
-      ret->base_addr = xmalloc (alloc_size);
 
9778
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
9779
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
9780
     }
 
9781
 
 
9782
Index: libgfortran/generated/bessel_r4.c
 
9783
===================================================================
 
9784
--- a/src/libgfortran/generated/bessel_r4.c     (.../tags/gcc_4_8_3_release)
 
9785
+++ b/src/libgfortran/generated/bessel_r4.c     (.../branches/gcc-4_8-branch)
 
9786
@@ -55,7 +55,7 @@
 
9787
     {
 
9788
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
9789
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
9790
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
 
9791
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
 
9792
       ret->offset = 0;
 
9793
     }
 
9794
 
 
9795
@@ -122,7 +122,7 @@
 
9796
     {
 
9797
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
9798
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
9799
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
 
9800
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
 
9801
       ret->offset = 0;
 
9802
     }
 
9803
 
 
9804
@@ -162,7 +162,7 @@
 
9805
 
 
9806
   x2rev = GFC_REAL_4_LITERAL(2.)/x;
 
9807
 
 
9808
-  for (i = 2; i <= n1+n2; i++)
 
9809
+  for (i = 2; i <= n2 - n1; i++)
 
9810
     {
 
9811
 #if defined(GFC_REAL_4_INFINITY)
 
9812
       if (unlikely (last2 == -GFC_REAL_4_INFINITY))
 
9813
Index: libgfortran/generated/any_l2.c
 
9814
===================================================================
 
9815
--- a/src/libgfortran/generated/any_l2.c        (.../tags/gcc_4_8_3_release)
 
9816
+++ b/src/libgfortran/generated/any_l2.c        (.../branches/gcc-4_8-branch)
 
9817
@@ -101,8 +101,7 @@
 
9818
       retarray->offset = 0;
 
9819
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9820
 
 
9821
-      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9822
-                  * extent[rank-1];
 
9823
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9824
 
 
9825
       if (alloc_size == 0)
 
9826
        {
 
9827
@@ -111,7 +110,7 @@
 
9828
          return;
 
9829
        }
 
9830
       else
 
9831
-       retarray->base_addr = xmalloc (alloc_size);
 
9832
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
 
9833
     }
 
9834
   else
 
9835
     {
 
9836
Index: libgfortran/generated/product_r4.c
 
9837
===================================================================
 
9838
--- a/src/libgfortran/generated/product_r4.c    (.../tags/gcc_4_8_3_release)
 
9839
+++ b/src/libgfortran/generated/product_r4.c    (.../branches/gcc-4_8-branch)
 
9840
@@ -97,10 +97,9 @@
 
9841
       retarray->offset = 0;
 
9842
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9843
 
 
9844
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9845
-                  * extent[rank-1];
 
9846
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9847
 
 
9848
-      retarray->base_addr = xmalloc (alloc_size);
 
9849
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
9850
       if (alloc_size == 0)
 
9851
        {
 
9852
          /* Make sure we have a zero-sized array.  */
 
9853
@@ -272,8 +271,7 @@
 
9854
 
 
9855
        }
 
9856
 
 
9857
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9858
-                  * extent[rank-1];
 
9859
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9860
 
 
9861
       retarray->offset = 0;
 
9862
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9863
@@ -285,7 +283,7 @@
 
9864
          return;
 
9865
        }
 
9866
       else
 
9867
-       retarray->base_addr = xmalloc (alloc_size);
 
9868
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
9869
 
 
9870
     }
 
9871
   else
 
9872
@@ -430,8 +428,7 @@
 
9873
       retarray->offset = 0;
 
9874
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9875
 
 
9876
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9877
-                  * extent[rank-1];
 
9878
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9879
 
 
9880
       if (alloc_size == 0)
 
9881
        {
 
9882
@@ -440,7 +437,7 @@
 
9883
          return;
 
9884
        }
 
9885
       else
 
9886
-       retarray->base_addr = xmalloc (alloc_size);
 
9887
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
9888
     }
 
9889
   else
 
9890
     {
 
9891
Index: libgfortran/generated/iany_i1.c
 
9892
===================================================================
 
9893
--- a/src/libgfortran/generated/iany_i1.c       (.../tags/gcc_4_8_3_release)
 
9894
+++ b/src/libgfortran/generated/iany_i1.c       (.../branches/gcc-4_8-branch)
 
9895
@@ -97,10 +97,9 @@
 
9896
       retarray->offset = 0;
 
9897
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9898
 
 
9899
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9900
-                  * extent[rank-1];
 
9901
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9902
 
 
9903
-      retarray->base_addr = xmalloc (alloc_size);
 
9904
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
9905
       if (alloc_size == 0)
 
9906
        {
 
9907
          /* Make sure we have a zero-sized array.  */
 
9908
@@ -272,8 +271,7 @@
 
9909
 
 
9910
        }
 
9911
 
 
9912
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9913
-                  * extent[rank-1];
 
9914
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9915
 
 
9916
       retarray->offset = 0;
 
9917
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9918
@@ -285,7 +283,7 @@
 
9919
          return;
 
9920
        }
 
9921
       else
 
9922
-       retarray->base_addr = xmalloc (alloc_size);
 
9923
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
9924
 
 
9925
     }
 
9926
   else
 
9927
@@ -430,8 +428,7 @@
 
9928
       retarray->offset = 0;
 
9929
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9930
 
 
9931
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9932
-                  * extent[rank-1];
 
9933
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9934
 
 
9935
       if (alloc_size == 0)
 
9936
        {
 
9937
@@ -440,7 +437,7 @@
 
9938
          return;
 
9939
        }
 
9940
       else
 
9941
-       retarray->base_addr = xmalloc (alloc_size);
 
9942
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
9943
     }
 
9944
   else
 
9945
     {
 
9946
Index: libgfortran/generated/parity_l16.c
 
9947
===================================================================
 
9948
--- a/src/libgfortran/generated/parity_l16.c    (.../tags/gcc_4_8_3_release)
 
9949
+++ b/src/libgfortran/generated/parity_l16.c    (.../branches/gcc-4_8-branch)
 
9950
@@ -98,10 +98,9 @@
 
9951
       retarray->offset = 0;
 
9952
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9953
 
 
9954
-      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9955
-                  * extent[rank-1];
 
9956
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9957
 
 
9958
-      retarray->base_addr = xmalloc (alloc_size);
 
9959
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
 
9960
       if (alloc_size == 0)
 
9961
        {
 
9962
          /* Make sure we have a zero-sized array.  */
 
9963
Index: libgfortran/generated/in_pack_r4.c
 
9964
===================================================================
 
9965
--- a/src/libgfortran/generated/in_pack_r4.c    (.../tags/gcc_4_8_3_release)
 
9966
+++ b/src/libgfortran/generated/in_pack_r4.c    (.../branches/gcc-4_8-branch)
 
9967
@@ -76,7 +76,7 @@
 
9968
     return source->base_addr;
 
9969
 
 
9970
   /* Allocate storage for the destination.  */
 
9971
-  destptr = (GFC_REAL_4 *)xmalloc (ssize * sizeof (GFC_REAL_4));
 
9972
+  destptr = xmallocarray (ssize, sizeof (GFC_REAL_4));
 
9973
   dest = destptr;
 
9974
   src = source->base_addr;
 
9975
   stride0 = stride[0];
 
9976
Index: libgfortran/generated/product_i2.c
 
9977
===================================================================
 
9978
--- a/src/libgfortran/generated/product_i2.c    (.../tags/gcc_4_8_3_release)
 
9979
+++ b/src/libgfortran/generated/product_i2.c    (.../branches/gcc-4_8-branch)
 
9980
@@ -97,10 +97,9 @@
 
9981
       retarray->offset = 0;
 
9982
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
9983
 
 
9984
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9985
-                  * extent[rank-1];
 
9986
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
9987
 
 
9988
-      retarray->base_addr = xmalloc (alloc_size);
 
9989
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
9990
       if (alloc_size == 0)
 
9991
        {
 
9992
          /* Make sure we have a zero-sized array.  */
 
9993
@@ -272,8 +271,7 @@
 
9994
 
 
9995
        }
 
9996
 
 
9997
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
9998
-                  * extent[rank-1];
 
9999
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10000
 
 
10001
       retarray->offset = 0;
 
10002
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10003
@@ -285,7 +283,7 @@
 
10004
          return;
 
10005
        }
 
10006
       else
 
10007
-       retarray->base_addr = xmalloc (alloc_size);
 
10008
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
10009
 
 
10010
     }
 
10011
   else
 
10012
@@ -430,8 +428,7 @@
 
10013
       retarray->offset = 0;
 
10014
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10015
 
 
10016
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10017
-                  * extent[rank-1];
 
10018
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10019
 
 
10020
       if (alloc_size == 0)
 
10021
        {
 
10022
@@ -440,7 +437,7 @@
 
10023
          return;
 
10024
        }
 
10025
       else
 
10026
-       retarray->base_addr = xmalloc (alloc_size);
 
10027
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
10028
     }
 
10029
   else
 
10030
     {
 
10031
Index: libgfortran/generated/iparity_i4.c
 
10032
===================================================================
 
10033
--- a/src/libgfortran/generated/iparity_i4.c    (.../tags/gcc_4_8_3_release)
 
10034
+++ b/src/libgfortran/generated/iparity_i4.c    (.../branches/gcc-4_8-branch)
 
10035
@@ -97,10 +97,9 @@
 
10036
       retarray->offset = 0;
 
10037
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10038
 
 
10039
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10040
-                  * extent[rank-1];
 
10041
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10042
 
 
10043
-      retarray->base_addr = xmalloc (alloc_size);
 
10044
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
10045
       if (alloc_size == 0)
 
10046
        {
 
10047
          /* Make sure we have a zero-sized array.  */
 
10048
@@ -272,8 +271,7 @@
 
10049
 
 
10050
        }
 
10051
 
 
10052
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10053
-                  * extent[rank-1];
 
10054
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10055
 
 
10056
       retarray->offset = 0;
 
10057
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10058
@@ -285,7 +283,7 @@
 
10059
          return;
 
10060
        }
 
10061
       else
 
10062
-       retarray->base_addr = xmalloc (alloc_size);
 
10063
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
10064
 
 
10065
     }
 
10066
   else
 
10067
@@ -430,8 +428,7 @@
 
10068
       retarray->offset = 0;
 
10069
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10070
 
 
10071
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10072
-                  * extent[rank-1];
 
10073
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10074
 
 
10075
       if (alloc_size == 0)
 
10076
        {
 
10077
@@ -440,7 +437,7 @@
 
10078
          return;
 
10079
        }
 
10080
       else
 
10081
-       retarray->base_addr = xmalloc (alloc_size);
 
10082
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
10083
     }
 
10084
   else
 
10085
     {
 
10086
Index: libgfortran/generated/minloc0_4_i1.c
 
10087
===================================================================
 
10088
--- a/src/libgfortran/generated/minloc0_4_i1.c  (.../tags/gcc_4_8_3_release)
 
10089
+++ b/src/libgfortran/generated/minloc0_4_i1.c  (.../branches/gcc-4_8-branch)
 
10090
@@ -58,7 +58,7 @@
 
10091
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10092
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10093
       retarray->offset = 0;
 
10094
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10095
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10096
     }
 
10097
   else
 
10098
     {
 
10099
@@ -199,7 +199,7 @@
 
10100
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
10101
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10102
       retarray->offset = 0;
 
10103
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10104
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10105
     }
 
10106
   else
 
10107
     {
 
10108
@@ -367,7 +367,7 @@
 
10109
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10110
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10111
       retarray->offset = 0;
 
10112
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10113
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10114
     }
 
10115
   else if (unlikely (compile_options.bounds_check))
 
10116
     {
 
10117
Index: libgfortran/generated/reshape_c4.c
 
10118
===================================================================
 
10119
--- a/src/libgfortran/generated/reshape_c4.c    (.../tags/gcc_4_8_3_release)
 
10120
+++ b/src/libgfortran/generated/reshape_c4.c    (.../branches/gcc-4_8-branch)
 
10121
@@ -111,11 +111,11 @@
 
10122
       ret->offset = 0;
 
10123
 
 
10124
       if (unlikely (rs < 1))
 
10125
-        alloc_size = 1;
 
10126
+        alloc_size = 0;
 
10127
       else
 
10128
-        alloc_size = rs * sizeof (GFC_COMPLEX_4);
 
10129
+        alloc_size = rs;
 
10130
 
 
10131
-      ret->base_addr = xmalloc (alloc_size);
 
10132
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
10133
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
10134
     }
 
10135
 
 
10136
Index: libgfortran/generated/maxloc0_4_r16.c
 
10137
===================================================================
 
10138
--- a/src/libgfortran/generated/maxloc0_4_r16.c (.../tags/gcc_4_8_3_release)
 
10139
+++ b/src/libgfortran/generated/maxloc0_4_r16.c (.../branches/gcc-4_8-branch)
 
10140
@@ -58,7 +58,7 @@
 
10141
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10142
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10143
       retarray->offset = 0;
 
10144
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10145
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10146
     }
 
10147
   else
 
10148
     {
 
10149
@@ -199,7 +199,7 @@
 
10150
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
10151
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10152
       retarray->offset = 0;
 
10153
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10154
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10155
     }
 
10156
   else
 
10157
     {
 
10158
@@ -367,7 +367,7 @@
 
10159
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10160
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10161
       retarray->offset = 0;
 
10162
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10163
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10164
     }
 
10165
   else if (unlikely (compile_options.bounds_check))
 
10166
     {
 
10167
Index: libgfortran/generated/iall_i8.c
 
10168
===================================================================
 
10169
--- a/src/libgfortran/generated/iall_i8.c       (.../tags/gcc_4_8_3_release)
 
10170
+++ b/src/libgfortran/generated/iall_i8.c       (.../branches/gcc-4_8-branch)
 
10171
@@ -97,10 +97,9 @@
 
10172
       retarray->offset = 0;
 
10173
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10174
 
 
10175
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10176
-                  * extent[rank-1];
 
10177
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10178
 
 
10179
-      retarray->base_addr = xmalloc (alloc_size);
 
10180
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10181
       if (alloc_size == 0)
 
10182
        {
 
10183
          /* Make sure we have a zero-sized array.  */
 
10184
@@ -272,8 +271,7 @@
 
10185
 
 
10186
        }
 
10187
 
 
10188
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10189
-                  * extent[rank-1];
 
10190
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10191
 
 
10192
       retarray->offset = 0;
 
10193
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10194
@@ -285,7 +283,7 @@
 
10195
          return;
 
10196
        }
 
10197
       else
 
10198
-       retarray->base_addr = xmalloc (alloc_size);
 
10199
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10200
 
 
10201
     }
 
10202
   else
 
10203
@@ -430,8 +428,7 @@
 
10204
       retarray->offset = 0;
 
10205
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10206
 
 
10207
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10208
-                  * extent[rank-1];
 
10209
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10210
 
 
10211
       if (alloc_size == 0)
 
10212
        {
 
10213
@@ -440,7 +437,7 @@
 
10214
          return;
 
10215
        }
 
10216
       else
 
10217
-       retarray->base_addr = xmalloc (alloc_size);
 
10218
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10219
     }
 
10220
   else
 
10221
     {
 
10222
Index: libgfortran/generated/maxloc1_8_r16.c
 
10223
===================================================================
 
10224
--- a/src/libgfortran/generated/maxloc1_8_r16.c (.../tags/gcc_4_8_3_release)
 
10225
+++ b/src/libgfortran/generated/maxloc1_8_r16.c (.../branches/gcc-4_8-branch)
 
10226
@@ -98,10 +98,9 @@
 
10227
       retarray->offset = 0;
 
10228
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10229
 
 
10230
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10231
-                  * extent[rank-1];
 
10232
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10233
 
 
10234
-      retarray->base_addr = xmalloc (alloc_size);
 
10235
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10236
       if (alloc_size == 0)
 
10237
        {
 
10238
          /* Make sure we have a zero-sized array.  */
 
10239
@@ -294,8 +293,7 @@
 
10240
 
 
10241
        }
 
10242
 
 
10243
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10244
-                  * extent[rank-1];
 
10245
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10246
 
 
10247
       retarray->offset = 0;
 
10248
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10249
@@ -307,7 +305,7 @@
 
10250
          return;
 
10251
        }
 
10252
       else
 
10253
-       retarray->base_addr = xmalloc (alloc_size);
 
10254
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10255
 
 
10256
     }
 
10257
   else
 
10258
@@ -485,8 +483,7 @@
 
10259
       retarray->offset = 0;
 
10260
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10261
 
 
10262
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10263
-                  * extent[rank-1];
 
10264
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10265
 
 
10266
       if (alloc_size == 0)
 
10267
        {
 
10268
@@ -495,7 +492,7 @@
 
10269
          return;
 
10270
        }
 
10271
       else
 
10272
-       retarray->base_addr = xmalloc (alloc_size);
 
10273
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10274
     }
 
10275
   else
 
10276
     {
 
10277
Index: libgfortran/generated/sum_r16.c
 
10278
===================================================================
 
10279
--- a/src/libgfortran/generated/sum_r16.c       (.../tags/gcc_4_8_3_release)
 
10280
+++ b/src/libgfortran/generated/sum_r16.c       (.../branches/gcc-4_8-branch)
 
10281
@@ -97,10 +97,9 @@
 
10282
       retarray->offset = 0;
 
10283
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10284
 
 
10285
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10286
-                  * extent[rank-1];
 
10287
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10288
 
 
10289
-      retarray->base_addr = xmalloc (alloc_size);
 
10290
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
10291
       if (alloc_size == 0)
 
10292
        {
 
10293
          /* Make sure we have a zero-sized array.  */
 
10294
@@ -272,8 +271,7 @@
 
10295
 
 
10296
        }
 
10297
 
 
10298
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10299
-                  * extent[rank-1];
 
10300
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10301
 
 
10302
       retarray->offset = 0;
 
10303
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10304
@@ -285,7 +283,7 @@
 
10305
          return;
 
10306
        }
 
10307
       else
 
10308
-       retarray->base_addr = xmalloc (alloc_size);
 
10309
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
10310
 
 
10311
     }
 
10312
   else
 
10313
@@ -430,8 +428,7 @@
 
10314
       retarray->offset = 0;
 
10315
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10316
 
 
10317
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10318
-                  * extent[rank-1];
 
10319
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10320
 
 
10321
       if (alloc_size == 0)
 
10322
        {
 
10323
@@ -440,7 +437,7 @@
 
10324
          return;
 
10325
        }
 
10326
       else
 
10327
-       retarray->base_addr = xmalloc (alloc_size);
 
10328
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
10329
     }
 
10330
   else
 
10331
     {
 
10332
Index: libgfortran/generated/sum_i1.c
 
10333
===================================================================
 
10334
--- a/src/libgfortran/generated/sum_i1.c        (.../tags/gcc_4_8_3_release)
 
10335
+++ b/src/libgfortran/generated/sum_i1.c        (.../branches/gcc-4_8-branch)
 
10336
@@ -97,10 +97,9 @@
 
10337
       retarray->offset = 0;
 
10338
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10339
 
 
10340
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10341
-                  * extent[rank-1];
 
10342
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10343
 
 
10344
-      retarray->base_addr = xmalloc (alloc_size);
 
10345
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
10346
       if (alloc_size == 0)
 
10347
        {
 
10348
          /* Make sure we have a zero-sized array.  */
 
10349
@@ -272,8 +271,7 @@
 
10350
 
 
10351
        }
 
10352
 
 
10353
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10354
-                  * extent[rank-1];
 
10355
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10356
 
 
10357
       retarray->offset = 0;
 
10358
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10359
@@ -285,7 +283,7 @@
 
10360
          return;
 
10361
        }
 
10362
       else
 
10363
-       retarray->base_addr = xmalloc (alloc_size);
 
10364
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
10365
 
 
10366
     }
 
10367
   else
 
10368
@@ -430,8 +428,7 @@
 
10369
       retarray->offset = 0;
 
10370
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10371
 
 
10372
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10373
-                  * extent[rank-1];
 
10374
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10375
 
 
10376
       if (alloc_size == 0)
 
10377
        {
 
10378
@@ -440,7 +437,7 @@
 
10379
          return;
 
10380
        }
 
10381
       else
 
10382
-       retarray->base_addr = xmalloc (alloc_size);
 
10383
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
10384
     }
 
10385
   else
 
10386
     {
 
10387
Index: libgfortran/generated/in_pack_i2.c
 
10388
===================================================================
 
10389
--- a/src/libgfortran/generated/in_pack_i2.c    (.../tags/gcc_4_8_3_release)
 
10390
+++ b/src/libgfortran/generated/in_pack_i2.c    (.../branches/gcc-4_8-branch)
 
10391
@@ -76,7 +76,7 @@
 
10392
     return source->base_addr;
 
10393
 
 
10394
   /* Allocate storage for the destination.  */
 
10395
-  destptr = (GFC_INTEGER_2 *)xmalloc (ssize * sizeof (GFC_INTEGER_2));
 
10396
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_2));
 
10397
   dest = destptr;
 
10398
   src = source->base_addr;
 
10399
   stride0 = stride[0];
 
10400
Index: libgfortran/generated/transpose_r10.c
 
10401
===================================================================
 
10402
--- a/src/libgfortran/generated/transpose_r10.c (.../tags/gcc_4_8_3_release)
 
10403
+++ b/src/libgfortran/generated/transpose_r10.c (.../branches/gcc-4_8-branch)
 
10404
@@ -60,7 +60,8 @@
 
10405
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
10406
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
10407
 
 
10408
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
 
10409
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
10410
+                                     sizeof (GFC_REAL_10));
 
10411
       ret->offset = 0;
 
10412
     } else if (unlikely (compile_options.bounds_check))
 
10413
     {
 
10414
Index: libgfortran/generated/maxloc1_16_r16.c
 
10415
===================================================================
 
10416
--- a/src/libgfortran/generated/maxloc1_16_r16.c        (.../tags/gcc_4_8_3_release)
 
10417
+++ b/src/libgfortran/generated/maxloc1_16_r16.c        (.../branches/gcc-4_8-branch)
 
10418
@@ -98,10 +98,9 @@
 
10419
       retarray->offset = 0;
 
10420
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10421
 
 
10422
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10423
-                  * extent[rank-1];
 
10424
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10425
 
 
10426
-      retarray->base_addr = xmalloc (alloc_size);
 
10427
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
10428
       if (alloc_size == 0)
 
10429
        {
 
10430
          /* Make sure we have a zero-sized array.  */
 
10431
@@ -294,8 +293,7 @@
 
10432
 
 
10433
        }
 
10434
 
 
10435
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10436
-                  * extent[rank-1];
 
10437
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10438
 
 
10439
       retarray->offset = 0;
 
10440
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10441
@@ -307,7 +305,7 @@
 
10442
          return;
 
10443
        }
 
10444
       else
 
10445
-       retarray->base_addr = xmalloc (alloc_size);
 
10446
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
10447
 
 
10448
     }
 
10449
   else
 
10450
@@ -485,8 +483,7 @@
 
10451
       retarray->offset = 0;
 
10452
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10453
 
 
10454
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10455
-                  * extent[rank-1];
 
10456
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10457
 
 
10458
       if (alloc_size == 0)
 
10459
        {
 
10460
@@ -495,7 +492,7 @@
 
10461
          return;
 
10462
        }
 
10463
       else
 
10464
-       retarray->base_addr = xmalloc (alloc_size);
 
10465
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
10466
     }
 
10467
   else
 
10468
     {
 
10469
Index: libgfortran/generated/maxloc1_16_i4.c
 
10470
===================================================================
 
10471
--- a/src/libgfortran/generated/maxloc1_16_i4.c (.../tags/gcc_4_8_3_release)
 
10472
+++ b/src/libgfortran/generated/maxloc1_16_i4.c (.../branches/gcc-4_8-branch)
 
10473
@@ -98,10 +98,9 @@
 
10474
       retarray->offset = 0;
 
10475
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10476
 
 
10477
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10478
-                  * extent[rank-1];
 
10479
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10480
 
 
10481
-      retarray->base_addr = xmalloc (alloc_size);
 
10482
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
10483
       if (alloc_size == 0)
 
10484
        {
 
10485
          /* Make sure we have a zero-sized array.  */
 
10486
@@ -294,8 +293,7 @@
 
10487
 
 
10488
        }
 
10489
 
 
10490
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10491
-                  * extent[rank-1];
 
10492
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10493
 
 
10494
       retarray->offset = 0;
 
10495
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10496
@@ -307,7 +305,7 @@
 
10497
          return;
 
10498
        }
 
10499
       else
 
10500
-       retarray->base_addr = xmalloc (alloc_size);
 
10501
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
10502
 
 
10503
     }
 
10504
   else
 
10505
@@ -485,8 +483,7 @@
 
10506
       retarray->offset = 0;
 
10507
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10508
 
 
10509
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10510
-                  * extent[rank-1];
 
10511
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10512
 
 
10513
       if (alloc_size == 0)
 
10514
        {
 
10515
@@ -495,7 +492,7 @@
 
10516
          return;
 
10517
        }
 
10518
       else
 
10519
-       retarray->base_addr = xmalloc (alloc_size);
 
10520
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
10521
     }
 
10522
   else
 
10523
     {
 
10524
Index: libgfortran/generated/spread_i1.c
 
10525
===================================================================
 
10526
--- a/src/libgfortran/generated/spread_i1.c     (.../tags/gcc_4_8_3_release)
 
10527
+++ b/src/libgfortran/generated/spread_i1.c     (.../branches/gcc-4_8-branch)
 
10528
@@ -101,8 +101,8 @@
 
10529
        }
 
10530
       ret->offset = 0;
 
10531
 
 
10532
-      /* xmalloc allocates a single byte for zero size.  */
 
10533
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
 
10534
+      /* xmallocarray allocates a single byte for zero size.  */
 
10535
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
 
10536
       if (rs <= 0)
 
10537
         return;
 
10538
     }
 
10539
@@ -244,7 +244,7 @@
 
10540
 
 
10541
   if (ret->base_addr == NULL)
 
10542
     {
 
10543
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
 
10544
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
 
10545
       ret->offset = 0;
 
10546
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
10547
     }
 
10548
Index: libgfortran/generated/maxloc0_16_i8.c
 
10549
===================================================================
 
10550
--- a/src/libgfortran/generated/maxloc0_16_i8.c (.../tags/gcc_4_8_3_release)
 
10551
+++ b/src/libgfortran/generated/maxloc0_16_i8.c (.../branches/gcc-4_8-branch)
 
10552
@@ -58,7 +58,7 @@
 
10553
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10554
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10555
       retarray->offset = 0;
 
10556
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
10557
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
10558
     }
 
10559
   else
 
10560
     {
 
10561
@@ -199,7 +199,7 @@
 
10562
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
10563
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10564
       retarray->offset = 0;
 
10565
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
10566
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
10567
     }
 
10568
   else
 
10569
     {
 
10570
@@ -367,7 +367,7 @@
 
10571
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10572
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10573
       retarray->offset = 0;
 
10574
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
10575
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
10576
     }
 
10577
   else if (unlikely (compile_options.bounds_check))
 
10578
     {
 
10579
Index: libgfortran/generated/maxval_r16.c
 
10580
===================================================================
 
10581
--- a/src/libgfortran/generated/maxval_r16.c    (.../tags/gcc_4_8_3_release)
 
10582
+++ b/src/libgfortran/generated/maxval_r16.c    (.../branches/gcc-4_8-branch)
 
10583
@@ -97,10 +97,9 @@
 
10584
       retarray->offset = 0;
 
10585
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10586
 
 
10587
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10588
-                  * extent[rank-1];
 
10589
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10590
 
 
10591
-      retarray->base_addr = xmalloc (alloc_size);
 
10592
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
10593
       if (alloc_size == 0)
 
10594
        {
 
10595
          /* Make sure we have a zero-sized array.  */
 
10596
@@ -286,8 +285,7 @@
 
10597
 
 
10598
        }
 
10599
 
 
10600
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10601
-                  * extent[rank-1];
 
10602
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10603
 
 
10604
       retarray->offset = 0;
 
10605
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10606
@@ -299,7 +297,7 @@
 
10607
          return;
 
10608
        }
 
10609
       else
 
10610
-       retarray->base_addr = xmalloc (alloc_size);
 
10611
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
10612
 
 
10613
     }
 
10614
   else
 
10615
@@ -472,8 +470,7 @@
 
10616
       retarray->offset = 0;
 
10617
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10618
 
 
10619
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10620
-                  * extent[rank-1];
 
10621
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10622
 
 
10623
       if (alloc_size == 0)
 
10624
        {
 
10625
@@ -482,7 +479,7 @@
 
10626
          return;
 
10627
        }
 
10628
       else
 
10629
-       retarray->base_addr = xmalloc (alloc_size);
 
10630
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
10631
     }
 
10632
   else
 
10633
     {
 
10634
Index: libgfortran/generated/product_c10.c
 
10635
===================================================================
 
10636
--- a/src/libgfortran/generated/product_c10.c   (.../tags/gcc_4_8_3_release)
 
10637
+++ b/src/libgfortran/generated/product_c10.c   (.../branches/gcc-4_8-branch)
 
10638
@@ -97,10 +97,9 @@
 
10639
       retarray->offset = 0;
 
10640
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10641
 
 
10642
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10643
-                  * extent[rank-1];
 
10644
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10645
 
 
10646
-      retarray->base_addr = xmalloc (alloc_size);
 
10647
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
10648
       if (alloc_size == 0)
 
10649
        {
 
10650
          /* Make sure we have a zero-sized array.  */
 
10651
@@ -272,8 +271,7 @@
 
10652
 
 
10653
        }
 
10654
 
 
10655
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10656
-                  * extent[rank-1];
 
10657
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10658
 
 
10659
       retarray->offset = 0;
 
10660
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10661
@@ -285,7 +283,7 @@
 
10662
          return;
 
10663
        }
 
10664
       else
 
10665
-       retarray->base_addr = xmalloc (alloc_size);
 
10666
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
10667
 
 
10668
     }
 
10669
   else
 
10670
@@ -430,8 +428,7 @@
 
10671
       retarray->offset = 0;
 
10672
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10673
 
 
10674
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10675
-                  * extent[rank-1];
 
10676
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10677
 
 
10678
       if (alloc_size == 0)
 
10679
        {
 
10680
@@ -440,7 +437,7 @@
 
10681
          return;
 
10682
        }
 
10683
       else
 
10684
-       retarray->base_addr = xmalloc (alloc_size);
 
10685
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
10686
     }
 
10687
   else
 
10688
     {
 
10689
Index: libgfortran/generated/minloc1_8_i4.c
 
10690
===================================================================
 
10691
--- a/src/libgfortran/generated/minloc1_8_i4.c  (.../tags/gcc_4_8_3_release)
 
10692
+++ b/src/libgfortran/generated/minloc1_8_i4.c  (.../branches/gcc-4_8-branch)
 
10693
@@ -98,10 +98,9 @@
 
10694
       retarray->offset = 0;
 
10695
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10696
 
 
10697
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10698
-                  * extent[rank-1];
 
10699
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10700
 
 
10701
-      retarray->base_addr = xmalloc (alloc_size);
 
10702
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10703
       if (alloc_size == 0)
 
10704
        {
 
10705
          /* Make sure we have a zero-sized array.  */
 
10706
@@ -294,8 +293,7 @@
 
10707
 
 
10708
        }
 
10709
 
 
10710
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10711
-                  * extent[rank-1];
 
10712
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10713
 
 
10714
       retarray->offset = 0;
 
10715
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10716
@@ -307,7 +305,7 @@
 
10717
          return;
 
10718
        }
 
10719
       else
 
10720
-       retarray->base_addr = xmalloc (alloc_size);
 
10721
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10722
 
 
10723
     }
 
10724
   else
 
10725
@@ -485,8 +483,7 @@
 
10726
       retarray->offset = 0;
 
10727
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10728
 
 
10729
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10730
-                  * extent[rank-1];
 
10731
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10732
 
 
10733
       if (alloc_size == 0)
 
10734
        {
 
10735
@@ -495,7 +492,7 @@
 
10736
          return;
 
10737
        }
 
10738
       else
 
10739
-       retarray->base_addr = xmalloc (alloc_size);
 
10740
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
10741
     }
 
10742
   else
 
10743
     {
 
10744
Index: libgfortran/generated/minloc0_16_i16.c
 
10745
===================================================================
 
10746
--- a/src/libgfortran/generated/minloc0_16_i16.c        (.../tags/gcc_4_8_3_release)
 
10747
+++ b/src/libgfortran/generated/minloc0_16_i16.c        (.../branches/gcc-4_8-branch)
 
10748
@@ -58,7 +58,7 @@
 
10749
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10750
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10751
       retarray->offset = 0;
 
10752
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
10753
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
10754
     }
 
10755
   else
 
10756
     {
 
10757
@@ -199,7 +199,7 @@
 
10758
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
10759
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10760
       retarray->offset = 0;
 
10761
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
10762
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
10763
     }
 
10764
   else
 
10765
     {
 
10766
@@ -367,7 +367,7 @@
 
10767
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10768
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10769
       retarray->offset = 0;
 
10770
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
10771
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
10772
     }
 
10773
   else if (unlikely (compile_options.bounds_check))
 
10774
     {
 
10775
Index: libgfortran/generated/matmul_r16.c
 
10776
===================================================================
 
10777
--- a/src/libgfortran/generated/matmul_r16.c    (.../tags/gcc_4_8_3_release)
 
10778
+++ b/src/libgfortran/generated/matmul_r16.c    (.../branches/gcc-4_8-branch)
 
10779
@@ -124,7 +124,7 @@
 
10780
         }
 
10781
 
 
10782
       retarray->base_addr
 
10783
-       = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
 
10784
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_16));
 
10785
       retarray->offset = 0;
 
10786
     }
 
10787
     else if (unlikely (compile_options.bounds_check))
 
10788
Index: libgfortran/generated/minloc0_4_r4.c
 
10789
===================================================================
 
10790
--- a/src/libgfortran/generated/minloc0_4_r4.c  (.../tags/gcc_4_8_3_release)
 
10791
+++ b/src/libgfortran/generated/minloc0_4_r4.c  (.../branches/gcc-4_8-branch)
 
10792
@@ -58,7 +58,7 @@
 
10793
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10794
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10795
       retarray->offset = 0;
 
10796
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10797
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10798
     }
 
10799
   else
 
10800
     {
 
10801
@@ -199,7 +199,7 @@
 
10802
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
10803
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10804
       retarray->offset = 0;
 
10805
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10806
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10807
     }
 
10808
   else
 
10809
     {
 
10810
@@ -367,7 +367,7 @@
 
10811
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10812
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10813
       retarray->offset = 0;
 
10814
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10815
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10816
     }
 
10817
   else if (unlikely (compile_options.bounds_check))
 
10818
     {
 
10819
Index: libgfortran/generated/iany_i2.c
 
10820
===================================================================
 
10821
--- a/src/libgfortran/generated/iany_i2.c       (.../tags/gcc_4_8_3_release)
 
10822
+++ b/src/libgfortran/generated/iany_i2.c       (.../branches/gcc-4_8-branch)
 
10823
@@ -97,10 +97,9 @@
 
10824
       retarray->offset = 0;
 
10825
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10826
 
 
10827
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10828
-                  * extent[rank-1];
 
10829
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10830
 
 
10831
-      retarray->base_addr = xmalloc (alloc_size);
 
10832
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
10833
       if (alloc_size == 0)
 
10834
        {
 
10835
          /* Make sure we have a zero-sized array.  */
 
10836
@@ -272,8 +271,7 @@
 
10837
 
 
10838
        }
 
10839
 
 
10840
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10841
-                  * extent[rank-1];
 
10842
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10843
 
 
10844
       retarray->offset = 0;
 
10845
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10846
@@ -285,7 +283,7 @@
 
10847
          return;
 
10848
        }
 
10849
       else
 
10850
-       retarray->base_addr = xmalloc (alloc_size);
 
10851
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
10852
 
 
10853
     }
 
10854
   else
 
10855
@@ -430,8 +428,7 @@
 
10856
       retarray->offset = 0;
 
10857
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10858
 
 
10859
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10860
-                  * extent[rank-1];
 
10861
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10862
 
 
10863
       if (alloc_size == 0)
 
10864
        {
 
10865
@@ -440,7 +437,7 @@
 
10866
          return;
 
10867
        }
 
10868
       else
 
10869
-       retarray->base_addr = xmalloc (alloc_size);
 
10870
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
10871
     }
 
10872
   else
 
10873
     {
 
10874
Index: libgfortran/generated/sum_r4.c
 
10875
===================================================================
 
10876
--- a/src/libgfortran/generated/sum_r4.c        (.../tags/gcc_4_8_3_release)
 
10877
+++ b/src/libgfortran/generated/sum_r4.c        (.../branches/gcc-4_8-branch)
 
10878
@@ -97,10 +97,9 @@
 
10879
       retarray->offset = 0;
 
10880
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10881
 
 
10882
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10883
-                  * extent[rank-1];
 
10884
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10885
 
 
10886
-      retarray->base_addr = xmalloc (alloc_size);
 
10887
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
10888
       if (alloc_size == 0)
 
10889
        {
 
10890
          /* Make sure we have a zero-sized array.  */
 
10891
@@ -272,8 +271,7 @@
 
10892
 
 
10893
        }
 
10894
 
 
10895
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10896
-                  * extent[rank-1];
 
10897
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10898
 
 
10899
       retarray->offset = 0;
 
10900
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10901
@@ -285,7 +283,7 @@
 
10902
          return;
 
10903
        }
 
10904
       else
 
10905
-       retarray->base_addr = xmalloc (alloc_size);
 
10906
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
10907
 
 
10908
     }
 
10909
   else
 
10910
@@ -430,8 +428,7 @@
 
10911
       retarray->offset = 0;
 
10912
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
10913
 
 
10914
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
10915
-                  * extent[rank-1];
 
10916
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
10917
 
 
10918
       if (alloc_size == 0)
 
10919
        {
 
10920
@@ -440,7 +437,7 @@
 
10921
          return;
 
10922
        }
 
10923
       else
 
10924
-       retarray->base_addr = xmalloc (alloc_size);
 
10925
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
10926
     }
 
10927
   else
 
10928
     {
 
10929
Index: libgfortran/generated/unpack_c8.c
 
10930
===================================================================
 
10931
--- a/src/libgfortran/generated/unpack_c8.c     (.../tags/gcc_4_8_3_release)
 
10932
+++ b/src/libgfortran/generated/unpack_c8.c     (.../branches/gcc-4_8-branch)
 
10933
@@ -99,7 +99,7 @@
 
10934
          rs *= extent[n];
 
10935
        }
 
10936
       ret->offset = 0;
 
10937
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
 
10938
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
 
10939
     }
 
10940
   else
 
10941
     {
 
10942
@@ -244,7 +244,7 @@
 
10943
          rs *= extent[n];
 
10944
        }
 
10945
       ret->offset = 0;
 
10946
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
 
10947
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
 
10948
     }
 
10949
   else
 
10950
     {
 
10951
Index: libgfortran/generated/in_pack_c16.c
 
10952
===================================================================
 
10953
--- a/src/libgfortran/generated/in_pack_c16.c   (.../tags/gcc_4_8_3_release)
 
10954
+++ b/src/libgfortran/generated/in_pack_c16.c   (.../branches/gcc-4_8-branch)
 
10955
@@ -76,7 +76,7 @@
 
10956
     return source->base_addr;
 
10957
 
 
10958
   /* Allocate storage for the destination.  */
 
10959
-  destptr = (GFC_COMPLEX_16 *)xmalloc (ssize * sizeof (GFC_COMPLEX_16));
 
10960
+  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_16));
 
10961
   dest = destptr;
 
10962
   src = source->base_addr;
 
10963
   stride0 = stride[0];
 
10964
Index: libgfortran/generated/minloc0_4_i2.c
 
10965
===================================================================
 
10966
--- a/src/libgfortran/generated/minloc0_4_i2.c  (.../tags/gcc_4_8_3_release)
 
10967
+++ b/src/libgfortran/generated/minloc0_4_i2.c  (.../branches/gcc-4_8-branch)
 
10968
@@ -58,7 +58,7 @@
 
10969
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10970
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10971
       retarray->offset = 0;
 
10972
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10973
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10974
     }
 
10975
   else
 
10976
     {
 
10977
@@ -199,7 +199,7 @@
 
10978
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
10979
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10980
       retarray->offset = 0;
 
10981
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10982
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10983
     }
 
10984
   else
 
10985
     {
 
10986
@@ -367,7 +367,7 @@
 
10987
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
10988
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
10989
       retarray->offset = 0;
 
10990
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
10991
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
10992
     }
 
10993
   else if (unlikely (compile_options.bounds_check))
 
10994
     {
 
10995
Index: libgfortran/generated/spread_c10.c
 
10996
===================================================================
 
10997
--- a/src/libgfortran/generated/spread_c10.c    (.../tags/gcc_4_8_3_release)
 
10998
+++ b/src/libgfortran/generated/spread_c10.c    (.../branches/gcc-4_8-branch)
 
10999
@@ -101,8 +101,8 @@
 
11000
        }
 
11001
       ret->offset = 0;
 
11002
 
 
11003
-      /* xmalloc allocates a single byte for zero size.  */
 
11004
-      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_10));
 
11005
+      /* xmallocarray allocates a single byte for zero size.  */
 
11006
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_10));
 
11007
       if (rs <= 0)
 
11008
         return;
 
11009
     }
 
11010
@@ -244,7 +244,7 @@
 
11011
 
 
11012
   if (ret->base_addr == NULL)
 
11013
     {
 
11014
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_10));
 
11015
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_10));
 
11016
       ret->offset = 0;
 
11017
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
11018
     }
 
11019
Index: libgfortran/generated/maxloc0_8_i1.c
 
11020
===================================================================
 
11021
--- a/src/libgfortran/generated/maxloc0_8_i1.c  (.../tags/gcc_4_8_3_release)
 
11022
+++ b/src/libgfortran/generated/maxloc0_8_i1.c  (.../branches/gcc-4_8-branch)
 
11023
@@ -58,7 +58,7 @@
 
11024
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11025
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11026
       retarray->offset = 0;
 
11027
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11028
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11029
     }
 
11030
   else
 
11031
     {
 
11032
@@ -199,7 +199,7 @@
 
11033
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11034
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11035
       retarray->offset = 0;
 
11036
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11037
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11038
     }
 
11039
   else
 
11040
     {
 
11041
@@ -367,7 +367,7 @@
 
11042
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11043
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11044
       retarray->offset = 0;
 
11045
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11046
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11047
     }
 
11048
   else if (unlikely (compile_options.bounds_check))
 
11049
     {
 
11050
Index: libgfortran/generated/spread_r4.c
 
11051
===================================================================
 
11052
--- a/src/libgfortran/generated/spread_r4.c     (.../tags/gcc_4_8_3_release)
 
11053
+++ b/src/libgfortran/generated/spread_r4.c     (.../branches/gcc-4_8-branch)
 
11054
@@ -101,8 +101,8 @@
 
11055
        }
 
11056
       ret->offset = 0;
 
11057
 
 
11058
-      /* xmalloc allocates a single byte for zero size.  */
 
11059
-      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4));
 
11060
+      /* xmallocarray allocates a single byte for zero size.  */
 
11061
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4));
 
11062
       if (rs <= 0)
 
11063
         return;
 
11064
     }
 
11065
@@ -244,7 +244,7 @@
 
11066
 
 
11067
   if (ret->base_addr == NULL)
 
11068
     {
 
11069
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4));
 
11070
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4));
 
11071
       ret->offset = 0;
 
11072
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
11073
     }
 
11074
Index: libgfortran/generated/minloc0_8_i8.c
 
11075
===================================================================
 
11076
--- a/src/libgfortran/generated/minloc0_8_i8.c  (.../tags/gcc_4_8_3_release)
 
11077
+++ b/src/libgfortran/generated/minloc0_8_i8.c  (.../branches/gcc-4_8-branch)
 
11078
@@ -58,7 +58,7 @@
 
11079
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11080
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11081
       retarray->offset = 0;
 
11082
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11083
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11084
     }
 
11085
   else
 
11086
     {
 
11087
@@ -199,7 +199,7 @@
 
11088
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11089
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11090
       retarray->offset = 0;
 
11091
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11092
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11093
     }
 
11094
   else
 
11095
     {
 
11096
@@ -367,7 +367,7 @@
 
11097
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11098
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11099
       retarray->offset = 0;
 
11100
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11101
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11102
     }
 
11103
   else if (unlikely (compile_options.bounds_check))
 
11104
     {
 
11105
Index: libgfortran/generated/matmul_c8.c
 
11106
===================================================================
 
11107
--- a/src/libgfortran/generated/matmul_c8.c     (.../tags/gcc_4_8_3_release)
 
11108
+++ b/src/libgfortran/generated/matmul_c8.c     (.../branches/gcc-4_8-branch)
 
11109
@@ -124,7 +124,7 @@
 
11110
         }
 
11111
 
 
11112
       retarray->base_addr
 
11113
-       = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
 
11114
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_8));
 
11115
       retarray->offset = 0;
 
11116
     }
 
11117
     else if (unlikely (compile_options.bounds_check))
 
11118
Index: libgfortran/generated/minloc1_16_r10.c
 
11119
===================================================================
 
11120
--- a/src/libgfortran/generated/minloc1_16_r10.c        (.../tags/gcc_4_8_3_release)
 
11121
+++ b/src/libgfortran/generated/minloc1_16_r10.c        (.../branches/gcc-4_8-branch)
 
11122
@@ -98,10 +98,9 @@
 
11123
       retarray->offset = 0;
 
11124
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11125
 
 
11126
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11127
-                  * extent[rank-1];
 
11128
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11129
 
 
11130
-      retarray->base_addr = xmalloc (alloc_size);
 
11131
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11132
       if (alloc_size == 0)
 
11133
        {
 
11134
          /* Make sure we have a zero-sized array.  */
 
11135
@@ -294,8 +293,7 @@
 
11136
 
 
11137
        }
 
11138
 
 
11139
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11140
-                  * extent[rank-1];
 
11141
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11142
 
 
11143
       retarray->offset = 0;
 
11144
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11145
@@ -307,7 +305,7 @@
 
11146
          return;
 
11147
        }
 
11148
       else
 
11149
-       retarray->base_addr = xmalloc (alloc_size);
 
11150
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11151
 
 
11152
     }
 
11153
   else
 
11154
@@ -485,8 +483,7 @@
 
11155
       retarray->offset = 0;
 
11156
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11157
 
 
11158
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11159
-                  * extent[rank-1];
 
11160
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11161
 
 
11162
       if (alloc_size == 0)
 
11163
        {
 
11164
@@ -495,7 +492,7 @@
 
11165
          return;
 
11166
        }
 
11167
       else
 
11168
-       retarray->base_addr = xmalloc (alloc_size);
 
11169
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11170
     }
 
11171
   else
 
11172
     {
 
11173
Index: libgfortran/generated/sum_i2.c
 
11174
===================================================================
 
11175
--- a/src/libgfortran/generated/sum_i2.c        (.../tags/gcc_4_8_3_release)
 
11176
+++ b/src/libgfortran/generated/sum_i2.c        (.../branches/gcc-4_8-branch)
 
11177
@@ -97,10 +97,9 @@
 
11178
       retarray->offset = 0;
 
11179
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11180
 
 
11181
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11182
-                  * extent[rank-1];
 
11183
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11184
 
 
11185
-      retarray->base_addr = xmalloc (alloc_size);
 
11186
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
11187
       if (alloc_size == 0)
 
11188
        {
 
11189
          /* Make sure we have a zero-sized array.  */
 
11190
@@ -272,8 +271,7 @@
 
11191
 
 
11192
        }
 
11193
 
 
11194
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11195
-                  * extent[rank-1];
 
11196
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11197
 
 
11198
       retarray->offset = 0;
 
11199
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11200
@@ -285,7 +283,7 @@
 
11201
          return;
 
11202
        }
 
11203
       else
 
11204
-       retarray->base_addr = xmalloc (alloc_size);
 
11205
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
11206
 
 
11207
     }
 
11208
   else
 
11209
@@ -430,8 +428,7 @@
 
11210
       retarray->offset = 0;
 
11211
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11212
 
 
11213
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11214
-                  * extent[rank-1];
 
11215
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11216
 
 
11217
       if (alloc_size == 0)
 
11218
        {
 
11219
@@ -440,7 +437,7 @@
 
11220
          return;
 
11221
        }
 
11222
       else
 
11223
-       retarray->base_addr = xmalloc (alloc_size);
 
11224
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
11225
     }
 
11226
   else
 
11227
     {
 
11228
Index: libgfortran/generated/iparity_i16.c
 
11229
===================================================================
 
11230
--- a/src/libgfortran/generated/iparity_i16.c   (.../tags/gcc_4_8_3_release)
 
11231
+++ b/src/libgfortran/generated/iparity_i16.c   (.../branches/gcc-4_8-branch)
 
11232
@@ -97,10 +97,9 @@
 
11233
       retarray->offset = 0;
 
11234
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11235
 
 
11236
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11237
-                  * extent[rank-1];
 
11238
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11239
 
 
11240
-      retarray->base_addr = xmalloc (alloc_size);
 
11241
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11242
       if (alloc_size == 0)
 
11243
        {
 
11244
          /* Make sure we have a zero-sized array.  */
 
11245
@@ -272,8 +271,7 @@
 
11246
 
 
11247
        }
 
11248
 
 
11249
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11250
-                  * extent[rank-1];
 
11251
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11252
 
 
11253
       retarray->offset = 0;
 
11254
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11255
@@ -285,7 +283,7 @@
 
11256
          return;
 
11257
        }
 
11258
       else
 
11259
-       retarray->base_addr = xmalloc (alloc_size);
 
11260
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11261
 
 
11262
     }
 
11263
   else
 
11264
@@ -430,8 +428,7 @@
 
11265
       retarray->offset = 0;
 
11266
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11267
 
 
11268
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11269
-                  * extent[rank-1];
 
11270
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11271
 
 
11272
       if (alloc_size == 0)
 
11273
        {
 
11274
@@ -440,7 +437,7 @@
 
11275
          return;
 
11276
        }
 
11277
       else
 
11278
-       retarray->base_addr = xmalloc (alloc_size);
 
11279
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11280
     }
 
11281
   else
 
11282
     {
 
11283
Index: libgfortran/generated/minloc0_16_i1.c
 
11284
===================================================================
 
11285
--- a/src/libgfortran/generated/minloc0_16_i1.c (.../tags/gcc_4_8_3_release)
 
11286
+++ b/src/libgfortran/generated/minloc0_16_i1.c (.../branches/gcc-4_8-branch)
 
11287
@@ -58,7 +58,7 @@
 
11288
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11289
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11290
       retarray->offset = 0;
 
11291
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11292
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11293
     }
 
11294
   else
 
11295
     {
 
11296
@@ -199,7 +199,7 @@
 
11297
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11298
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11299
       retarray->offset = 0;
 
11300
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11301
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11302
     }
 
11303
   else
 
11304
     {
 
11305
@@ -367,7 +367,7 @@
 
11306
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11307
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11308
       retarray->offset = 0;
 
11309
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11310
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11311
     }
 
11312
   else if (unlikely (compile_options.bounds_check))
 
11313
     {
 
11314
Index: libgfortran/generated/reshape_c16.c
 
11315
===================================================================
 
11316
--- a/src/libgfortran/generated/reshape_c16.c   (.../tags/gcc_4_8_3_release)
 
11317
+++ b/src/libgfortran/generated/reshape_c16.c   (.../branches/gcc-4_8-branch)
 
11318
@@ -111,11 +111,11 @@
 
11319
       ret->offset = 0;
 
11320
 
 
11321
       if (unlikely (rs < 1))
 
11322
-        alloc_size = 1;
 
11323
+        alloc_size = 0;
 
11324
       else
 
11325
-        alloc_size = rs * sizeof (GFC_COMPLEX_16);
 
11326
+        alloc_size = rs;
 
11327
 
 
11328
-      ret->base_addr = xmalloc (alloc_size);
 
11329
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
11330
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
11331
     }
 
11332
 
 
11333
Index: libgfortran/generated/pack_c4.c
 
11334
===================================================================
 
11335
--- a/src/libgfortran/generated/pack_c4.c       (.../tags/gcc_4_8_3_release)
 
11336
+++ b/src/libgfortran/generated/pack_c4.c       (.../branches/gcc-4_8-branch)
 
11337
@@ -167,8 +167,8 @@
 
11338
 
 
11339
          ret->offset = 0;
 
11340
 
 
11341
-         /* xmalloc allocates a single byte for zero size.  */
 
11342
-         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * total);
 
11343
+         /* xmallocarray allocates a single byte for zero size.  */
 
11344
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_4));
 
11345
 
 
11346
          if (total == 0)
 
11347
            return;
 
11348
Index: libgfortran/generated/parity_l4.c
 
11349
===================================================================
 
11350
--- a/src/libgfortran/generated/parity_l4.c     (.../tags/gcc_4_8_3_release)
 
11351
+++ b/src/libgfortran/generated/parity_l4.c     (.../branches/gcc-4_8-branch)
 
11352
@@ -98,10 +98,9 @@
 
11353
       retarray->offset = 0;
 
11354
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11355
 
 
11356
-      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11357
-                  * extent[rank-1];
 
11358
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11359
 
 
11360
-      retarray->base_addr = xmalloc (alloc_size);
 
11361
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
 
11362
       if (alloc_size == 0)
 
11363
        {
 
11364
          /* Make sure we have a zero-sized array.  */
 
11365
Index: libgfortran/generated/spread_i2.c
 
11366
===================================================================
 
11367
--- a/src/libgfortran/generated/spread_i2.c     (.../tags/gcc_4_8_3_release)
 
11368
+++ b/src/libgfortran/generated/spread_i2.c     (.../branches/gcc-4_8-branch)
 
11369
@@ -101,8 +101,8 @@
 
11370
        }
 
11371
       ret->offset = 0;
 
11372
 
 
11373
-      /* xmalloc allocates a single byte for zero size.  */
 
11374
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_2));
 
11375
+      /* xmallocarray allocates a single byte for zero size.  */
 
11376
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_2));
 
11377
       if (rs <= 0)
 
11378
         return;
 
11379
     }
 
11380
@@ -244,7 +244,7 @@
 
11381
 
 
11382
   if (ret->base_addr == NULL)
 
11383
     {
 
11384
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_2));
 
11385
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_2));
 
11386
       ret->offset = 0;
 
11387
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
11388
     }
 
11389
Index: libgfortran/generated/any_l4.c
 
11390
===================================================================
 
11391
--- a/src/libgfortran/generated/any_l4.c        (.../tags/gcc_4_8_3_release)
 
11392
+++ b/src/libgfortran/generated/any_l4.c        (.../branches/gcc-4_8-branch)
 
11393
@@ -101,8 +101,7 @@
 
11394
       retarray->offset = 0;
 
11395
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11396
 
 
11397
-      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11398
-                  * extent[rank-1];
 
11399
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11400
 
 
11401
       if (alloc_size == 0)
 
11402
        {
 
11403
@@ -111,7 +110,7 @@
 
11404
          return;
 
11405
        }
 
11406
       else
 
11407
-       retarray->base_addr = xmalloc (alloc_size);
 
11408
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
 
11409
     }
 
11410
   else
 
11411
     {
 
11412
Index: libgfortran/generated/maxloc1_4_i8.c
 
11413
===================================================================
 
11414
--- a/src/libgfortran/generated/maxloc1_4_i8.c  (.../tags/gcc_4_8_3_release)
 
11415
+++ b/src/libgfortran/generated/maxloc1_4_i8.c  (.../branches/gcc-4_8-branch)
 
11416
@@ -98,10 +98,9 @@
 
11417
       retarray->offset = 0;
 
11418
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11419
 
 
11420
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11421
-                  * extent[rank-1];
 
11422
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11423
 
 
11424
-      retarray->base_addr = xmalloc (alloc_size);
 
11425
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11426
       if (alloc_size == 0)
 
11427
        {
 
11428
          /* Make sure we have a zero-sized array.  */
 
11429
@@ -294,8 +293,7 @@
 
11430
 
 
11431
        }
 
11432
 
 
11433
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11434
-                  * extent[rank-1];
 
11435
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11436
 
 
11437
       retarray->offset = 0;
 
11438
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11439
@@ -307,7 +305,7 @@
 
11440
          return;
 
11441
        }
 
11442
       else
 
11443
-       retarray->base_addr = xmalloc (alloc_size);
 
11444
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11445
 
 
11446
     }
 
11447
   else
 
11448
@@ -485,8 +483,7 @@
 
11449
       retarray->offset = 0;
 
11450
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11451
 
 
11452
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11453
-                  * extent[rank-1];
 
11454
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11455
 
 
11456
       if (alloc_size == 0)
 
11457
        {
 
11458
@@ -495,7 +492,7 @@
 
11459
          return;
 
11460
        }
 
11461
       else
 
11462
-       retarray->base_addr = xmalloc (alloc_size);
 
11463
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11464
     }
 
11465
   else
 
11466
     {
 
11467
Index: libgfortran/generated/maxloc0_8_r4.c
 
11468
===================================================================
 
11469
--- a/src/libgfortran/generated/maxloc0_8_r4.c  (.../tags/gcc_4_8_3_release)
 
11470
+++ b/src/libgfortran/generated/maxloc0_8_r4.c  (.../branches/gcc-4_8-branch)
 
11471
@@ -58,7 +58,7 @@
 
11472
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11473
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11474
       retarray->offset = 0;
 
11475
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11476
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11477
     }
 
11478
   else
 
11479
     {
 
11480
@@ -199,7 +199,7 @@
 
11481
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11482
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11483
       retarray->offset = 0;
 
11484
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11485
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11486
     }
 
11487
   else
 
11488
     {
 
11489
@@ -367,7 +367,7 @@
 
11490
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11491
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11492
       retarray->offset = 0;
 
11493
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11494
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11495
     }
 
11496
   else if (unlikely (compile_options.bounds_check))
 
11497
     {
 
11498
Index: libgfortran/generated/maxloc1_4_i16.c
 
11499
===================================================================
 
11500
--- a/src/libgfortran/generated/maxloc1_4_i16.c (.../tags/gcc_4_8_3_release)
 
11501
+++ b/src/libgfortran/generated/maxloc1_4_i16.c (.../branches/gcc-4_8-branch)
 
11502
@@ -98,10 +98,9 @@
 
11503
       retarray->offset = 0;
 
11504
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11505
 
 
11506
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11507
-                  * extent[rank-1];
 
11508
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11509
 
 
11510
-      retarray->base_addr = xmalloc (alloc_size);
 
11511
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11512
       if (alloc_size == 0)
 
11513
        {
 
11514
          /* Make sure we have a zero-sized array.  */
 
11515
@@ -294,8 +293,7 @@
 
11516
 
 
11517
        }
 
11518
 
 
11519
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11520
-                  * extent[rank-1];
 
11521
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11522
 
 
11523
       retarray->offset = 0;
 
11524
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11525
@@ -307,7 +305,7 @@
 
11526
          return;
 
11527
        }
 
11528
       else
 
11529
-       retarray->base_addr = xmalloc (alloc_size);
 
11530
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11531
 
 
11532
     }
 
11533
   else
 
11534
@@ -485,8 +483,7 @@
 
11535
       retarray->offset = 0;
 
11536
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11537
 
 
11538
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11539
-                  * extent[rank-1];
 
11540
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11541
 
 
11542
       if (alloc_size == 0)
 
11543
        {
 
11544
@@ -495,7 +492,7 @@
 
11545
          return;
 
11546
        }
 
11547
       else
 
11548
-       retarray->base_addr = xmalloc (alloc_size);
 
11549
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11550
     }
 
11551
   else
 
11552
     {
 
11553
Index: libgfortran/generated/minloc0_4_r10.c
 
11554
===================================================================
 
11555
--- a/src/libgfortran/generated/minloc0_4_r10.c (.../tags/gcc_4_8_3_release)
 
11556
+++ b/src/libgfortran/generated/minloc0_4_r10.c (.../branches/gcc-4_8-branch)
 
11557
@@ -58,7 +58,7 @@
 
11558
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11559
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11560
       retarray->offset = 0;
 
11561
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11562
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11563
     }
 
11564
   else
 
11565
     {
 
11566
@@ -199,7 +199,7 @@
 
11567
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11568
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11569
       retarray->offset = 0;
 
11570
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11571
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11572
     }
 
11573
   else
 
11574
     {
 
11575
@@ -367,7 +367,7 @@
 
11576
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11577
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11578
       retarray->offset = 0;
 
11579
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
11580
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
11581
     }
 
11582
   else if (unlikely (compile_options.bounds_check))
 
11583
     {
 
11584
Index: libgfortran/generated/minloc0_8_i16.c
 
11585
===================================================================
 
11586
--- a/src/libgfortran/generated/minloc0_8_i16.c (.../tags/gcc_4_8_3_release)
 
11587
+++ b/src/libgfortran/generated/minloc0_8_i16.c (.../branches/gcc-4_8-branch)
 
11588
@@ -58,7 +58,7 @@
 
11589
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11590
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11591
       retarray->offset = 0;
 
11592
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11593
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11594
     }
 
11595
   else
 
11596
     {
 
11597
@@ -199,7 +199,7 @@
 
11598
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11599
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11600
       retarray->offset = 0;
 
11601
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11602
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11603
     }
 
11604
   else
 
11605
     {
 
11606
@@ -367,7 +367,7 @@
 
11607
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11608
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11609
       retarray->offset = 0;
 
11610
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11611
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11612
     }
 
11613
   else if (unlikely (compile_options.bounds_check))
 
11614
     {
 
11615
Index: libgfortran/generated/minloc1_8_r10.c
 
11616
===================================================================
 
11617
--- a/src/libgfortran/generated/minloc1_8_r10.c (.../tags/gcc_4_8_3_release)
 
11618
+++ b/src/libgfortran/generated/minloc1_8_r10.c (.../branches/gcc-4_8-branch)
 
11619
@@ -98,10 +98,9 @@
 
11620
       retarray->offset = 0;
 
11621
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11622
 
 
11623
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11624
-                  * extent[rank-1];
 
11625
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11626
 
 
11627
-      retarray->base_addr = xmalloc (alloc_size);
 
11628
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11629
       if (alloc_size == 0)
 
11630
        {
 
11631
          /* Make sure we have a zero-sized array.  */
 
11632
@@ -294,8 +293,7 @@
 
11633
 
 
11634
        }
 
11635
 
 
11636
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11637
-                  * extent[rank-1];
 
11638
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11639
 
 
11640
       retarray->offset = 0;
 
11641
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11642
@@ -307,7 +305,7 @@
 
11643
          return;
 
11644
        }
 
11645
       else
 
11646
-       retarray->base_addr = xmalloc (alloc_size);
 
11647
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11648
 
 
11649
     }
 
11650
   else
 
11651
@@ -485,8 +483,7 @@
 
11652
       retarray->offset = 0;
 
11653
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11654
 
 
11655
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11656
-                  * extent[rank-1];
 
11657
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11658
 
 
11659
       if (alloc_size == 0)
 
11660
        {
 
11661
@@ -495,7 +492,7 @@
 
11662
          return;
 
11663
        }
 
11664
       else
 
11665
-       retarray->base_addr = xmalloc (alloc_size);
 
11666
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11667
     }
 
11668
   else
 
11669
     {
 
11670
Index: libgfortran/generated/minloc0_16_r4.c
 
11671
===================================================================
 
11672
--- a/src/libgfortran/generated/minloc0_16_r4.c (.../tags/gcc_4_8_3_release)
 
11673
+++ b/src/libgfortran/generated/minloc0_16_r4.c (.../branches/gcc-4_8-branch)
 
11674
@@ -58,7 +58,7 @@
 
11675
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11676
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11677
       retarray->offset = 0;
 
11678
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11679
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11680
     }
 
11681
   else
 
11682
     {
 
11683
@@ -199,7 +199,7 @@
 
11684
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11685
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11686
       retarray->offset = 0;
 
11687
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11688
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11689
     }
 
11690
   else
 
11691
     {
 
11692
@@ -367,7 +367,7 @@
 
11693
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11694
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11695
       retarray->offset = 0;
 
11696
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11697
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11698
     }
 
11699
   else if (unlikely (compile_options.bounds_check))
 
11700
     {
 
11701
Index: libgfortran/generated/product_i4.c
 
11702
===================================================================
 
11703
--- a/src/libgfortran/generated/product_i4.c    (.../tags/gcc_4_8_3_release)
 
11704
+++ b/src/libgfortran/generated/product_i4.c    (.../branches/gcc-4_8-branch)
 
11705
@@ -97,10 +97,9 @@
 
11706
       retarray->offset = 0;
 
11707
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11708
 
 
11709
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11710
-                  * extent[rank-1];
 
11711
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11712
 
 
11713
-      retarray->base_addr = xmalloc (alloc_size);
 
11714
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11715
       if (alloc_size == 0)
 
11716
        {
 
11717
          /* Make sure we have a zero-sized array.  */
 
11718
@@ -272,8 +271,7 @@
 
11719
 
 
11720
        }
 
11721
 
 
11722
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11723
-                  * extent[rank-1];
 
11724
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11725
 
 
11726
       retarray->offset = 0;
 
11727
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11728
@@ -285,7 +283,7 @@
 
11729
          return;
 
11730
        }
 
11731
       else
 
11732
-       retarray->base_addr = xmalloc (alloc_size);
 
11733
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11734
 
 
11735
     }
 
11736
   else
 
11737
@@ -430,8 +428,7 @@
 
11738
       retarray->offset = 0;
 
11739
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11740
 
 
11741
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11742
-                  * extent[rank-1];
 
11743
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11744
 
 
11745
       if (alloc_size == 0)
 
11746
        {
 
11747
@@ -440,7 +437,7 @@
 
11748
          return;
 
11749
        }
 
11750
       else
 
11751
-       retarray->base_addr = xmalloc (alloc_size);
 
11752
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
11753
     }
 
11754
   else
 
11755
     {
 
11756
Index: libgfortran/generated/sum_c16.c
 
11757
===================================================================
 
11758
--- a/src/libgfortran/generated/sum_c16.c       (.../tags/gcc_4_8_3_release)
 
11759
+++ b/src/libgfortran/generated/sum_c16.c       (.../branches/gcc-4_8-branch)
 
11760
@@ -97,10 +97,9 @@
 
11761
       retarray->offset = 0;
 
11762
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11763
 
 
11764
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11765
-                  * extent[rank-1];
 
11766
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11767
 
 
11768
-      retarray->base_addr = xmalloc (alloc_size);
 
11769
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
11770
       if (alloc_size == 0)
 
11771
        {
 
11772
          /* Make sure we have a zero-sized array.  */
 
11773
@@ -272,8 +271,7 @@
 
11774
 
 
11775
        }
 
11776
 
 
11777
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11778
-                  * extent[rank-1];
 
11779
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11780
 
 
11781
       retarray->offset = 0;
 
11782
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11783
@@ -285,7 +283,7 @@
 
11784
          return;
 
11785
        }
 
11786
       else
 
11787
-       retarray->base_addr = xmalloc (alloc_size);
 
11788
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
11789
 
 
11790
     }
 
11791
   else
 
11792
@@ -430,8 +428,7 @@
 
11793
       retarray->offset = 0;
 
11794
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11795
 
 
11796
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11797
-                  * extent[rank-1];
 
11798
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11799
 
 
11800
       if (alloc_size == 0)
 
11801
        {
 
11802
@@ -440,7 +437,7 @@
 
11803
          return;
 
11804
        }
 
11805
       else
 
11806
-       retarray->base_addr = xmalloc (alloc_size);
 
11807
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
11808
     }
 
11809
   else
 
11810
     {
 
11811
Index: libgfortran/generated/transpose_c10.c
 
11812
===================================================================
 
11813
--- a/src/libgfortran/generated/transpose_c10.c (.../tags/gcc_4_8_3_release)
 
11814
+++ b/src/libgfortran/generated/transpose_c10.c (.../branches/gcc-4_8-branch)
 
11815
@@ -60,7 +60,8 @@
 
11816
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
11817
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
11818
 
 
11819
-      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
 
11820
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
11821
+                                     sizeof (GFC_COMPLEX_10));
 
11822
       ret->offset = 0;
 
11823
     } else if (unlikely (compile_options.bounds_check))
 
11824
     {
 
11825
Index: libgfortran/generated/maxloc1_16_r8.c
 
11826
===================================================================
 
11827
--- a/src/libgfortran/generated/maxloc1_16_r8.c (.../tags/gcc_4_8_3_release)
 
11828
+++ b/src/libgfortran/generated/maxloc1_16_r8.c (.../branches/gcc-4_8-branch)
 
11829
@@ -98,10 +98,9 @@
 
11830
       retarray->offset = 0;
 
11831
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11832
 
 
11833
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11834
-                  * extent[rank-1];
 
11835
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11836
 
 
11837
-      retarray->base_addr = xmalloc (alloc_size);
 
11838
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11839
       if (alloc_size == 0)
 
11840
        {
 
11841
          /* Make sure we have a zero-sized array.  */
 
11842
@@ -294,8 +293,7 @@
 
11843
 
 
11844
        }
 
11845
 
 
11846
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11847
-                  * extent[rank-1];
 
11848
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11849
 
 
11850
       retarray->offset = 0;
 
11851
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11852
@@ -307,7 +305,7 @@
 
11853
          return;
 
11854
        }
 
11855
       else
 
11856
-       retarray->base_addr = xmalloc (alloc_size);
 
11857
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11858
 
 
11859
     }
 
11860
   else
 
11861
@@ -485,8 +483,7 @@
 
11862
       retarray->offset = 0;
 
11863
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11864
 
 
11865
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11866
-                  * extent[rank-1];
 
11867
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11868
 
 
11869
       if (alloc_size == 0)
 
11870
        {
 
11871
@@ -495,7 +492,7 @@
 
11872
          return;
 
11873
        }
 
11874
       else
 
11875
-       retarray->base_addr = xmalloc (alloc_size);
 
11876
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
11877
     }
 
11878
   else
 
11879
     {
 
11880
Index: libgfortran/generated/transpose_r4.c
 
11881
===================================================================
 
11882
--- a/src/libgfortran/generated/transpose_r4.c  (.../tags/gcc_4_8_3_release)
 
11883
+++ b/src/libgfortran/generated/transpose_r4.c  (.../branches/gcc-4_8-branch)
 
11884
@@ -60,7 +60,8 @@
 
11885
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
11886
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
11887
 
 
11888
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
 
11889
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
11890
+                                     sizeof (GFC_REAL_4));
 
11891
       ret->offset = 0;
 
11892
     } else if (unlikely (compile_options.bounds_check))
 
11893
     {
 
11894
Index: libgfortran/generated/cshift1_4.c
 
11895
===================================================================
 
11896
--- a/src/libgfortran/generated/cshift1_4.c     (.../tags/gcc_4_8_3_release)
 
11897
+++ b/src/libgfortran/generated/cshift1_4.c     (.../branches/gcc-4_8-branch)
 
11898
@@ -80,7 +80,7 @@
 
11899
     {
 
11900
       int i;
 
11901
 
 
11902
-      ret->base_addr = xmalloc (size * arraysize);
 
11903
+      ret->base_addr = xmallocarray (arraysize, size);
 
11904
       ret->offset = 0;
 
11905
       ret->dtype = array->dtype;
 
11906
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
11907
Index: libgfortran/generated/maxloc0_8_i2.c
 
11908
===================================================================
 
11909
--- a/src/libgfortran/generated/maxloc0_8_i2.c  (.../tags/gcc_4_8_3_release)
 
11910
+++ b/src/libgfortran/generated/maxloc0_8_i2.c  (.../branches/gcc-4_8-branch)
 
11911
@@ -58,7 +58,7 @@
 
11912
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11913
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11914
       retarray->offset = 0;
 
11915
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11916
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11917
     }
 
11918
   else
 
11919
     {
 
11920
@@ -199,7 +199,7 @@
 
11921
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11922
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11923
       retarray->offset = 0;
 
11924
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11925
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11926
     }
 
11927
   else
 
11928
     {
 
11929
@@ -367,7 +367,7 @@
 
11930
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11931
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11932
       retarray->offset = 0;
 
11933
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
11934
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
11935
     }
 
11936
   else if (unlikely (compile_options.bounds_check))
 
11937
     {
 
11938
Index: libgfortran/generated/count_8_l.c
 
11939
===================================================================
 
11940
--- a/src/libgfortran/generated/count_8_l.c     (.../tags/gcc_4_8_3_release)
 
11941
+++ b/src/libgfortran/generated/count_8_l.c     (.../branches/gcc-4_8-branch)
 
11942
@@ -101,8 +101,7 @@
 
11943
       retarray->offset = 0;
 
11944
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
11945
 
 
11946
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
11947
-                  * extent[rank-1];
 
11948
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
11949
 
 
11950
       if (alloc_size == 0)
 
11951
        {
 
11952
@@ -111,7 +110,7 @@
 
11953
          return;
 
11954
        }
 
11955
       else
 
11956
-       retarray->base_addr = xmalloc (alloc_size);
 
11957
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
11958
     }
 
11959
   else
 
11960
     {
 
11961
Index: libgfortran/generated/in_pack_i4.c
 
11962
===================================================================
 
11963
--- a/src/libgfortran/generated/in_pack_i4.c    (.../tags/gcc_4_8_3_release)
 
11964
+++ b/src/libgfortran/generated/in_pack_i4.c    (.../branches/gcc-4_8-branch)
 
11965
@@ -76,7 +76,7 @@
 
11966
     return source->base_addr;
 
11967
 
 
11968
   /* Allocate storage for the destination.  */
 
11969
-  destptr = (GFC_INTEGER_4 *)xmalloc (ssize * sizeof (GFC_INTEGER_4));
 
11970
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_4));
 
11971
   dest = destptr;
 
11972
   src = source->base_addr;
 
11973
   stride0 = stride[0];
 
11974
Index: libgfortran/generated/minloc0_16_i2.c
 
11975
===================================================================
 
11976
--- a/src/libgfortran/generated/minloc0_16_i2.c (.../tags/gcc_4_8_3_release)
 
11977
+++ b/src/libgfortran/generated/minloc0_16_i2.c (.../branches/gcc-4_8-branch)
 
11978
@@ -58,7 +58,7 @@
 
11979
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11980
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11981
       retarray->offset = 0;
 
11982
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11983
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11984
     }
 
11985
   else
 
11986
     {
 
11987
@@ -199,7 +199,7 @@
 
11988
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
11989
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11990
       retarray->offset = 0;
 
11991
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
11992
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
11993
     }
 
11994
   else
 
11995
     {
 
11996
@@ -367,7 +367,7 @@
 
11997
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
11998
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
11999
       retarray->offset = 0;
 
12000
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12001
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12002
     }
 
12003
   else if (unlikely (compile_options.bounds_check))
 
12004
     {
 
12005
Index: libgfortran/generated/minloc1_8_r8.c
 
12006
===================================================================
 
12007
--- a/src/libgfortran/generated/minloc1_8_r8.c  (.../tags/gcc_4_8_3_release)
 
12008
+++ b/src/libgfortran/generated/minloc1_8_r8.c  (.../branches/gcc-4_8-branch)
 
12009
@@ -98,10 +98,9 @@
 
12010
       retarray->offset = 0;
 
12011
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12012
 
 
12013
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12014
-                  * extent[rank-1];
 
12015
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12016
 
 
12017
-      retarray->base_addr = xmalloc (alloc_size);
 
12018
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12019
       if (alloc_size == 0)
 
12020
        {
 
12021
          /* Make sure we have a zero-sized array.  */
 
12022
@@ -294,8 +293,7 @@
 
12023
 
 
12024
        }
 
12025
 
 
12026
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12027
-                  * extent[rank-1];
 
12028
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12029
 
 
12030
       retarray->offset = 0;
 
12031
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12032
@@ -307,7 +305,7 @@
 
12033
          return;
 
12034
        }
 
12035
       else
 
12036
-       retarray->base_addr = xmalloc (alloc_size);
 
12037
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12038
 
 
12039
     }
 
12040
   else
 
12041
@@ -485,8 +483,7 @@
 
12042
       retarray->offset = 0;
 
12043
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12044
 
 
12045
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12046
-                  * extent[rank-1];
 
12047
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12048
 
 
12049
       if (alloc_size == 0)
 
12050
        {
 
12051
@@ -495,7 +492,7 @@
 
12052
          return;
 
12053
        }
 
12054
       else
 
12055
-       retarray->base_addr = xmalloc (alloc_size);
 
12056
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12057
     }
 
12058
   else
 
12059
     {
 
12060
Index: libgfortran/generated/matmul_c16.c
 
12061
===================================================================
 
12062
--- a/src/libgfortran/generated/matmul_c16.c    (.../tags/gcc_4_8_3_release)
 
12063
+++ b/src/libgfortran/generated/matmul_c16.c    (.../branches/gcc-4_8-branch)
 
12064
@@ -124,7 +124,7 @@
 
12065
         }
 
12066
 
 
12067
       retarray->base_addr
 
12068
-       = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
 
12069
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_16));
 
12070
       retarray->offset = 0;
 
12071
     }
 
12072
     else if (unlikely (compile_options.bounds_check))
 
12073
Index: libgfortran/generated/minval_i1.c
 
12074
===================================================================
 
12075
--- a/src/libgfortran/generated/minval_i1.c     (.../tags/gcc_4_8_3_release)
 
12076
+++ b/src/libgfortran/generated/minval_i1.c     (.../branches/gcc-4_8-branch)
 
12077
@@ -97,10 +97,9 @@
 
12078
       retarray->offset = 0;
 
12079
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12080
 
 
12081
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12082
-                  * extent[rank-1];
 
12083
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12084
 
 
12085
-      retarray->base_addr = xmalloc (alloc_size);
 
12086
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
12087
       if (alloc_size == 0)
 
12088
        {
 
12089
          /* Make sure we have a zero-sized array.  */
 
12090
@@ -286,8 +285,7 @@
 
12091
 
 
12092
        }
 
12093
 
 
12094
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12095
-                  * extent[rank-1];
 
12096
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12097
 
 
12098
       retarray->offset = 0;
 
12099
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12100
@@ -299,7 +297,7 @@
 
12101
          return;
 
12102
        }
 
12103
       else
 
12104
-       retarray->base_addr = xmalloc (alloc_size);
 
12105
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
12106
 
 
12107
     }
 
12108
   else
 
12109
@@ -472,8 +470,7 @@
 
12110
       retarray->offset = 0;
 
12111
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12112
 
 
12113
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12114
-                  * extent[rank-1];
 
12115
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12116
 
 
12117
       if (alloc_size == 0)
 
12118
        {
 
12119
@@ -482,7 +479,7 @@
 
12120
          return;
 
12121
        }
 
12122
       else
 
12123
-       retarray->base_addr = xmalloc (alloc_size);
 
12124
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
12125
     }
 
12126
   else
 
12127
     {
 
12128
Index: libgfortran/generated/shape_i16.c
 
12129
===================================================================
 
12130
--- a/src/libgfortran/generated/shape_i16.c     (.../tags/gcc_4_8_3_release)
 
12131
+++ b/src/libgfortran/generated/shape_i16.c     (.../branches/gcc-4_8-branch)
 
12132
@@ -49,7 +49,7 @@
 
12133
     {
 
12134
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
 
12135
       ret->offset = 0;
 
12136
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12137
+      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12138
     }
 
12139
 
 
12140
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
12141
Index: libgfortran/generated/iany_i4.c
 
12142
===================================================================
 
12143
--- a/src/libgfortran/generated/iany_i4.c       (.../tags/gcc_4_8_3_release)
 
12144
+++ b/src/libgfortran/generated/iany_i4.c       (.../branches/gcc-4_8-branch)
 
12145
@@ -97,10 +97,9 @@
 
12146
       retarray->offset = 0;
 
12147
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12148
 
 
12149
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12150
-                  * extent[rank-1];
 
12151
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12152
 
 
12153
-      retarray->base_addr = xmalloc (alloc_size);
 
12154
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12155
       if (alloc_size == 0)
 
12156
        {
 
12157
          /* Make sure we have a zero-sized array.  */
 
12158
@@ -272,8 +271,7 @@
 
12159
 
 
12160
        }
 
12161
 
 
12162
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12163
-                  * extent[rank-1];
 
12164
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12165
 
 
12166
       retarray->offset = 0;
 
12167
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12168
@@ -285,7 +283,7 @@
 
12169
          return;
 
12170
        }
 
12171
       else
 
12172
-       retarray->base_addr = xmalloc (alloc_size);
 
12173
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12174
 
 
12175
     }
 
12176
   else
 
12177
@@ -430,8 +428,7 @@
 
12178
       retarray->offset = 0;
 
12179
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12180
 
 
12181
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12182
-                  * extent[rank-1];
 
12183
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12184
 
 
12185
       if (alloc_size == 0)
 
12186
        {
 
12187
@@ -440,7 +437,7 @@
 
12188
          return;
 
12189
        }
 
12190
       else
 
12191
-       retarray->base_addr = xmalloc (alloc_size);
 
12192
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12193
     }
 
12194
   else
 
12195
     {
 
12196
Index: libgfortran/generated/minloc0_16_r16.c
 
12197
===================================================================
 
12198
--- a/src/libgfortran/generated/minloc0_16_r16.c        (.../tags/gcc_4_8_3_release)
 
12199
+++ b/src/libgfortran/generated/minloc0_16_r16.c        (.../branches/gcc-4_8-branch)
 
12200
@@ -58,7 +58,7 @@
 
12201
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12202
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12203
       retarray->offset = 0;
 
12204
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12205
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12206
     }
 
12207
   else
 
12208
     {
 
12209
@@ -199,7 +199,7 @@
 
12210
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12211
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12212
       retarray->offset = 0;
 
12213
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12214
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12215
     }
 
12216
   else
 
12217
     {
 
12218
@@ -367,7 +367,7 @@
 
12219
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12220
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12221
       retarray->offset = 0;
 
12222
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
12223
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
12224
     }
 
12225
   else if (unlikely (compile_options.bounds_check))
 
12226
     {
 
12227
Index: libgfortran/generated/product_i16.c
 
12228
===================================================================
 
12229
--- a/src/libgfortran/generated/product_i16.c   (.../tags/gcc_4_8_3_release)
 
12230
+++ b/src/libgfortran/generated/product_i16.c   (.../branches/gcc-4_8-branch)
 
12231
@@ -97,10 +97,9 @@
 
12232
       retarray->offset = 0;
 
12233
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12234
 
 
12235
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12236
-                  * extent[rank-1];
 
12237
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12238
 
 
12239
-      retarray->base_addr = xmalloc (alloc_size);
 
12240
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12241
       if (alloc_size == 0)
 
12242
        {
 
12243
          /* Make sure we have a zero-sized array.  */
 
12244
@@ -272,8 +271,7 @@
 
12245
 
 
12246
        }
 
12247
 
 
12248
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12249
-                  * extent[rank-1];
 
12250
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12251
 
 
12252
       retarray->offset = 0;
 
12253
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12254
@@ -285,7 +283,7 @@
 
12255
          return;
 
12256
        }
 
12257
       else
 
12258
-       retarray->base_addr = xmalloc (alloc_size);
 
12259
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12260
 
 
12261
     }
 
12262
   else
 
12263
@@ -430,8 +428,7 @@
 
12264
       retarray->offset = 0;
 
12265
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12266
 
 
12267
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12268
-                  * extent[rank-1];
 
12269
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12270
 
 
12271
       if (alloc_size == 0)
 
12272
        {
 
12273
@@ -440,7 +437,7 @@
 
12274
          return;
 
12275
        }
 
12276
       else
 
12277
-       retarray->base_addr = xmalloc (alloc_size);
 
12278
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
12279
     }
 
12280
   else
 
12281
     {
 
12282
Index: libgfortran/generated/unpack_i1.c
 
12283
===================================================================
 
12284
--- a/src/libgfortran/generated/unpack_i1.c     (.../tags/gcc_4_8_3_release)
 
12285
+++ b/src/libgfortran/generated/unpack_i1.c     (.../branches/gcc-4_8-branch)
 
12286
@@ -99,7 +99,7 @@
 
12287
          rs *= extent[n];
 
12288
        }
 
12289
       ret->offset = 0;
 
12290
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
 
12291
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
 
12292
     }
 
12293
   else
 
12294
     {
 
12295
@@ -244,7 +244,7 @@
 
12296
          rs *= extent[n];
 
12297
        }
 
12298
       ret->offset = 0;
 
12299
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
 
12300
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
 
12301
     }
 
12302
   else
 
12303
     {
 
12304
Index: libgfortran/generated/minloc0_4_i4.c
 
12305
===================================================================
 
12306
--- a/src/libgfortran/generated/minloc0_4_i4.c  (.../tags/gcc_4_8_3_release)
 
12307
+++ b/src/libgfortran/generated/minloc0_4_i4.c  (.../branches/gcc-4_8-branch)
 
12308
@@ -58,7 +58,7 @@
 
12309
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12310
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12311
       retarray->offset = 0;
 
12312
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12313
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12314
     }
 
12315
   else
 
12316
     {
 
12317
@@ -199,7 +199,7 @@
 
12318
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12319
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12320
       retarray->offset = 0;
 
12321
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12322
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12323
     }
 
12324
   else
 
12325
     {
 
12326
@@ -367,7 +367,7 @@
 
12327
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12328
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12329
       retarray->offset = 0;
 
12330
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
12331
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
12332
     }
 
12333
   else if (unlikely (compile_options.bounds_check))
 
12334
     {
 
12335
Index: libgfortran/generated/matmul_i1.c
 
12336
===================================================================
 
12337
--- a/src/libgfortran/generated/matmul_i1.c     (.../tags/gcc_4_8_3_release)
 
12338
+++ b/src/libgfortran/generated/matmul_i1.c     (.../branches/gcc-4_8-branch)
 
12339
@@ -124,7 +124,7 @@
 
12340
         }
 
12341
 
 
12342
       retarray->base_addr
 
12343
-       = xmalloc (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
 
12344
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_1));
 
12345
       retarray->offset = 0;
 
12346
     }
 
12347
     else if (unlikely (compile_options.bounds_check))
 
12348
Index: libgfortran/generated/minval_r4.c
 
12349
===================================================================
 
12350
--- a/src/libgfortran/generated/minval_r4.c     (.../tags/gcc_4_8_3_release)
 
12351
+++ b/src/libgfortran/generated/minval_r4.c     (.../branches/gcc-4_8-branch)
 
12352
@@ -97,10 +97,9 @@
 
12353
       retarray->offset = 0;
 
12354
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12355
 
 
12356
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12357
-                  * extent[rank-1];
 
12358
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12359
 
 
12360
-      retarray->base_addr = xmalloc (alloc_size);
 
12361
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
12362
       if (alloc_size == 0)
 
12363
        {
 
12364
          /* Make sure we have a zero-sized array.  */
 
12365
@@ -286,8 +285,7 @@
 
12366
 
 
12367
        }
 
12368
 
 
12369
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12370
-                  * extent[rank-1];
 
12371
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12372
 
 
12373
       retarray->offset = 0;
 
12374
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12375
@@ -299,7 +297,7 @@
 
12376
          return;
 
12377
        }
 
12378
       else
 
12379
-       retarray->base_addr = xmalloc (alloc_size);
 
12380
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
12381
 
 
12382
     }
 
12383
   else
 
12384
@@ -472,8 +470,7 @@
 
12385
       retarray->offset = 0;
 
12386
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12387
 
 
12388
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12389
-                  * extent[rank-1];
 
12390
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12391
 
 
12392
       if (alloc_size == 0)
 
12393
        {
 
12394
@@ -482,7 +479,7 @@
 
12395
          return;
 
12396
        }
 
12397
       else
 
12398
-       retarray->base_addr = xmalloc (alloc_size);
 
12399
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
12400
     }
 
12401
   else
 
12402
     {
 
12403
Index: libgfortran/generated/spread_i16.c
 
12404
===================================================================
 
12405
--- a/src/libgfortran/generated/spread_i16.c    (.../tags/gcc_4_8_3_release)
 
12406
+++ b/src/libgfortran/generated/spread_i16.c    (.../branches/gcc-4_8-branch)
 
12407
@@ -101,8 +101,8 @@
 
12408
        }
 
12409
       ret->offset = 0;
 
12410
 
 
12411
-      /* xmalloc allocates a single byte for zero size.  */
 
12412
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_16));
 
12413
+      /* xmallocarray allocates a single byte for zero size.  */
 
12414
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_16));
 
12415
       if (rs <= 0)
 
12416
         return;
 
12417
     }
 
12418
@@ -244,7 +244,7 @@
 
12419
 
 
12420
   if (ret->base_addr == NULL)
 
12421
     {
 
12422
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_16));
 
12423
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_16));
 
12424
       ret->offset = 0;
 
12425
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
12426
     }
 
12427
Index: libgfortran/generated/sum_i4.c
 
12428
===================================================================
 
12429
--- a/src/libgfortran/generated/sum_i4.c        (.../tags/gcc_4_8_3_release)
 
12430
+++ b/src/libgfortran/generated/sum_i4.c        (.../branches/gcc-4_8-branch)
 
12431
@@ -97,10 +97,9 @@
 
12432
       retarray->offset = 0;
 
12433
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12434
 
 
12435
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12436
-                  * extent[rank-1];
 
12437
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12438
 
 
12439
-      retarray->base_addr = xmalloc (alloc_size);
 
12440
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12441
       if (alloc_size == 0)
 
12442
        {
 
12443
          /* Make sure we have a zero-sized array.  */
 
12444
@@ -272,8 +271,7 @@
 
12445
 
 
12446
        }
 
12447
 
 
12448
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12449
-                  * extent[rank-1];
 
12450
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12451
 
 
12452
       retarray->offset = 0;
 
12453
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12454
@@ -285,7 +283,7 @@
 
12455
          return;
 
12456
        }
 
12457
       else
 
12458
-       retarray->base_addr = xmalloc (alloc_size);
 
12459
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12460
 
 
12461
     }
 
12462
   else
 
12463
@@ -430,8 +428,7 @@
 
12464
       retarray->offset = 0;
 
12465
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12466
 
 
12467
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12468
-                  * extent[rank-1];
 
12469
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12470
 
 
12471
       if (alloc_size == 0)
 
12472
        {
 
12473
@@ -440,7 +437,7 @@
 
12474
          return;
 
12475
        }
 
12476
       else
 
12477
-       retarray->base_addr = xmalloc (alloc_size);
 
12478
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12479
     }
 
12480
   else
 
12481
     {
 
12482
Index: libgfortran/generated/unpack_r10.c
 
12483
===================================================================
 
12484
--- a/src/libgfortran/generated/unpack_r10.c    (.../tags/gcc_4_8_3_release)
 
12485
+++ b/src/libgfortran/generated/unpack_r10.c    (.../branches/gcc-4_8-branch)
 
12486
@@ -99,7 +99,7 @@
 
12487
          rs *= extent[n];
 
12488
        }
 
12489
       ret->offset = 0;
 
12490
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
 
12491
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
 
12492
     }
 
12493
   else
 
12494
     {
 
12495
@@ -244,7 +244,7 @@
 
12496
          rs *= extent[n];
 
12497
        }
 
12498
       ret->offset = 0;
 
12499
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
 
12500
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
 
12501
     }
 
12502
   else
 
12503
     {
 
12504
Index: libgfortran/generated/bessel_r16.c
 
12505
===================================================================
 
12506
--- a/src/libgfortran/generated/bessel_r16.c    (.../tags/gcc_4_8_3_release)
 
12507
+++ b/src/libgfortran/generated/bessel_r16.c    (.../branches/gcc-4_8-branch)
 
12508
@@ -59,7 +59,7 @@
 
12509
     {
 
12510
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
12511
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
12512
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
 
12513
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
 
12514
       ret->offset = 0;
 
12515
     }
 
12516
 
 
12517
@@ -126,7 +126,7 @@
 
12518
     {
 
12519
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
12520
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
12521
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
 
12522
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
 
12523
       ret->offset = 0;
 
12524
     }
 
12525
 
 
12526
@@ -166,7 +166,7 @@
 
12527
 
 
12528
   x2rev = GFC_REAL_16_LITERAL(2.)/x;
 
12529
 
 
12530
-  for (i = 2; i <= n1+n2; i++)
 
12531
+  for (i = 2; i <= n2 - n1; i++)
 
12532
     {
 
12533
 #if defined(GFC_REAL_16_INFINITY)
 
12534
       if (unlikely (last2 == -GFC_REAL_16_INFINITY))
 
12535
Index: libgfortran/generated/norm2_r8.c
 
12536
===================================================================
 
12537
--- a/src/libgfortran/generated/norm2_r8.c      (.../tags/gcc_4_8_3_release)
 
12538
+++ b/src/libgfortran/generated/norm2_r8.c      (.../branches/gcc-4_8-branch)
 
12539
@@ -101,10 +101,9 @@
 
12540
       retarray->offset = 0;
 
12541
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12542
 
 
12543
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12544
-                  * extent[rank-1];
 
12545
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12546
 
 
12547
-      retarray->base_addr = xmalloc (alloc_size);
 
12548
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
12549
       if (alloc_size == 0)
 
12550
        {
 
12551
          /* Make sure we have a zero-sized array.  */
 
12552
Index: libgfortran/generated/spread_i4.c
 
12553
===================================================================
 
12554
--- a/src/libgfortran/generated/spread_i4.c     (.../tags/gcc_4_8_3_release)
 
12555
+++ b/src/libgfortran/generated/spread_i4.c     (.../branches/gcc-4_8-branch)
 
12556
@@ -101,8 +101,8 @@
 
12557
        }
 
12558
       ret->offset = 0;
 
12559
 
 
12560
-      /* xmalloc allocates a single byte for zero size.  */
 
12561
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_4));
 
12562
+      /* xmallocarray allocates a single byte for zero size.  */
 
12563
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_4));
 
12564
       if (rs <= 0)
 
12565
         return;
 
12566
     }
 
12567
@@ -244,7 +244,7 @@
 
12568
 
 
12569
   if (ret->base_addr == NULL)
 
12570
     {
 
12571
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_4));
 
12572
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_4));
 
12573
       ret->offset = 0;
 
12574
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
12575
     }
 
12576
Index: libgfortran/generated/eoshift3_8.c
 
12577
===================================================================
 
12578
--- a/src/libgfortran/generated/eoshift3_8.c    (.../tags/gcc_4_8_3_release)
 
12579
+++ b/src/libgfortran/generated/eoshift3_8.c    (.../branches/gcc-4_8-branch)
 
12580
@@ -89,7 +89,7 @@
 
12581
     {
 
12582
       int i;
 
12583
 
 
12584
-      ret->base_addr = xmalloc (size * arraysize);
 
12585
+      ret->base_addr = xmallocarray (arraysize, size);
 
12586
       ret->offset = 0;
 
12587
       ret->dtype = array->dtype;
 
12588
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
12589
@@ -107,8 +107,8 @@
 
12590
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
12591
 
 
12592
         }
 
12593
-      /* xmalloc allocates a single byte for zero size.  */
 
12594
-      ret->base_addr = xmalloc (size * arraysize);
 
12595
+      /* xmallocarray allocates a single byte for zero size.  */
 
12596
+      ret->base_addr = xmallocarray (arraysize, size);
 
12597
 
 
12598
     }
 
12599
   else if (unlikely (compile_options.bounds_check))
 
12600
Index: libgfortran/generated/minloc1_4_i1.c
 
12601
===================================================================
 
12602
--- a/src/libgfortran/generated/minloc1_4_i1.c  (.../tags/gcc_4_8_3_release)
 
12603
+++ b/src/libgfortran/generated/minloc1_4_i1.c  (.../branches/gcc-4_8-branch)
 
12604
@@ -98,10 +98,9 @@
 
12605
       retarray->offset = 0;
 
12606
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12607
 
 
12608
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12609
-                  * extent[rank-1];
 
12610
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12611
 
 
12612
-      retarray->base_addr = xmalloc (alloc_size);
 
12613
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12614
       if (alloc_size == 0)
 
12615
        {
 
12616
          /* Make sure we have a zero-sized array.  */
 
12617
@@ -294,8 +293,7 @@
 
12618
 
 
12619
        }
 
12620
 
 
12621
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12622
-                  * extent[rank-1];
 
12623
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12624
 
 
12625
       retarray->offset = 0;
 
12626
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12627
@@ -307,7 +305,7 @@
 
12628
          return;
 
12629
        }
 
12630
       else
 
12631
-       retarray->base_addr = xmalloc (alloc_size);
 
12632
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12633
 
 
12634
     }
 
12635
   else
 
12636
@@ -485,8 +483,7 @@
 
12637
       retarray->offset = 0;
 
12638
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12639
 
 
12640
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12641
-                  * extent[rank-1];
 
12642
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12643
 
 
12644
       if (alloc_size == 0)
 
12645
        {
 
12646
@@ -495,7 +492,7 @@
 
12647
          return;
 
12648
        }
 
12649
       else
 
12650
-       retarray->base_addr = xmalloc (alloc_size);
 
12651
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12652
     }
 
12653
   else
 
12654
     {
 
12655
Index: libgfortran/generated/minval_i2.c
 
12656
===================================================================
 
12657
--- a/src/libgfortran/generated/minval_i2.c     (.../tags/gcc_4_8_3_release)
 
12658
+++ b/src/libgfortran/generated/minval_i2.c     (.../branches/gcc-4_8-branch)
 
12659
@@ -97,10 +97,9 @@
 
12660
       retarray->offset = 0;
 
12661
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12662
 
 
12663
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12664
-                  * extent[rank-1];
 
12665
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12666
 
 
12667
-      retarray->base_addr = xmalloc (alloc_size);
 
12668
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12669
       if (alloc_size == 0)
 
12670
        {
 
12671
          /* Make sure we have a zero-sized array.  */
 
12672
@@ -286,8 +285,7 @@
 
12673
 
 
12674
        }
 
12675
 
 
12676
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12677
-                  * extent[rank-1];
 
12678
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12679
 
 
12680
       retarray->offset = 0;
 
12681
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12682
@@ -299,7 +297,7 @@
 
12683
          return;
 
12684
        }
 
12685
       else
 
12686
-       retarray->base_addr = xmalloc (alloc_size);
 
12687
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12688
 
 
12689
     }
 
12690
   else
 
12691
@@ -472,8 +470,7 @@
 
12692
       retarray->offset = 0;
 
12693
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12694
 
 
12695
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12696
-                  * extent[rank-1];
 
12697
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12698
 
 
12699
       if (alloc_size == 0)
 
12700
        {
 
12701
@@ -482,7 +479,7 @@
 
12702
          return;
 
12703
        }
 
12704
       else
 
12705
-       retarray->base_addr = xmalloc (alloc_size);
 
12706
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
12707
     }
 
12708
   else
 
12709
     {
 
12710
Index: libgfortran/generated/bessel_r8.c
 
12711
===================================================================
 
12712
--- a/src/libgfortran/generated/bessel_r8.c     (.../tags/gcc_4_8_3_release)
 
12713
+++ b/src/libgfortran/generated/bessel_r8.c     (.../branches/gcc-4_8-branch)
 
12714
@@ -55,7 +55,7 @@
 
12715
     {
 
12716
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
12717
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
12718
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
 
12719
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
 
12720
       ret->offset = 0;
 
12721
     }
 
12722
 
 
12723
@@ -122,7 +122,7 @@
 
12724
     {
 
12725
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
12726
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
12727
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
 
12728
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
 
12729
       ret->offset = 0;
 
12730
     }
 
12731
 
 
12732
@@ -162,7 +162,7 @@
 
12733
 
 
12734
   x2rev = GFC_REAL_8_LITERAL(2.)/x;
 
12735
 
 
12736
-  for (i = 2; i <= n1+n2; i++)
 
12737
+  for (i = 2; i <= n2 - n1; i++)
 
12738
     {
 
12739
 #if defined(GFC_REAL_8_INFINITY)
 
12740
       if (unlikely (last2 == -GFC_REAL_8_INFINITY))
 
12741
Index: libgfortran/generated/unpack_r4.c
 
12742
===================================================================
 
12743
--- a/src/libgfortran/generated/unpack_r4.c     (.../tags/gcc_4_8_3_release)
 
12744
+++ b/src/libgfortran/generated/unpack_r4.c     (.../branches/gcc-4_8-branch)
 
12745
@@ -99,7 +99,7 @@
 
12746
          rs *= extent[n];
 
12747
        }
 
12748
       ret->offset = 0;
 
12749
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
 
12750
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
 
12751
     }
 
12752
   else
 
12753
     {
 
12754
@@ -244,7 +244,7 @@
 
12755
          rs *= extent[n];
 
12756
        }
 
12757
       ret->offset = 0;
 
12758
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
 
12759
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
 
12760
     }
 
12761
   else
 
12762
     {
 
12763
Index: libgfortran/generated/product_r8.c
 
12764
===================================================================
 
12765
--- a/src/libgfortran/generated/product_r8.c    (.../tags/gcc_4_8_3_release)
 
12766
+++ b/src/libgfortran/generated/product_r8.c    (.../branches/gcc-4_8-branch)
 
12767
@@ -97,10 +97,9 @@
 
12768
       retarray->offset = 0;
 
12769
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12770
 
 
12771
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12772
-                  * extent[rank-1];
 
12773
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12774
 
 
12775
-      retarray->base_addr = xmalloc (alloc_size);
 
12776
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
12777
       if (alloc_size == 0)
 
12778
        {
 
12779
          /* Make sure we have a zero-sized array.  */
 
12780
@@ -272,8 +271,7 @@
 
12781
 
 
12782
        }
 
12783
 
 
12784
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12785
-                  * extent[rank-1];
 
12786
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12787
 
 
12788
       retarray->offset = 0;
 
12789
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12790
@@ -285,7 +283,7 @@
 
12791
          return;
 
12792
        }
 
12793
       else
 
12794
-       retarray->base_addr = xmalloc (alloc_size);
 
12795
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
12796
 
 
12797
     }
 
12798
   else
 
12799
@@ -430,8 +428,7 @@
 
12800
       retarray->offset = 0;
 
12801
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12802
 
 
12803
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12804
-                  * extent[rank-1];
 
12805
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12806
 
 
12807
       if (alloc_size == 0)
 
12808
        {
 
12809
@@ -440,7 +437,7 @@
 
12810
          return;
 
12811
        }
 
12812
       else
 
12813
-       retarray->base_addr = xmalloc (alloc_size);
 
12814
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
12815
     }
 
12816
   else
 
12817
     {
 
12818
Index: libgfortran/generated/matmul_r4.c
 
12819
===================================================================
 
12820
--- a/src/libgfortran/generated/matmul_r4.c     (.../tags/gcc_4_8_3_release)
 
12821
+++ b/src/libgfortran/generated/matmul_r4.c     (.../branches/gcc-4_8-branch)
 
12822
@@ -124,7 +124,7 @@
 
12823
         }
 
12824
 
 
12825
       retarray->base_addr
 
12826
-       = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
 
12827
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_4));
 
12828
       retarray->offset = 0;
 
12829
     }
 
12830
     else if (unlikely (compile_options.bounds_check))
 
12831
Index: libgfortran/generated/unpack_i2.c
 
12832
===================================================================
 
12833
--- a/src/libgfortran/generated/unpack_i2.c     (.../tags/gcc_4_8_3_release)
 
12834
+++ b/src/libgfortran/generated/unpack_i2.c     (.../branches/gcc-4_8-branch)
 
12835
@@ -99,7 +99,7 @@
 
12836
          rs *= extent[n];
 
12837
        }
 
12838
       ret->offset = 0;
 
12839
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
 
12840
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
 
12841
     }
 
12842
   else
 
12843
     {
 
12844
@@ -244,7 +244,7 @@
 
12845
          rs *= extent[n];
 
12846
        }
 
12847
       ret->offset = 0;
 
12848
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
 
12849
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
 
12850
     }
 
12851
   else
 
12852
     {
 
12853
Index: libgfortran/generated/in_pack_r8.c
 
12854
===================================================================
 
12855
--- a/src/libgfortran/generated/in_pack_r8.c    (.../tags/gcc_4_8_3_release)
 
12856
+++ b/src/libgfortran/generated/in_pack_r8.c    (.../branches/gcc-4_8-branch)
 
12857
@@ -76,7 +76,7 @@
 
12858
     return source->base_addr;
 
12859
 
 
12860
   /* Allocate storage for the destination.  */
 
12861
-  destptr = (GFC_REAL_8 *)xmalloc (ssize * sizeof (GFC_REAL_8));
 
12862
+  destptr = xmallocarray (ssize, sizeof (GFC_REAL_8));
 
12863
   dest = destptr;
 
12864
   src = source->base_addr;
 
12865
   stride0 = stride[0];
 
12866
Index: libgfortran/generated/maxloc1_4_r16.c
 
12867
===================================================================
 
12868
--- a/src/libgfortran/generated/maxloc1_4_r16.c (.../tags/gcc_4_8_3_release)
 
12869
+++ b/src/libgfortran/generated/maxloc1_4_r16.c (.../branches/gcc-4_8-branch)
 
12870
@@ -98,10 +98,9 @@
 
12871
       retarray->offset = 0;
 
12872
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12873
 
 
12874
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12875
-                  * extent[rank-1];
 
12876
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12877
 
 
12878
-      retarray->base_addr = xmalloc (alloc_size);
 
12879
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12880
       if (alloc_size == 0)
 
12881
        {
 
12882
          /* Make sure we have a zero-sized array.  */
 
12883
@@ -294,8 +293,7 @@
 
12884
 
 
12885
        }
 
12886
 
 
12887
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12888
-                  * extent[rank-1];
 
12889
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12890
 
 
12891
       retarray->offset = 0;
 
12892
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12893
@@ -307,7 +305,7 @@
 
12894
          return;
 
12895
        }
 
12896
       else
 
12897
-       retarray->base_addr = xmalloc (alloc_size);
 
12898
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12899
 
 
12900
     }
 
12901
   else
 
12902
@@ -485,8 +483,7 @@
 
12903
       retarray->offset = 0;
 
12904
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12905
 
 
12906
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12907
-                  * extent[rank-1];
 
12908
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12909
 
 
12910
       if (alloc_size == 0)
 
12911
        {
 
12912
@@ -495,7 +492,7 @@
 
12913
          return;
 
12914
        }
 
12915
       else
 
12916
-       retarray->base_addr = xmalloc (alloc_size);
 
12917
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
12918
     }
 
12919
   else
 
12920
     {
 
12921
Index: libgfortran/generated/minloc0_8_r16.c
 
12922
===================================================================
 
12923
--- a/src/libgfortran/generated/minloc0_8_r16.c (.../tags/gcc_4_8_3_release)
 
12924
+++ b/src/libgfortran/generated/minloc0_8_r16.c (.../branches/gcc-4_8-branch)
 
12925
@@ -58,7 +58,7 @@
 
12926
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12927
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12928
       retarray->offset = 0;
 
12929
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12930
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12931
     }
 
12932
   else
 
12933
     {
 
12934
@@ -199,7 +199,7 @@
 
12935
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
12936
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12937
       retarray->offset = 0;
 
12938
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12939
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12940
     }
 
12941
   else
 
12942
     {
 
12943
@@ -367,7 +367,7 @@
 
12944
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
12945
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
12946
       retarray->offset = 0;
 
12947
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
12948
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
12949
     }
 
12950
   else if (unlikely (compile_options.bounds_check))
 
12951
     {
 
12952
Index: libgfortran/generated/reshape_c8.c
 
12953
===================================================================
 
12954
--- a/src/libgfortran/generated/reshape_c8.c    (.../tags/gcc_4_8_3_release)
 
12955
+++ b/src/libgfortran/generated/reshape_c8.c    (.../branches/gcc-4_8-branch)
 
12956
@@ -111,11 +111,11 @@
 
12957
       ret->offset = 0;
 
12958
 
 
12959
       if (unlikely (rs < 1))
 
12960
-        alloc_size = 1;
 
12961
+        alloc_size = 0;
 
12962
       else
 
12963
-        alloc_size = rs * sizeof (GFC_COMPLEX_8);
 
12964
+        alloc_size = rs;
 
12965
 
 
12966
-      ret->base_addr = xmalloc (alloc_size);
 
12967
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
12968
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
12969
     }
 
12970
 
 
12971
Index: libgfortran/generated/iparity_i8.c
 
12972
===================================================================
 
12973
--- a/src/libgfortran/generated/iparity_i8.c    (.../tags/gcc_4_8_3_release)
 
12974
+++ b/src/libgfortran/generated/iparity_i8.c    (.../branches/gcc-4_8-branch)
 
12975
@@ -97,10 +97,9 @@
 
12976
       retarray->offset = 0;
 
12977
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12978
 
 
12979
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12980
-                  * extent[rank-1];
 
12981
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12982
 
 
12983
-      retarray->base_addr = xmalloc (alloc_size);
 
12984
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
12985
       if (alloc_size == 0)
 
12986
        {
 
12987
          /* Make sure we have a zero-sized array.  */
 
12988
@@ -272,8 +271,7 @@
 
12989
 
 
12990
        }
 
12991
 
 
12992
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
12993
-                  * extent[rank-1];
 
12994
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
12995
 
 
12996
       retarray->offset = 0;
 
12997
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
12998
@@ -285,7 +283,7 @@
 
12999
          return;
 
13000
        }
 
13001
       else
 
13002
-       retarray->base_addr = xmalloc (alloc_size);
 
13003
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13004
 
 
13005
     }
 
13006
   else
 
13007
@@ -430,8 +428,7 @@
 
13008
       retarray->offset = 0;
 
13009
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13010
 
 
13011
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13012
-                  * extent[rank-1];
 
13013
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13014
 
 
13015
       if (alloc_size == 0)
 
13016
        {
 
13017
@@ -440,7 +437,7 @@
 
13018
          return;
 
13019
        }
 
13020
       else
 
13021
-       retarray->base_addr = xmalloc (alloc_size);
 
13022
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13023
     }
 
13024
   else
 
13025
     {
 
13026
Index: libgfortran/generated/count_1_l.c
 
13027
===================================================================
 
13028
--- a/src/libgfortran/generated/count_1_l.c     (.../tags/gcc_4_8_3_release)
 
13029
+++ b/src/libgfortran/generated/count_1_l.c     (.../branches/gcc-4_8-branch)
 
13030
@@ -101,8 +101,7 @@
 
13031
       retarray->offset = 0;
 
13032
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13033
 
 
13034
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13035
-                  * extent[rank-1];
 
13036
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13037
 
 
13038
       if (alloc_size == 0)
 
13039
        {
 
13040
@@ -111,7 +110,7 @@
 
13041
          return;
 
13042
        }
 
13043
       else
 
13044
-       retarray->base_addr = xmalloc (alloc_size);
 
13045
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
13046
     }
 
13047
   else
 
13048
     {
 
13049
Index: libgfortran/generated/maxloc0_8_i4.c
 
13050
===================================================================
 
13051
--- a/src/libgfortran/generated/maxloc0_8_i4.c  (.../tags/gcc_4_8_3_release)
 
13052
+++ b/src/libgfortran/generated/maxloc0_8_i4.c  (.../branches/gcc-4_8-branch)
 
13053
@@ -58,7 +58,7 @@
 
13054
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13055
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13056
       retarray->offset = 0;
 
13057
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
13058
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
13059
     }
 
13060
   else
 
13061
     {
 
13062
@@ -199,7 +199,7 @@
 
13063
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
13064
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13065
       retarray->offset = 0;
 
13066
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
13067
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
13068
     }
 
13069
   else
 
13070
     {
 
13071
@@ -367,7 +367,7 @@
 
13072
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13073
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13074
       retarray->offset = 0;
 
13075
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
13076
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
13077
     }
 
13078
   else if (unlikely (compile_options.bounds_check))
 
13079
     {
 
13080
Index: libgfortran/generated/matmul_i2.c
 
13081
===================================================================
 
13082
--- a/src/libgfortran/generated/matmul_i2.c     (.../tags/gcc_4_8_3_release)
 
13083
+++ b/src/libgfortran/generated/matmul_i2.c     (.../branches/gcc-4_8-branch)
 
13084
@@ -124,7 +124,7 @@
 
13085
         }
 
13086
 
 
13087
       retarray->base_addr
 
13088
-       = xmalloc (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
 
13089
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_2));
 
13090
       retarray->offset = 0;
 
13091
     }
 
13092
     else if (unlikely (compile_options.bounds_check))
 
13093
Index: libgfortran/generated/minloc1_4_r4.c
 
13094
===================================================================
 
13095
--- a/src/libgfortran/generated/minloc1_4_r4.c  (.../tags/gcc_4_8_3_release)
 
13096
+++ b/src/libgfortran/generated/minloc1_4_r4.c  (.../branches/gcc-4_8-branch)
 
13097
@@ -98,10 +98,9 @@
 
13098
       retarray->offset = 0;
 
13099
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13100
 
 
13101
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13102
-                  * extent[rank-1];
 
13103
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13104
 
 
13105
-      retarray->base_addr = xmalloc (alloc_size);
 
13106
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13107
       if (alloc_size == 0)
 
13108
        {
 
13109
          /* Make sure we have a zero-sized array.  */
 
13110
@@ -294,8 +293,7 @@
 
13111
 
 
13112
        }
 
13113
 
 
13114
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13115
-                  * extent[rank-1];
 
13116
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13117
 
 
13118
       retarray->offset = 0;
 
13119
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13120
@@ -307,7 +305,7 @@
 
13121
          return;
 
13122
        }
 
13123
       else
 
13124
-       retarray->base_addr = xmalloc (alloc_size);
 
13125
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13126
 
 
13127
     }
 
13128
   else
 
13129
@@ -485,8 +483,7 @@
 
13130
       retarray->offset = 0;
 
13131
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13132
 
 
13133
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13134
-                  * extent[rank-1];
 
13135
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13136
 
 
13137
       if (alloc_size == 0)
 
13138
        {
 
13139
@@ -495,7 +492,7 @@
 
13140
          return;
 
13141
        }
 
13142
       else
 
13143
-       retarray->base_addr = xmalloc (alloc_size);
 
13144
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13145
     }
 
13146
   else
 
13147
     {
 
13148
Index: libgfortran/generated/transpose_i16.c
 
13149
===================================================================
 
13150
--- a/src/libgfortran/generated/transpose_i16.c (.../tags/gcc_4_8_3_release)
 
13151
+++ b/src/libgfortran/generated/transpose_i16.c (.../branches/gcc-4_8-branch)
 
13152
@@ -60,7 +60,8 @@
 
13153
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
13154
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
13155
 
 
13156
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
 
13157
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
13158
+                                     sizeof (GFC_INTEGER_16));
 
13159
       ret->offset = 0;
 
13160
     } else if (unlikely (compile_options.bounds_check))
 
13161
     {
 
13162
Index: libgfortran/generated/minloc0_16_i4.c
 
13163
===================================================================
 
13164
--- a/src/libgfortran/generated/minloc0_16_i4.c (.../tags/gcc_4_8_3_release)
 
13165
+++ b/src/libgfortran/generated/minloc0_16_i4.c (.../branches/gcc-4_8-branch)
 
13166
@@ -58,7 +58,7 @@
 
13167
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13168
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13169
       retarray->offset = 0;
 
13170
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13171
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13172
     }
 
13173
   else
 
13174
     {
 
13175
@@ -199,7 +199,7 @@
 
13176
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
13177
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13178
       retarray->offset = 0;
 
13179
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13180
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13181
     }
 
13182
   else
 
13183
     {
 
13184
@@ -367,7 +367,7 @@
 
13185
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13186
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13187
       retarray->offset = 0;
 
13188
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
13189
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
13190
     }
 
13191
   else if (unlikely (compile_options.bounds_check))
 
13192
     {
 
13193
Index: libgfortran/generated/transpose_i4.c
 
13194
===================================================================
 
13195
--- a/src/libgfortran/generated/transpose_i4.c  (.../tags/gcc_4_8_3_release)
 
13196
+++ b/src/libgfortran/generated/transpose_i4.c  (.../branches/gcc-4_8-branch)
 
13197
@@ -60,7 +60,8 @@
 
13198
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
13199
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
13200
 
 
13201
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
 
13202
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
13203
+                                     sizeof (GFC_INTEGER_4));
 
13204
       ret->offset = 0;
 
13205
     } else if (unlikely (compile_options.bounds_check))
 
13206
     {
 
13207
Index: libgfortran/generated/maxloc1_16_i8.c
 
13208
===================================================================
 
13209
--- a/src/libgfortran/generated/maxloc1_16_i8.c (.../tags/gcc_4_8_3_release)
 
13210
+++ b/src/libgfortran/generated/maxloc1_16_i8.c (.../branches/gcc-4_8-branch)
 
13211
@@ -98,10 +98,9 @@
 
13212
       retarray->offset = 0;
 
13213
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13214
 
 
13215
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13216
-                  * extent[rank-1];
 
13217
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13218
 
 
13219
-      retarray->base_addr = xmalloc (alloc_size);
 
13220
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13221
       if (alloc_size == 0)
 
13222
        {
 
13223
          /* Make sure we have a zero-sized array.  */
 
13224
@@ -294,8 +293,7 @@
 
13225
 
 
13226
        }
 
13227
 
 
13228
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13229
-                  * extent[rank-1];
 
13230
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13231
 
 
13232
       retarray->offset = 0;
 
13233
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13234
@@ -307,7 +305,7 @@
 
13235
          return;
 
13236
        }
 
13237
       else
 
13238
-       retarray->base_addr = xmalloc (alloc_size);
 
13239
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13240
 
 
13241
     }
 
13242
   else
 
13243
@@ -485,8 +483,7 @@
 
13244
       retarray->offset = 0;
 
13245
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13246
 
 
13247
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13248
-                  * extent[rank-1];
 
13249
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13250
 
 
13251
       if (alloc_size == 0)
 
13252
        {
 
13253
@@ -495,7 +492,7 @@
 
13254
          return;
 
13255
        }
 
13256
       else
 
13257
-       retarray->base_addr = xmalloc (alloc_size);
 
13258
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13259
     }
 
13260
   else
 
13261
     {
 
13262
Index: libgfortran/generated/minloc1_4_i2.c
 
13263
===================================================================
 
13264
--- a/src/libgfortran/generated/minloc1_4_i2.c  (.../tags/gcc_4_8_3_release)
 
13265
+++ b/src/libgfortran/generated/minloc1_4_i2.c  (.../branches/gcc-4_8-branch)
 
13266
@@ -98,10 +98,9 @@
 
13267
       retarray->offset = 0;
 
13268
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13269
 
 
13270
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13271
-                  * extent[rank-1];
 
13272
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13273
 
 
13274
-      retarray->base_addr = xmalloc (alloc_size);
 
13275
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13276
       if (alloc_size == 0)
 
13277
        {
 
13278
          /* Make sure we have a zero-sized array.  */
 
13279
@@ -294,8 +293,7 @@
 
13280
 
 
13281
        }
 
13282
 
 
13283
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13284
-                  * extent[rank-1];
 
13285
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13286
 
 
13287
       retarray->offset = 0;
 
13288
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13289
@@ -307,7 +305,7 @@
 
13290
          return;
 
13291
        }
 
13292
       else
 
13293
-       retarray->base_addr = xmalloc (alloc_size);
 
13294
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13295
 
 
13296
     }
 
13297
   else
 
13298
@@ -485,8 +483,7 @@
 
13299
       retarray->offset = 0;
 
13300
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13301
 
 
13302
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13303
-                  * extent[rank-1];
 
13304
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13305
 
 
13306
       if (alloc_size == 0)
 
13307
        {
 
13308
@@ -495,7 +492,7 @@
 
13309
          return;
 
13310
        }
 
13311
       else
 
13312
-       retarray->base_addr = xmalloc (alloc_size);
 
13313
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13314
     }
 
13315
   else
 
13316
     {
 
13317
Index: libgfortran/generated/matmul_l16.c
 
13318
===================================================================
 
13319
--- a/src/libgfortran/generated/matmul_l16.c    (.../tags/gcc_4_8_3_release)
 
13320
+++ b/src/libgfortran/generated/matmul_l16.c    (.../branches/gcc-4_8-branch)
 
13321
@@ -88,7 +88,7 @@
 
13322
         }
 
13323
           
 
13324
       retarray->base_addr
 
13325
-       = xmalloc (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
 
13326
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_16));
 
13327
       retarray->offset = 0;
 
13328
     }
 
13329
     else if (unlikely (compile_options.bounds_check))
 
13330
Index: libgfortran/generated/maxloc1_8_i1.c
 
13331
===================================================================
 
13332
--- a/src/libgfortran/generated/maxloc1_8_i1.c  (.../tags/gcc_4_8_3_release)
 
13333
+++ b/src/libgfortran/generated/maxloc1_8_i1.c  (.../branches/gcc-4_8-branch)
 
13334
@@ -98,10 +98,9 @@
 
13335
       retarray->offset = 0;
 
13336
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13337
 
 
13338
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13339
-                  * extent[rank-1];
 
13340
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13341
 
 
13342
-      retarray->base_addr = xmalloc (alloc_size);
 
13343
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13344
       if (alloc_size == 0)
 
13345
        {
 
13346
          /* Make sure we have a zero-sized array.  */
 
13347
@@ -294,8 +293,7 @@
 
13348
 
 
13349
        }
 
13350
 
 
13351
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13352
-                  * extent[rank-1];
 
13353
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13354
 
 
13355
       retarray->offset = 0;
 
13356
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13357
@@ -307,7 +305,7 @@
 
13358
          return;
 
13359
        }
 
13360
       else
 
13361
-       retarray->base_addr = xmalloc (alloc_size);
 
13362
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13363
 
 
13364
     }
 
13365
   else
 
13366
@@ -485,8 +483,7 @@
 
13367
       retarray->offset = 0;
 
13368
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13369
 
 
13370
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13371
-                  * extent[rank-1];
 
13372
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13373
 
 
13374
       if (alloc_size == 0)
 
13375
        {
 
13376
@@ -495,7 +492,7 @@
 
13377
          return;
 
13378
        }
 
13379
       else
 
13380
-       retarray->base_addr = xmalloc (alloc_size);
 
13381
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13382
     }
 
13383
   else
 
13384
     {
 
13385
Index: libgfortran/generated/minloc1_8_i8.c
 
13386
===================================================================
 
13387
--- a/src/libgfortran/generated/minloc1_8_i8.c  (.../tags/gcc_4_8_3_release)
 
13388
+++ b/src/libgfortran/generated/minloc1_8_i8.c  (.../branches/gcc-4_8-branch)
 
13389
@@ -98,10 +98,9 @@
 
13390
       retarray->offset = 0;
 
13391
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13392
 
 
13393
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13394
-                  * extent[rank-1];
 
13395
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13396
 
 
13397
-      retarray->base_addr = xmalloc (alloc_size);
 
13398
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13399
       if (alloc_size == 0)
 
13400
        {
 
13401
          /* Make sure we have a zero-sized array.  */
 
13402
@@ -294,8 +293,7 @@
 
13403
 
 
13404
        }
 
13405
 
 
13406
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13407
-                  * extent[rank-1];
 
13408
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13409
 
 
13410
       retarray->offset = 0;
 
13411
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13412
@@ -307,7 +305,7 @@
 
13413
          return;
 
13414
        }
 
13415
       else
 
13416
-       retarray->base_addr = xmalloc (alloc_size);
 
13417
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13418
 
 
13419
     }
 
13420
   else
 
13421
@@ -485,8 +483,7 @@
 
13422
       retarray->offset = 0;
 
13423
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13424
 
 
13425
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13426
-                  * extent[rank-1];
 
13427
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13428
 
 
13429
       if (alloc_size == 0)
 
13430
        {
 
13431
@@ -495,7 +492,7 @@
 
13432
          return;
 
13433
        }
 
13434
       else
 
13435
-       retarray->base_addr = xmalloc (alloc_size);
 
13436
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13437
     }
 
13438
   else
 
13439
     {
 
13440
Index: libgfortran/generated/minloc0_4_r8.c
 
13441
===================================================================
 
13442
--- a/src/libgfortran/generated/minloc0_4_r8.c  (.../tags/gcc_4_8_3_release)
 
13443
+++ b/src/libgfortran/generated/minloc0_4_r8.c  (.../branches/gcc-4_8-branch)
 
13444
@@ -58,7 +58,7 @@
 
13445
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13446
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13447
       retarray->offset = 0;
 
13448
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
13449
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
13450
     }
 
13451
   else
 
13452
     {
 
13453
@@ -199,7 +199,7 @@
 
13454
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
13455
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13456
       retarray->offset = 0;
 
13457
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
13458
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
13459
     }
 
13460
   else
 
13461
     {
 
13462
@@ -367,7 +367,7 @@
 
13463
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
13464
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
13465
       retarray->offset = 0;
 
13466
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
13467
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
13468
     }
 
13469
   else if (unlikely (compile_options.bounds_check))
 
13470
     {
 
13471
Index: libgfortran/generated/product_r16.c
 
13472
===================================================================
 
13473
--- a/src/libgfortran/generated/product_r16.c   (.../tags/gcc_4_8_3_release)
 
13474
+++ b/src/libgfortran/generated/product_r16.c   (.../branches/gcc-4_8-branch)
 
13475
@@ -97,10 +97,9 @@
 
13476
       retarray->offset = 0;
 
13477
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13478
 
 
13479
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13480
-                  * extent[rank-1];
 
13481
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13482
 
 
13483
-      retarray->base_addr = xmalloc (alloc_size);
 
13484
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
13485
       if (alloc_size == 0)
 
13486
        {
 
13487
          /* Make sure we have a zero-sized array.  */
 
13488
@@ -272,8 +271,7 @@
 
13489
 
 
13490
        }
 
13491
 
 
13492
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13493
-                  * extent[rank-1];
 
13494
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13495
 
 
13496
       retarray->offset = 0;
 
13497
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13498
@@ -285,7 +283,7 @@
 
13499
          return;
 
13500
        }
 
13501
       else
 
13502
-       retarray->base_addr = xmalloc (alloc_size);
 
13503
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
13504
 
 
13505
     }
 
13506
   else
 
13507
@@ -430,8 +428,7 @@
 
13508
       retarray->offset = 0;
 
13509
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13510
 
 
13511
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13512
-                  * extent[rank-1];
 
13513
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13514
 
 
13515
       if (alloc_size == 0)
 
13516
        {
 
13517
@@ -440,7 +437,7 @@
 
13518
          return;
 
13519
        }
 
13520
       else
 
13521
-       retarray->base_addr = xmalloc (alloc_size);
 
13522
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
13523
     }
 
13524
   else
 
13525
     {
 
13526
Index: libgfortran/generated/sum_r8.c
 
13527
===================================================================
 
13528
--- a/src/libgfortran/generated/sum_r8.c        (.../tags/gcc_4_8_3_release)
 
13529
+++ b/src/libgfortran/generated/sum_r8.c        (.../branches/gcc-4_8-branch)
 
13530
@@ -97,10 +97,9 @@
 
13531
       retarray->offset = 0;
 
13532
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13533
 
 
13534
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13535
-                  * extent[rank-1];
 
13536
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13537
 
 
13538
-      retarray->base_addr = xmalloc (alloc_size);
 
13539
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
13540
       if (alloc_size == 0)
 
13541
        {
 
13542
          /* Make sure we have a zero-sized array.  */
 
13543
@@ -272,8 +271,7 @@
 
13544
 
 
13545
        }
 
13546
 
 
13547
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13548
-                  * extent[rank-1];
 
13549
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13550
 
 
13551
       retarray->offset = 0;
 
13552
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13553
@@ -285,7 +283,7 @@
 
13554
          return;
 
13555
        }
 
13556
       else
 
13557
-       retarray->base_addr = xmalloc (alloc_size);
 
13558
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
13559
 
 
13560
     }
 
13561
   else
 
13562
@@ -430,8 +428,7 @@
 
13563
       retarray->offset = 0;
 
13564
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13565
 
 
13566
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13567
-                  * extent[rank-1];
 
13568
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13569
 
 
13570
       if (alloc_size == 0)
 
13571
        {
 
13572
@@ -440,7 +437,7 @@
 
13573
          return;
 
13574
        }
 
13575
       else
 
13576
-       retarray->base_addr = xmalloc (alloc_size);
 
13577
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
13578
     }
 
13579
   else
 
13580
     {
 
13581
Index: libgfortran/generated/norm2_r10.c
 
13582
===================================================================
 
13583
--- a/src/libgfortran/generated/norm2_r10.c     (.../tags/gcc_4_8_3_release)
 
13584
+++ b/src/libgfortran/generated/norm2_r10.c     (.../branches/gcc-4_8-branch)
 
13585
@@ -101,10 +101,9 @@
 
13586
       retarray->offset = 0;
 
13587
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13588
 
 
13589
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13590
-                  * extent[rank-1];
 
13591
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13592
 
 
13593
-      retarray->base_addr = xmalloc (alloc_size);
 
13594
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
13595
       if (alloc_size == 0)
 
13596
        {
 
13597
          /* Make sure we have a zero-sized array.  */
 
13598
Index: libgfortran/generated/unpack_c10.c
 
13599
===================================================================
 
13600
--- a/src/libgfortran/generated/unpack_c10.c    (.../tags/gcc_4_8_3_release)
 
13601
+++ b/src/libgfortran/generated/unpack_c10.c    (.../branches/gcc-4_8-branch)
 
13602
@@ -99,7 +99,7 @@
 
13603
          rs *= extent[n];
 
13604
        }
 
13605
       ret->offset = 0;
 
13606
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
 
13607
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
 
13608
     }
 
13609
   else
 
13610
     {
 
13611
@@ -244,7 +244,7 @@
 
13612
          rs *= extent[n];
 
13613
        }
 
13614
       ret->offset = 0;
 
13615
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
 
13616
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
 
13617
     }
 
13618
   else
 
13619
     {
 
13620
Index: libgfortran/generated/spread_r8.c
 
13621
===================================================================
 
13622
--- a/src/libgfortran/generated/spread_r8.c     (.../tags/gcc_4_8_3_release)
 
13623
+++ b/src/libgfortran/generated/spread_r8.c     (.../branches/gcc-4_8-branch)
 
13624
@@ -101,8 +101,8 @@
 
13625
        }
 
13626
       ret->offset = 0;
 
13627
 
 
13628
-      /* xmalloc allocates a single byte for zero size.  */
 
13629
-      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
 
13630
+      /* xmallocarray allocates a single byte for zero size.  */
 
13631
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
 
13632
       if (rs <= 0)
 
13633
         return;
 
13634
     }
 
13635
@@ -244,7 +244,7 @@
 
13636
 
 
13637
   if (ret->base_addr == NULL)
 
13638
     {
 
13639
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
 
13640
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
 
13641
       ret->offset = 0;
 
13642
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
13643
     }
 
13644
Index: libgfortran/generated/minloc1_16_i16.c
 
13645
===================================================================
 
13646
--- a/src/libgfortran/generated/minloc1_16_i16.c        (.../tags/gcc_4_8_3_release)
 
13647
+++ b/src/libgfortran/generated/minloc1_16_i16.c        (.../branches/gcc-4_8-branch)
 
13648
@@ -98,10 +98,9 @@
 
13649
       retarray->offset = 0;
 
13650
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13651
 
 
13652
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13653
-                  * extent[rank-1];
 
13654
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13655
 
 
13656
-      retarray->base_addr = xmalloc (alloc_size);
 
13657
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13658
       if (alloc_size == 0)
 
13659
        {
 
13660
          /* Make sure we have a zero-sized array.  */
 
13661
@@ -294,8 +293,7 @@
 
13662
 
 
13663
        }
 
13664
 
 
13665
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13666
-                  * extent[rank-1];
 
13667
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13668
 
 
13669
       retarray->offset = 0;
 
13670
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13671
@@ -307,7 +305,7 @@
 
13672
          return;
 
13673
        }
 
13674
       else
 
13675
-       retarray->base_addr = xmalloc (alloc_size);
 
13676
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13677
 
 
13678
     }
 
13679
   else
 
13680
@@ -485,8 +483,7 @@
 
13681
       retarray->offset = 0;
 
13682
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13683
 
 
13684
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13685
-                  * extent[rank-1];
 
13686
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13687
 
 
13688
       if (alloc_size == 0)
 
13689
        {
 
13690
@@ -495,7 +492,7 @@
 
13691
          return;
 
13692
        }
 
13693
       else
 
13694
-       retarray->base_addr = xmalloc (alloc_size);
 
13695
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13696
     }
 
13697
   else
 
13698
     {
 
13699
Index: libgfortran/generated/maxloc1_8_r4.c
 
13700
===================================================================
 
13701
--- a/src/libgfortran/generated/maxloc1_8_r4.c  (.../tags/gcc_4_8_3_release)
 
13702
+++ b/src/libgfortran/generated/maxloc1_8_r4.c  (.../branches/gcc-4_8-branch)
 
13703
@@ -98,10 +98,9 @@
 
13704
       retarray->offset = 0;
 
13705
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13706
 
 
13707
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13708
-                  * extent[rank-1];
 
13709
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13710
 
 
13711
-      retarray->base_addr = xmalloc (alloc_size);
 
13712
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13713
       if (alloc_size == 0)
 
13714
        {
 
13715
          /* Make sure we have a zero-sized array.  */
 
13716
@@ -294,8 +293,7 @@
 
13717
 
 
13718
        }
 
13719
 
 
13720
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13721
-                  * extent[rank-1];
 
13722
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13723
 
 
13724
       retarray->offset = 0;
 
13725
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13726
@@ -307,7 +305,7 @@
 
13727
          return;
 
13728
        }
 
13729
       else
 
13730
-       retarray->base_addr = xmalloc (alloc_size);
 
13731
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13732
 
 
13733
     }
 
13734
   else
 
13735
@@ -485,8 +483,7 @@
 
13736
       retarray->offset = 0;
 
13737
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13738
 
 
13739
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13740
-                  * extent[rank-1];
 
13741
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13742
 
 
13743
       if (alloc_size == 0)
 
13744
        {
 
13745
@@ -495,7 +492,7 @@
 
13746
          return;
 
13747
        }
 
13748
       else
 
13749
-       retarray->base_addr = xmalloc (alloc_size);
 
13750
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13751
     }
 
13752
   else
 
13753
     {
 
13754
Index: libgfortran/generated/minloc1_16_i1.c
 
13755
===================================================================
 
13756
--- a/src/libgfortran/generated/minloc1_16_i1.c (.../tags/gcc_4_8_3_release)
 
13757
+++ b/src/libgfortran/generated/minloc1_16_i1.c (.../branches/gcc-4_8-branch)
 
13758
@@ -98,10 +98,9 @@
 
13759
       retarray->offset = 0;
 
13760
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13761
 
 
13762
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13763
-                  * extent[rank-1];
 
13764
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13765
 
 
13766
-      retarray->base_addr = xmalloc (alloc_size);
 
13767
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13768
       if (alloc_size == 0)
 
13769
        {
 
13770
          /* Make sure we have a zero-sized array.  */
 
13771
@@ -294,8 +293,7 @@
 
13772
 
 
13773
        }
 
13774
 
 
13775
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13776
-                  * extent[rank-1];
 
13777
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13778
 
 
13779
       retarray->offset = 0;
 
13780
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13781
@@ -307,7 +305,7 @@
 
13782
          return;
 
13783
        }
 
13784
       else
 
13785
-       retarray->base_addr = xmalloc (alloc_size);
 
13786
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13787
 
 
13788
     }
 
13789
   else
 
13790
@@ -485,8 +483,7 @@
 
13791
       retarray->offset = 0;
 
13792
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13793
 
 
13794
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13795
-                  * extent[rank-1];
 
13796
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13797
 
 
13798
       if (alloc_size == 0)
 
13799
        {
 
13800
@@ -495,7 +492,7 @@
 
13801
          return;
 
13802
        }
 
13803
       else
 
13804
-       retarray->base_addr = xmalloc (alloc_size);
 
13805
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
13806
     }
 
13807
   else
 
13808
     {
 
13809
Index: libgfortran/generated/spread_r16.c
 
13810
===================================================================
 
13811
--- a/src/libgfortran/generated/spread_r16.c    (.../tags/gcc_4_8_3_release)
 
13812
+++ b/src/libgfortran/generated/spread_r16.c    (.../branches/gcc-4_8-branch)
 
13813
@@ -101,8 +101,8 @@
 
13814
        }
 
13815
       ret->offset = 0;
 
13816
 
 
13817
-      /* xmalloc allocates a single byte for zero size.  */
 
13818
-      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_16));
 
13819
+      /* xmallocarray allocates a single byte for zero size.  */
 
13820
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_16));
 
13821
       if (rs <= 0)
 
13822
         return;
 
13823
     }
 
13824
@@ -244,7 +244,7 @@
 
13825
 
 
13826
   if (ret->base_addr == NULL)
 
13827
     {
 
13828
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_16));
 
13829
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_16));
 
13830
       ret->offset = 0;
 
13831
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
13832
     }
 
13833
Index: libgfortran/generated/pack_c8.c
 
13834
===================================================================
 
13835
--- a/src/libgfortran/generated/pack_c8.c       (.../tags/gcc_4_8_3_release)
 
13836
+++ b/src/libgfortran/generated/pack_c8.c       (.../branches/gcc-4_8-branch)
 
13837
@@ -167,8 +167,8 @@
 
13838
 
 
13839
          ret->offset = 0;
 
13840
 
 
13841
-         /* xmalloc allocates a single byte for zero size.  */
 
13842
-         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * total);
 
13843
+         /* xmallocarray allocates a single byte for zero size.  */
 
13844
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_8));
 
13845
 
 
13846
          if (total == 0)
 
13847
            return;
 
13848
Index: libgfortran/generated/minval_r10.c
 
13849
===================================================================
 
13850
--- a/src/libgfortran/generated/minval_r10.c    (.../tags/gcc_4_8_3_release)
 
13851
+++ b/src/libgfortran/generated/minval_r10.c    (.../branches/gcc-4_8-branch)
 
13852
@@ -97,10 +97,9 @@
 
13853
       retarray->offset = 0;
 
13854
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13855
 
 
13856
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13857
-                  * extent[rank-1];
 
13858
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13859
 
 
13860
-      retarray->base_addr = xmalloc (alloc_size);
 
13861
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
13862
       if (alloc_size == 0)
 
13863
        {
 
13864
          /* Make sure we have a zero-sized array.  */
 
13865
@@ -286,8 +285,7 @@
 
13866
 
 
13867
        }
 
13868
 
 
13869
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13870
-                  * extent[rank-1];
 
13871
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13872
 
 
13873
       retarray->offset = 0;
 
13874
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13875
@@ -299,7 +297,7 @@
 
13876
          return;
 
13877
        }
 
13878
       else
 
13879
-       retarray->base_addr = xmalloc (alloc_size);
 
13880
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
13881
 
 
13882
     }
 
13883
   else
 
13884
@@ -472,8 +470,7 @@
 
13885
       retarray->offset = 0;
 
13886
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13887
 
 
13888
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13889
-                  * extent[rank-1];
 
13890
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13891
 
 
13892
       if (alloc_size == 0)
 
13893
        {
 
13894
@@ -482,7 +479,7 @@
 
13895
          return;
 
13896
        }
 
13897
       else
 
13898
-       retarray->base_addr = xmalloc (alloc_size);
 
13899
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
13900
     }
 
13901
   else
 
13902
     {
 
13903
Index: libgfortran/generated/parity_l8.c
 
13904
===================================================================
 
13905
--- a/src/libgfortran/generated/parity_l8.c     (.../tags/gcc_4_8_3_release)
 
13906
+++ b/src/libgfortran/generated/parity_l8.c     (.../branches/gcc-4_8-branch)
 
13907
@@ -98,10 +98,9 @@
 
13908
       retarray->offset = 0;
 
13909
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13910
 
 
13911
-      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13912
-                  * extent[rank-1];
 
13913
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13914
 
 
13915
-      retarray->base_addr = xmalloc (alloc_size);
 
13916
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
 
13917
       if (alloc_size == 0)
 
13918
        {
 
13919
          /* Make sure we have a zero-sized array.  */
 
13920
Index: libgfortran/generated/minval_i4.c
 
13921
===================================================================
 
13922
--- a/src/libgfortran/generated/minval_i4.c     (.../tags/gcc_4_8_3_release)
 
13923
+++ b/src/libgfortran/generated/minval_i4.c     (.../branches/gcc-4_8-branch)
 
13924
@@ -97,10 +97,9 @@
 
13925
       retarray->offset = 0;
 
13926
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13927
 
 
13928
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13929
-                  * extent[rank-1];
 
13930
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13931
 
 
13932
-      retarray->base_addr = xmalloc (alloc_size);
 
13933
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13934
       if (alloc_size == 0)
 
13935
        {
 
13936
          /* Make sure we have a zero-sized array.  */
 
13937
@@ -286,8 +285,7 @@
 
13938
 
 
13939
        }
 
13940
 
 
13941
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13942
-                  * extent[rank-1];
 
13943
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13944
 
 
13945
       retarray->offset = 0;
 
13946
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13947
@@ -299,7 +297,7 @@
 
13948
          return;
 
13949
        }
 
13950
       else
 
13951
-       retarray->base_addr = xmalloc (alloc_size);
 
13952
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13953
 
 
13954
     }
 
13955
   else
 
13956
@@ -472,8 +470,7 @@
 
13957
       retarray->offset = 0;
 
13958
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13959
 
 
13960
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13961
-                  * extent[rank-1];
 
13962
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13963
 
 
13964
       if (alloc_size == 0)
 
13965
        {
 
13966
@@ -482,7 +479,7 @@
 
13967
          return;
 
13968
        }
 
13969
       else
 
13970
-       retarray->base_addr = xmalloc (alloc_size);
 
13971
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
13972
     }
 
13973
   else
 
13974
     {
 
13975
Index: libgfortran/generated/maxloc1_8_i2.c
 
13976
===================================================================
 
13977
--- a/src/libgfortran/generated/maxloc1_8_i2.c  (.../tags/gcc_4_8_3_release)
 
13978
+++ b/src/libgfortran/generated/maxloc1_8_i2.c  (.../branches/gcc-4_8-branch)
 
13979
@@ -98,10 +98,9 @@
 
13980
       retarray->offset = 0;
 
13981
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
13982
 
 
13983
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13984
-                  * extent[rank-1];
 
13985
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13986
 
 
13987
-      retarray->base_addr = xmalloc (alloc_size);
 
13988
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
13989
       if (alloc_size == 0)
 
13990
        {
 
13991
          /* Make sure we have a zero-sized array.  */
 
13992
@@ -294,8 +293,7 @@
 
13993
 
 
13994
        }
 
13995
 
 
13996
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
13997
-                  * extent[rank-1];
 
13998
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
13999
 
 
14000
       retarray->offset = 0;
 
14001
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14002
@@ -307,7 +305,7 @@
 
14003
          return;
 
14004
        }
 
14005
       else
 
14006
-       retarray->base_addr = xmalloc (alloc_size);
 
14007
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14008
 
 
14009
     }
 
14010
   else
 
14011
@@ -485,8 +483,7 @@
 
14012
       retarray->offset = 0;
 
14013
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14014
 
 
14015
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14016
-                  * extent[rank-1];
 
14017
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14018
 
 
14019
       if (alloc_size == 0)
 
14020
        {
 
14021
@@ -495,7 +492,7 @@
 
14022
          return;
 
14023
        }
 
14024
       else
 
14025
-       retarray->base_addr = xmalloc (alloc_size);
 
14026
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14027
     }
 
14028
   else
 
14029
     {
 
14030
Index: libgfortran/generated/any_l8.c
 
14031
===================================================================
 
14032
--- a/src/libgfortran/generated/any_l8.c        (.../tags/gcc_4_8_3_release)
 
14033
+++ b/src/libgfortran/generated/any_l8.c        (.../branches/gcc-4_8-branch)
 
14034
@@ -101,8 +101,7 @@
 
14035
       retarray->offset = 0;
 
14036
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14037
 
 
14038
-      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14039
-                  * extent[rank-1];
 
14040
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14041
 
 
14042
       if (alloc_size == 0)
 
14043
        {
 
14044
@@ -111,7 +110,7 @@
 
14045
          return;
 
14046
        }
 
14047
       else
 
14048
-       retarray->base_addr = xmalloc (alloc_size);
 
14049
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
 
14050
     }
 
14051
   else
 
14052
     {
 
14053
Index: libgfortran/generated/maxloc0_16_r10.c
 
14054
===================================================================
 
14055
--- a/src/libgfortran/generated/maxloc0_16_r10.c        (.../tags/gcc_4_8_3_release)
 
14056
+++ b/src/libgfortran/generated/maxloc0_16_r10.c        (.../branches/gcc-4_8-branch)
 
14057
@@ -58,7 +58,7 @@
 
14058
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14059
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14060
       retarray->offset = 0;
 
14061
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14062
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14063
     }
 
14064
   else
 
14065
     {
 
14066
@@ -199,7 +199,7 @@
 
14067
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14068
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14069
       retarray->offset = 0;
 
14070
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14071
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14072
     }
 
14073
   else
 
14074
     {
 
14075
@@ -367,7 +367,7 @@
 
14076
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14077
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14078
       retarray->offset = 0;
 
14079
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14080
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14081
     }
 
14082
   else if (unlikely (compile_options.bounds_check))
 
14083
     {
 
14084
Index: libgfortran/generated/minloc0_4_i16.c
 
14085
===================================================================
 
14086
--- a/src/libgfortran/generated/minloc0_4_i16.c (.../tags/gcc_4_8_3_release)
 
14087
+++ b/src/libgfortran/generated/minloc0_4_i16.c (.../branches/gcc-4_8-branch)
 
14088
@@ -58,7 +58,7 @@
 
14089
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14090
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14091
       retarray->offset = 0;
 
14092
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14093
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14094
     }
 
14095
   else
 
14096
     {
 
14097
@@ -199,7 +199,7 @@
 
14098
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14099
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14100
       retarray->offset = 0;
 
14101
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14102
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14103
     }
 
14104
   else
 
14105
     {
 
14106
@@ -367,7 +367,7 @@
 
14107
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14108
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14109
       retarray->offset = 0;
 
14110
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14111
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14112
     }
 
14113
   else if (unlikely (compile_options.bounds_check))
 
14114
     {
 
14115
Index: libgfortran/generated/maxloc0_8_r8.c
 
14116
===================================================================
 
14117
--- a/src/libgfortran/generated/maxloc0_8_r8.c  (.../tags/gcc_4_8_3_release)
 
14118
+++ b/src/libgfortran/generated/maxloc0_8_r8.c  (.../branches/gcc-4_8-branch)
 
14119
@@ -58,7 +58,7 @@
 
14120
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14121
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14122
       retarray->offset = 0;
 
14123
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14124
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14125
     }
 
14126
   else
 
14127
     {
 
14128
@@ -199,7 +199,7 @@
 
14129
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14130
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14131
       retarray->offset = 0;
 
14132
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14133
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14134
     }
 
14135
   else
 
14136
     {
 
14137
@@ -367,7 +367,7 @@
 
14138
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14139
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14140
       retarray->offset = 0;
 
14141
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14142
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14143
     }
 
14144
   else if (unlikely (compile_options.bounds_check))
 
14145
     {
 
14146
Index: libgfortran/generated/minloc1_4_r10.c
 
14147
===================================================================
 
14148
--- a/src/libgfortran/generated/minloc1_4_r10.c (.../tags/gcc_4_8_3_release)
 
14149
+++ b/src/libgfortran/generated/minloc1_4_r10.c (.../branches/gcc-4_8-branch)
 
14150
@@ -98,10 +98,9 @@
 
14151
       retarray->offset = 0;
 
14152
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14153
 
 
14154
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14155
-                  * extent[rank-1];
 
14156
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14157
 
 
14158
-      retarray->base_addr = xmalloc (alloc_size);
 
14159
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14160
       if (alloc_size == 0)
 
14161
        {
 
14162
          /* Make sure we have a zero-sized array.  */
 
14163
@@ -294,8 +293,7 @@
 
14164
 
 
14165
        }
 
14166
 
 
14167
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14168
-                  * extent[rank-1];
 
14169
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14170
 
 
14171
       retarray->offset = 0;
 
14172
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14173
@@ -307,7 +305,7 @@
 
14174
          return;
 
14175
        }
 
14176
       else
 
14177
-       retarray->base_addr = xmalloc (alloc_size);
 
14178
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14179
 
 
14180
     }
 
14181
   else
 
14182
@@ -485,8 +483,7 @@
 
14183
       retarray->offset = 0;
 
14184
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14185
 
 
14186
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14187
-                  * extent[rank-1];
 
14188
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14189
 
 
14190
       if (alloc_size == 0)
 
14191
        {
 
14192
@@ -495,7 +492,7 @@
 
14193
          return;
 
14194
        }
 
14195
       else
 
14196
-       retarray->base_addr = xmalloc (alloc_size);
 
14197
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14198
     }
 
14199
   else
 
14200
     {
 
14201
Index: libgfortran/generated/minloc1_8_i16.c
 
14202
===================================================================
 
14203
--- a/src/libgfortran/generated/minloc1_8_i16.c (.../tags/gcc_4_8_3_release)
 
14204
+++ b/src/libgfortran/generated/minloc1_8_i16.c (.../branches/gcc-4_8-branch)
 
14205
@@ -98,10 +98,9 @@
 
14206
       retarray->offset = 0;
 
14207
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14208
 
 
14209
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14210
-                  * extent[rank-1];
 
14211
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14212
 
 
14213
-      retarray->base_addr = xmalloc (alloc_size);
 
14214
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14215
       if (alloc_size == 0)
 
14216
        {
 
14217
          /* Make sure we have a zero-sized array.  */
 
14218
@@ -294,8 +293,7 @@
 
14219
 
 
14220
        }
 
14221
 
 
14222
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14223
-                  * extent[rank-1];
 
14224
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14225
 
 
14226
       retarray->offset = 0;
 
14227
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14228
@@ -307,7 +305,7 @@
 
14229
          return;
 
14230
        }
 
14231
       else
 
14232
-       retarray->base_addr = xmalloc (alloc_size);
 
14233
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14234
 
 
14235
     }
 
14236
   else
 
14237
@@ -485,8 +483,7 @@
 
14238
       retarray->offset = 0;
 
14239
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14240
 
 
14241
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14242
-                  * extent[rank-1];
 
14243
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14244
 
 
14245
       if (alloc_size == 0)
 
14246
        {
 
14247
@@ -495,7 +492,7 @@
 
14248
          return;
 
14249
        }
 
14250
       else
 
14251
-       retarray->base_addr = xmalloc (alloc_size);
 
14252
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14253
     }
 
14254
   else
 
14255
     {
 
14256
Index: libgfortran/generated/maxloc0_8_r10.c
 
14257
===================================================================
 
14258
--- a/src/libgfortran/generated/maxloc0_8_r10.c (.../tags/gcc_4_8_3_release)
 
14259
+++ b/src/libgfortran/generated/maxloc0_8_r10.c (.../branches/gcc-4_8-branch)
 
14260
@@ -58,7 +58,7 @@
 
14261
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14262
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14263
       retarray->offset = 0;
 
14264
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14265
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14266
     }
 
14267
   else
 
14268
     {
 
14269
@@ -199,7 +199,7 @@
 
14270
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14271
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14272
       retarray->offset = 0;
 
14273
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14274
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14275
     }
 
14276
   else
 
14277
     {
 
14278
@@ -367,7 +367,7 @@
 
14279
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14280
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14281
       retarray->offset = 0;
 
14282
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
14283
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
14284
     }
 
14285
   else if (unlikely (compile_options.bounds_check))
 
14286
     {
 
14287
Index: libgfortran/generated/unpack_i4.c
 
14288
===================================================================
 
14289
--- a/src/libgfortran/generated/unpack_i4.c     (.../tags/gcc_4_8_3_release)
 
14290
+++ b/src/libgfortran/generated/unpack_i4.c     (.../branches/gcc-4_8-branch)
 
14291
@@ -99,7 +99,7 @@
 
14292
          rs *= extent[n];
 
14293
        }
 
14294
       ret->offset = 0;
 
14295
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
 
14296
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
 
14297
     }
 
14298
   else
 
14299
     {
 
14300
@@ -244,7 +244,7 @@
 
14301
          rs *= extent[n];
 
14302
        }
 
14303
       ret->offset = 0;
 
14304
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
 
14305
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
 
14306
     }
 
14307
   else
 
14308
     {
 
14309
Index: libgfortran/generated/minloc1_16_r4.c
 
14310
===================================================================
 
14311
--- a/src/libgfortran/generated/minloc1_16_r4.c (.../tags/gcc_4_8_3_release)
 
14312
+++ b/src/libgfortran/generated/minloc1_16_r4.c (.../branches/gcc-4_8-branch)
 
14313
@@ -98,10 +98,9 @@
 
14314
       retarray->offset = 0;
 
14315
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14316
 
 
14317
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14318
-                  * extent[rank-1];
 
14319
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14320
 
 
14321
-      retarray->base_addr = xmalloc (alloc_size);
 
14322
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14323
       if (alloc_size == 0)
 
14324
        {
 
14325
          /* Make sure we have a zero-sized array.  */
 
14326
@@ -294,8 +293,7 @@
 
14327
 
 
14328
        }
 
14329
 
 
14330
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14331
-                  * extent[rank-1];
 
14332
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14333
 
 
14334
       retarray->offset = 0;
 
14335
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14336
@@ -307,7 +305,7 @@
 
14337
          return;
 
14338
        }
 
14339
       else
 
14340
-       retarray->base_addr = xmalloc (alloc_size);
 
14341
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14342
 
 
14343
     }
 
14344
   else
 
14345
@@ -485,8 +483,7 @@
 
14346
       retarray->offset = 0;
 
14347
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14348
 
 
14349
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14350
-                  * extent[rank-1];
 
14351
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14352
 
 
14353
       if (alloc_size == 0)
 
14354
        {
 
14355
@@ -495,7 +492,7 @@
 
14356
          return;
 
14357
        }
 
14358
       else
 
14359
-       retarray->base_addr = xmalloc (alloc_size);
 
14360
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14361
     }
 
14362
   else
 
14363
     {
 
14364
Index: libgfortran/generated/product_i8.c
 
14365
===================================================================
 
14366
--- a/src/libgfortran/generated/product_i8.c    (.../tags/gcc_4_8_3_release)
 
14367
+++ b/src/libgfortran/generated/product_i8.c    (.../branches/gcc-4_8-branch)
 
14368
@@ -97,10 +97,9 @@
 
14369
       retarray->offset = 0;
 
14370
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14371
 
 
14372
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14373
-                  * extent[rank-1];
 
14374
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14375
 
 
14376
-      retarray->base_addr = xmalloc (alloc_size);
 
14377
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14378
       if (alloc_size == 0)
 
14379
        {
 
14380
          /* Make sure we have a zero-sized array.  */
 
14381
@@ -272,8 +271,7 @@
 
14382
 
 
14383
        }
 
14384
 
 
14385
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14386
-                  * extent[rank-1];
 
14387
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14388
 
 
14389
       retarray->offset = 0;
 
14390
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14391
@@ -285,7 +283,7 @@
 
14392
          return;
 
14393
        }
 
14394
       else
 
14395
-       retarray->base_addr = xmalloc (alloc_size);
 
14396
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14397
 
 
14398
     }
 
14399
   else
 
14400
@@ -430,8 +428,7 @@
 
14401
       retarray->offset = 0;
 
14402
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14403
 
 
14404
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14405
-                  * extent[rank-1];
 
14406
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14407
 
 
14408
       if (alloc_size == 0)
 
14409
        {
 
14410
@@ -440,7 +437,7 @@
 
14411
          return;
 
14412
        }
 
14413
       else
 
14414
-       retarray->base_addr = xmalloc (alloc_size);
 
14415
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14416
     }
 
14417
   else
 
14418
     {
 
14419
Index: libgfortran/generated/minloc0_16_r8.c
 
14420
===================================================================
 
14421
--- a/src/libgfortran/generated/minloc0_16_r8.c (.../tags/gcc_4_8_3_release)
 
14422
+++ b/src/libgfortran/generated/minloc0_16_r8.c (.../branches/gcc-4_8-branch)
 
14423
@@ -58,7 +58,7 @@
 
14424
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14425
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14426
       retarray->offset = 0;
 
14427
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14428
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14429
     }
 
14430
   else
 
14431
     {
 
14432
@@ -199,7 +199,7 @@
 
14433
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14434
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14435
       retarray->offset = 0;
 
14436
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14437
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14438
     }
 
14439
   else
 
14440
     {
 
14441
@@ -367,7 +367,7 @@
 
14442
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14443
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14444
       retarray->offset = 0;
 
14445
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
14446
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
14447
     }
 
14448
   else if (unlikely (compile_options.bounds_check))
 
14449
     {
 
14450
Index: libgfortran/generated/count_2_l.c
 
14451
===================================================================
 
14452
--- a/src/libgfortran/generated/count_2_l.c     (.../tags/gcc_4_8_3_release)
 
14453
+++ b/src/libgfortran/generated/count_2_l.c     (.../branches/gcc-4_8-branch)
 
14454
@@ -101,8 +101,7 @@
 
14455
       retarray->offset = 0;
 
14456
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14457
 
 
14458
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14459
-                  * extent[rank-1];
 
14460
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14461
 
 
14462
       if (alloc_size == 0)
 
14463
        {
 
14464
@@ -111,7 +110,7 @@
 
14465
          return;
 
14466
        }
 
14467
       else
 
14468
-       retarray->base_addr = xmalloc (alloc_size);
 
14469
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
14470
     }
 
14471
   else
 
14472
     {
 
14473
Index: libgfortran/generated/transpose_r8.c
 
14474
===================================================================
 
14475
--- a/src/libgfortran/generated/transpose_r8.c  (.../tags/gcc_4_8_3_release)
 
14476
+++ b/src/libgfortran/generated/transpose_r8.c  (.../branches/gcc-4_8-branch)
 
14477
@@ -60,7 +60,8 @@
 
14478
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
14479
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
14480
 
 
14481
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
 
14482
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
14483
+                                     sizeof (GFC_REAL_8));
 
14484
       ret->offset = 0;
 
14485
     } else if (unlikely (compile_options.bounds_check))
 
14486
     {
 
14487
Index: libgfortran/generated/cshift1_8.c
 
14488
===================================================================
 
14489
--- a/src/libgfortran/generated/cshift1_8.c     (.../tags/gcc_4_8_3_release)
 
14490
+++ b/src/libgfortran/generated/cshift1_8.c     (.../branches/gcc-4_8-branch)
 
14491
@@ -80,7 +80,7 @@
 
14492
     {
 
14493
       int i;
 
14494
 
 
14495
-      ret->base_addr = xmalloc (size * arraysize);
 
14496
+      ret->base_addr = xmallocarray (arraysize, size);
 
14497
       ret->offset = 0;
 
14498
       ret->dtype = array->dtype;
 
14499
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
14500
Index: libgfortran/generated/matmul_i4.c
 
14501
===================================================================
 
14502
--- a/src/libgfortran/generated/matmul_i4.c     (.../tags/gcc_4_8_3_release)
 
14503
+++ b/src/libgfortran/generated/matmul_i4.c     (.../branches/gcc-4_8-branch)
 
14504
@@ -124,7 +124,7 @@
 
14505
         }
 
14506
 
 
14507
       retarray->base_addr
 
14508
-       = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
 
14509
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_4));
 
14510
       retarray->offset = 0;
 
14511
     }
 
14512
     else if (unlikely (compile_options.bounds_check))
 
14513
Index: libgfortran/generated/pack_r10.c
 
14514
===================================================================
 
14515
--- a/src/libgfortran/generated/pack_r10.c      (.../tags/gcc_4_8_3_release)
 
14516
+++ b/src/libgfortran/generated/pack_r10.c      (.../branches/gcc-4_8-branch)
 
14517
@@ -167,8 +167,8 @@
 
14518
 
 
14519
          ret->offset = 0;
 
14520
 
 
14521
-         /* xmalloc allocates a single byte for zero size.  */
 
14522
-         ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * total);
 
14523
+         /* xmallocarray allocates a single byte for zero size.  */
 
14524
+         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_10));
 
14525
 
 
14526
          if (total == 0)
 
14527
            return;
 
14528
Index: libgfortran/generated/minloc1_16_i2.c
 
14529
===================================================================
 
14530
--- a/src/libgfortran/generated/minloc1_16_i2.c (.../tags/gcc_4_8_3_release)
 
14531
+++ b/src/libgfortran/generated/minloc1_16_i2.c (.../branches/gcc-4_8-branch)
 
14532
@@ -98,10 +98,9 @@
 
14533
       retarray->offset = 0;
 
14534
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14535
 
 
14536
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14537
-                  * extent[rank-1];
 
14538
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14539
 
 
14540
-      retarray->base_addr = xmalloc (alloc_size);
 
14541
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14542
       if (alloc_size == 0)
 
14543
        {
 
14544
          /* Make sure we have a zero-sized array.  */
 
14545
@@ -294,8 +293,7 @@
 
14546
 
 
14547
        }
 
14548
 
 
14549
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14550
-                  * extent[rank-1];
 
14551
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14552
 
 
14553
       retarray->offset = 0;
 
14554
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14555
@@ -307,7 +305,7 @@
 
14556
          return;
 
14557
        }
 
14558
       else
 
14559
-       retarray->base_addr = xmalloc (alloc_size);
 
14560
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14561
 
 
14562
     }
 
14563
   else
 
14564
@@ -485,8 +483,7 @@
 
14565
       retarray->offset = 0;
 
14566
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14567
 
 
14568
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14569
-                  * extent[rank-1];
 
14570
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14571
 
 
14572
       if (alloc_size == 0)
 
14573
        {
 
14574
@@ -495,7 +492,7 @@
 
14575
          return;
 
14576
        }
 
14577
       else
 
14578
-       retarray->base_addr = xmalloc (alloc_size);
 
14579
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
14580
     }
 
14581
   else
 
14582
     {
 
14583
Index: libgfortran/generated/in_pack_i8.c
 
14584
===================================================================
 
14585
--- a/src/libgfortran/generated/in_pack_i8.c    (.../tags/gcc_4_8_3_release)
 
14586
+++ b/src/libgfortran/generated/in_pack_i8.c    (.../branches/gcc-4_8-branch)
 
14587
@@ -76,7 +76,7 @@
 
14588
     return source->base_addr;
 
14589
 
 
14590
   /* Allocate storage for the destination.  */
 
14591
-  destptr = (GFC_INTEGER_8 *)xmalloc (ssize * sizeof (GFC_INTEGER_8));
 
14592
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_8));
 
14593
   dest = destptr;
 
14594
   src = source->base_addr;
 
14595
   stride0 = stride[0];
 
14596
Index: libgfortran/generated/transpose_r16.c
 
14597
===================================================================
 
14598
--- a/src/libgfortran/generated/transpose_r16.c (.../tags/gcc_4_8_3_release)
 
14599
+++ b/src/libgfortran/generated/transpose_r16.c (.../branches/gcc-4_8-branch)
 
14600
@@ -60,7 +60,8 @@
 
14601
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
14602
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
14603
 
 
14604
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
 
14605
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
14606
+                                     sizeof (GFC_REAL_16));
 
14607
       ret->offset = 0;
 
14608
     } else if (unlikely (compile_options.bounds_check))
 
14609
     {
 
14610
Index: libgfortran/generated/minloc1_4_i4.c
 
14611
===================================================================
 
14612
--- a/src/libgfortran/generated/minloc1_4_i4.c  (.../tags/gcc_4_8_3_release)
 
14613
+++ b/src/libgfortran/generated/minloc1_4_i4.c  (.../branches/gcc-4_8-branch)
 
14614
@@ -98,10 +98,9 @@
 
14615
       retarray->offset = 0;
 
14616
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14617
 
 
14618
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14619
-                  * extent[rank-1];
 
14620
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14621
 
 
14622
-      retarray->base_addr = xmalloc (alloc_size);
 
14623
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14624
       if (alloc_size == 0)
 
14625
        {
 
14626
          /* Make sure we have a zero-sized array.  */
 
14627
@@ -294,8 +293,7 @@
 
14628
 
 
14629
        }
 
14630
 
 
14631
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14632
-                  * extent[rank-1];
 
14633
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14634
 
 
14635
       retarray->offset = 0;
 
14636
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14637
@@ -307,7 +305,7 @@
 
14638
          return;
 
14639
        }
 
14640
       else
 
14641
-       retarray->base_addr = xmalloc (alloc_size);
 
14642
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14643
 
 
14644
     }
 
14645
   else
 
14646
@@ -485,8 +483,7 @@
 
14647
       retarray->offset = 0;
 
14648
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14649
 
 
14650
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14651
-                  * extent[rank-1];
 
14652
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14653
 
 
14654
       if (alloc_size == 0)
 
14655
        {
 
14656
@@ -495,7 +492,7 @@
 
14657
          return;
 
14658
        }
 
14659
       else
 
14660
-       retarray->base_addr = xmalloc (alloc_size);
 
14661
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
14662
     }
 
14663
   else
 
14664
     {
 
14665
Index: libgfortran/generated/maxval_i1.c
 
14666
===================================================================
 
14667
--- a/src/libgfortran/generated/maxval_i1.c     (.../tags/gcc_4_8_3_release)
 
14668
+++ b/src/libgfortran/generated/maxval_i1.c     (.../branches/gcc-4_8-branch)
 
14669
@@ -97,10 +97,9 @@
 
14670
       retarray->offset = 0;
 
14671
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14672
 
 
14673
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14674
-                  * extent[rank-1];
 
14675
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14676
 
 
14677
-      retarray->base_addr = xmalloc (alloc_size);
 
14678
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
14679
       if (alloc_size == 0)
 
14680
        {
 
14681
          /* Make sure we have a zero-sized array.  */
 
14682
@@ -286,8 +285,7 @@
 
14683
 
 
14684
        }
 
14685
 
 
14686
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14687
-                  * extent[rank-1];
 
14688
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14689
 
 
14690
       retarray->offset = 0;
 
14691
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14692
@@ -299,7 +297,7 @@
 
14693
          return;
 
14694
        }
 
14695
       else
 
14696
-       retarray->base_addr = xmalloc (alloc_size);
 
14697
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
14698
 
 
14699
     }
 
14700
   else
 
14701
@@ -472,8 +470,7 @@
 
14702
       retarray->offset = 0;
 
14703
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14704
 
 
14705
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14706
-                  * extent[rank-1];
 
14707
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14708
 
 
14709
       if (alloc_size == 0)
 
14710
        {
 
14711
@@ -482,7 +479,7 @@
 
14712
          return;
 
14713
        }
 
14714
       else
 
14715
-       retarray->base_addr = xmalloc (alloc_size);
 
14716
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
14717
     }
 
14718
   else
 
14719
     {
 
14720
Index: libgfortran/generated/product_c16.c
 
14721
===================================================================
 
14722
--- a/src/libgfortran/generated/product_c16.c   (.../tags/gcc_4_8_3_release)
 
14723
+++ b/src/libgfortran/generated/product_c16.c   (.../branches/gcc-4_8-branch)
 
14724
@@ -97,10 +97,9 @@
 
14725
       retarray->offset = 0;
 
14726
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14727
 
 
14728
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14729
-                  * extent[rank-1];
 
14730
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14731
 
 
14732
-      retarray->base_addr = xmalloc (alloc_size);
 
14733
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
14734
       if (alloc_size == 0)
 
14735
        {
 
14736
          /* Make sure we have a zero-sized array.  */
 
14737
@@ -272,8 +271,7 @@
 
14738
 
 
14739
        }
 
14740
 
 
14741
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14742
-                  * extent[rank-1];
 
14743
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14744
 
 
14745
       retarray->offset = 0;
 
14746
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14747
@@ -285,7 +283,7 @@
 
14748
          return;
 
14749
        }
 
14750
       else
 
14751
-       retarray->base_addr = xmalloc (alloc_size);
 
14752
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
14753
 
 
14754
     }
 
14755
   else
 
14756
@@ -430,8 +428,7 @@
 
14757
       retarray->offset = 0;
 
14758
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14759
 
 
14760
-      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14761
-                  * extent[rank-1];
 
14762
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14763
 
 
14764
       if (alloc_size == 0)
 
14765
        {
 
14766
@@ -440,7 +437,7 @@
 
14767
          return;
 
14768
        }
 
14769
       else
 
14770
-       retarray->base_addr = xmalloc (alloc_size);
 
14771
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
14772
     }
 
14773
   else
 
14774
     {
 
14775
Index: libgfortran/generated/reshape_r4.c
 
14776
===================================================================
 
14777
--- a/src/libgfortran/generated/reshape_r4.c    (.../tags/gcc_4_8_3_release)
 
14778
+++ b/src/libgfortran/generated/reshape_r4.c    (.../branches/gcc-4_8-branch)
 
14779
@@ -111,11 +111,11 @@
 
14780
       ret->offset = 0;
 
14781
 
 
14782
       if (unlikely (rs < 1))
 
14783
-        alloc_size = 1;
 
14784
+        alloc_size = 0;
 
14785
       else
 
14786
-        alloc_size = rs * sizeof (GFC_REAL_4);
 
14787
+        alloc_size = rs;
 
14788
 
 
14789
-      ret->base_addr = xmalloc (alloc_size);
 
14790
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
14791
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
14792
     }
 
14793
 
 
14794
Index: libgfortran/generated/iany_i8.c
 
14795
===================================================================
 
14796
--- a/src/libgfortran/generated/iany_i8.c       (.../tags/gcc_4_8_3_release)
 
14797
+++ b/src/libgfortran/generated/iany_i8.c       (.../branches/gcc-4_8-branch)
 
14798
@@ -97,10 +97,9 @@
 
14799
       retarray->offset = 0;
 
14800
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14801
 
 
14802
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14803
-                  * extent[rank-1];
 
14804
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14805
 
 
14806
-      retarray->base_addr = xmalloc (alloc_size);
 
14807
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14808
       if (alloc_size == 0)
 
14809
        {
 
14810
          /* Make sure we have a zero-sized array.  */
 
14811
@@ -272,8 +271,7 @@
 
14812
 
 
14813
        }
 
14814
 
 
14815
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14816
-                  * extent[rank-1];
 
14817
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14818
 
 
14819
       retarray->offset = 0;
 
14820
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14821
@@ -285,7 +283,7 @@
 
14822
          return;
 
14823
        }
 
14824
       else
 
14825
-       retarray->base_addr = xmalloc (alloc_size);
 
14826
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14827
 
 
14828
     }
 
14829
   else
 
14830
@@ -430,8 +428,7 @@
 
14831
       retarray->offset = 0;
 
14832
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14833
 
 
14834
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14835
-                  * extent[rank-1];
 
14836
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14837
 
 
14838
       if (alloc_size == 0)
 
14839
        {
 
14840
@@ -440,7 +437,7 @@
 
14841
          return;
 
14842
        }
 
14843
       else
 
14844
-       retarray->base_addr = xmalloc (alloc_size);
 
14845
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
14846
     }
 
14847
   else
 
14848
     {
 
14849
Index: libgfortran/generated/cshift1_16.c
 
14850
===================================================================
 
14851
--- a/src/libgfortran/generated/cshift1_16.c    (.../tags/gcc_4_8_3_release)
 
14852
+++ b/src/libgfortran/generated/cshift1_16.c    (.../branches/gcc-4_8-branch)
 
14853
@@ -80,7 +80,7 @@
 
14854
     {
 
14855
       int i;
 
14856
 
 
14857
-      ret->base_addr = xmalloc (size * arraysize);
 
14858
+      ret->base_addr = xmallocarray (arraysize, size);
 
14859
       ret->offset = 0;
 
14860
       ret->dtype = array->dtype;
 
14861
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
14862
Index: libgfortran/generated/maxloc0_4_i1.c
 
14863
===================================================================
 
14864
--- a/src/libgfortran/generated/maxloc0_4_i1.c  (.../tags/gcc_4_8_3_release)
 
14865
+++ b/src/libgfortran/generated/maxloc0_4_i1.c  (.../branches/gcc-4_8-branch)
 
14866
@@ -58,7 +58,7 @@
 
14867
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14868
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14869
       retarray->offset = 0;
 
14870
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14871
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14872
     }
 
14873
   else
 
14874
     {
 
14875
@@ -199,7 +199,7 @@
 
14876
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14877
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14878
       retarray->offset = 0;
 
14879
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14880
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14881
     }
 
14882
   else
 
14883
     {
 
14884
@@ -367,7 +367,7 @@
 
14885
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14886
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14887
       retarray->offset = 0;
 
14888
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14889
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14890
     }
 
14891
   else if (unlikely (compile_options.bounds_check))
 
14892
     {
 
14893
Index: libgfortran/generated/minloc0_4_i8.c
 
14894
===================================================================
 
14895
--- a/src/libgfortran/generated/minloc0_4_i8.c  (.../tags/gcc_4_8_3_release)
 
14896
+++ b/src/libgfortran/generated/minloc0_4_i8.c  (.../branches/gcc-4_8-branch)
 
14897
@@ -58,7 +58,7 @@
 
14898
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14899
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14900
       retarray->offset = 0;
 
14901
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14902
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14903
     }
 
14904
   else
 
14905
     {
 
14906
@@ -199,7 +199,7 @@
 
14907
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
14908
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14909
       retarray->offset = 0;
 
14910
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14911
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14912
     }
 
14913
   else
 
14914
     {
 
14915
@@ -367,7 +367,7 @@
 
14916
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
14917
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
14918
       retarray->offset = 0;
 
14919
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
14920
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
14921
     }
 
14922
   else if (unlikely (compile_options.bounds_check))
 
14923
     {
 
14924
Index: libgfortran/generated/spread_c16.c
 
14925
===================================================================
 
14926
--- a/src/libgfortran/generated/spread_c16.c    (.../tags/gcc_4_8_3_release)
 
14927
+++ b/src/libgfortran/generated/spread_c16.c    (.../branches/gcc-4_8-branch)
 
14928
@@ -101,8 +101,8 @@
 
14929
        }
 
14930
       ret->offset = 0;
 
14931
 
 
14932
-      /* xmalloc allocates a single byte for zero size.  */
 
14933
-      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_16));
 
14934
+      /* xmallocarray allocates a single byte for zero size.  */
 
14935
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_16));
 
14936
       if (rs <= 0)
 
14937
         return;
 
14938
     }
 
14939
@@ -244,7 +244,7 @@
 
14940
 
 
14941
   if (ret->base_addr == NULL)
 
14942
     {
 
14943
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_16));
 
14944
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_16));
 
14945
       ret->offset = 0;
 
14946
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
14947
     }
 
14948
Index: libgfortran/generated/maxval_r4.c
 
14949
===================================================================
 
14950
--- a/src/libgfortran/generated/maxval_r4.c     (.../tags/gcc_4_8_3_release)
 
14951
+++ b/src/libgfortran/generated/maxval_r4.c     (.../branches/gcc-4_8-branch)
 
14952
@@ -97,10 +97,9 @@
 
14953
       retarray->offset = 0;
 
14954
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14955
 
 
14956
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14957
-                  * extent[rank-1];
 
14958
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14959
 
 
14960
-      retarray->base_addr = xmalloc (alloc_size);
 
14961
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
14962
       if (alloc_size == 0)
 
14963
        {
 
14964
          /* Make sure we have a zero-sized array.  */
 
14965
@@ -286,8 +285,7 @@
 
14966
 
 
14967
        }
 
14968
 
 
14969
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14970
-                  * extent[rank-1];
 
14971
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14972
 
 
14973
       retarray->offset = 0;
 
14974
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14975
@@ -299,7 +297,7 @@
 
14976
          return;
 
14977
        }
 
14978
       else
 
14979
-       retarray->base_addr = xmalloc (alloc_size);
 
14980
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
14981
 
 
14982
     }
 
14983
   else
 
14984
@@ -472,8 +470,7 @@
 
14985
       retarray->offset = 0;
 
14986
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
14987
 
 
14988
-      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
14989
-                  * extent[rank-1];
 
14990
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
14991
 
 
14992
       if (alloc_size == 0)
 
14993
        {
 
14994
@@ -482,7 +479,7 @@
 
14995
          return;
 
14996
        }
 
14997
       else
 
14998
-       retarray->base_addr = xmalloc (alloc_size);
 
14999
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
15000
     }
 
15001
   else
 
15002
     {
 
15003
Index: libgfortran/generated/minval_r8.c
 
15004
===================================================================
 
15005
--- a/src/libgfortran/generated/minval_r8.c     (.../tags/gcc_4_8_3_release)
 
15006
+++ b/src/libgfortran/generated/minval_r8.c     (.../branches/gcc-4_8-branch)
 
15007
@@ -97,10 +97,9 @@
 
15008
       retarray->offset = 0;
 
15009
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15010
 
 
15011
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15012
-                  * extent[rank-1];
 
15013
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15014
 
 
15015
-      retarray->base_addr = xmalloc (alloc_size);
 
15016
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
15017
       if (alloc_size == 0)
 
15018
        {
 
15019
          /* Make sure we have a zero-sized array.  */
 
15020
@@ -286,8 +285,7 @@
 
15021
 
 
15022
        }
 
15023
 
 
15024
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15025
-                  * extent[rank-1];
 
15026
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15027
 
 
15028
       retarray->offset = 0;
 
15029
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15030
@@ -299,7 +297,7 @@
 
15031
          return;
 
15032
        }
 
15033
       else
 
15034
-       retarray->base_addr = xmalloc (alloc_size);
 
15035
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
15036
 
 
15037
     }
 
15038
   else
 
15039
@@ -472,8 +470,7 @@
 
15040
       retarray->offset = 0;
 
15041
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15042
 
 
15043
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15044
-                  * extent[rank-1];
 
15045
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15046
 
 
15047
       if (alloc_size == 0)
 
15048
        {
 
15049
@@ -482,7 +479,7 @@
 
15050
          return;
 
15051
        }
 
15052
       else
 
15053
-       retarray->base_addr = xmalloc (alloc_size);
 
15054
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
15055
     }
 
15056
   else
 
15057
     {
 
15058
Index: libgfortran/generated/minloc1_16_r16.c
 
15059
===================================================================
 
15060
--- a/src/libgfortran/generated/minloc1_16_r16.c        (.../tags/gcc_4_8_3_release)
 
15061
+++ b/src/libgfortran/generated/minloc1_16_r16.c        (.../branches/gcc-4_8-branch)
 
15062
@@ -98,10 +98,9 @@
 
15063
       retarray->offset = 0;
 
15064
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15065
 
 
15066
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15067
-                  * extent[rank-1];
 
15068
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15069
 
 
15070
-      retarray->base_addr = xmalloc (alloc_size);
 
15071
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15072
       if (alloc_size == 0)
 
15073
        {
 
15074
          /* Make sure we have a zero-sized array.  */
 
15075
@@ -294,8 +293,7 @@
 
15076
 
 
15077
        }
 
15078
 
 
15079
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15080
-                  * extent[rank-1];
 
15081
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15082
 
 
15083
       retarray->offset = 0;
 
15084
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15085
@@ -307,7 +305,7 @@
 
15086
          return;
 
15087
        }
 
15088
       else
 
15089
-       retarray->base_addr = xmalloc (alloc_size);
 
15090
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15091
 
 
15092
     }
 
15093
   else
 
15094
@@ -485,8 +483,7 @@
 
15095
       retarray->offset = 0;
 
15096
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15097
 
 
15098
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15099
-                  * extent[rank-1];
 
15100
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15101
 
 
15102
       if (alloc_size == 0)
 
15103
        {
 
15104
@@ -495,7 +492,7 @@
 
15105
          return;
 
15106
        }
 
15107
       else
 
15108
-       retarray->base_addr = xmalloc (alloc_size);
 
15109
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15110
     }
 
15111
   else
 
15112
     {
 
15113
Index: libgfortran/generated/unpack_i16.c
 
15114
===================================================================
 
15115
--- a/src/libgfortran/generated/unpack_i16.c    (.../tags/gcc_4_8_3_release)
 
15116
+++ b/src/libgfortran/generated/unpack_i16.c    (.../branches/gcc-4_8-branch)
 
15117
@@ -99,7 +99,7 @@
 
15118
          rs *= extent[n];
 
15119
        }
 
15120
       ret->offset = 0;
 
15121
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
 
15122
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
 
15123
     }
 
15124
   else
 
15125
     {
 
15126
@@ -244,7 +244,7 @@
 
15127
          rs *= extent[n];
 
15128
        }
 
15129
       ret->offset = 0;
 
15130
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
 
15131
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
 
15132
     }
 
15133
   else
 
15134
     {
 
15135
Index: libgfortran/generated/sum_i8.c
 
15136
===================================================================
 
15137
--- a/src/libgfortran/generated/sum_i8.c        (.../tags/gcc_4_8_3_release)
 
15138
+++ b/src/libgfortran/generated/sum_i8.c        (.../branches/gcc-4_8-branch)
 
15139
@@ -97,10 +97,9 @@
 
15140
       retarray->offset = 0;
 
15141
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15142
 
 
15143
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15144
-                  * extent[rank-1];
 
15145
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15146
 
 
15147
-      retarray->base_addr = xmalloc (alloc_size);
 
15148
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15149
       if (alloc_size == 0)
 
15150
        {
 
15151
          /* Make sure we have a zero-sized array.  */
 
15152
@@ -272,8 +271,7 @@
 
15153
 
 
15154
        }
 
15155
 
 
15156
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15157
-                  * extent[rank-1];
 
15158
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15159
 
 
15160
       retarray->offset = 0;
 
15161
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15162
@@ -285,7 +283,7 @@
 
15163
          return;
 
15164
        }
 
15165
       else
 
15166
-       retarray->base_addr = xmalloc (alloc_size);
 
15167
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15168
 
 
15169
     }
 
15170
   else
 
15171
@@ -430,8 +428,7 @@
 
15172
       retarray->offset = 0;
 
15173
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15174
 
 
15175
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15176
-                  * extent[rank-1];
 
15177
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15178
 
 
15179
       if (alloc_size == 0)
 
15180
        {
 
15181
@@ -440,7 +437,7 @@
 
15182
          return;
 
15183
        }
 
15184
       else
 
15185
-       retarray->base_addr = xmalloc (alloc_size);
 
15186
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15187
     }
 
15188
   else
 
15189
     {
 
15190
Index: libgfortran/generated/pack_i1.c
 
15191
===================================================================
 
15192
--- a/src/libgfortran/generated/pack_i1.c       (.../tags/gcc_4_8_3_release)
 
15193
+++ b/src/libgfortran/generated/pack_i1.c       (.../branches/gcc-4_8-branch)
 
15194
@@ -167,8 +167,8 @@
 
15195
 
 
15196
          ret->offset = 0;
 
15197
 
 
15198
-         /* xmalloc allocates a single byte for zero size.  */
 
15199
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_1) * total);
 
15200
+         /* xmallocarray allocates a single byte for zero size.  */
 
15201
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_1));
 
15202
 
 
15203
          if (total == 0)
 
15204
            return;
 
15205
Index: libgfortran/generated/any_l16.c
 
15206
===================================================================
 
15207
--- a/src/libgfortran/generated/any_l16.c       (.../tags/gcc_4_8_3_release)
 
15208
+++ b/src/libgfortran/generated/any_l16.c       (.../branches/gcc-4_8-branch)
 
15209
@@ -101,8 +101,7 @@
 
15210
       retarray->offset = 0;
 
15211
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15212
 
 
15213
-      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15214
-                  * extent[rank-1];
 
15215
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15216
 
 
15217
       if (alloc_size == 0)
 
15218
        {
 
15219
@@ -111,7 +110,7 @@
 
15220
          return;
 
15221
        }
 
15222
       else
 
15223
-       retarray->base_addr = xmalloc (alloc_size);
 
15224
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
 
15225
     }
 
15226
   else
 
15227
     {
 
15228
Index: libgfortran/generated/spread_i8.c
 
15229
===================================================================
 
15230
--- a/src/libgfortran/generated/spread_i8.c     (.../tags/gcc_4_8_3_release)
 
15231
+++ b/src/libgfortran/generated/spread_i8.c     (.../branches/gcc-4_8-branch)
 
15232
@@ -101,8 +101,8 @@
 
15233
        }
 
15234
       ret->offset = 0;
 
15235
 
 
15236
-      /* xmalloc allocates a single byte for zero size.  */
 
15237
-      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_8));
 
15238
+      /* xmallocarray allocates a single byte for zero size.  */
 
15239
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_8));
 
15240
       if (rs <= 0)
 
15241
         return;
 
15242
     }
 
15243
@@ -244,7 +244,7 @@
 
15244
 
 
15245
   if (ret->base_addr == NULL)
 
15246
     {
 
15247
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_8));
 
15248
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_8));
 
15249
       ret->offset = 0;
 
15250
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
15251
     }
 
15252
Index: libgfortran/generated/maxval_i2.c
 
15253
===================================================================
 
15254
--- a/src/libgfortran/generated/maxval_i2.c     (.../tags/gcc_4_8_3_release)
 
15255
+++ b/src/libgfortran/generated/maxval_i2.c     (.../branches/gcc-4_8-branch)
 
15256
@@ -97,10 +97,9 @@
 
15257
       retarray->offset = 0;
 
15258
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15259
 
 
15260
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15261
-                  * extent[rank-1];
 
15262
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15263
 
 
15264
-      retarray->base_addr = xmalloc (alloc_size);
 
15265
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
15266
       if (alloc_size == 0)
 
15267
        {
 
15268
          /* Make sure we have a zero-sized array.  */
 
15269
@@ -286,8 +285,7 @@
 
15270
 
 
15271
        }
 
15272
 
 
15273
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15274
-                  * extent[rank-1];
 
15275
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15276
 
 
15277
       retarray->offset = 0;
 
15278
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15279
@@ -299,7 +297,7 @@
 
15280
          return;
 
15281
        }
 
15282
       else
 
15283
-       retarray->base_addr = xmalloc (alloc_size);
 
15284
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
15285
 
 
15286
     }
 
15287
   else
 
15288
@@ -472,8 +470,7 @@
 
15289
       retarray->offset = 0;
 
15290
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15291
 
 
15292
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15293
-                  * extent[rank-1];
 
15294
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15295
 
 
15296
       if (alloc_size == 0)
 
15297
        {
 
15298
@@ -482,7 +479,7 @@
 
15299
          return;
 
15300
        }
 
15301
       else
 
15302
-       retarray->base_addr = xmalloc (alloc_size);
 
15303
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
15304
     }
 
15305
   else
 
15306
     {
 
15307
Index: libgfortran/generated/maxloc1_8_i4.c
 
15308
===================================================================
 
15309
--- a/src/libgfortran/generated/maxloc1_8_i4.c  (.../tags/gcc_4_8_3_release)
 
15310
+++ b/src/libgfortran/generated/maxloc1_8_i4.c  (.../branches/gcc-4_8-branch)
 
15311
@@ -98,10 +98,9 @@
 
15312
       retarray->offset = 0;
 
15313
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15314
 
 
15315
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15316
-                  * extent[rank-1];
 
15317
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15318
 
 
15319
-      retarray->base_addr = xmalloc (alloc_size);
 
15320
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15321
       if (alloc_size == 0)
 
15322
        {
 
15323
          /* Make sure we have a zero-sized array.  */
 
15324
@@ -294,8 +293,7 @@
 
15325
 
 
15326
        }
 
15327
 
 
15328
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15329
-                  * extent[rank-1];
 
15330
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15331
 
 
15332
       retarray->offset = 0;
 
15333
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15334
@@ -307,7 +305,7 @@
 
15335
          return;
 
15336
        }
 
15337
       else
 
15338
-       retarray->base_addr = xmalloc (alloc_size);
 
15339
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15340
 
 
15341
     }
 
15342
   else
 
15343
@@ -485,8 +483,7 @@
 
15344
       retarray->offset = 0;
 
15345
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15346
 
 
15347
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15348
-                  * extent[rank-1];
 
15349
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15350
 
 
15351
       if (alloc_size == 0)
 
15352
        {
 
15353
@@ -495,7 +492,7 @@
 
15354
          return;
 
15355
        }
 
15356
       else
 
15357
-       retarray->base_addr = xmalloc (alloc_size);
 
15358
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15359
     }
 
15360
   else
 
15361
     {
 
15362
Index: libgfortran/generated/unpack_r8.c
 
15363
===================================================================
 
15364
--- a/src/libgfortran/generated/unpack_r8.c     (.../tags/gcc_4_8_3_release)
 
15365
+++ b/src/libgfortran/generated/unpack_r8.c     (.../branches/gcc-4_8-branch)
 
15366
@@ -99,7 +99,7 @@
 
15367
          rs *= extent[n];
 
15368
        }
 
15369
       ret->offset = 0;
 
15370
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
 
15371
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
 
15372
     }
 
15373
   else
 
15374
     {
 
15375
@@ -244,7 +244,7 @@
 
15376
          rs *= extent[n];
 
15377
        }
 
15378
       ret->offset = 0;
 
15379
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
 
15380
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
 
15381
     }
 
15382
   else
 
15383
     {
 
15384
Index: libgfortran/generated/maxloc0_4_r4.c
 
15385
===================================================================
 
15386
--- a/src/libgfortran/generated/maxloc0_4_r4.c  (.../tags/gcc_4_8_3_release)
 
15387
+++ b/src/libgfortran/generated/maxloc0_4_r4.c  (.../branches/gcc-4_8-branch)
 
15388
@@ -58,7 +58,7 @@
 
15389
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15390
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15391
       retarray->offset = 0;
 
15392
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15393
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15394
     }
 
15395
   else
 
15396
     {
 
15397
@@ -199,7 +199,7 @@
 
15398
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15399
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15400
       retarray->offset = 0;
 
15401
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15402
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15403
     }
 
15404
   else
 
15405
     {
 
15406
@@ -367,7 +367,7 @@
 
15407
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15408
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15409
       retarray->offset = 0;
 
15410
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15411
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15412
     }
 
15413
   else if (unlikely (compile_options.bounds_check))
 
15414
     {
 
15415
Index: libgfortran/generated/all_l1.c
 
15416
===================================================================
 
15417
--- a/src/libgfortran/generated/all_l1.c        (.../tags/gcc_4_8_3_release)
 
15418
+++ b/src/libgfortran/generated/all_l1.c        (.../branches/gcc-4_8-branch)
 
15419
@@ -101,8 +101,7 @@
 
15420
       retarray->offset = 0;
 
15421
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15422
 
 
15423
-      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15424
-                  * extent[rank-1];
 
15425
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15426
 
 
15427
       if (alloc_size == 0)
 
15428
        {
 
15429
@@ -111,7 +110,7 @@
 
15430
          return;
 
15431
        }
 
15432
       else
 
15433
-       retarray->base_addr = xmalloc (alloc_size);
 
15434
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
 
15435
     }
 
15436
   else
 
15437
     {
 
15438
Index: libgfortran/generated/matmul_r8.c
 
15439
===================================================================
 
15440
--- a/src/libgfortran/generated/matmul_r8.c     (.../tags/gcc_4_8_3_release)
 
15441
+++ b/src/libgfortran/generated/matmul_r8.c     (.../branches/gcc-4_8-branch)
 
15442
@@ -124,7 +124,7 @@
 
15443
         }
 
15444
 
 
15445
       retarray->base_addr
 
15446
-       = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
 
15447
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_8));
 
15448
       retarray->offset = 0;
 
15449
     }
 
15450
     else if (unlikely (compile_options.bounds_check))
 
15451
Index: libgfortran/generated/minloc0_4_r16.c
 
15452
===================================================================
 
15453
--- a/src/libgfortran/generated/minloc0_4_r16.c (.../tags/gcc_4_8_3_release)
 
15454
+++ b/src/libgfortran/generated/minloc0_4_r16.c (.../branches/gcc-4_8-branch)
 
15455
@@ -58,7 +58,7 @@
 
15456
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15457
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15458
       retarray->offset = 0;
 
15459
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15460
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15461
     }
 
15462
   else
 
15463
     {
 
15464
@@ -199,7 +199,7 @@
 
15465
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15466
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15467
       retarray->offset = 0;
 
15468
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15469
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15470
     }
 
15471
   else
 
15472
     {
 
15473
@@ -367,7 +367,7 @@
 
15474
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15475
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15476
       retarray->offset = 0;
 
15477
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15478
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15479
     }
 
15480
   else if (unlikely (compile_options.bounds_check))
 
15481
     {
 
15482
Index: libgfortran/generated/maxloc0_4_i2.c
 
15483
===================================================================
 
15484
--- a/src/libgfortran/generated/maxloc0_4_i2.c  (.../tags/gcc_4_8_3_release)
 
15485
+++ b/src/libgfortran/generated/maxloc0_4_i2.c  (.../branches/gcc-4_8-branch)
 
15486
@@ -58,7 +58,7 @@
 
15487
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15488
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15489
       retarray->offset = 0;
 
15490
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15491
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15492
     }
 
15493
   else
 
15494
     {
 
15495
@@ -199,7 +199,7 @@
 
15496
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15497
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15498
       retarray->offset = 0;
 
15499
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15500
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15501
     }
 
15502
   else
 
15503
     {
 
15504
@@ -367,7 +367,7 @@
 
15505
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15506
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15507
       retarray->offset = 0;
 
15508
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
15509
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
15510
     }
 
15511
   else if (unlikely (compile_options.bounds_check))
 
15512
     {
 
15513
Index: libgfortran/generated/minloc1_8_r16.c
 
15514
===================================================================
 
15515
--- a/src/libgfortran/generated/minloc1_8_r16.c (.../tags/gcc_4_8_3_release)
 
15516
+++ b/src/libgfortran/generated/minloc1_8_r16.c (.../branches/gcc-4_8-branch)
 
15517
@@ -98,10 +98,9 @@
 
15518
       retarray->offset = 0;
 
15519
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15520
 
 
15521
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15522
-                  * extent[rank-1];
 
15523
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15524
 
 
15525
-      retarray->base_addr = xmalloc (alloc_size);
 
15526
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15527
       if (alloc_size == 0)
 
15528
        {
 
15529
          /* Make sure we have a zero-sized array.  */
 
15530
@@ -294,8 +293,7 @@
 
15531
 
 
15532
        }
 
15533
 
 
15534
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15535
-                  * extent[rank-1];
 
15536
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15537
 
 
15538
       retarray->offset = 0;
 
15539
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15540
@@ -307,7 +305,7 @@
 
15541
          return;
 
15542
        }
 
15543
       else
 
15544
-       retarray->base_addr = xmalloc (alloc_size);
 
15545
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15546
 
 
15547
     }
 
15548
   else
 
15549
@@ -485,8 +483,7 @@
 
15550
       retarray->offset = 0;
 
15551
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15552
 
 
15553
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15554
-                  * extent[rank-1];
 
15555
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15556
 
 
15557
       if (alloc_size == 0)
 
15558
        {
 
15559
@@ -495,7 +492,7 @@
 
15560
          return;
 
15561
        }
 
15562
       else
 
15563
-       retarray->base_addr = xmalloc (alloc_size);
 
15564
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
15565
     }
 
15566
   else
 
15567
     {
 
15568
Index: libgfortran/generated/pack_c10.c
 
15569
===================================================================
 
15570
--- a/src/libgfortran/generated/pack_c10.c      (.../tags/gcc_4_8_3_release)
 
15571
+++ b/src/libgfortran/generated/pack_c10.c      (.../branches/gcc-4_8-branch)
 
15572
@@ -167,8 +167,8 @@
 
15573
 
 
15574
          ret->offset = 0;
 
15575
 
 
15576
-         /* xmalloc allocates a single byte for zero size.  */
 
15577
-         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * total);
 
15578
+         /* xmallocarray allocates a single byte for zero size.  */
 
15579
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
 
15580
 
 
15581
          if (total == 0)
 
15582
            return;
 
15583
Index: libgfortran/generated/pack_r4.c
 
15584
===================================================================
 
15585
--- a/src/libgfortran/generated/pack_r4.c       (.../tags/gcc_4_8_3_release)
 
15586
+++ b/src/libgfortran/generated/pack_r4.c       (.../branches/gcc-4_8-branch)
 
15587
@@ -167,8 +167,8 @@
 
15588
 
 
15589
          ret->offset = 0;
 
15590
 
 
15591
-         /* xmalloc allocates a single byte for zero size.  */
 
15592
-         ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * total);
 
15593
+         /* xmallocarray allocates a single byte for zero size.  */
 
15594
+         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_4));
 
15595
 
 
15596
          if (total == 0)
 
15597
            return;
 
15598
Index: libgfortran/generated/transpose_c16.c
 
15599
===================================================================
 
15600
--- a/src/libgfortran/generated/transpose_c16.c (.../tags/gcc_4_8_3_release)
 
15601
+++ b/src/libgfortran/generated/transpose_c16.c (.../branches/gcc-4_8-branch)
 
15602
@@ -60,7 +60,8 @@
 
15603
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
15604
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
15605
 
 
15606
-      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
 
15607
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
15608
+                                     sizeof (GFC_COMPLEX_16));
 
15609
       ret->offset = 0;
 
15610
     } else if (unlikely (compile_options.bounds_check))
 
15611
     {
 
15612
Index: libgfortran/generated/maxloc0_8_i8.c
 
15613
===================================================================
 
15614
--- a/src/libgfortran/generated/maxloc0_8_i8.c  (.../tags/gcc_4_8_3_release)
 
15615
+++ b/src/libgfortran/generated/maxloc0_8_i8.c  (.../branches/gcc-4_8-branch)
 
15616
@@ -58,7 +58,7 @@
 
15617
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15618
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15619
       retarray->offset = 0;
 
15620
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15621
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15622
     }
 
15623
   else
 
15624
     {
 
15625
@@ -199,7 +199,7 @@
 
15626
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15627
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15628
       retarray->offset = 0;
 
15629
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15630
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15631
     }
 
15632
   else
 
15633
     {
 
15634
@@ -367,7 +367,7 @@
 
15635
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15636
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15637
       retarray->offset = 0;
 
15638
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
15639
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
15640
     }
 
15641
   else if (unlikely (compile_options.bounds_check))
 
15642
     {
 
15643
Index: libgfortran/generated/minloc1_4_r8.c
 
15644
===================================================================
 
15645
--- a/src/libgfortran/generated/minloc1_4_r8.c  (.../tags/gcc_4_8_3_release)
 
15646
+++ b/src/libgfortran/generated/minloc1_4_r8.c  (.../branches/gcc-4_8-branch)
 
15647
@@ -98,10 +98,9 @@
 
15648
       retarray->offset = 0;
 
15649
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15650
 
 
15651
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15652
-                  * extent[rank-1];
 
15653
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15654
 
 
15655
-      retarray->base_addr = xmalloc (alloc_size);
 
15656
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15657
       if (alloc_size == 0)
 
15658
        {
 
15659
          /* Make sure we have a zero-sized array.  */
 
15660
@@ -294,8 +293,7 @@
 
15661
 
 
15662
        }
 
15663
 
 
15664
-      alloc_size = sizeof (GFC_INTEGER_4) * 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->offset = 0;
 
15669
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15670
@@ -307,7 +305,7 @@
 
15671
          return;
 
15672
        }
 
15673
       else
 
15674
-       retarray->base_addr = xmalloc (alloc_size);
 
15675
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15676
 
 
15677
     }
 
15678
   else
 
15679
@@ -485,8 +483,7 @@
 
15680
       retarray->offset = 0;
 
15681
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15682
 
 
15683
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15684
-                  * extent[rank-1];
 
15685
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15686
 
 
15687
       if (alloc_size == 0)
 
15688
        {
 
15689
@@ -495,7 +492,7 @@
 
15690
          return;
 
15691
        }
 
15692
       else
 
15693
-       retarray->base_addr = xmalloc (alloc_size);
 
15694
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15695
     }
 
15696
   else
 
15697
     {
 
15698
Index: libgfortran/generated/minloc1_16_i4.c
 
15699
===================================================================
 
15700
--- a/src/libgfortran/generated/minloc1_16_i4.c (.../tags/gcc_4_8_3_release)
 
15701
+++ b/src/libgfortran/generated/minloc1_16_i4.c (.../branches/gcc-4_8-branch)
 
15702
@@ -98,10 +98,9 @@
 
15703
       retarray->offset = 0;
 
15704
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15705
 
 
15706
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15707
-                  * extent[rank-1];
 
15708
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15709
 
 
15710
-      retarray->base_addr = xmalloc (alloc_size);
 
15711
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15712
       if (alloc_size == 0)
 
15713
        {
 
15714
          /* Make sure we have a zero-sized array.  */
 
15715
@@ -294,8 +293,7 @@
 
15716
 
 
15717
        }
 
15718
 
 
15719
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15720
-                  * extent[rank-1];
 
15721
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15722
 
 
15723
       retarray->offset = 0;
 
15724
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15725
@@ -307,7 +305,7 @@
 
15726
          return;
 
15727
        }
 
15728
       else
 
15729
-       retarray->base_addr = xmalloc (alloc_size);
 
15730
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15731
 
 
15732
     }
 
15733
   else
 
15734
@@ -485,8 +483,7 @@
 
15735
       retarray->offset = 0;
 
15736
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15737
 
 
15738
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15739
-                  * extent[rank-1];
 
15740
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15741
 
 
15742
       if (alloc_size == 0)
 
15743
        {
 
15744
@@ -495,7 +492,7 @@
 
15745
          return;
 
15746
        }
 
15747
       else
 
15748
-       retarray->base_addr = xmalloc (alloc_size);
 
15749
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
15750
     }
 
15751
   else
 
15752
     {
 
15753
Index: libgfortran/generated/minloc0_16_i8.c
 
15754
===================================================================
 
15755
--- a/src/libgfortran/generated/minloc0_16_i8.c (.../tags/gcc_4_8_3_release)
 
15756
+++ b/src/libgfortran/generated/minloc0_16_i8.c (.../branches/gcc-4_8-branch)
 
15757
@@ -58,7 +58,7 @@
 
15758
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15759
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15760
       retarray->offset = 0;
 
15761
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15762
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15763
     }
 
15764
   else
 
15765
     {
 
15766
@@ -199,7 +199,7 @@
 
15767
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
15768
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15769
       retarray->offset = 0;
 
15770
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15771
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15772
     }
 
15773
   else
 
15774
     {
 
15775
@@ -367,7 +367,7 @@
 
15776
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
15777
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
15778
       retarray->offset = 0;
 
15779
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
15780
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
15781
     }
 
15782
   else if (unlikely (compile_options.bounds_check))
 
15783
     {
 
15784
Index: libgfortran/generated/pack_i2.c
 
15785
===================================================================
 
15786
--- a/src/libgfortran/generated/pack_i2.c       (.../tags/gcc_4_8_3_release)
 
15787
+++ b/src/libgfortran/generated/pack_i2.c       (.../branches/gcc-4_8-branch)
 
15788
@@ -167,8 +167,8 @@
 
15789
 
 
15790
          ret->offset = 0;
 
15791
 
 
15792
-         /* xmalloc allocates a single byte for zero size.  */
 
15793
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_2) * total);
 
15794
+         /* xmallocarray allocates a single byte for zero size.  */
 
15795
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_2));
 
15796
 
 
15797
          if (total == 0)
 
15798
            return;
 
15799
Index: libgfortran/generated/transpose_i8.c
 
15800
===================================================================
 
15801
--- a/src/libgfortran/generated/transpose_i8.c  (.../tags/gcc_4_8_3_release)
 
15802
+++ b/src/libgfortran/generated/transpose_i8.c  (.../branches/gcc-4_8-branch)
 
15803
@@ -60,7 +60,8 @@
 
15804
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
15805
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
15806
 
 
15807
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
 
15808
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
15809
+                                     sizeof (GFC_INTEGER_8));
 
15810
       ret->offset = 0;
 
15811
     } else if (unlikely (compile_options.bounds_check))
 
15812
     {
 
15813
Index: libgfortran/generated/eoshift1_16.c
 
15814
===================================================================
 
15815
--- a/src/libgfortran/generated/eoshift1_16.c   (.../tags/gcc_4_8_3_release)
 
15816
+++ b/src/libgfortran/generated/eoshift1_16.c   (.../branches/gcc-4_8-branch)
 
15817
@@ -105,8 +105,8 @@
 
15818
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
15819
 
 
15820
         }
 
15821
-      /* xmalloc allocates a single byte for zero size.  */
 
15822
-      ret->base_addr = xmalloc (size * arraysize);
 
15823
+      /* xmallocarray allocates a single byte for zero size.  */
 
15824
+      ret->base_addr = xmallocarray (arraysize, size);
 
15825
 
 
15826
     }
 
15827
   else if (unlikely (compile_options.bounds_check))
 
15828
Index: libgfortran/generated/all_l2.c
 
15829
===================================================================
 
15830
--- a/src/libgfortran/generated/all_l2.c        (.../tags/gcc_4_8_3_release)
 
15831
+++ b/src/libgfortran/generated/all_l2.c        (.../branches/gcc-4_8-branch)
 
15832
@@ -101,8 +101,7 @@
 
15833
       retarray->offset = 0;
 
15834
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15835
 
 
15836
-      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15837
-                  * extent[rank-1];
 
15838
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15839
 
 
15840
       if (alloc_size == 0)
 
15841
        {
 
15842
@@ -111,7 +110,7 @@
 
15843
          return;
 
15844
        }
 
15845
       else
 
15846
-       retarray->base_addr = xmalloc (alloc_size);
 
15847
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
 
15848
     }
 
15849
   else
 
15850
     {
 
15851
Index: libgfortran/generated/product_c4.c
 
15852
===================================================================
 
15853
--- a/src/libgfortran/generated/product_c4.c    (.../tags/gcc_4_8_3_release)
 
15854
+++ b/src/libgfortran/generated/product_c4.c    (.../branches/gcc-4_8-branch)
 
15855
@@ -97,10 +97,9 @@
 
15856
       retarray->offset = 0;
 
15857
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15858
 
 
15859
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15860
-                  * extent[rank-1];
 
15861
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15862
 
 
15863
-      retarray->base_addr = xmalloc (alloc_size);
 
15864
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
15865
       if (alloc_size == 0)
 
15866
        {
 
15867
          /* Make sure we have a zero-sized array.  */
 
15868
@@ -272,8 +271,7 @@
 
15869
 
 
15870
        }
 
15871
 
 
15872
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15873
-                  * extent[rank-1];
 
15874
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15875
 
 
15876
       retarray->offset = 0;
 
15877
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15878
@@ -285,7 +283,7 @@
 
15879
          return;
 
15880
        }
 
15881
       else
 
15882
-       retarray->base_addr = xmalloc (alloc_size);
 
15883
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
15884
 
 
15885
     }
 
15886
   else
 
15887
@@ -430,8 +428,7 @@
 
15888
       retarray->offset = 0;
 
15889
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15890
 
 
15891
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15892
-                  * extent[rank-1];
 
15893
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15894
 
 
15895
       if (alloc_size == 0)
 
15896
        {
 
15897
@@ -440,7 +437,7 @@
 
15898
          return;
 
15899
        }
 
15900
       else
 
15901
-       retarray->base_addr = xmalloc (alloc_size);
 
15902
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
15903
     }
 
15904
   else
 
15905
     {
 
15906
Index: libgfortran/generated/iall_i1.c
 
15907
===================================================================
 
15908
--- a/src/libgfortran/generated/iall_i1.c       (.../tags/gcc_4_8_3_release)
 
15909
+++ b/src/libgfortran/generated/iall_i1.c       (.../branches/gcc-4_8-branch)
 
15910
@@ -97,10 +97,9 @@
 
15911
       retarray->offset = 0;
 
15912
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15913
 
 
15914
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15915
-                  * extent[rank-1];
 
15916
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15917
 
 
15918
-      retarray->base_addr = xmalloc (alloc_size);
 
15919
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
15920
       if (alloc_size == 0)
 
15921
        {
 
15922
          /* Make sure we have a zero-sized array.  */
 
15923
@@ -272,8 +271,7 @@
 
15924
 
 
15925
        }
 
15926
 
 
15927
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15928
-                  * extent[rank-1];
 
15929
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15930
 
 
15931
       retarray->offset = 0;
 
15932
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15933
@@ -285,7 +283,7 @@
 
15934
          return;
 
15935
        }
 
15936
       else
 
15937
-       retarray->base_addr = xmalloc (alloc_size);
 
15938
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
15939
 
 
15940
     }
 
15941
   else
 
15942
@@ -430,8 +428,7 @@
 
15943
       retarray->offset = 0;
 
15944
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
15945
 
 
15946
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
15947
-                  * extent[rank-1];
 
15948
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
15949
 
 
15950
       if (alloc_size == 0)
 
15951
        {
 
15952
@@ -440,7 +437,7 @@
 
15953
          return;
 
15954
        }
 
15955
       else
 
15956
-       retarray->base_addr = xmalloc (alloc_size);
 
15957
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
15958
     }
 
15959
   else
 
15960
     {
 
15961
Index: libgfortran/generated/reshape_i4.c
 
15962
===================================================================
 
15963
--- a/src/libgfortran/generated/reshape_i4.c    (.../tags/gcc_4_8_3_release)
 
15964
+++ b/src/libgfortran/generated/reshape_i4.c    (.../branches/gcc-4_8-branch)
 
15965
@@ -111,11 +111,11 @@
 
15966
       ret->offset = 0;
 
15967
 
 
15968
       if (unlikely (rs < 1))
 
15969
-        alloc_size = 1;
 
15970
+        alloc_size = 0;
 
15971
       else
 
15972
-        alloc_size = rs * sizeof (GFC_INTEGER_4);
 
15973
+        alloc_size = rs;
 
15974
 
 
15975
-      ret->base_addr = xmalloc (alloc_size);
 
15976
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
15977
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
15978
     }
 
15979
 
 
15980
Index: libgfortran/generated/in_pack_r10.c
 
15981
===================================================================
 
15982
--- a/src/libgfortran/generated/in_pack_r10.c   (.../tags/gcc_4_8_3_release)
 
15983
+++ b/src/libgfortran/generated/in_pack_r10.c   (.../branches/gcc-4_8-branch)
 
15984
@@ -76,7 +76,7 @@
 
15985
     return source->base_addr;
 
15986
 
 
15987
   /* Allocate storage for the destination.  */
 
15988
-  destptr = (GFC_REAL_10 *)xmalloc (ssize * sizeof (GFC_REAL_10));
 
15989
+  destptr = xmallocarray (ssize, sizeof (GFC_REAL_10));
 
15990
   dest = destptr;
 
15991
   src = source->base_addr;
 
15992
   stride0 = stride[0];
 
15993
Index: libgfortran/generated/in_pack_c4.c
 
15994
===================================================================
 
15995
--- a/src/libgfortran/generated/in_pack_c4.c    (.../tags/gcc_4_8_3_release)
 
15996
+++ b/src/libgfortran/generated/in_pack_c4.c    (.../branches/gcc-4_8-branch)
 
15997
@@ -76,7 +76,7 @@
 
15998
     return source->base_addr;
 
15999
 
 
16000
   /* Allocate storage for the destination.  */
 
16001
-  destptr = (GFC_COMPLEX_4 *)xmalloc (ssize * sizeof (GFC_COMPLEX_4));
 
16002
+  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_4));
 
16003
   dest = destptr;
 
16004
   src = source->base_addr;
 
16005
   stride0 = stride[0];
 
16006
Index: libgfortran/generated/all_l16.c
 
16007
===================================================================
 
16008
--- a/src/libgfortran/generated/all_l16.c       (.../tags/gcc_4_8_3_release)
 
16009
+++ b/src/libgfortran/generated/all_l16.c       (.../branches/gcc-4_8-branch)
 
16010
@@ -101,8 +101,7 @@
 
16011
       retarray->offset = 0;
 
16012
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16013
 
 
16014
-      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16015
-                  * extent[rank-1];
 
16016
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16017
 
 
16018
       if (alloc_size == 0)
 
16019
        {
 
16020
@@ -111,7 +110,7 @@
 
16021
          return;
 
16022
        }
 
16023
       else
 
16024
-       retarray->base_addr = xmalloc (alloc_size);
 
16025
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
 
16026
     }
 
16027
   else
 
16028
     {
 
16029
Index: libgfortran/generated/maxloc0_16_i1.c
 
16030
===================================================================
 
16031
--- a/src/libgfortran/generated/maxloc0_16_i1.c (.../tags/gcc_4_8_3_release)
 
16032
+++ b/src/libgfortran/generated/maxloc0_16_i1.c (.../branches/gcc-4_8-branch)
 
16033
@@ -58,7 +58,7 @@
 
16034
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16035
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16036
       retarray->offset = 0;
 
16037
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16038
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16039
     }
 
16040
   else
 
16041
     {
 
16042
@@ -199,7 +199,7 @@
 
16043
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16044
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16045
       retarray->offset = 0;
 
16046
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16047
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16048
     }
 
16049
   else
 
16050
     {
 
16051
@@ -367,7 +367,7 @@
 
16052
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16053
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16054
       retarray->offset = 0;
 
16055
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16056
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16057
     }
 
16058
   else if (unlikely (compile_options.bounds_check))
 
16059
     {
 
16060
Index: libgfortran/generated/maxloc1_8_r8.c
 
16061
===================================================================
 
16062
--- a/src/libgfortran/generated/maxloc1_8_r8.c  (.../tags/gcc_4_8_3_release)
 
16063
+++ b/src/libgfortran/generated/maxloc1_8_r8.c  (.../branches/gcc-4_8-branch)
 
16064
@@ -98,10 +98,9 @@
 
16065
       retarray->offset = 0;
 
16066
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16067
 
 
16068
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16069
-                  * extent[rank-1];
 
16070
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16071
 
 
16072
-      retarray->base_addr = xmalloc (alloc_size);
 
16073
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16074
       if (alloc_size == 0)
 
16075
        {
 
16076
          /* Make sure we have a zero-sized array.  */
 
16077
@@ -294,8 +293,7 @@
 
16078
 
 
16079
        }
 
16080
 
 
16081
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16082
-                  * extent[rank-1];
 
16083
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16084
 
 
16085
       retarray->offset = 0;
 
16086
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16087
@@ -307,7 +305,7 @@
 
16088
          return;
 
16089
        }
 
16090
       else
 
16091
-       retarray->base_addr = xmalloc (alloc_size);
 
16092
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16093
 
 
16094
     }
 
16095
   else
 
16096
@@ -485,8 +483,7 @@
 
16097
       retarray->offset = 0;
 
16098
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16099
 
 
16100
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16101
-                  * extent[rank-1];
 
16102
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16103
 
 
16104
       if (alloc_size == 0)
 
16105
        {
 
16106
@@ -495,7 +492,7 @@
 
16107
          return;
 
16108
        }
 
16109
       else
 
16110
-       retarray->base_addr = xmalloc (alloc_size);
 
16111
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16112
     }
 
16113
   else
 
16114
     {
 
16115
Index: libgfortran/generated/minval_i16.c
 
16116
===================================================================
 
16117
--- a/src/libgfortran/generated/minval_i16.c    (.../tags/gcc_4_8_3_release)
 
16118
+++ b/src/libgfortran/generated/minval_i16.c    (.../branches/gcc-4_8-branch)
 
16119
@@ -97,10 +97,9 @@
 
16120
       retarray->offset = 0;
 
16121
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16122
 
 
16123
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16124
-                  * extent[rank-1];
 
16125
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16126
 
 
16127
-      retarray->base_addr = xmalloc (alloc_size);
 
16128
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16129
       if (alloc_size == 0)
 
16130
        {
 
16131
          /* Make sure we have a zero-sized array.  */
 
16132
@@ -286,8 +285,7 @@
 
16133
 
 
16134
        }
 
16135
 
 
16136
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16137
-                  * extent[rank-1];
 
16138
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16139
 
 
16140
       retarray->offset = 0;
 
16141
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16142
@@ -299,7 +297,7 @@
 
16143
          return;
 
16144
        }
 
16145
       else
 
16146
-       retarray->base_addr = xmalloc (alloc_size);
 
16147
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16148
 
 
16149
     }
 
16150
   else
 
16151
@@ -472,8 +470,7 @@
 
16152
       retarray->offset = 0;
 
16153
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16154
 
 
16155
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16156
-                  * extent[rank-1];
 
16157
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16158
 
 
16159
       if (alloc_size == 0)
 
16160
        {
 
16161
@@ -482,7 +479,7 @@
 
16162
          return;
 
16163
        }
 
16164
       else
 
16165
-       retarray->base_addr = xmalloc (alloc_size);
 
16166
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16167
     }
 
16168
   else
 
16169
     {
 
16170
Index: libgfortran/generated/reshape_r10.c
 
16171
===================================================================
 
16172
--- a/src/libgfortran/generated/reshape_r10.c   (.../tags/gcc_4_8_3_release)
 
16173
+++ b/src/libgfortran/generated/reshape_r10.c   (.../branches/gcc-4_8-branch)
 
16174
@@ -111,11 +111,11 @@
 
16175
       ret->offset = 0;
 
16176
 
 
16177
       if (unlikely (rs < 1))
 
16178
-        alloc_size = 1;
 
16179
+        alloc_size = 0;
 
16180
       else
 
16181
-        alloc_size = rs * sizeof (GFC_REAL_10);
 
16182
+        alloc_size = rs;
 
16183
 
 
16184
-      ret->base_addr = xmalloc (alloc_size);
 
16185
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
16186
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
16187
     }
 
16188
 
 
16189
Index: libgfortran/generated/unpack_r16.c
 
16190
===================================================================
 
16191
--- a/src/libgfortran/generated/unpack_r16.c    (.../tags/gcc_4_8_3_release)
 
16192
+++ b/src/libgfortran/generated/unpack_r16.c    (.../branches/gcc-4_8-branch)
 
16193
@@ -99,7 +99,7 @@
 
16194
          rs *= extent[n];
 
16195
        }
 
16196
       ret->offset = 0;
 
16197
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
 
16198
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
 
16199
     }
 
16200
   else
 
16201
     {
 
16202
@@ -244,7 +244,7 @@
 
16203
          rs *= extent[n];
 
16204
        }
 
16205
       ret->offset = 0;
 
16206
-      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
 
16207
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
 
16208
     }
 
16209
   else
 
16210
     {
 
16211
Index: libgfortran/generated/maxval_i4.c
 
16212
===================================================================
 
16213
--- a/src/libgfortran/generated/maxval_i4.c     (.../tags/gcc_4_8_3_release)
 
16214
+++ b/src/libgfortran/generated/maxval_i4.c     (.../branches/gcc-4_8-branch)
 
16215
@@ -97,10 +97,9 @@
 
16216
       retarray->offset = 0;
 
16217
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16218
 
 
16219
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16220
-                  * extent[rank-1];
 
16221
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16222
 
 
16223
-      retarray->base_addr = xmalloc (alloc_size);
 
16224
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16225
       if (alloc_size == 0)
 
16226
        {
 
16227
          /* Make sure we have a zero-sized array.  */
 
16228
@@ -286,8 +285,7 @@
 
16229
 
 
16230
        }
 
16231
 
 
16232
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16233
-                  * extent[rank-1];
 
16234
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16235
 
 
16236
       retarray->offset = 0;
 
16237
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16238
@@ -299,7 +297,7 @@
 
16239
          return;
 
16240
        }
 
16241
       else
 
16242
-       retarray->base_addr = xmalloc (alloc_size);
 
16243
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16244
 
 
16245
     }
 
16246
   else
 
16247
@@ -472,8 +470,7 @@
 
16248
       retarray->offset = 0;
 
16249
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16250
 
 
16251
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16252
-                  * extent[rank-1];
 
16253
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16254
 
 
16255
       if (alloc_size == 0)
 
16256
        {
 
16257
@@ -482,7 +479,7 @@
 
16258
          return;
 
16259
        }
 
16260
       else
 
16261
-       retarray->base_addr = xmalloc (alloc_size);
 
16262
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16263
     }
 
16264
   else
 
16265
     {
 
16266
Index: libgfortran/generated/minval_i8.c
 
16267
===================================================================
 
16268
--- a/src/libgfortran/generated/minval_i8.c     (.../tags/gcc_4_8_3_release)
 
16269
+++ b/src/libgfortran/generated/minval_i8.c     (.../branches/gcc-4_8-branch)
 
16270
@@ -97,10 +97,9 @@
 
16271
       retarray->offset = 0;
 
16272
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16273
 
 
16274
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16275
-                  * extent[rank-1];
 
16276
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16277
 
 
16278
-      retarray->base_addr = xmalloc (alloc_size);
 
16279
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16280
       if (alloc_size == 0)
 
16281
        {
 
16282
          /* Make sure we have a zero-sized array.  */
 
16283
@@ -286,8 +285,7 @@
 
16284
 
 
16285
        }
 
16286
 
 
16287
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16288
-                  * extent[rank-1];
 
16289
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16290
 
 
16291
       retarray->offset = 0;
 
16292
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16293
@@ -299,7 +297,7 @@
 
16294
          return;
 
16295
        }
 
16296
       else
 
16297
-       retarray->base_addr = xmalloc (alloc_size);
 
16298
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16299
 
 
16300
     }
 
16301
   else
 
16302
@@ -472,8 +470,7 @@
 
16303
       retarray->offset = 0;
 
16304
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16305
 
 
16306
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16307
-                  * extent[rank-1];
 
16308
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16309
 
 
16310
       if (alloc_size == 0)
 
16311
        {
 
16312
@@ -482,7 +479,7 @@
 
16313
          return;
 
16314
        }
 
16315
       else
 
16316
-       retarray->base_addr = xmalloc (alloc_size);
 
16317
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16318
     }
 
16319
   else
 
16320
     {
 
16321
Index: libgfortran/generated/maxloc0_16_i16.c
 
16322
===================================================================
 
16323
--- a/src/libgfortran/generated/maxloc0_16_i16.c        (.../tags/gcc_4_8_3_release)
 
16324
+++ b/src/libgfortran/generated/maxloc0_16_i16.c        (.../branches/gcc-4_8-branch)
 
16325
@@ -58,7 +58,7 @@
 
16326
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16327
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16328
       retarray->offset = 0;
 
16329
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16330
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16331
     }
 
16332
   else
 
16333
     {
 
16334
@@ -199,7 +199,7 @@
 
16335
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16336
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16337
       retarray->offset = 0;
 
16338
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16339
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16340
     }
 
16341
   else
 
16342
     {
 
16343
@@ -367,7 +367,7 @@
 
16344
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16345
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16346
       retarray->offset = 0;
 
16347
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16348
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16349
     }
 
16350
   else if (unlikely (compile_options.bounds_check))
 
16351
     {
 
16352
Index: libgfortran/generated/shape_i4.c
 
16353
===================================================================
 
16354
--- a/src/libgfortran/generated/shape_i4.c      (.../tags/gcc_4_8_3_release)
 
16355
+++ b/src/libgfortran/generated/shape_i4.c      (.../branches/gcc-4_8-branch)
 
16356
@@ -49,7 +49,7 @@
 
16357
     {
 
16358
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
 
16359
       ret->offset = 0;
 
16360
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16361
+      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16362
     }
 
16363
 
 
16364
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
16365
Index: libgfortran/generated/minloc1_4_i16.c
 
16366
===================================================================
 
16367
--- a/src/libgfortran/generated/minloc1_4_i16.c (.../tags/gcc_4_8_3_release)
 
16368
+++ b/src/libgfortran/generated/minloc1_4_i16.c (.../branches/gcc-4_8-branch)
 
16369
@@ -98,10 +98,9 @@
 
16370
       retarray->offset = 0;
 
16371
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16372
 
 
16373
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16374
-                  * extent[rank-1];
 
16375
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16376
 
 
16377
-      retarray->base_addr = xmalloc (alloc_size);
 
16378
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16379
       if (alloc_size == 0)
 
16380
        {
 
16381
          /* Make sure we have a zero-sized array.  */
 
16382
@@ -294,8 +293,7 @@
 
16383
 
 
16384
        }
 
16385
 
 
16386
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16387
-                  * extent[rank-1];
 
16388
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16389
 
 
16390
       retarray->offset = 0;
 
16391
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16392
@@ -307,7 +305,7 @@
 
16393
          return;
 
16394
        }
 
16395
       else
 
16396
-       retarray->base_addr = xmalloc (alloc_size);
 
16397
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16398
 
 
16399
     }
 
16400
   else
 
16401
@@ -485,8 +483,7 @@
 
16402
       retarray->offset = 0;
 
16403
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16404
 
 
16405
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16406
-                  * extent[rank-1];
 
16407
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16408
 
 
16409
       if (alloc_size == 0)
 
16410
        {
 
16411
@@ -495,7 +492,7 @@
 
16412
          return;
 
16413
        }
 
16414
       else
 
16415
-       retarray->base_addr = xmalloc (alloc_size);
 
16416
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16417
     }
 
16418
   else
 
16419
     {
 
16420
Index: libgfortran/generated/maxloc0_4_r10.c
 
16421
===================================================================
 
16422
--- a/src/libgfortran/generated/maxloc0_4_r10.c (.../tags/gcc_4_8_3_release)
 
16423
+++ b/src/libgfortran/generated/maxloc0_4_r10.c (.../branches/gcc-4_8-branch)
 
16424
@@ -58,7 +58,7 @@
 
16425
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16426
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16427
       retarray->offset = 0;
 
16428
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16429
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16430
     }
 
16431
   else
 
16432
     {
 
16433
@@ -199,7 +199,7 @@
 
16434
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16435
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16436
       retarray->offset = 0;
 
16437
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16438
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16439
     }
 
16440
   else
 
16441
     {
 
16442
@@ -367,7 +367,7 @@
 
16443
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16444
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16445
       retarray->offset = 0;
 
16446
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16447
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16448
     }
 
16449
   else if (unlikely (compile_options.bounds_check))
 
16450
     {
 
16451
Index: libgfortran/generated/maxloc0_8_i16.c
 
16452
===================================================================
 
16453
--- a/src/libgfortran/generated/maxloc0_8_i16.c (.../tags/gcc_4_8_3_release)
 
16454
+++ b/src/libgfortran/generated/maxloc0_8_i16.c (.../branches/gcc-4_8-branch)
 
16455
@@ -58,7 +58,7 @@
 
16456
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16457
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16458
       retarray->offset = 0;
 
16459
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16460
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16461
     }
 
16462
   else
 
16463
     {
 
16464
@@ -199,7 +199,7 @@
 
16465
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16466
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16467
       retarray->offset = 0;
 
16468
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16469
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16470
     }
 
16471
   else
 
16472
     {
 
16473
@@ -367,7 +367,7 @@
 
16474
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16475
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16476
       retarray->offset = 0;
 
16477
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16478
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16479
     }
 
16480
   else if (unlikely (compile_options.bounds_check))
 
16481
     {
 
16482
Index: libgfortran/generated/iall_i2.c
 
16483
===================================================================
 
16484
--- a/src/libgfortran/generated/iall_i2.c       (.../tags/gcc_4_8_3_release)
 
16485
+++ b/src/libgfortran/generated/iall_i2.c       (.../branches/gcc-4_8-branch)
 
16486
@@ -97,10 +97,9 @@
 
16487
       retarray->offset = 0;
 
16488
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16489
 
 
16490
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16491
-                  * extent[rank-1];
 
16492
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16493
 
 
16494
-      retarray->base_addr = xmalloc (alloc_size);
 
16495
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
16496
       if (alloc_size == 0)
 
16497
        {
 
16498
          /* Make sure we have a zero-sized array.  */
 
16499
@@ -272,8 +271,7 @@
 
16500
 
 
16501
        }
 
16502
 
 
16503
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16504
-                  * extent[rank-1];
 
16505
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16506
 
 
16507
       retarray->offset = 0;
 
16508
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16509
@@ -285,7 +283,7 @@
 
16510
          return;
 
16511
        }
 
16512
       else
 
16513
-       retarray->base_addr = xmalloc (alloc_size);
 
16514
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
16515
 
 
16516
     }
 
16517
   else
 
16518
@@ -430,8 +428,7 @@
 
16519
       retarray->offset = 0;
 
16520
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16521
 
 
16522
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16523
-                  * extent[rank-1];
 
16524
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16525
 
 
16526
       if (alloc_size == 0)
 
16527
        {
 
16528
@@ -440,7 +437,7 @@
 
16529
          return;
 
16530
        }
 
16531
       else
 
16532
-       retarray->base_addr = xmalloc (alloc_size);
 
16533
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
16534
     }
 
16535
   else
 
16536
     {
 
16537
Index: libgfortran/generated/maxloc1_8_r10.c
 
16538
===================================================================
 
16539
--- a/src/libgfortran/generated/maxloc1_8_r10.c (.../tags/gcc_4_8_3_release)
 
16540
+++ b/src/libgfortran/generated/maxloc1_8_r10.c (.../branches/gcc-4_8-branch)
 
16541
@@ -98,10 +98,9 @@
 
16542
       retarray->offset = 0;
 
16543
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16544
 
 
16545
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16546
-                  * extent[rank-1];
 
16547
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16548
 
 
16549
-      retarray->base_addr = xmalloc (alloc_size);
 
16550
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16551
       if (alloc_size == 0)
 
16552
        {
 
16553
          /* Make sure we have a zero-sized array.  */
 
16554
@@ -294,8 +293,7 @@
 
16555
 
 
16556
        }
 
16557
 
 
16558
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16559
-                  * extent[rank-1];
 
16560
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16561
 
 
16562
       retarray->offset = 0;
 
16563
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16564
@@ -307,7 +305,7 @@
 
16565
          return;
 
16566
        }
 
16567
       else
 
16568
-       retarray->base_addr = xmalloc (alloc_size);
 
16569
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16570
 
 
16571
     }
 
16572
   else
 
16573
@@ -485,8 +483,7 @@
 
16574
       retarray->offset = 0;
 
16575
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16576
 
 
16577
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16578
-                  * extent[rank-1];
 
16579
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16580
 
 
16581
       if (alloc_size == 0)
 
16582
        {
 
16583
@@ -495,7 +492,7 @@
 
16584
          return;
 
16585
        }
 
16586
       else
 
16587
-       retarray->base_addr = xmalloc (alloc_size);
 
16588
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
16589
     }
 
16590
   else
 
16591
     {
 
16592
Index: libgfortran/generated/maxloc0_16_r4.c
 
16593
===================================================================
 
16594
--- a/src/libgfortran/generated/maxloc0_16_r4.c (.../tags/gcc_4_8_3_release)
 
16595
+++ b/src/libgfortran/generated/maxloc0_16_r4.c (.../branches/gcc-4_8-branch)
 
16596
@@ -58,7 +58,7 @@
 
16597
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16598
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16599
       retarray->offset = 0;
 
16600
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16601
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16602
     }
 
16603
   else
 
16604
     {
 
16605
@@ -199,7 +199,7 @@
 
16606
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16607
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16608
       retarray->offset = 0;
 
16609
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16610
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16611
     }
 
16612
   else
 
16613
     {
 
16614
@@ -367,7 +367,7 @@
 
16615
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16616
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16617
       retarray->offset = 0;
 
16618
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16619
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16620
     }
 
16621
   else if (unlikely (compile_options.bounds_check))
 
16622
     {
 
16623
Index: libgfortran/generated/minloc0_8_i1.c
 
16624
===================================================================
 
16625
--- a/src/libgfortran/generated/minloc0_8_i1.c  (.../tags/gcc_4_8_3_release)
 
16626
+++ b/src/libgfortran/generated/minloc0_8_i1.c  (.../branches/gcc-4_8-branch)
 
16627
@@ -58,7 +58,7 @@
 
16628
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16629
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16630
       retarray->offset = 0;
 
16631
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16632
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16633
     }
 
16634
   else
 
16635
     {
 
16636
@@ -199,7 +199,7 @@
 
16637
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16638
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16639
       retarray->offset = 0;
 
16640
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16641
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16642
     }
 
16643
   else
 
16644
     {
 
16645
@@ -367,7 +367,7 @@
 
16646
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16647
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16648
       retarray->offset = 0;
 
16649
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
16650
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
16651
     }
 
16652
   else if (unlikely (compile_options.bounds_check))
 
16653
     {
 
16654
Index: libgfortran/generated/minloc1_16_r8.c
 
16655
===================================================================
 
16656
--- a/src/libgfortran/generated/minloc1_16_r8.c (.../tags/gcc_4_8_3_release)
 
16657
+++ b/src/libgfortran/generated/minloc1_16_r8.c (.../branches/gcc-4_8-branch)
 
16658
@@ -98,10 +98,9 @@
 
16659
       retarray->offset = 0;
 
16660
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16661
 
 
16662
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16663
-                  * extent[rank-1];
 
16664
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16665
 
 
16666
-      retarray->base_addr = xmalloc (alloc_size);
 
16667
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16668
       if (alloc_size == 0)
 
16669
        {
 
16670
          /* Make sure we have a zero-sized array.  */
 
16671
@@ -294,8 +293,7 @@
 
16672
 
 
16673
        }
 
16674
 
 
16675
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16676
-                  * extent[rank-1];
 
16677
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16678
 
 
16679
       retarray->offset = 0;
 
16680
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16681
@@ -307,7 +305,7 @@
 
16682
          return;
 
16683
        }
 
16684
       else
 
16685
-       retarray->base_addr = xmalloc (alloc_size);
 
16686
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16687
 
 
16688
     }
 
16689
   else
 
16690
@@ -485,8 +483,7 @@
 
16691
       retarray->offset = 0;
 
16692
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16693
 
 
16694
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16695
-                  * extent[rank-1];
 
16696
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16697
 
 
16698
       if (alloc_size == 0)
 
16699
        {
 
16700
@@ -495,7 +492,7 @@
 
16701
          return;
 
16702
        }
 
16703
       else
 
16704
-       retarray->base_addr = xmalloc (alloc_size);
 
16705
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16706
     }
 
16707
   else
 
16708
     {
 
16709
Index: libgfortran/generated/unpack_i8.c
 
16710
===================================================================
 
16711
--- a/src/libgfortran/generated/unpack_i8.c     (.../tags/gcc_4_8_3_release)
 
16712
+++ b/src/libgfortran/generated/unpack_i8.c     (.../branches/gcc-4_8-branch)
 
16713
@@ -99,7 +99,7 @@
 
16714
          rs *= extent[n];
 
16715
        }
 
16716
       ret->offset = 0;
 
16717
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
 
16718
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
 
16719
     }
 
16720
   else
 
16721
     {
 
16722
@@ -244,7 +244,7 @@
 
16723
          rs *= extent[n];
 
16724
        }
 
16725
       ret->offset = 0;
 
16726
-      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
 
16727
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
 
16728
     }
 
16729
   else
 
16730
     {
 
16731
Index: libgfortran/generated/maxloc0_4_i4.c
 
16732
===================================================================
 
16733
--- a/src/libgfortran/generated/maxloc0_4_i4.c  (.../tags/gcc_4_8_3_release)
 
16734
+++ b/src/libgfortran/generated/maxloc0_4_i4.c  (.../branches/gcc-4_8-branch)
 
16735
@@ -58,7 +58,7 @@
 
16736
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16737
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16738
       retarray->offset = 0;
 
16739
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16740
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16741
     }
 
16742
   else
 
16743
     {
 
16744
@@ -199,7 +199,7 @@
 
16745
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16746
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16747
       retarray->offset = 0;
 
16748
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16749
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16750
     }
 
16751
   else
 
16752
     {
 
16753
@@ -367,7 +367,7 @@
 
16754
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16755
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16756
       retarray->offset = 0;
 
16757
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
16758
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
16759
     }
 
16760
   else if (unlikely (compile_options.bounds_check))
 
16761
     {
 
16762
Index: libgfortran/generated/count_4_l.c
 
16763
===================================================================
 
16764
--- a/src/libgfortran/generated/count_4_l.c     (.../tags/gcc_4_8_3_release)
 
16765
+++ b/src/libgfortran/generated/count_4_l.c     (.../branches/gcc-4_8-branch)
 
16766
@@ -101,8 +101,7 @@
 
16767
       retarray->offset = 0;
 
16768
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16769
 
 
16770
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16771
-                  * extent[rank-1];
 
16772
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16773
 
 
16774
       if (alloc_size == 0)
 
16775
        {
 
16776
@@ -111,7 +110,7 @@
 
16777
          return;
 
16778
        }
 
16779
       else
 
16780
-       retarray->base_addr = xmalloc (alloc_size);
 
16781
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
16782
     }
 
16783
   else
 
16784
     {
 
16785
Index: libgfortran/generated/sum_r10.c
 
16786
===================================================================
 
16787
--- a/src/libgfortran/generated/sum_r10.c       (.../tags/gcc_4_8_3_release)
 
16788
+++ b/src/libgfortran/generated/sum_r10.c       (.../branches/gcc-4_8-branch)
 
16789
@@ -97,10 +97,9 @@
 
16790
       retarray->offset = 0;
 
16791
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16792
 
 
16793
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16794
-                  * extent[rank-1];
 
16795
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16796
 
 
16797
-      retarray->base_addr = xmalloc (alloc_size);
 
16798
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
16799
       if (alloc_size == 0)
 
16800
        {
 
16801
          /* Make sure we have a zero-sized array.  */
 
16802
@@ -272,8 +271,7 @@
 
16803
 
 
16804
        }
 
16805
 
 
16806
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16807
-                  * extent[rank-1];
 
16808
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16809
 
 
16810
       retarray->offset = 0;
 
16811
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16812
@@ -285,7 +283,7 @@
 
16813
          return;
 
16814
        }
 
16815
       else
 
16816
-       retarray->base_addr = xmalloc (alloc_size);
 
16817
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
16818
 
 
16819
     }
 
16820
   else
 
16821
@@ -430,8 +428,7 @@
 
16822
       retarray->offset = 0;
 
16823
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16824
 
 
16825
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16826
-                  * extent[rank-1];
 
16827
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16828
 
 
16829
       if (alloc_size == 0)
 
16830
        {
 
16831
@@ -440,7 +437,7 @@
 
16832
          return;
 
16833
        }
 
16834
       else
 
16835
-       retarray->base_addr = xmalloc (alloc_size);
 
16836
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
16837
     }
 
16838
   else
 
16839
     {
 
16840
Index: libgfortran/generated/sum_c4.c
 
16841
===================================================================
 
16842
--- a/src/libgfortran/generated/sum_c4.c        (.../tags/gcc_4_8_3_release)
 
16843
+++ b/src/libgfortran/generated/sum_c4.c        (.../branches/gcc-4_8-branch)
 
16844
@@ -97,10 +97,9 @@
 
16845
       retarray->offset = 0;
 
16846
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16847
 
 
16848
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16849
-                  * extent[rank-1];
 
16850
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16851
 
 
16852
-      retarray->base_addr = xmalloc (alloc_size);
 
16853
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
16854
       if (alloc_size == 0)
 
16855
        {
 
16856
          /* Make sure we have a zero-sized array.  */
 
16857
@@ -272,8 +271,7 @@
 
16858
 
 
16859
        }
 
16860
 
 
16861
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16862
-                  * extent[rank-1];
 
16863
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16864
 
 
16865
       retarray->offset = 0;
 
16866
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16867
@@ -285,7 +283,7 @@
 
16868
          return;
 
16869
        }
 
16870
       else
 
16871
-       retarray->base_addr = xmalloc (alloc_size);
 
16872
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
16873
 
 
16874
     }
 
16875
   else
 
16876
@@ -430,8 +428,7 @@
 
16877
       retarray->offset = 0;
 
16878
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16879
 
 
16880
-      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16881
-                  * extent[rank-1];
 
16882
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16883
 
 
16884
       if (alloc_size == 0)
 
16885
        {
 
16886
@@ -440,7 +437,7 @@
 
16887
          return;
 
16888
        }
 
16889
       else
 
16890
-       retarray->base_addr = xmalloc (alloc_size);
 
16891
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
16892
     }
 
16893
   else
 
16894
     {
 
16895
Index: libgfortran/generated/maxloc1_16_r10.c
 
16896
===================================================================
 
16897
--- a/src/libgfortran/generated/maxloc1_16_r10.c        (.../tags/gcc_4_8_3_release)
 
16898
+++ b/src/libgfortran/generated/maxloc1_16_r10.c        (.../branches/gcc-4_8-branch)
 
16899
@@ -98,10 +98,9 @@
 
16900
       retarray->offset = 0;
 
16901
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16902
 
 
16903
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16904
-                  * extent[rank-1];
 
16905
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16906
 
 
16907
-      retarray->base_addr = xmalloc (alloc_size);
 
16908
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16909
       if (alloc_size == 0)
 
16910
        {
 
16911
          /* Make sure we have a zero-sized array.  */
 
16912
@@ -294,8 +293,7 @@
 
16913
 
 
16914
        }
 
16915
 
 
16916
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16917
-                  * extent[rank-1];
 
16918
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16919
 
 
16920
       retarray->offset = 0;
 
16921
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16922
@@ -307,7 +305,7 @@
 
16923
          return;
 
16924
        }
 
16925
       else
 
16926
-       retarray->base_addr = xmalloc (alloc_size);
 
16927
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16928
 
 
16929
     }
 
16930
   else
 
16931
@@ -485,8 +483,7 @@
 
16932
       retarray->offset = 0;
 
16933
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
16934
 
 
16935
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
16936
-                  * extent[rank-1];
 
16937
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
16938
 
 
16939
       if (alloc_size == 0)
 
16940
        {
 
16941
@@ -495,7 +492,7 @@
 
16942
          return;
 
16943
        }
 
16944
       else
 
16945
-       retarray->base_addr = xmalloc (alloc_size);
 
16946
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
16947
     }
 
16948
   else
 
16949
     {
 
16950
Index: libgfortran/generated/pack_i16.c
 
16951
===================================================================
 
16952
--- a/src/libgfortran/generated/pack_i16.c      (.../tags/gcc_4_8_3_release)
 
16953
+++ b/src/libgfortran/generated/pack_i16.c      (.../branches/gcc-4_8-branch)
 
16954
@@ -167,8 +167,8 @@
 
16955
 
 
16956
          ret->offset = 0;
 
16957
 
 
16958
-         /* xmalloc allocates a single byte for zero size.  */
 
16959
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
 
16960
+         /* xmallocarray allocates a single byte for zero size.  */
 
16961
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
 
16962
 
 
16963
          if (total == 0)
 
16964
            return;
 
16965
Index: libgfortran/generated/matmul_i8.c
 
16966
===================================================================
 
16967
--- a/src/libgfortran/generated/matmul_i8.c     (.../tags/gcc_4_8_3_release)
 
16968
+++ b/src/libgfortran/generated/matmul_i8.c     (.../branches/gcc-4_8-branch)
 
16969
@@ -124,7 +124,7 @@
 
16970
         }
 
16971
 
 
16972
       retarray->base_addr
 
16973
-       = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
 
16974
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_8));
 
16975
       retarray->offset = 0;
 
16976
     }
 
16977
     else if (unlikely (compile_options.bounds_check))
 
16978
Index: libgfortran/generated/maxloc0_16_i2.c
 
16979
===================================================================
 
16980
--- a/src/libgfortran/generated/maxloc0_16_i2.c (.../tags/gcc_4_8_3_release)
 
16981
+++ b/src/libgfortran/generated/maxloc0_16_i2.c (.../branches/gcc-4_8-branch)
 
16982
@@ -58,7 +58,7 @@
 
16983
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
16984
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16985
       retarray->offset = 0;
 
16986
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16987
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16988
     }
 
16989
   else
 
16990
     {
 
16991
@@ -199,7 +199,7 @@
 
16992
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
16993
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
16994
       retarray->offset = 0;
 
16995
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
16996
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
16997
     }
 
16998
   else
 
16999
     {
 
17000
@@ -367,7 +367,7 @@
 
17001
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17002
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17003
       retarray->offset = 0;
 
17004
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17005
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17006
     }
 
17007
   else if (unlikely (compile_options.bounds_check))
 
17008
     {
 
17009
Index: libgfortran/generated/spread_c4.c
 
17010
===================================================================
 
17011
--- a/src/libgfortran/generated/spread_c4.c     (.../tags/gcc_4_8_3_release)
 
17012
+++ b/src/libgfortran/generated/spread_c4.c     (.../branches/gcc-4_8-branch)
 
17013
@@ -101,8 +101,8 @@
 
17014
        }
 
17015
       ret->offset = 0;
 
17016
 
 
17017
-      /* xmalloc allocates a single byte for zero size.  */
 
17018
-      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_4));
 
17019
+      /* xmallocarray allocates a single byte for zero size.  */
 
17020
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_4));
 
17021
       if (rs <= 0)
 
17022
         return;
 
17023
     }
 
17024
@@ -244,7 +244,7 @@
 
17025
 
 
17026
   if (ret->base_addr == NULL)
 
17027
     {
 
17028
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_4));
 
17029
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_4));
 
17030
       ret->offset = 0;
 
17031
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
17032
     }
 
17033
Index: libgfortran/generated/maxval_r10.c
 
17034
===================================================================
 
17035
--- a/src/libgfortran/generated/maxval_r10.c    (.../tags/gcc_4_8_3_release)
 
17036
+++ b/src/libgfortran/generated/maxval_r10.c    (.../branches/gcc-4_8-branch)
 
17037
@@ -97,10 +97,9 @@
 
17038
       retarray->offset = 0;
 
17039
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17040
 
 
17041
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17042
-                  * extent[rank-1];
 
17043
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17044
 
 
17045
-      retarray->base_addr = xmalloc (alloc_size);
 
17046
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
17047
       if (alloc_size == 0)
 
17048
        {
 
17049
          /* Make sure we have a zero-sized array.  */
 
17050
@@ -286,8 +285,7 @@
 
17051
 
 
17052
        }
 
17053
 
 
17054
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17055
-                  * extent[rank-1];
 
17056
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17057
 
 
17058
       retarray->offset = 0;
 
17059
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17060
@@ -299,7 +297,7 @@
 
17061
          return;
 
17062
        }
 
17063
       else
 
17064
-       retarray->base_addr = xmalloc (alloc_size);
 
17065
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
17066
 
 
17067
     }
 
17068
   else
 
17069
@@ -472,8 +470,7 @@
 
17070
       retarray->offset = 0;
 
17071
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17072
 
 
17073
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17074
-                  * extent[rank-1];
 
17075
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17076
 
 
17077
       if (alloc_size == 0)
 
17078
        {
 
17079
@@ -482,7 +479,7 @@
 
17080
          return;
 
17081
        }
 
17082
       else
 
17083
-       retarray->base_addr = xmalloc (alloc_size);
 
17084
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
17085
     }
 
17086
   else
 
17087
     {
 
17088
Index: libgfortran/generated/pack_i4.c
 
17089
===================================================================
 
17090
--- a/src/libgfortran/generated/pack_i4.c       (.../tags/gcc_4_8_3_release)
 
17091
+++ b/src/libgfortran/generated/pack_i4.c       (.../branches/gcc-4_8-branch)
 
17092
@@ -167,8 +167,8 @@
 
17093
 
 
17094
          ret->offset = 0;
 
17095
 
 
17096
-         /* xmalloc allocates a single byte for zero size.  */
 
17097
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * total);
 
17098
+         /* xmallocarray allocates a single byte for zero size.  */
 
17099
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_4));
 
17100
 
 
17101
          if (total == 0)
 
17102
            return;
 
17103
Index: libgfortran/generated/maxloc1_4_i1.c
 
17104
===================================================================
 
17105
--- a/src/libgfortran/generated/maxloc1_4_i1.c  (.../tags/gcc_4_8_3_release)
 
17106
+++ b/src/libgfortran/generated/maxloc1_4_i1.c  (.../branches/gcc-4_8-branch)
 
17107
@@ -98,10 +98,9 @@
 
17108
       retarray->offset = 0;
 
17109
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17110
 
 
17111
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17112
-                  * extent[rank-1];
 
17113
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17114
 
 
17115
-      retarray->base_addr = xmalloc (alloc_size);
 
17116
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17117
       if (alloc_size == 0)
 
17118
        {
 
17119
          /* Make sure we have a zero-sized array.  */
 
17120
@@ -294,8 +293,7 @@
 
17121
 
 
17122
        }
 
17123
 
 
17124
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17125
-                  * extent[rank-1];
 
17126
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17127
 
 
17128
       retarray->offset = 0;
 
17129
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17130
@@ -307,7 +305,7 @@
 
17131
          return;
 
17132
        }
 
17133
       else
 
17134
-       retarray->base_addr = xmalloc (alloc_size);
 
17135
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17136
 
 
17137
     }
 
17138
   else
 
17139
@@ -485,8 +483,7 @@
 
17140
       retarray->offset = 0;
 
17141
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17142
 
 
17143
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17144
-                  * extent[rank-1];
 
17145
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17146
 
 
17147
       if (alloc_size == 0)
 
17148
        {
 
17149
@@ -495,7 +492,7 @@
 
17150
          return;
 
17151
        }
 
17152
       else
 
17153
-       retarray->base_addr = xmalloc (alloc_size);
 
17154
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17155
     }
 
17156
   else
 
17157
     {
 
17158
Index: libgfortran/generated/matmul_r10.c
 
17159
===================================================================
 
17160
--- a/src/libgfortran/generated/matmul_r10.c    (.../tags/gcc_4_8_3_release)
 
17161
+++ b/src/libgfortran/generated/matmul_r10.c    (.../branches/gcc-4_8-branch)
 
17162
@@ -124,7 +124,7 @@
 
17163
         }
 
17164
 
 
17165
       retarray->base_addr
 
17166
-       = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
 
17167
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_10));
 
17168
       retarray->offset = 0;
 
17169
     }
 
17170
     else if (unlikely (compile_options.bounds_check))
 
17171
Index: libgfortran/generated/minloc1_4_i8.c
 
17172
===================================================================
 
17173
--- a/src/libgfortran/generated/minloc1_4_i8.c  (.../tags/gcc_4_8_3_release)
 
17174
+++ b/src/libgfortran/generated/minloc1_4_i8.c  (.../branches/gcc-4_8-branch)
 
17175
@@ -98,10 +98,9 @@
 
17176
       retarray->offset = 0;
 
17177
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17178
 
 
17179
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17180
-                  * extent[rank-1];
 
17181
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17182
 
 
17183
-      retarray->base_addr = xmalloc (alloc_size);
 
17184
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17185
       if (alloc_size == 0)
 
17186
        {
 
17187
          /* Make sure we have a zero-sized array.  */
 
17188
@@ -294,8 +293,7 @@
 
17189
 
 
17190
        }
 
17191
 
 
17192
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17193
-                  * extent[rank-1];
 
17194
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17195
 
 
17196
       retarray->offset = 0;
 
17197
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17198
@@ -307,7 +305,7 @@
 
17199
          return;
 
17200
        }
 
17201
       else
 
17202
-       retarray->base_addr = xmalloc (alloc_size);
 
17203
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17204
 
 
17205
     }
 
17206
   else
 
17207
@@ -485,8 +483,7 @@
 
17208
       retarray->offset = 0;
 
17209
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17210
 
 
17211
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17212
-                  * extent[rank-1];
 
17213
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17214
 
 
17215
       if (alloc_size == 0)
 
17216
        {
 
17217
@@ -495,7 +492,7 @@
 
17218
          return;
 
17219
        }
 
17220
       else
 
17221
-       retarray->base_addr = xmalloc (alloc_size);
 
17222
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17223
     }
 
17224
   else
 
17225
     {
 
17226
Index: libgfortran/generated/minloc0_8_r4.c
 
17227
===================================================================
 
17228
--- a/src/libgfortran/generated/minloc0_8_r4.c  (.../tags/gcc_4_8_3_release)
 
17229
+++ b/src/libgfortran/generated/minloc0_8_r4.c  (.../branches/gcc-4_8-branch)
 
17230
@@ -58,7 +58,7 @@
 
17231
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17232
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17233
       retarray->offset = 0;
 
17234
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17235
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17236
     }
 
17237
   else
 
17238
     {
 
17239
@@ -199,7 +199,7 @@
 
17240
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17241
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17242
       retarray->offset = 0;
 
17243
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17244
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17245
     }
 
17246
   else
 
17247
     {
 
17248
@@ -367,7 +367,7 @@
 
17249
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17250
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17251
       retarray->offset = 0;
 
17252
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17253
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17254
     }
 
17255
   else if (unlikely (compile_options.bounds_check))
 
17256
     {
 
17257
Index: libgfortran/generated/matmul_l4.c
 
17258
===================================================================
 
17259
--- a/src/libgfortran/generated/matmul_l4.c     (.../tags/gcc_4_8_3_release)
 
17260
+++ b/src/libgfortran/generated/matmul_l4.c     (.../branches/gcc-4_8-branch)
 
17261
@@ -88,7 +88,7 @@
 
17262
         }
 
17263
           
 
17264
       retarray->base_addr
 
17265
-       = xmalloc (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
 
17266
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_4));
 
17267
       retarray->offset = 0;
 
17268
     }
 
17269
     else if (unlikely (compile_options.bounds_check))
 
17270
Index: libgfortran/generated/reshape_r8.c
 
17271
===================================================================
 
17272
--- a/src/libgfortran/generated/reshape_r8.c    (.../tags/gcc_4_8_3_release)
 
17273
+++ b/src/libgfortran/generated/reshape_r8.c    (.../branches/gcc-4_8-branch)
 
17274
@@ -111,11 +111,11 @@
 
17275
       ret->offset = 0;
 
17276
 
 
17277
       if (unlikely (rs < 1))
 
17278
-        alloc_size = 1;
 
17279
+        alloc_size = 0;
 
17280
       else
 
17281
-        alloc_size = rs * sizeof (GFC_REAL_8);
 
17282
+        alloc_size = rs;
 
17283
 
 
17284
-      ret->base_addr = xmalloc (alloc_size);
 
17285
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
17286
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
17287
     }
 
17288
 
 
17289
Index: libgfortran/generated/in_pack_c10.c
 
17290
===================================================================
 
17291
--- a/src/libgfortran/generated/in_pack_c10.c   (.../tags/gcc_4_8_3_release)
 
17292
+++ b/src/libgfortran/generated/in_pack_c10.c   (.../branches/gcc-4_8-branch)
 
17293
@@ -76,7 +76,7 @@
 
17294
     return source->base_addr;
 
17295
 
 
17296
   /* Allocate storage for the destination.  */
 
17297
-  destptr = (GFC_COMPLEX_10 *)xmalloc (ssize * sizeof (GFC_COMPLEX_10));
 
17298
+  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_10));
 
17299
   dest = destptr;
 
17300
   src = source->base_addr;
 
17301
   stride0 = stride[0];
 
17302
Index: libgfortran/generated/all_l4.c
 
17303
===================================================================
 
17304
--- a/src/libgfortran/generated/all_l4.c        (.../tags/gcc_4_8_3_release)
 
17305
+++ b/src/libgfortran/generated/all_l4.c        (.../branches/gcc-4_8-branch)
 
17306
@@ -101,8 +101,7 @@
 
17307
       retarray->offset = 0;
 
17308
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17309
 
 
17310
-      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17311
-                  * extent[rank-1];
 
17312
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17313
 
 
17314
       if (alloc_size == 0)
 
17315
        {
 
17316
@@ -111,7 +110,7 @@
 
17317
          return;
 
17318
        }
 
17319
       else
 
17320
-       retarray->base_addr = xmalloc (alloc_size);
 
17321
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
 
17322
     }
 
17323
   else
 
17324
     {
 
17325
Index: libgfortran/generated/minloc0_8_i2.c
 
17326
===================================================================
 
17327
--- a/src/libgfortran/generated/minloc0_8_i2.c  (.../tags/gcc_4_8_3_release)
 
17328
+++ b/src/libgfortran/generated/minloc0_8_i2.c  (.../branches/gcc-4_8-branch)
 
17329
@@ -58,7 +58,7 @@
 
17330
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17331
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17332
       retarray->offset = 0;
 
17333
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17334
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17335
     }
 
17336
   else
 
17337
     {
 
17338
@@ -199,7 +199,7 @@
 
17339
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17340
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17341
       retarray->offset = 0;
 
17342
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17343
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17344
     }
 
17345
   else
 
17346
     {
 
17347
@@ -367,7 +367,7 @@
 
17348
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17349
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17350
       retarray->offset = 0;
 
17351
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
17352
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
17353
     }
 
17354
   else if (unlikely (compile_options.bounds_check))
 
17355
     {
 
17356
Index: libgfortran/generated/norm2_r16.c
 
17357
===================================================================
 
17358
--- a/src/libgfortran/generated/norm2_r16.c     (.../tags/gcc_4_8_3_release)
 
17359
+++ b/src/libgfortran/generated/norm2_r16.c     (.../branches/gcc-4_8-branch)
 
17360
@@ -105,10 +105,9 @@
 
17361
       retarray->offset = 0;
 
17362
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17363
 
 
17364
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17365
-                  * extent[rank-1];
 
17366
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17367
 
 
17368
-      retarray->base_addr = xmalloc (alloc_size);
 
17369
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
17370
       if (alloc_size == 0)
 
17371
        {
 
17372
          /* Make sure we have a zero-sized array.  */
 
17373
Index: libgfortran/generated/reshape_c10.c
 
17374
===================================================================
 
17375
--- a/src/libgfortran/generated/reshape_c10.c   (.../tags/gcc_4_8_3_release)
 
17376
+++ b/src/libgfortran/generated/reshape_c10.c   (.../branches/gcc-4_8-branch)
 
17377
@@ -111,11 +111,11 @@
 
17378
       ret->offset = 0;
 
17379
 
 
17380
       if (unlikely (rs < 1))
 
17381
-        alloc_size = 1;
 
17382
+        alloc_size = 0;
 
17383
       else
 
17384
-        alloc_size = rs * sizeof (GFC_COMPLEX_10);
 
17385
+        alloc_size = rs;
 
17386
 
 
17387
-      ret->base_addr = xmalloc (alloc_size);
 
17388
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
17389
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
17390
     }
 
17391
 
 
17392
Index: libgfortran/generated/unpack_c16.c
 
17393
===================================================================
 
17394
--- a/src/libgfortran/generated/unpack_c16.c    (.../tags/gcc_4_8_3_release)
 
17395
+++ b/src/libgfortran/generated/unpack_c16.c    (.../branches/gcc-4_8-branch)
 
17396
@@ -99,7 +99,7 @@
 
17397
          rs *= extent[n];
 
17398
        }
 
17399
       ret->offset = 0;
 
17400
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
 
17401
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
 
17402
     }
 
17403
   else
 
17404
     {
 
17405
@@ -244,7 +244,7 @@
 
17406
          rs *= extent[n];
 
17407
        }
 
17408
       ret->offset = 0;
 
17409
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
 
17410
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
 
17411
     }
 
17412
   else
 
17413
     {
 
17414
Index: libgfortran/generated/maxloc1_4_r4.c
 
17415
===================================================================
 
17416
--- a/src/libgfortran/generated/maxloc1_4_r4.c  (.../tags/gcc_4_8_3_release)
 
17417
+++ b/src/libgfortran/generated/maxloc1_4_r4.c  (.../branches/gcc-4_8-branch)
 
17418
@@ -98,10 +98,9 @@
 
17419
       retarray->offset = 0;
 
17420
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17421
 
 
17422
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17423
-                  * extent[rank-1];
 
17424
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17425
 
 
17426
-      retarray->base_addr = xmalloc (alloc_size);
 
17427
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17428
       if (alloc_size == 0)
 
17429
        {
 
17430
          /* Make sure we have a zero-sized array.  */
 
17431
@@ -294,8 +293,7 @@
 
17432
 
 
17433
        }
 
17434
 
 
17435
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17436
-                  * extent[rank-1];
 
17437
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17438
 
 
17439
       retarray->offset = 0;
 
17440
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17441
@@ -307,7 +305,7 @@
 
17442
          return;
 
17443
        }
 
17444
       else
 
17445
-       retarray->base_addr = xmalloc (alloc_size);
 
17446
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17447
 
 
17448
     }
 
17449
   else
 
17450
@@ -485,8 +483,7 @@
 
17451
       retarray->offset = 0;
 
17452
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17453
 
 
17454
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17455
-                  * extent[rank-1];
 
17456
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17457
 
 
17458
       if (alloc_size == 0)
 
17459
        {
 
17460
@@ -495,7 +492,7 @@
 
17461
          return;
 
17462
        }
 
17463
       else
 
17464
-       retarray->base_addr = xmalloc (alloc_size);
 
17465
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17466
     }
 
17467
   else
 
17468
     {
 
17469
Index: libgfortran/generated/maxval_r8.c
 
17470
===================================================================
 
17471
--- a/src/libgfortran/generated/maxval_r8.c     (.../tags/gcc_4_8_3_release)
 
17472
+++ b/src/libgfortran/generated/maxval_r8.c     (.../branches/gcc-4_8-branch)
 
17473
@@ -97,10 +97,9 @@
 
17474
       retarray->offset = 0;
 
17475
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17476
 
 
17477
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17478
-                  * extent[rank-1];
 
17479
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17480
 
 
17481
-      retarray->base_addr = xmalloc (alloc_size);
 
17482
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
17483
       if (alloc_size == 0)
 
17484
        {
 
17485
          /* Make sure we have a zero-sized array.  */
 
17486
@@ -286,8 +285,7 @@
 
17487
 
 
17488
        }
 
17489
 
 
17490
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17491
-                  * extent[rank-1];
 
17492
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17493
 
 
17494
       retarray->offset = 0;
 
17495
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17496
@@ -299,7 +297,7 @@
 
17497
          return;
 
17498
        }
 
17499
       else
 
17500
-       retarray->base_addr = xmalloc (alloc_size);
 
17501
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
17502
 
 
17503
     }
 
17504
   else
 
17505
@@ -472,8 +470,7 @@
 
17506
       retarray->offset = 0;
 
17507
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17508
 
 
17509
-      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17510
-                  * extent[rank-1];
 
17511
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17512
 
 
17513
       if (alloc_size == 0)
 
17514
        {
 
17515
@@ -482,7 +479,7 @@
 
17516
          return;
 
17517
        }
 
17518
       else
 
17519
-       retarray->base_addr = xmalloc (alloc_size);
 
17520
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
17521
     }
 
17522
   else
 
17523
     {
 
17524
Index: libgfortran/generated/transpose_c4.c
 
17525
===================================================================
 
17526
--- a/src/libgfortran/generated/transpose_c4.c  (.../tags/gcc_4_8_3_release)
 
17527
+++ b/src/libgfortran/generated/transpose_c4.c  (.../branches/gcc-4_8-branch)
 
17528
@@ -60,7 +60,8 @@
 
17529
       GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
 
17530
                        GFC_DESCRIPTOR_EXTENT(source, 1));
 
17531
 
 
17532
-      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
 
17533
+      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
 
17534
+                                     sizeof (GFC_COMPLEX_4));
 
17535
       ret->offset = 0;
 
17536
     } else if (unlikely (compile_options.bounds_check))
 
17537
     {
 
17538
Index: libgfortran/generated/eoshift1_4.c
 
17539
===================================================================
 
17540
--- a/src/libgfortran/generated/eoshift1_4.c    (.../tags/gcc_4_8_3_release)
 
17541
+++ b/src/libgfortran/generated/eoshift1_4.c    (.../branches/gcc-4_8-branch)
 
17542
@@ -105,8 +105,8 @@
 
17543
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
17544
 
 
17545
         }
 
17546
-      /* xmalloc allocates a single byte for zero size.  */
 
17547
-      ret->base_addr = xmalloc (size * arraysize);
 
17548
+      /* xmallocarray allocates a single byte for zero size.  */
 
17549
+      ret->base_addr = xmallocarray (arraysize, size);
 
17550
 
 
17551
     }
 
17552
   else if (unlikely (compile_options.bounds_check))
 
17553
Index: libgfortran/generated/minval_r16.c
 
17554
===================================================================
 
17555
--- a/src/libgfortran/generated/minval_r16.c    (.../tags/gcc_4_8_3_release)
 
17556
+++ b/src/libgfortran/generated/minval_r16.c    (.../branches/gcc-4_8-branch)
 
17557
@@ -97,10 +97,9 @@
 
17558
       retarray->offset = 0;
 
17559
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17560
 
 
17561
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17562
-                  * extent[rank-1];
 
17563
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17564
 
 
17565
-      retarray->base_addr = xmalloc (alloc_size);
 
17566
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
17567
       if (alloc_size == 0)
 
17568
        {
 
17569
          /* Make sure we have a zero-sized array.  */
 
17570
@@ -286,8 +285,7 @@
 
17571
 
 
17572
        }
 
17573
 
 
17574
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17575
-                  * extent[rank-1];
 
17576
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17577
 
 
17578
       retarray->offset = 0;
 
17579
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17580
@@ -299,7 +297,7 @@
 
17581
          return;
 
17582
        }
 
17583
       else
 
17584
-       retarray->base_addr = xmalloc (alloc_size);
 
17585
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
17586
 
 
17587
     }
 
17588
   else
 
17589
@@ -472,8 +470,7 @@
 
17590
       retarray->offset = 0;
 
17591
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17592
 
 
17593
-      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17594
-                  * extent[rank-1];
 
17595
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17596
 
 
17597
       if (alloc_size == 0)
 
17598
        {
 
17599
@@ -482,7 +479,7 @@
 
17600
          return;
 
17601
        }
 
17602
       else
 
17603
-       retarray->base_addr = xmalloc (alloc_size);
 
17604
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
17605
     }
 
17606
   else
 
17607
     {
 
17608
Index: libgfortran/generated/iany_i16.c
 
17609
===================================================================
 
17610
--- a/src/libgfortran/generated/iany_i16.c      (.../tags/gcc_4_8_3_release)
 
17611
+++ b/src/libgfortran/generated/iany_i16.c      (.../branches/gcc-4_8-branch)
 
17612
@@ -97,10 +97,9 @@
 
17613
       retarray->offset = 0;
 
17614
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17615
 
 
17616
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17617
-                  * extent[rank-1];
 
17618
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17619
 
 
17620
-      retarray->base_addr = xmalloc (alloc_size);
 
17621
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17622
       if (alloc_size == 0)
 
17623
        {
 
17624
          /* Make sure we have a zero-sized array.  */
 
17625
@@ -272,8 +271,7 @@
 
17626
 
 
17627
        }
 
17628
 
 
17629
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17630
-                  * extent[rank-1];
 
17631
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17632
 
 
17633
       retarray->offset = 0;
 
17634
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17635
@@ -285,7 +283,7 @@
 
17636
          return;
 
17637
        }
 
17638
       else
 
17639
-       retarray->base_addr = xmalloc (alloc_size);
 
17640
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17641
 
 
17642
     }
 
17643
   else
 
17644
@@ -430,8 +428,7 @@
 
17645
       retarray->offset = 0;
 
17646
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17647
 
 
17648
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17649
-                  * extent[rank-1];
 
17650
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17651
 
 
17652
       if (alloc_size == 0)
 
17653
        {
 
17654
@@ -440,7 +437,7 @@
 
17655
          return;
 
17656
        }
 
17657
       else
 
17658
-       retarray->base_addr = xmalloc (alloc_size);
 
17659
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
17660
     }
 
17661
   else
 
17662
     {
 
17663
Index: libgfortran/generated/maxloc1_4_i2.c
 
17664
===================================================================
 
17665
--- a/src/libgfortran/generated/maxloc1_4_i2.c  (.../tags/gcc_4_8_3_release)
 
17666
+++ b/src/libgfortran/generated/maxloc1_4_i2.c  (.../branches/gcc-4_8-branch)
 
17667
@@ -98,10 +98,9 @@
 
17668
       retarray->offset = 0;
 
17669
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17670
 
 
17671
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17672
-                  * extent[rank-1];
 
17673
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17674
 
 
17675
-      retarray->base_addr = xmalloc (alloc_size);
 
17676
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17677
       if (alloc_size == 0)
 
17678
        {
 
17679
          /* Make sure we have a zero-sized array.  */
 
17680
@@ -294,8 +293,7 @@
 
17681
 
 
17682
        }
 
17683
 
 
17684
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17685
-                  * extent[rank-1];
 
17686
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17687
 
 
17688
       retarray->offset = 0;
 
17689
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17690
@@ -307,7 +305,7 @@
 
17691
          return;
 
17692
        }
 
17693
       else
 
17694
-       retarray->base_addr = xmalloc (alloc_size);
 
17695
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17696
 
 
17697
     }
 
17698
   else
 
17699
@@ -485,8 +483,7 @@
 
17700
       retarray->offset = 0;
 
17701
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17702
 
 
17703
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17704
-                  * extent[rank-1];
 
17705
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17706
 
 
17707
       if (alloc_size == 0)
 
17708
        {
 
17709
@@ -495,7 +492,7 @@
 
17710
          return;
 
17711
        }
 
17712
       else
 
17713
-       retarray->base_addr = xmalloc (alloc_size);
 
17714
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17715
     }
 
17716
   else
 
17717
     {
 
17718
Index: libgfortran/generated/maxloc1_8_i8.c
 
17719
===================================================================
 
17720
--- a/src/libgfortran/generated/maxloc1_8_i8.c  (.../tags/gcc_4_8_3_release)
 
17721
+++ b/src/libgfortran/generated/maxloc1_8_i8.c  (.../branches/gcc-4_8-branch)
 
17722
@@ -98,10 +98,9 @@
 
17723
       retarray->offset = 0;
 
17724
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17725
 
 
17726
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17727
-                  * extent[rank-1];
 
17728
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17729
 
 
17730
-      retarray->base_addr = xmalloc (alloc_size);
 
17731
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17732
       if (alloc_size == 0)
 
17733
        {
 
17734
          /* Make sure we have a zero-sized array.  */
 
17735
@@ -294,8 +293,7 @@
 
17736
 
 
17737
        }
 
17738
 
 
17739
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17740
-                  * extent[rank-1];
 
17741
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17742
 
 
17743
       retarray->offset = 0;
 
17744
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17745
@@ -307,7 +305,7 @@
 
17746
          return;
 
17747
        }
 
17748
       else
 
17749
-       retarray->base_addr = xmalloc (alloc_size);
 
17750
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17751
 
 
17752
     }
 
17753
   else
 
17754
@@ -485,8 +483,7 @@
 
17755
       retarray->offset = 0;
 
17756
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17757
 
 
17758
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17759
-                  * extent[rank-1];
 
17760
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17761
 
 
17762
       if (alloc_size == 0)
 
17763
        {
 
17764
@@ -495,7 +492,7 @@
 
17765
          return;
 
17766
        }
 
17767
       else
 
17768
-       retarray->base_addr = xmalloc (alloc_size);
 
17769
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
17770
     }
 
17771
   else
 
17772
     {
 
17773
Index: libgfortran/generated/maxloc0_4_r8.c
 
17774
===================================================================
 
17775
--- a/src/libgfortran/generated/maxloc0_4_r8.c  (.../tags/gcc_4_8_3_release)
 
17776
+++ b/src/libgfortran/generated/maxloc0_4_r8.c  (.../branches/gcc-4_8-branch)
 
17777
@@ -58,7 +58,7 @@
 
17778
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17779
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17780
       retarray->offset = 0;
 
17781
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
17782
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
17783
     }
 
17784
   else
 
17785
     {
 
17786
@@ -199,7 +199,7 @@
 
17787
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17788
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17789
       retarray->offset = 0;
 
17790
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
17791
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
17792
     }
 
17793
   else
 
17794
     {
 
17795
@@ -367,7 +367,7 @@
 
17796
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17797
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17798
       retarray->offset = 0;
 
17799
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
17800
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
17801
     }
 
17802
   else if (unlikely (compile_options.bounds_check))
 
17803
     {
 
17804
Index: libgfortran/generated/maxloc0_16_r16.c
 
17805
===================================================================
 
17806
--- a/src/libgfortran/generated/maxloc0_16_r16.c        (.../tags/gcc_4_8_3_release)
 
17807
+++ b/src/libgfortran/generated/maxloc0_16_r16.c        (.../branches/gcc-4_8-branch)
 
17808
@@ -58,7 +58,7 @@
 
17809
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17810
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17811
       retarray->offset = 0;
 
17812
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17813
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17814
     }
 
17815
   else
 
17816
     {
 
17817
@@ -199,7 +199,7 @@
 
17818
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
17819
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17820
       retarray->offset = 0;
 
17821
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17822
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17823
     }
 
17824
   else
 
17825
     {
 
17826
@@ -367,7 +367,7 @@
 
17827
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
17828
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
17829
       retarray->offset = 0;
 
17830
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
17831
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
17832
     }
 
17833
   else if (unlikely (compile_options.bounds_check))
 
17834
     {
 
17835
Index: libgfortran/generated/sum_c10.c
 
17836
===================================================================
 
17837
--- a/src/libgfortran/generated/sum_c10.c       (.../tags/gcc_4_8_3_release)
 
17838
+++ b/src/libgfortran/generated/sum_c10.c       (.../branches/gcc-4_8-branch)
 
17839
@@ -97,10 +97,9 @@
 
17840
       retarray->offset = 0;
 
17841
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17842
 
 
17843
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17844
-                  * extent[rank-1];
 
17845
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17846
 
 
17847
-      retarray->base_addr = xmalloc (alloc_size);
 
17848
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
17849
       if (alloc_size == 0)
 
17850
        {
 
17851
          /* Make sure we have a zero-sized array.  */
 
17852
@@ -272,8 +271,7 @@
 
17853
 
 
17854
        }
 
17855
 
 
17856
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17857
-                  * extent[rank-1];
 
17858
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17859
 
 
17860
       retarray->offset = 0;
 
17861
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17862
@@ -285,7 +283,7 @@
 
17863
          return;
 
17864
        }
 
17865
       else
 
17866
-       retarray->base_addr = xmalloc (alloc_size);
 
17867
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
17868
 
 
17869
     }
 
17870
   else
 
17871
@@ -430,8 +428,7 @@
 
17872
       retarray->offset = 0;
 
17873
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17874
 
 
17875
-      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17876
-                  * extent[rank-1];
 
17877
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17878
 
 
17879
       if (alloc_size == 0)
 
17880
        {
 
17881
@@ -440,7 +437,7 @@
 
17882
          return;
 
17883
        }
 
17884
       else
 
17885
-       retarray->base_addr = xmalloc (alloc_size);
 
17886
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
17887
     }
 
17888
   else
 
17889
     {
 
17890
Index: libgfortran/generated/iall_i4.c
 
17891
===================================================================
 
17892
--- a/src/libgfortran/generated/iall_i4.c       (.../tags/gcc_4_8_3_release)
 
17893
+++ b/src/libgfortran/generated/iall_i4.c       (.../branches/gcc-4_8-branch)
 
17894
@@ -97,10 +97,9 @@
 
17895
       retarray->offset = 0;
 
17896
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17897
 
 
17898
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17899
-                  * extent[rank-1];
 
17900
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17901
 
 
17902
-      retarray->base_addr = xmalloc (alloc_size);
 
17903
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17904
       if (alloc_size == 0)
 
17905
        {
 
17906
          /* Make sure we have a zero-sized array.  */
 
17907
@@ -272,8 +271,7 @@
 
17908
 
 
17909
        }
 
17910
 
 
17911
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17912
-                  * extent[rank-1];
 
17913
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17914
 
 
17915
       retarray->offset = 0;
 
17916
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17917
@@ -285,7 +283,7 @@
 
17918
          return;
 
17919
        }
 
17920
       else
 
17921
-       retarray->base_addr = xmalloc (alloc_size);
 
17922
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17923
 
 
17924
     }
 
17925
   else
 
17926
@@ -430,8 +428,7 @@
 
17927
       retarray->offset = 0;
 
17928
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17929
 
 
17930
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17931
-                  * extent[rank-1];
 
17932
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17933
 
 
17934
       if (alloc_size == 0)
 
17935
        {
 
17936
@@ -440,7 +437,7 @@
 
17937
          return;
 
17938
        }
 
17939
       else
 
17940
-       retarray->base_addr = xmalloc (alloc_size);
 
17941
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17942
     }
 
17943
   else
 
17944
     {
 
17945
Index: libgfortran/generated/minloc1_4_r16.c
 
17946
===================================================================
 
17947
--- a/src/libgfortran/generated/minloc1_4_r16.c (.../tags/gcc_4_8_3_release)
 
17948
+++ b/src/libgfortran/generated/minloc1_4_r16.c (.../branches/gcc-4_8-branch)
 
17949
@@ -98,10 +98,9 @@
 
17950
       retarray->offset = 0;
 
17951
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17952
 
 
17953
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17954
-                  * extent[rank-1];
 
17955
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17956
 
 
17957
-      retarray->base_addr = xmalloc (alloc_size);
 
17958
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17959
       if (alloc_size == 0)
 
17960
        {
 
17961
          /* Make sure we have a zero-sized array.  */
 
17962
@@ -294,8 +293,7 @@
 
17963
 
 
17964
        }
 
17965
 
 
17966
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17967
-                  * extent[rank-1];
 
17968
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17969
 
 
17970
       retarray->offset = 0;
 
17971
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17972
@@ -307,7 +305,7 @@
 
17973
          return;
 
17974
        }
 
17975
       else
 
17976
-       retarray->base_addr = xmalloc (alloc_size);
 
17977
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17978
 
 
17979
     }
 
17980
   else
 
17981
@@ -485,8 +483,7 @@
 
17982
       retarray->offset = 0;
 
17983
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
17984
 
 
17985
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
17986
-                  * extent[rank-1];
 
17987
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
17988
 
 
17989
       if (alloc_size == 0)
 
17990
        {
 
17991
@@ -495,7 +492,7 @@
 
17992
          return;
 
17993
        }
 
17994
       else
 
17995
-       retarray->base_addr = xmalloc (alloc_size);
 
17996
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
17997
     }
 
17998
   else
 
17999
     {
 
18000
Index: libgfortran/generated/maxloc0_8_r16.c
 
18001
===================================================================
 
18002
--- a/src/libgfortran/generated/maxloc0_8_r16.c (.../tags/gcc_4_8_3_release)
 
18003
+++ b/src/libgfortran/generated/maxloc0_8_r16.c (.../branches/gcc-4_8-branch)
 
18004
@@ -58,7 +58,7 @@
 
18005
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18006
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18007
       retarray->offset = 0;
 
18008
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18009
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18010
     }
 
18011
   else
 
18012
     {
 
18013
@@ -199,7 +199,7 @@
 
18014
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18015
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18016
       retarray->offset = 0;
 
18017
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18018
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18019
     }
 
18020
   else
 
18021
     {
 
18022
@@ -367,7 +367,7 @@
 
18023
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18024
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18025
       retarray->offset = 0;
 
18026
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18027
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18028
     }
 
18029
   else if (unlikely (compile_options.bounds_check))
 
18030
     {
 
18031
Index: libgfortran/generated/pack_r8.c
 
18032
===================================================================
 
18033
--- a/src/libgfortran/generated/pack_r8.c       (.../tags/gcc_4_8_3_release)
 
18034
+++ b/src/libgfortran/generated/pack_r8.c       (.../branches/gcc-4_8-branch)
 
18035
@@ -167,8 +167,8 @@
 
18036
 
 
18037
          ret->offset = 0;
 
18038
 
 
18039
-         /* xmalloc allocates a single byte for zero size.  */
 
18040
-         ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * total);
 
18041
+         /* xmallocarray allocates a single byte for zero size.  */
 
18042
+         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_8));
 
18043
 
 
18044
          if (total == 0)
 
18045
            return;
 
18046
Index: libgfortran/generated/matmul_c10.c
 
18047
===================================================================
 
18048
--- a/src/libgfortran/generated/matmul_c10.c    (.../tags/gcc_4_8_3_release)
 
18049
+++ b/src/libgfortran/generated/matmul_c10.c    (.../branches/gcc-4_8-branch)
 
18050
@@ -124,7 +124,7 @@
 
18051
         }
 
18052
 
 
18053
       retarray->base_addr
 
18054
-       = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
 
18055
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_10));
 
18056
       retarray->offset = 0;
 
18057
     }
 
18058
     else if (unlikely (compile_options.bounds_check))
 
18059
Index: libgfortran/generated/maxloc0_16_i4.c
 
18060
===================================================================
 
18061
--- a/src/libgfortran/generated/maxloc0_16_i4.c (.../tags/gcc_4_8_3_release)
 
18062
+++ b/src/libgfortran/generated/maxloc0_16_i4.c (.../branches/gcc-4_8-branch)
 
18063
@@ -58,7 +58,7 @@
 
18064
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18065
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18066
       retarray->offset = 0;
 
18067
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18068
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18069
     }
 
18070
   else
 
18071
     {
 
18072
@@ -199,7 +199,7 @@
 
18073
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18074
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18075
       retarray->offset = 0;
 
18076
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18077
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18078
     }
 
18079
   else
 
18080
     {
 
18081
@@ -367,7 +367,7 @@
 
18082
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18083
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18084
       retarray->offset = 0;
 
18085
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18086
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18087
     }
 
18088
   else if (unlikely (compile_options.bounds_check))
 
18089
     {
 
18090
Index: libgfortran/generated/pack_r16.c
 
18091
===================================================================
 
18092
--- a/src/libgfortran/generated/pack_r16.c      (.../tags/gcc_4_8_3_release)
 
18093
+++ b/src/libgfortran/generated/pack_r16.c      (.../branches/gcc-4_8-branch)
 
18094
@@ -167,8 +167,8 @@
 
18095
 
 
18096
          ret->offset = 0;
 
18097
 
 
18098
-         /* xmalloc allocates a single byte for zero size.  */
 
18099
-         ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * total);
 
18100
+         /* xmallocarray allocates a single byte for zero size.  */
 
18101
+         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_16));
 
18102
 
 
18103
          if (total == 0)
 
18104
            return;
 
18105
Index: libgfortran/generated/minloc1_16_i8.c
 
18106
===================================================================
 
18107
--- a/src/libgfortran/generated/minloc1_16_i8.c (.../tags/gcc_4_8_3_release)
 
18108
+++ b/src/libgfortran/generated/minloc1_16_i8.c (.../branches/gcc-4_8-branch)
 
18109
@@ -98,10 +98,9 @@
 
18110
       retarray->offset = 0;
 
18111
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18112
 
 
18113
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18114
-                  * extent[rank-1];
 
18115
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18116
 
 
18117
-      retarray->base_addr = xmalloc (alloc_size);
 
18118
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18119
       if (alloc_size == 0)
 
18120
        {
 
18121
          /* Make sure we have a zero-sized array.  */
 
18122
@@ -294,8 +293,7 @@
 
18123
 
 
18124
        }
 
18125
 
 
18126
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18127
-                  * extent[rank-1];
 
18128
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18129
 
 
18130
       retarray->offset = 0;
 
18131
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18132
@@ -307,7 +305,7 @@
 
18133
          return;
 
18134
        }
 
18135
       else
 
18136
-       retarray->base_addr = xmalloc (alloc_size);
 
18137
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18138
 
 
18139
     }
 
18140
   else
 
18141
@@ -485,8 +483,7 @@
 
18142
       retarray->offset = 0;
 
18143
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18144
 
 
18145
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18146
-                  * extent[rank-1];
 
18147
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18148
 
 
18149
       if (alloc_size == 0)
 
18150
        {
 
18151
@@ -495,7 +492,7 @@
 
18152
          return;
 
18153
        }
 
18154
       else
 
18155
-       retarray->base_addr = xmalloc (alloc_size);
 
18156
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18157
     }
 
18158
   else
 
18159
     {
 
18160
Index: libgfortran/generated/minloc0_16_r10.c
 
18161
===================================================================
 
18162
--- a/src/libgfortran/generated/minloc0_16_r10.c        (.../tags/gcc_4_8_3_release)
 
18163
+++ b/src/libgfortran/generated/minloc0_16_r10.c        (.../branches/gcc-4_8-branch)
 
18164
@@ -58,7 +58,7 @@
 
18165
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18166
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18167
       retarray->offset = 0;
 
18168
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18169
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18170
     }
 
18171
   else
 
18172
     {
 
18173
@@ -199,7 +199,7 @@
 
18174
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18175
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18176
       retarray->offset = 0;
 
18177
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18178
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18179
     }
 
18180
   else
 
18181
     {
 
18182
@@ -367,7 +367,7 @@
 
18183
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18184
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18185
       retarray->offset = 0;
 
18186
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
18187
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
18188
     }
 
18189
   else if (unlikely (compile_options.bounds_check))
 
18190
     {
 
18191
Index: libgfortran/generated/unpack_c4.c
 
18192
===================================================================
 
18193
--- a/src/libgfortran/generated/unpack_c4.c     (.../tags/gcc_4_8_3_release)
 
18194
+++ b/src/libgfortran/generated/unpack_c4.c     (.../branches/gcc-4_8-branch)
 
18195
@@ -99,7 +99,7 @@
 
18196
          rs *= extent[n];
 
18197
        }
 
18198
       ret->offset = 0;
 
18199
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
 
18200
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
 
18201
     }
 
18202
   else
 
18203
     {
 
18204
@@ -244,7 +244,7 @@
 
18205
          rs *= extent[n];
 
18206
        }
 
18207
       ret->offset = 0;
 
18208
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
 
18209
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
 
18210
     }
 
18211
   else
 
18212
     {
 
18213
Index: libgfortran/generated/iparity_i1.c
 
18214
===================================================================
 
18215
--- a/src/libgfortran/generated/iparity_i1.c    (.../tags/gcc_4_8_3_release)
 
18216
+++ b/src/libgfortran/generated/iparity_i1.c    (.../branches/gcc-4_8-branch)
 
18217
@@ -97,10 +97,9 @@
 
18218
       retarray->offset = 0;
 
18219
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18220
 
 
18221
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18222
-                  * extent[rank-1];
 
18223
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18224
 
 
18225
-      retarray->base_addr = xmalloc (alloc_size);
 
18226
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
18227
       if (alloc_size == 0)
 
18228
        {
 
18229
          /* Make sure we have a zero-sized array.  */
 
18230
@@ -272,8 +271,7 @@
 
18231
 
 
18232
        }
 
18233
 
 
18234
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18235
-                  * extent[rank-1];
 
18236
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18237
 
 
18238
       retarray->offset = 0;
 
18239
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18240
@@ -285,7 +283,7 @@
 
18241
          return;
 
18242
        }
 
18243
       else
 
18244
-       retarray->base_addr = xmalloc (alloc_size);
 
18245
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
18246
 
 
18247
     }
 
18248
   else
 
18249
@@ -430,8 +428,7 @@
 
18250
       retarray->offset = 0;
 
18251
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18252
 
 
18253
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18254
-                  * extent[rank-1];
 
18255
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18256
 
 
18257
       if (alloc_size == 0)
 
18258
        {
 
18259
@@ -440,7 +437,7 @@
 
18260
          return;
 
18261
        }
 
18262
       else
 
18263
-       retarray->base_addr = xmalloc (alloc_size);
 
18264
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
18265
     }
 
18266
   else
 
18267
     {
 
18268
Index: libgfortran/generated/product_c8.c
 
18269
===================================================================
 
18270
--- a/src/libgfortran/generated/product_c8.c    (.../tags/gcc_4_8_3_release)
 
18271
+++ b/src/libgfortran/generated/product_c8.c    (.../branches/gcc-4_8-branch)
 
18272
@@ -97,10 +97,9 @@
 
18273
       retarray->offset = 0;
 
18274
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18275
 
 
18276
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18277
-                  * extent[rank-1];
 
18278
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18279
 
 
18280
-      retarray->base_addr = xmalloc (alloc_size);
 
18281
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
18282
       if (alloc_size == 0)
 
18283
        {
 
18284
          /* Make sure we have a zero-sized array.  */
 
18285
@@ -272,8 +271,7 @@
 
18286
 
 
18287
        }
 
18288
 
 
18289
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18290
-                  * extent[rank-1];
 
18291
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18292
 
 
18293
       retarray->offset = 0;
 
18294
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18295
@@ -285,7 +283,7 @@
 
18296
          return;
 
18297
        }
 
18298
       else
 
18299
-       retarray->base_addr = xmalloc (alloc_size);
 
18300
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
18301
 
 
18302
     }
 
18303
   else
 
18304
@@ -430,8 +428,7 @@
 
18305
       retarray->offset = 0;
 
18306
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18307
 
 
18308
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18309
-                  * extent[rank-1];
 
18310
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18311
 
 
18312
       if (alloc_size == 0)
 
18313
        {
 
18314
@@ -440,7 +437,7 @@
 
18315
          return;
 
18316
        }
 
18317
       else
 
18318
-       retarray->base_addr = xmalloc (alloc_size);
 
18319
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
18320
     }
 
18321
   else
 
18322
     {
 
18323
Index: libgfortran/generated/in_pack_i16.c
 
18324
===================================================================
 
18325
--- a/src/libgfortran/generated/in_pack_i16.c   (.../tags/gcc_4_8_3_release)
 
18326
+++ b/src/libgfortran/generated/in_pack_i16.c   (.../branches/gcc-4_8-branch)
 
18327
@@ -76,7 +76,7 @@
 
18328
     return source->base_addr;
 
18329
 
 
18330
   /* Allocate storage for the destination.  */
 
18331
-  destptr = (GFC_INTEGER_16 *)xmalloc (ssize * sizeof (GFC_INTEGER_16));
 
18332
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_16));
 
18333
   dest = destptr;
 
18334
   src = source->base_addr;
 
18335
   stride0 = stride[0];
 
18336
Index: libgfortran/generated/minloc0_8_i4.c
 
18337
===================================================================
 
18338
--- a/src/libgfortran/generated/minloc0_8_i4.c  (.../tags/gcc_4_8_3_release)
 
18339
+++ b/src/libgfortran/generated/minloc0_8_i4.c  (.../branches/gcc-4_8-branch)
 
18340
@@ -58,7 +58,7 @@
 
18341
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18342
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18343
       retarray->offset = 0;
 
18344
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18345
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18346
     }
 
18347
   else
 
18348
     {
 
18349
@@ -199,7 +199,7 @@
 
18350
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18351
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18352
       retarray->offset = 0;
 
18353
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18354
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18355
     }
 
18356
   else
 
18357
     {
 
18358
@@ -367,7 +367,7 @@
 
18359
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18360
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18361
       retarray->offset = 0;
 
18362
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18363
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18364
     }
 
18365
   else if (unlikely (compile_options.bounds_check))
 
18366
     {
 
18367
Index: libgfortran/generated/matmul_c4.c
 
18368
===================================================================
 
18369
--- a/src/libgfortran/generated/matmul_c4.c     (.../tags/gcc_4_8_3_release)
 
18370
+++ b/src/libgfortran/generated/matmul_c4.c     (.../branches/gcc-4_8-branch)
 
18371
@@ -124,7 +124,7 @@
 
18372
         }
 
18373
 
 
18374
       retarray->base_addr
 
18375
-       = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
 
18376
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_4));
 
18377
       retarray->offset = 0;
 
18378
     }
 
18379
     else if (unlikely (compile_options.bounds_check))
 
18380
Index: libgfortran/generated/reshape_i8.c
 
18381
===================================================================
 
18382
--- a/src/libgfortran/generated/reshape_i8.c    (.../tags/gcc_4_8_3_release)
 
18383
+++ b/src/libgfortran/generated/reshape_i8.c    (.../branches/gcc-4_8-branch)
 
18384
@@ -111,11 +111,11 @@
 
18385
       ret->offset = 0;
 
18386
 
 
18387
       if (unlikely (rs < 1))
 
18388
-        alloc_size = 1;
 
18389
+        alloc_size = 0;
 
18390
       else
 
18391
-        alloc_size = rs * sizeof (GFC_INTEGER_8);
 
18392
+        alloc_size = rs;
 
18393
 
 
18394
-      ret->base_addr = xmalloc (alloc_size);
 
18395
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18396
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
18397
     }
 
18398
 
 
18399
Index: libgfortran/generated/in_pack_c8.c
 
18400
===================================================================
 
18401
--- a/src/libgfortran/generated/in_pack_c8.c    (.../tags/gcc_4_8_3_release)
 
18402
+++ b/src/libgfortran/generated/in_pack_c8.c    (.../branches/gcc-4_8-branch)
 
18403
@@ -76,7 +76,7 @@
 
18404
     return source->base_addr;
 
18405
 
 
18406
   /* Allocate storage for the destination.  */
 
18407
-  destptr = (GFC_COMPLEX_8 *)xmalloc (ssize * sizeof (GFC_COMPLEX_8));
 
18408
+  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_8));
 
18409
   dest = destptr;
 
18410
   src = source->base_addr;
 
18411
   stride0 = stride[0];
 
18412
Index: libgfortran/generated/bessel_r10.c
 
18413
===================================================================
 
18414
--- a/src/libgfortran/generated/bessel_r10.c    (.../tags/gcc_4_8_3_release)
 
18415
+++ b/src/libgfortran/generated/bessel_r10.c    (.../branches/gcc-4_8-branch)
 
18416
@@ -55,7 +55,7 @@
 
18417
     {
 
18418
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
18419
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
18420
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
 
18421
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
 
18422
       ret->offset = 0;
 
18423
     }
 
18424
 
 
18425
@@ -122,7 +122,7 @@
 
18426
     {
 
18427
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
 
18428
       GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
 
18429
-      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
 
18430
+      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
 
18431
       ret->offset = 0;
 
18432
     }
 
18433
 
 
18434
@@ -162,7 +162,7 @@
 
18435
 
 
18436
   x2rev = GFC_REAL_10_LITERAL(2.)/x;
 
18437
 
 
18438
-  for (i = 2; i <= n1+n2; i++)
 
18439
+  for (i = 2; i <= n2 - n1; i++)
 
18440
     {
 
18441
 #if defined(GFC_REAL_10_INFINITY)
 
18442
       if (unlikely (last2 == -GFC_REAL_10_INFINITY))
 
18443
Index: libgfortran/generated/iall_i16.c
 
18444
===================================================================
 
18445
--- a/src/libgfortran/generated/iall_i16.c      (.../tags/gcc_4_8_3_release)
 
18446
+++ b/src/libgfortran/generated/iall_i16.c      (.../branches/gcc-4_8-branch)
 
18447
@@ -97,10 +97,9 @@
 
18448
       retarray->offset = 0;
 
18449
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18450
 
 
18451
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18452
-                  * extent[rank-1];
 
18453
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18454
 
 
18455
-      retarray->base_addr = xmalloc (alloc_size);
 
18456
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18457
       if (alloc_size == 0)
 
18458
        {
 
18459
          /* Make sure we have a zero-sized array.  */
 
18460
@@ -272,8 +271,7 @@
 
18461
 
 
18462
        }
 
18463
 
 
18464
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18465
-                  * extent[rank-1];
 
18466
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18467
 
 
18468
       retarray->offset = 0;
 
18469
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18470
@@ -285,7 +283,7 @@
 
18471
          return;
 
18472
        }
 
18473
       else
 
18474
-       retarray->base_addr = xmalloc (alloc_size);
 
18475
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18476
 
 
18477
     }
 
18478
   else
 
18479
@@ -430,8 +428,7 @@
 
18480
       retarray->offset = 0;
 
18481
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18482
 
 
18483
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18484
-                  * extent[rank-1];
 
18485
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18486
 
 
18487
       if (alloc_size == 0)
 
18488
        {
 
18489
@@ -440,7 +437,7 @@
 
18490
          return;
 
18491
        }
 
18492
       else
 
18493
-       retarray->base_addr = xmalloc (alloc_size);
 
18494
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18495
     }
 
18496
   else
 
18497
     {
 
18498
Index: libgfortran/generated/maxloc1_16_i1.c
 
18499
===================================================================
 
18500
--- a/src/libgfortran/generated/maxloc1_16_i1.c (.../tags/gcc_4_8_3_release)
 
18501
+++ b/src/libgfortran/generated/maxloc1_16_i1.c (.../branches/gcc-4_8-branch)
 
18502
@@ -98,10 +98,9 @@
 
18503
       retarray->offset = 0;
 
18504
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18505
 
 
18506
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18507
-                  * extent[rank-1];
 
18508
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18509
 
 
18510
-      retarray->base_addr = xmalloc (alloc_size);
 
18511
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18512
       if (alloc_size == 0)
 
18513
        {
 
18514
          /* Make sure we have a zero-sized array.  */
 
18515
@@ -294,8 +293,7 @@
 
18516
 
 
18517
        }
 
18518
 
 
18519
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18520
-                  * extent[rank-1];
 
18521
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18522
 
 
18523
       retarray->offset = 0;
 
18524
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18525
@@ -307,7 +305,7 @@
 
18526
          return;
 
18527
        }
 
18528
       else
 
18529
-       retarray->base_addr = xmalloc (alloc_size);
 
18530
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18531
 
 
18532
     }
 
18533
   else
 
18534
@@ -485,8 +483,7 @@
 
18535
       retarray->offset = 0;
 
18536
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18537
 
 
18538
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18539
-                  * extent[rank-1];
 
18540
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18541
 
 
18542
       if (alloc_size == 0)
 
18543
        {
 
18544
@@ -495,7 +492,7 @@
 
18545
          return;
 
18546
        }
 
18547
       else
 
18548
-       retarray->base_addr = xmalloc (alloc_size);
 
18549
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18550
     }
 
18551
   else
 
18552
     {
 
18553
Index: libgfortran/generated/reshape_i16.c
 
18554
===================================================================
 
18555
--- a/src/libgfortran/generated/reshape_i16.c   (.../tags/gcc_4_8_3_release)
 
18556
+++ b/src/libgfortran/generated/reshape_i16.c   (.../branches/gcc-4_8-branch)
 
18557
@@ -111,11 +111,11 @@
 
18558
       ret->offset = 0;
 
18559
 
 
18560
       if (unlikely (rs < 1))
 
18561
-        alloc_size = 1;
 
18562
+        alloc_size = 0;
 
18563
       else
 
18564
-        alloc_size = rs * sizeof (GFC_INTEGER_16);
 
18565
+        alloc_size = rs;
 
18566
 
 
18567
-      ret->base_addr = xmalloc (alloc_size);
 
18568
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18569
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
 
18570
     }
 
18571
 
 
18572
Index: libgfortran/generated/count_16_l.c
 
18573
===================================================================
 
18574
--- a/src/libgfortran/generated/count_16_l.c    (.../tags/gcc_4_8_3_release)
 
18575
+++ b/src/libgfortran/generated/count_16_l.c    (.../branches/gcc-4_8-branch)
 
18576
@@ -101,8 +101,7 @@
 
18577
       retarray->offset = 0;
 
18578
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18579
 
 
18580
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18581
-                  * extent[rank-1];
 
18582
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18583
 
 
18584
       if (alloc_size == 0)
 
18585
        {
 
18586
@@ -111,7 +110,7 @@
 
18587
          return;
 
18588
        }
 
18589
       else
 
18590
-       retarray->base_addr = xmalloc (alloc_size);
 
18591
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
18592
     }
 
18593
   else
 
18594
     {
 
18595
Index: libgfortran/generated/minloc1_8_i1.c
 
18596
===================================================================
 
18597
--- a/src/libgfortran/generated/minloc1_8_i1.c  (.../tags/gcc_4_8_3_release)
 
18598
+++ b/src/libgfortran/generated/minloc1_8_i1.c  (.../branches/gcc-4_8-branch)
 
18599
@@ -98,10 +98,9 @@
 
18600
       retarray->offset = 0;
 
18601
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18602
 
 
18603
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18604
-                  * extent[rank-1];
 
18605
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18606
 
 
18607
-      retarray->base_addr = xmalloc (alloc_size);
 
18608
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18609
       if (alloc_size == 0)
 
18610
        {
 
18611
          /* Make sure we have a zero-sized array.  */
 
18612
@@ -294,8 +293,7 @@
 
18613
 
 
18614
        }
 
18615
 
 
18616
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18617
-                  * extent[rank-1];
 
18618
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18619
 
 
18620
       retarray->offset = 0;
 
18621
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18622
@@ -307,7 +305,7 @@
 
18623
          return;
 
18624
        }
 
18625
       else
 
18626
-       retarray->base_addr = xmalloc (alloc_size);
 
18627
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18628
 
 
18629
     }
 
18630
   else
 
18631
@@ -485,8 +483,7 @@
 
18632
       retarray->offset = 0;
 
18633
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18634
 
 
18635
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18636
-                  * extent[rank-1];
 
18637
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18638
 
 
18639
       if (alloc_size == 0)
 
18640
        {
 
18641
@@ -495,7 +492,7 @@
 
18642
          return;
 
18643
        }
 
18644
       else
 
18645
-       retarray->base_addr = xmalloc (alloc_size);
 
18646
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18647
     }
 
18648
   else
 
18649
     {
 
18650
Index: libgfortran/generated/maxloc1_4_i4.c
 
18651
===================================================================
 
18652
--- a/src/libgfortran/generated/maxloc1_4_i4.c  (.../tags/gcc_4_8_3_release)
 
18653
+++ b/src/libgfortran/generated/maxloc1_4_i4.c  (.../branches/gcc-4_8-branch)
 
18654
@@ -98,10 +98,9 @@
 
18655
       retarray->offset = 0;
 
18656
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18657
 
 
18658
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18659
-                  * extent[rank-1];
 
18660
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18661
 
 
18662
-      retarray->base_addr = xmalloc (alloc_size);
 
18663
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18664
       if (alloc_size == 0)
 
18665
        {
 
18666
          /* Make sure we have a zero-sized array.  */
 
18667
@@ -294,8 +293,7 @@
 
18668
 
 
18669
        }
 
18670
 
 
18671
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18672
-                  * extent[rank-1];
 
18673
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18674
 
 
18675
       retarray->offset = 0;
 
18676
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18677
@@ -307,7 +305,7 @@
 
18678
          return;
 
18679
        }
 
18680
       else
 
18681
-       retarray->base_addr = xmalloc (alloc_size);
 
18682
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18683
 
 
18684
     }
 
18685
   else
 
18686
@@ -485,8 +483,7 @@
 
18687
       retarray->offset = 0;
 
18688
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18689
 
 
18690
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18691
-                  * extent[rank-1];
 
18692
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18693
 
 
18694
       if (alloc_size == 0)
 
18695
        {
 
18696
@@ -495,7 +492,7 @@
 
18697
          return;
 
18698
        }
 
18699
       else
 
18700
-       retarray->base_addr = xmalloc (alloc_size);
 
18701
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18702
     }
 
18703
   else
 
18704
     {
 
18705
Index: libgfortran/generated/maxval_i8.c
 
18706
===================================================================
 
18707
--- a/src/libgfortran/generated/maxval_i8.c     (.../tags/gcc_4_8_3_release)
 
18708
+++ b/src/libgfortran/generated/maxval_i8.c     (.../branches/gcc-4_8-branch)
 
18709
@@ -97,10 +97,9 @@
 
18710
       retarray->offset = 0;
 
18711
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18712
 
 
18713
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18714
-                  * extent[rank-1];
 
18715
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18716
 
 
18717
-      retarray->base_addr = xmalloc (alloc_size);
 
18718
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18719
       if (alloc_size == 0)
 
18720
        {
 
18721
          /* Make sure we have a zero-sized array.  */
 
18722
@@ -286,8 +285,7 @@
 
18723
 
 
18724
        }
 
18725
 
 
18726
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18727
-                  * extent[rank-1];
 
18728
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18729
 
 
18730
       retarray->offset = 0;
 
18731
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18732
@@ -299,7 +297,7 @@
 
18733
          return;
 
18734
        }
 
18735
       else
 
18736
-       retarray->base_addr = xmalloc (alloc_size);
 
18737
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18738
 
 
18739
     }
 
18740
   else
 
18741
@@ -472,8 +470,7 @@
 
18742
       retarray->offset = 0;
 
18743
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18744
 
 
18745
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18746
-                  * extent[rank-1];
 
18747
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18748
 
 
18749
       if (alloc_size == 0)
 
18750
        {
 
18751
@@ -482,7 +479,7 @@
 
18752
          return;
 
18753
        }
 
18754
       else
 
18755
-       retarray->base_addr = xmalloc (alloc_size);
 
18756
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18757
     }
 
18758
   else
 
18759
     {
 
18760
Index: libgfortran/generated/eoshift3_16.c
 
18761
===================================================================
 
18762
--- a/src/libgfortran/generated/eoshift3_16.c   (.../tags/gcc_4_8_3_release)
 
18763
+++ b/src/libgfortran/generated/eoshift3_16.c   (.../branches/gcc-4_8-branch)
 
18764
@@ -89,7 +89,7 @@
 
18765
     {
 
18766
       int i;
 
18767
 
 
18768
-      ret->base_addr = xmalloc (size * arraysize);
 
18769
+      ret->base_addr = xmallocarray (arraysize, size);
 
18770
       ret->offset = 0;
 
18771
       ret->dtype = array->dtype;
 
18772
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
 
18773
@@ -107,8 +107,8 @@
 
18774
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
18775
 
 
18776
         }
 
18777
-      /* xmalloc allocates a single byte for zero size.  */
 
18778
-      ret->base_addr = xmalloc (size * arraysize);
 
18779
+      /* xmallocarray allocates a single byte for zero size.  */
 
18780
+      ret->base_addr = xmallocarray (arraysize, size);
 
18781
 
 
18782
     }
 
18783
   else if (unlikely (compile_options.bounds_check))
 
18784
Index: libgfortran/generated/shape_i8.c
 
18785
===================================================================
 
18786
--- a/src/libgfortran/generated/shape_i8.c      (.../tags/gcc_4_8_3_release)
 
18787
+++ b/src/libgfortran/generated/shape_i8.c      (.../branches/gcc-4_8-branch)
 
18788
@@ -49,7 +49,7 @@
 
18789
     {
 
18790
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
 
18791
       ret->offset = 0;
 
18792
-      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18793
+      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18794
     }
 
18795
 
 
18796
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
18797
Index: libgfortran/generated/maxloc0_4_i16.c
 
18798
===================================================================
 
18799
--- a/src/libgfortran/generated/maxloc0_4_i16.c (.../tags/gcc_4_8_3_release)
 
18800
+++ b/src/libgfortran/generated/maxloc0_4_i16.c (.../branches/gcc-4_8-branch)
 
18801
@@ -58,7 +58,7 @@
 
18802
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18803
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18804
       retarray->offset = 0;
 
18805
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
18806
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
18807
     }
 
18808
   else
 
18809
     {
 
18810
@@ -199,7 +199,7 @@
 
18811
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18812
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18813
       retarray->offset = 0;
 
18814
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
18815
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
18816
     }
 
18817
   else
 
18818
     {
 
18819
@@ -367,7 +367,7 @@
 
18820
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18821
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18822
       retarray->offset = 0;
 
18823
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
18824
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
18825
     }
 
18826
   else if (unlikely (compile_options.bounds_check))
 
18827
     {
 
18828
Index: libgfortran/generated/maxloc1_4_r10.c
 
18829
===================================================================
 
18830
--- a/src/libgfortran/generated/maxloc1_4_r10.c (.../tags/gcc_4_8_3_release)
 
18831
+++ b/src/libgfortran/generated/maxloc1_4_r10.c (.../branches/gcc-4_8-branch)
 
18832
@@ -98,10 +98,9 @@
 
18833
       retarray->offset = 0;
 
18834
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18835
 
 
18836
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18837
-                  * extent[rank-1];
 
18838
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18839
 
 
18840
-      retarray->base_addr = xmalloc (alloc_size);
 
18841
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18842
       if (alloc_size == 0)
 
18843
        {
 
18844
          /* Make sure we have a zero-sized array.  */
 
18845
@@ -294,8 +293,7 @@
 
18846
 
 
18847
        }
 
18848
 
 
18849
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18850
-                  * extent[rank-1];
 
18851
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18852
 
 
18853
       retarray->offset = 0;
 
18854
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18855
@@ -307,7 +305,7 @@
 
18856
          return;
 
18857
        }
 
18858
       else
 
18859
-       retarray->base_addr = xmalloc (alloc_size);
 
18860
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18861
 
 
18862
     }
 
18863
   else
 
18864
@@ -485,8 +483,7 @@
 
18865
       retarray->offset = 0;
 
18866
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18867
 
 
18868
-      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18869
-                  * extent[rank-1];
 
18870
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18871
 
 
18872
       if (alloc_size == 0)
 
18873
        {
 
18874
@@ -495,7 +492,7 @@
 
18875
          return;
 
18876
        }
 
18877
       else
 
18878
-       retarray->base_addr = xmalloc (alloc_size);
 
18879
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
18880
     }
 
18881
   else
 
18882
     {
 
18883
Index: libgfortran/generated/maxloc1_8_i16.c
 
18884
===================================================================
 
18885
--- a/src/libgfortran/generated/maxloc1_8_i16.c (.../tags/gcc_4_8_3_release)
 
18886
+++ b/src/libgfortran/generated/maxloc1_8_i16.c (.../branches/gcc-4_8-branch)
 
18887
@@ -98,10 +98,9 @@
 
18888
       retarray->offset = 0;
 
18889
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18890
 
 
18891
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18892
-                  * extent[rank-1];
 
18893
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18894
 
 
18895
-      retarray->base_addr = xmalloc (alloc_size);
 
18896
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18897
       if (alloc_size == 0)
 
18898
        {
 
18899
          /* Make sure we have a zero-sized array.  */
 
18900
@@ -294,8 +293,7 @@
 
18901
 
 
18902
        }
 
18903
 
 
18904
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18905
-                  * extent[rank-1];
 
18906
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18907
 
 
18908
       retarray->offset = 0;
 
18909
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18910
@@ -307,7 +305,7 @@
 
18911
          return;
 
18912
        }
 
18913
       else
 
18914
-       retarray->base_addr = xmalloc (alloc_size);
 
18915
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18916
 
 
18917
     }
 
18918
   else
 
18919
@@ -485,8 +483,7 @@
 
18920
       retarray->offset = 0;
 
18921
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18922
 
 
18923
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18924
-                  * extent[rank-1];
 
18925
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18926
 
 
18927
       if (alloc_size == 0)
 
18928
        {
 
18929
@@ -495,7 +492,7 @@
 
18930
          return;
 
18931
        }
 
18932
       else
 
18933
-       retarray->base_addr = xmalloc (alloc_size);
 
18934
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
18935
     }
 
18936
   else
 
18937
     {
 
18938
Index: libgfortran/generated/minloc0_8_r10.c
 
18939
===================================================================
 
18940
--- a/src/libgfortran/generated/minloc0_8_r10.c (.../tags/gcc_4_8_3_release)
 
18941
+++ b/src/libgfortran/generated/minloc0_8_r10.c (.../branches/gcc-4_8-branch)
 
18942
@@ -58,7 +58,7 @@
 
18943
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18944
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18945
       retarray->offset = 0;
 
18946
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18947
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18948
     }
 
18949
   else
 
18950
     {
 
18951
@@ -199,7 +199,7 @@
 
18952
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
18953
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18954
       retarray->offset = 0;
 
18955
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18956
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18957
     }
 
18958
   else
 
18959
     {
 
18960
@@ -367,7 +367,7 @@
 
18961
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
18962
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
18963
       retarray->offset = 0;
 
18964
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
18965
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
18966
     }
 
18967
   else if (unlikely (compile_options.bounds_check))
 
18968
     {
 
18969
Index: libgfortran/generated/iparity_i2.c
 
18970
===================================================================
 
18971
--- a/src/libgfortran/generated/iparity_i2.c    (.../tags/gcc_4_8_3_release)
 
18972
+++ b/src/libgfortran/generated/iparity_i2.c    (.../branches/gcc-4_8-branch)
 
18973
@@ -97,10 +97,9 @@
 
18974
       retarray->offset = 0;
 
18975
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18976
 
 
18977
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18978
-                  * extent[rank-1];
 
18979
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18980
 
 
18981
-      retarray->base_addr = xmalloc (alloc_size);
 
18982
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
18983
       if (alloc_size == 0)
 
18984
        {
 
18985
          /* Make sure we have a zero-sized array.  */
 
18986
@@ -272,8 +271,7 @@
 
18987
 
 
18988
        }
 
18989
 
 
18990
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
18991
-                  * extent[rank-1];
 
18992
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
18993
 
 
18994
       retarray->offset = 0;
 
18995
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
18996
@@ -285,7 +283,7 @@
 
18997
          return;
 
18998
        }
 
18999
       else
 
19000
-       retarray->base_addr = xmalloc (alloc_size);
 
19001
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
19002
 
 
19003
     }
 
19004
   else
 
19005
@@ -430,8 +428,7 @@
 
19006
       retarray->offset = 0;
 
19007
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19008
 
 
19009
-      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19010
-                  * extent[rank-1];
 
19011
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19012
 
 
19013
       if (alloc_size == 0)
 
19014
        {
 
19015
@@ -440,7 +437,7 @@
 
19016
          return;
 
19017
        }
 
19018
       else
 
19019
-       retarray->base_addr = xmalloc (alloc_size);
 
19020
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
19021
     }
 
19022
   else
 
19023
     {
 
19024
Index: libgfortran/generated/maxloc1_16_r4.c
 
19025
===================================================================
 
19026
--- a/src/libgfortran/generated/maxloc1_16_r4.c (.../tags/gcc_4_8_3_release)
 
19027
+++ b/src/libgfortran/generated/maxloc1_16_r4.c (.../branches/gcc-4_8-branch)
 
19028
@@ -98,10 +98,9 @@
 
19029
       retarray->offset = 0;
 
19030
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19031
 
 
19032
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19033
-                  * extent[rank-1];
 
19034
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19035
 
 
19036
-      retarray->base_addr = xmalloc (alloc_size);
 
19037
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19038
       if (alloc_size == 0)
 
19039
        {
 
19040
          /* Make sure we have a zero-sized array.  */
 
19041
@@ -294,8 +293,7 @@
 
19042
 
 
19043
        }
 
19044
 
 
19045
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19046
-                  * extent[rank-1];
 
19047
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19048
 
 
19049
       retarray->offset = 0;
 
19050
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19051
@@ -307,7 +305,7 @@
 
19052
          return;
 
19053
        }
 
19054
       else
 
19055
-       retarray->base_addr = xmalloc (alloc_size);
 
19056
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19057
 
 
19058
     }
 
19059
   else
 
19060
@@ -485,8 +483,7 @@
 
19061
       retarray->offset = 0;
 
19062
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19063
 
 
19064
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19065
-                  * extent[rank-1];
 
19066
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19067
 
 
19068
       if (alloc_size == 0)
 
19069
        {
 
19070
@@ -495,7 +492,7 @@
 
19071
          return;
 
19072
        }
 
19073
       else
 
19074
-       retarray->base_addr = xmalloc (alloc_size);
 
19075
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19076
     }
 
19077
   else
 
19078
     {
 
19079
Index: libgfortran/generated/maxloc0_16_r8.c
 
19080
===================================================================
 
19081
--- a/src/libgfortran/generated/maxloc0_16_r8.c (.../tags/gcc_4_8_3_release)
 
19082
+++ b/src/libgfortran/generated/maxloc0_16_r8.c (.../branches/gcc-4_8-branch)
 
19083
@@ -58,7 +58,7 @@
 
19084
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19085
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19086
       retarray->offset = 0;
 
19087
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19088
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19089
     }
 
19090
   else
 
19091
     {
 
19092
@@ -199,7 +199,7 @@
 
19093
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19094
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19095
       retarray->offset = 0;
 
19096
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19097
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19098
     }
 
19099
   else
 
19100
     {
 
19101
@@ -367,7 +367,7 @@
 
19102
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19103
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19104
       retarray->offset = 0;
 
19105
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
 
19106
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
 
19107
     }
 
19108
   else if (unlikely (compile_options.bounds_check))
 
19109
     {
 
19110
Index: libgfortran/generated/sum_i16.c
 
19111
===================================================================
 
19112
--- a/src/libgfortran/generated/sum_i16.c       (.../tags/gcc_4_8_3_release)
 
19113
+++ b/src/libgfortran/generated/sum_i16.c       (.../branches/gcc-4_8-branch)
 
19114
@@ -97,10 +97,9 @@
 
19115
       retarray->offset = 0;
 
19116
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19117
 
 
19118
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19119
-                  * extent[rank-1];
 
19120
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19121
 
 
19122
-      retarray->base_addr = xmalloc (alloc_size);
 
19123
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19124
       if (alloc_size == 0)
 
19125
        {
 
19126
          /* Make sure we have a zero-sized array.  */
 
19127
@@ -272,8 +271,7 @@
 
19128
 
 
19129
        }
 
19130
 
 
19131
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19132
-                  * extent[rank-1];
 
19133
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19134
 
 
19135
       retarray->offset = 0;
 
19136
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19137
@@ -285,7 +283,7 @@
 
19138
          return;
 
19139
        }
 
19140
       else
 
19141
-       retarray->base_addr = xmalloc (alloc_size);
 
19142
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19143
 
 
19144
     }
 
19145
   else
 
19146
@@ -430,8 +428,7 @@
 
19147
       retarray->offset = 0;
 
19148
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19149
 
 
19150
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19151
-                  * extent[rank-1];
 
19152
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19153
 
 
19154
       if (alloc_size == 0)
 
19155
        {
 
19156
@@ -440,7 +437,7 @@
 
19157
          return;
 
19158
        }
 
19159
       else
 
19160
-       retarray->base_addr = xmalloc (alloc_size);
 
19161
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19162
     }
 
19163
   else
 
19164
     {
 
19165
Index: libgfortran/generated/maxloc0_4_i8.c
 
19166
===================================================================
 
19167
--- a/src/libgfortran/generated/maxloc0_4_i8.c  (.../tags/gcc_4_8_3_release)
 
19168
+++ b/src/libgfortran/generated/maxloc0_4_i8.c  (.../branches/gcc-4_8-branch)
 
19169
@@ -58,7 +58,7 @@
 
19170
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19171
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19172
       retarray->offset = 0;
 
19173
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
19174
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
19175
     }
 
19176
   else
 
19177
     {
 
19178
@@ -199,7 +199,7 @@
 
19179
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19180
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19181
       retarray->offset = 0;
 
19182
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
19183
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
19184
     }
 
19185
   else
 
19186
     {
 
19187
@@ -367,7 +367,7 @@
 
19188
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19189
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19190
       retarray->offset = 0;
 
19191
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
 
19192
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
 
19193
     }
 
19194
   else if (unlikely (compile_options.bounds_check))
 
19195
     {
 
19196
Index: libgfortran/generated/pack_c16.c
 
19197
===================================================================
 
19198
--- a/src/libgfortran/generated/pack_c16.c      (.../tags/gcc_4_8_3_release)
 
19199
+++ b/src/libgfortran/generated/pack_c16.c      (.../branches/gcc-4_8-branch)
 
19200
@@ -167,8 +167,8 @@
 
19201
 
 
19202
          ret->offset = 0;
 
19203
 
 
19204
-         /* xmalloc allocates a single byte for zero size.  */
 
19205
-         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * total);
 
19206
+         /* xmallocarray allocates a single byte for zero size.  */
 
19207
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_16));
 
19208
 
 
19209
          if (total == 0)
 
19210
            return;
 
19211
Index: libgfortran/generated/maxloc1_16_i16.c
 
19212
===================================================================
 
19213
--- a/src/libgfortran/generated/maxloc1_16_i16.c        (.../tags/gcc_4_8_3_release)
 
19214
+++ b/src/libgfortran/generated/maxloc1_16_i16.c        (.../branches/gcc-4_8-branch)
 
19215
@@ -98,10 +98,9 @@
 
19216
       retarray->offset = 0;
 
19217
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19218
 
 
19219
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19220
-                  * extent[rank-1];
 
19221
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19222
 
 
19223
-      retarray->base_addr = xmalloc (alloc_size);
 
19224
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19225
       if (alloc_size == 0)
 
19226
        {
 
19227
          /* Make sure we have a zero-sized array.  */
 
19228
@@ -294,8 +293,7 @@
 
19229
 
 
19230
        }
 
19231
 
 
19232
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19233
-                  * extent[rank-1];
 
19234
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19235
 
 
19236
       retarray->offset = 0;
 
19237
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19238
@@ -307,7 +305,7 @@
 
19239
          return;
 
19240
        }
 
19241
       else
 
19242
-       retarray->base_addr = xmalloc (alloc_size);
 
19243
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19244
 
 
19245
     }
 
19246
   else
 
19247
@@ -485,8 +483,7 @@
 
19248
       retarray->offset = 0;
 
19249
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19250
 
 
19251
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19252
-                  * extent[rank-1];
 
19253
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19254
 
 
19255
       if (alloc_size == 0)
 
19256
        {
 
19257
@@ -495,7 +492,7 @@
 
19258
          return;
 
19259
        }
 
19260
       else
 
19261
-       retarray->base_addr = xmalloc (alloc_size);
 
19262
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19263
     }
 
19264
   else
 
19265
     {
 
19266
Index: libgfortran/generated/minloc1_8_r4.c
 
19267
===================================================================
 
19268
--- a/src/libgfortran/generated/minloc1_8_r4.c  (.../tags/gcc_4_8_3_release)
 
19269
+++ b/src/libgfortran/generated/minloc1_8_r4.c  (.../branches/gcc-4_8-branch)
 
19270
@@ -98,10 +98,9 @@
 
19271
       retarray->offset = 0;
 
19272
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19273
 
 
19274
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19275
-                  * extent[rank-1];
 
19276
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19277
 
 
19278
-      retarray->base_addr = xmalloc (alloc_size);
 
19279
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19280
       if (alloc_size == 0)
 
19281
        {
 
19282
          /* Make sure we have a zero-sized array.  */
 
19283
@@ -294,8 +293,7 @@
 
19284
 
 
19285
        }
 
19286
 
 
19287
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19288
-                  * extent[rank-1];
 
19289
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19290
 
 
19291
       retarray->offset = 0;
 
19292
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19293
@@ -307,7 +305,7 @@
 
19294
          return;
 
19295
        }
 
19296
       else
 
19297
-       retarray->base_addr = xmalloc (alloc_size);
 
19298
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19299
 
 
19300
     }
 
19301
   else
 
19302
@@ -485,8 +483,7 @@
 
19303
       retarray->offset = 0;
 
19304
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19305
 
 
19306
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19307
-                  * extent[rank-1];
 
19308
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19309
 
 
19310
       if (alloc_size == 0)
 
19311
        {
 
19312
@@ -495,7 +492,7 @@
 
19313
          return;
 
19314
        }
 
19315
       else
 
19316
-       retarray->base_addr = xmalloc (alloc_size);
 
19317
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19318
     }
 
19319
   else
 
19320
     {
 
19321
Index: libgfortran/generated/sum_c8.c
 
19322
===================================================================
 
19323
--- a/src/libgfortran/generated/sum_c8.c        (.../tags/gcc_4_8_3_release)
 
19324
+++ b/src/libgfortran/generated/sum_c8.c        (.../branches/gcc-4_8-branch)
 
19325
@@ -97,10 +97,9 @@
 
19326
       retarray->offset = 0;
 
19327
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19328
 
 
19329
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19330
-                  * extent[rank-1];
 
19331
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19332
 
 
19333
-      retarray->base_addr = xmalloc (alloc_size);
 
19334
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
19335
       if (alloc_size == 0)
 
19336
        {
 
19337
          /* Make sure we have a zero-sized array.  */
 
19338
@@ -272,8 +271,7 @@
 
19339
 
 
19340
        }
 
19341
 
 
19342
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19343
-                  * extent[rank-1];
 
19344
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19345
 
 
19346
       retarray->offset = 0;
 
19347
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19348
@@ -285,7 +283,7 @@
 
19349
          return;
 
19350
        }
 
19351
       else
 
19352
-       retarray->base_addr = xmalloc (alloc_size);
 
19353
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
19354
 
 
19355
     }
 
19356
   else
 
19357
@@ -430,8 +428,7 @@
 
19358
       retarray->offset = 0;
 
19359
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19360
 
 
19361
-      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19362
-                  * extent[rank-1];
 
19363
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19364
 
 
19365
       if (alloc_size == 0)
 
19366
        {
 
19367
@@ -440,7 +437,7 @@
 
19368
          return;
 
19369
        }
 
19370
       else
 
19371
-       retarray->base_addr = xmalloc (alloc_size);
 
19372
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
19373
     }
 
19374
   else
 
19375
     {
 
19376
Index: libgfortran/generated/maxloc1_16_i2.c
 
19377
===================================================================
 
19378
--- a/src/libgfortran/generated/maxloc1_16_i2.c (.../tags/gcc_4_8_3_release)
 
19379
+++ b/src/libgfortran/generated/maxloc1_16_i2.c (.../branches/gcc-4_8-branch)
 
19380
@@ -98,10 +98,9 @@
 
19381
       retarray->offset = 0;
 
19382
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19383
 
 
19384
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19385
-                  * extent[rank-1];
 
19386
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19387
 
 
19388
-      retarray->base_addr = xmalloc (alloc_size);
 
19389
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19390
       if (alloc_size == 0)
 
19391
        {
 
19392
          /* Make sure we have a zero-sized array.  */
 
19393
@@ -294,8 +293,7 @@
 
19394
 
 
19395
        }
 
19396
 
 
19397
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19398
-                  * extent[rank-1];
 
19399
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19400
 
 
19401
       retarray->offset = 0;
 
19402
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19403
@@ -307,7 +305,7 @@
 
19404
          return;
 
19405
        }
 
19406
       else
 
19407
-       retarray->base_addr = xmalloc (alloc_size);
 
19408
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19409
 
 
19410
     }
 
19411
   else
 
19412
@@ -485,8 +483,7 @@
 
19413
       retarray->offset = 0;
 
19414
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19415
 
 
19416
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19417
-                  * extent[rank-1];
 
19418
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19419
 
 
19420
       if (alloc_size == 0)
 
19421
        {
 
19422
@@ -495,7 +492,7 @@
 
19423
          return;
 
19424
        }
 
19425
       else
 
19426
-       retarray->base_addr = xmalloc (alloc_size);
 
19427
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19428
     }
 
19429
   else
 
19430
     {
 
19431
Index: libgfortran/generated/parity_l1.c
 
19432
===================================================================
 
19433
--- a/src/libgfortran/generated/parity_l1.c     (.../tags/gcc_4_8_3_release)
 
19434
+++ b/src/libgfortran/generated/parity_l1.c     (.../branches/gcc-4_8-branch)
 
19435
@@ -98,10 +98,9 @@
 
19436
       retarray->offset = 0;
 
19437
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19438
 
 
19439
-      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19440
-                  * extent[rank-1];
 
19441
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19442
 
 
19443
-      retarray->base_addr = xmalloc (alloc_size);
 
19444
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
 
19445
       if (alloc_size == 0)
 
19446
        {
 
19447
          /* Make sure we have a zero-sized array.  */
 
19448
Index: libgfortran/generated/maxval_i16.c
 
19449
===================================================================
 
19450
--- a/src/libgfortran/generated/maxval_i16.c    (.../tags/gcc_4_8_3_release)
 
19451
+++ b/src/libgfortran/generated/maxval_i16.c    (.../branches/gcc-4_8-branch)
 
19452
@@ -97,10 +97,9 @@
 
19453
       retarray->offset = 0;
 
19454
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19455
 
 
19456
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19457
-                  * extent[rank-1];
 
19458
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19459
 
 
19460
-      retarray->base_addr = xmalloc (alloc_size);
 
19461
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19462
       if (alloc_size == 0)
 
19463
        {
 
19464
          /* Make sure we have a zero-sized array.  */
 
19465
@@ -286,8 +285,7 @@
 
19466
 
 
19467
        }
 
19468
 
 
19469
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19470
-                  * extent[rank-1];
 
19471
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19472
 
 
19473
       retarray->offset = 0;
 
19474
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19475
@@ -299,7 +297,7 @@
 
19476
          return;
 
19477
        }
 
19478
       else
 
19479
-       retarray->base_addr = xmalloc (alloc_size);
 
19480
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19481
 
 
19482
     }
 
19483
   else
 
19484
@@ -472,8 +470,7 @@
 
19485
       retarray->offset = 0;
 
19486
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19487
 
 
19488
-      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19489
-                  * extent[rank-1];
 
19490
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19491
 
 
19492
       if (alloc_size == 0)
 
19493
        {
 
19494
@@ -482,7 +479,7 @@
 
19495
          return;
 
19496
        }
 
19497
       else
 
19498
-       retarray->base_addr = xmalloc (alloc_size);
 
19499
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
19500
     }
 
19501
   else
 
19502
     {
 
19503
Index: libgfortran/generated/spread_c8.c
 
19504
===================================================================
 
19505
--- a/src/libgfortran/generated/spread_c8.c     (.../tags/gcc_4_8_3_release)
 
19506
+++ b/src/libgfortran/generated/spread_c8.c     (.../branches/gcc-4_8-branch)
 
19507
@@ -101,8 +101,8 @@
 
19508
        }
 
19509
       ret->offset = 0;
 
19510
 
 
19511
-      /* xmalloc allocates a single byte for zero size.  */
 
19512
-      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_8));
 
19513
+      /* xmallocarray allocates a single byte for zero size.  */
 
19514
+      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_8));
 
19515
       if (rs <= 0)
 
19516
         return;
 
19517
     }
 
19518
@@ -244,7 +244,7 @@
 
19519
 
 
19520
   if (ret->base_addr == NULL)
 
19521
     {
 
19522
-      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_8));
 
19523
+      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_8));
 
19524
       ret->offset = 0;
 
19525
       GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
 
19526
     }
 
19527
Index: libgfortran/generated/matmul_i16.c
 
19528
===================================================================
 
19529
--- a/src/libgfortran/generated/matmul_i16.c    (.../tags/gcc_4_8_3_release)
 
19530
+++ b/src/libgfortran/generated/matmul_i16.c    (.../branches/gcc-4_8-branch)
 
19531
@@ -124,7 +124,7 @@
 
19532
         }
 
19533
 
 
19534
       retarray->base_addr
 
19535
-       = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
 
19536
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_16));
 
19537
       retarray->offset = 0;
 
19538
     }
 
19539
     else if (unlikely (compile_options.bounds_check))
 
19540
Index: libgfortran/generated/pack_i8.c
 
19541
===================================================================
 
19542
--- a/src/libgfortran/generated/pack_i8.c       (.../tags/gcc_4_8_3_release)
 
19543
+++ b/src/libgfortran/generated/pack_i8.c       (.../branches/gcc-4_8-branch)
 
19544
@@ -167,8 +167,8 @@
 
19545
 
 
19546
          ret->offset = 0;
 
19547
 
 
19548
-         /* xmalloc allocates a single byte for zero size.  */
 
19549
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * total);
 
19550
+         /* xmallocarray allocates a single byte for zero size.  */
 
19551
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_8));
 
19552
 
 
19553
          if (total == 0)
 
19554
            return;
 
19555
Index: libgfortran/generated/any_l1.c
 
19556
===================================================================
 
19557
--- a/src/libgfortran/generated/any_l1.c        (.../tags/gcc_4_8_3_release)
 
19558
+++ b/src/libgfortran/generated/any_l1.c        (.../branches/gcc-4_8-branch)
 
19559
@@ -101,8 +101,7 @@
 
19560
       retarray->offset = 0;
 
19561
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19562
 
 
19563
-      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19564
-                  * extent[rank-1];
 
19565
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19566
 
 
19567
       if (alloc_size == 0)
 
19568
        {
 
19569
@@ -111,7 +110,7 @@
 
19570
          return;
 
19571
        }
 
19572
       else
 
19573
-       retarray->base_addr = xmalloc (alloc_size);
 
19574
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
 
19575
     }
 
19576
   else
 
19577
     {
 
19578
Index: libgfortran/generated/minloc1_8_i2.c
 
19579
===================================================================
 
19580
--- a/src/libgfortran/generated/minloc1_8_i2.c  (.../tags/gcc_4_8_3_release)
 
19581
+++ b/src/libgfortran/generated/minloc1_8_i2.c  (.../branches/gcc-4_8-branch)
 
19582
@@ -98,10 +98,9 @@
 
19583
       retarray->offset = 0;
 
19584
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19585
 
 
19586
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19587
-                  * extent[rank-1];
 
19588
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19589
 
 
19590
-      retarray->base_addr = xmalloc (alloc_size);
 
19591
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19592
       if (alloc_size == 0)
 
19593
        {
 
19594
          /* Make sure we have a zero-sized array.  */
 
19595
@@ -294,8 +293,7 @@
 
19596
 
 
19597
        }
 
19598
 
 
19599
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19600
-                  * extent[rank-1];
 
19601
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19602
 
 
19603
       retarray->offset = 0;
 
19604
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19605
@@ -307,7 +305,7 @@
 
19606
          return;
 
19607
        }
 
19608
       else
 
19609
-       retarray->base_addr = xmalloc (alloc_size);
 
19610
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19611
 
 
19612
     }
 
19613
   else
 
19614
@@ -485,8 +483,7 @@
 
19615
       retarray->offset = 0;
 
19616
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19617
 
 
19618
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19619
-                  * extent[rank-1];
 
19620
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19621
 
 
19622
       if (alloc_size == 0)
 
19623
        {
 
19624
@@ -495,7 +492,7 @@
 
19625
          return;
 
19626
        }
 
19627
       else
 
19628
-       retarray->base_addr = xmalloc (alloc_size);
 
19629
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
19630
     }
 
19631
   else
 
19632
     {
 
19633
Index: libgfortran/generated/minloc0_8_r8.c
 
19634
===================================================================
 
19635
--- a/src/libgfortran/generated/minloc0_8_r8.c  (.../tags/gcc_4_8_3_release)
 
19636
+++ b/src/libgfortran/generated/minloc0_8_r8.c  (.../branches/gcc-4_8-branch)
 
19637
@@ -58,7 +58,7 @@
 
19638
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19639
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19640
       retarray->offset = 0;
 
19641
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19642
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19643
     }
 
19644
   else
 
19645
     {
 
19646
@@ -199,7 +199,7 @@
 
19647
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
 
19648
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19649
       retarray->offset = 0;
 
19650
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19651
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19652
     }
 
19653
   else
 
19654
     {
 
19655
@@ -367,7 +367,7 @@
 
19656
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
 
19657
       retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
 
19658
       retarray->offset = 0;
 
19659
-      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
 
19660
+      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
 
19661
     }
 
19662
   else if (unlikely (compile_options.bounds_check))
 
19663
     {
 
19664
Index: libgfortran/generated/matmul_l8.c
 
19665
===================================================================
 
19666
--- a/src/libgfortran/generated/matmul_l8.c     (.../tags/gcc_4_8_3_release)
 
19667
+++ b/src/libgfortran/generated/matmul_l8.c     (.../branches/gcc-4_8-branch)
 
19668
@@ -88,7 +88,7 @@
 
19669
         }
 
19670
           
 
19671
       retarray->base_addr
 
19672
-       = xmalloc (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
 
19673
+       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_8));
 
19674
       retarray->offset = 0;
 
19675
     }
 
19676
     else if (unlikely (compile_options.bounds_check))
 
19677
Index: libgfortran/generated/product_r10.c
 
19678
===================================================================
 
19679
--- a/src/libgfortran/generated/product_r10.c   (.../tags/gcc_4_8_3_release)
 
19680
+++ b/src/libgfortran/generated/product_r10.c   (.../branches/gcc-4_8-branch)
 
19681
@@ -97,10 +97,9 @@
 
19682
       retarray->offset = 0;
 
19683
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19684
 
 
19685
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19686
-                  * extent[rank-1];
 
19687
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19688
 
 
19689
-      retarray->base_addr = xmalloc (alloc_size);
 
19690
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
19691
       if (alloc_size == 0)
 
19692
        {
 
19693
          /* Make sure we have a zero-sized array.  */
 
19694
@@ -272,8 +271,7 @@
 
19695
 
 
19696
        }
 
19697
 
 
19698
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19699
-                  * extent[rank-1];
 
19700
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19701
 
 
19702
       retarray->offset = 0;
 
19703
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19704
@@ -285,7 +283,7 @@
 
19705
          return;
 
19706
        }
 
19707
       else
 
19708
-       retarray->base_addr = xmalloc (alloc_size);
 
19709
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
19710
 
 
19711
     }
 
19712
   else
 
19713
@@ -430,8 +428,7 @@
 
19714
       retarray->offset = 0;
 
19715
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19716
 
 
19717
-      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19718
-                  * extent[rank-1];
 
19719
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19720
 
 
19721
       if (alloc_size == 0)
 
19722
        {
 
19723
@@ -440,7 +437,7 @@
 
19724
          return;
 
19725
        }
 
19726
       else
 
19727
-       retarray->base_addr = xmalloc (alloc_size);
 
19728
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
19729
     }
 
19730
   else
 
19731
     {
 
19732
Index: libgfortran/generated/product_i1.c
 
19733
===================================================================
 
19734
--- a/src/libgfortran/generated/product_i1.c    (.../tags/gcc_4_8_3_release)
 
19735
+++ b/src/libgfortran/generated/product_i1.c    (.../branches/gcc-4_8-branch)
 
19736
@@ -97,10 +97,9 @@
 
19737
       retarray->offset = 0;
 
19738
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19739
 
 
19740
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19741
-                  * extent[rank-1];
 
19742
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19743
 
 
19744
-      retarray->base_addr = xmalloc (alloc_size);
 
19745
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
19746
       if (alloc_size == 0)
 
19747
        {
 
19748
          /* Make sure we have a zero-sized array.  */
 
19749
@@ -272,8 +271,7 @@
 
19750
 
 
19751
        }
 
19752
 
 
19753
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19754
-                  * extent[rank-1];
 
19755
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19756
 
 
19757
       retarray->offset = 0;
 
19758
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19759
@@ -285,7 +283,7 @@
 
19760
          return;
 
19761
        }
 
19762
       else
 
19763
-       retarray->base_addr = xmalloc (alloc_size);
 
19764
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
19765
 
 
19766
     }
 
19767
   else
 
19768
@@ -430,8 +428,7 @@
 
19769
       retarray->offset = 0;
 
19770
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19771
 
 
19772
-      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19773
-                  * extent[rank-1];
 
19774
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19775
 
 
19776
       if (alloc_size == 0)
 
19777
        {
 
19778
@@ -440,7 +437,7 @@
 
19779
          return;
 
19780
        }
 
19781
       else
 
19782
-       retarray->base_addr = xmalloc (alloc_size);
 
19783
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
19784
     }
 
19785
   else
 
19786
     {
 
19787
Index: libgfortran/generated/all_l8.c
 
19788
===================================================================
 
19789
--- a/src/libgfortran/generated/all_l8.c        (.../tags/gcc_4_8_3_release)
 
19790
+++ b/src/libgfortran/generated/all_l8.c        (.../branches/gcc-4_8-branch)
 
19791
@@ -101,8 +101,7 @@
 
19792
       retarray->offset = 0;
 
19793
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
19794
 
 
19795
-      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
 
19796
-                  * extent[rank-1];
 
19797
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
19798
 
 
19799
       if (alloc_size == 0)
 
19800
        {
 
19801
@@ -111,7 +110,7 @@
 
19802
          return;
 
19803
        }
 
19804
       else
 
19805
-       retarray->base_addr = xmalloc (alloc_size);
 
19806
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
 
19807
     }
 
19808
   else
 
19809
     {
 
19810
Index: libgfortran/generated/in_pack_r16.c
 
19811
===================================================================
 
19812
--- a/src/libgfortran/generated/in_pack_r16.c   (.../tags/gcc_4_8_3_release)
 
19813
+++ b/src/libgfortran/generated/in_pack_r16.c   (.../branches/gcc-4_8-branch)
 
19814
@@ -76,7 +76,7 @@
 
19815
     return source->base_addr;
 
19816
 
 
19817
   /* Allocate storage for the destination.  */
 
19818
-  destptr = (GFC_REAL_16 *)xmalloc (ssize * sizeof (GFC_REAL_16));
 
19819
+  destptr = xmallocarray (ssize, sizeof (GFC_REAL_16));
 
19820
   dest = destptr;
 
19821
   src = source->base_addr;
 
19822
   stride0 = stride[0];
 
19823
Index: libgfortran/generated/in_pack_i1.c
 
19824
===================================================================
 
19825
--- a/src/libgfortran/generated/in_pack_i1.c    (.../tags/gcc_4_8_3_release)
 
19826
+++ b/src/libgfortran/generated/in_pack_i1.c    (.../branches/gcc-4_8-branch)
 
19827
@@ -76,7 +76,7 @@
 
19828
     return source->base_addr;
 
19829
 
 
19830
   /* Allocate storage for the destination.  */
 
19831
-  destptr = (GFC_INTEGER_1 *)xmalloc (ssize * sizeof (GFC_INTEGER_1));
 
19832
+  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_1));
 
19833
   dest = destptr;
 
19834
   src = source->base_addr;
 
19835
   stride0 = stride[0];
 
19836
Index: libgfortran/libgfortran.h
 
19837
===================================================================
 
19838
--- a/src/libgfortran/libgfortran.h     (.../tags/gcc_4_8_3_release)
 
19839
+++ b/src/libgfortran/libgfortran.h     (.../branches/gcc-4_8-branch)
 
19840
@@ -751,6 +751,9 @@
 
19841
 extern void *xmalloc (size_t) __attribute__ ((malloc));
 
19842
 internal_proto(xmalloc);
 
19843
 
 
19844
+extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc));
 
19845
+internal_proto(xmallocarray);
 
19846
+
 
19847
 extern void *xcalloc (size_t, size_t) __attribute__ ((malloc));
 
19848
 internal_proto(xcalloc);
 
19849
 
 
19850
Index: libgfortran/io/list_read.c
 
19851
===================================================================
 
19852
--- a/src/libgfortran/io/list_read.c    (.../tags/gcc_4_8_3_release)
 
19853
+++ b/src/libgfortran/io/list_read.c    (.../branches/gcc-4_8-branch)
 
19854
@@ -2354,7 +2354,7 @@
 
19855
 {
 
19856
   index_type len = strlen (nl->var_name) + 1;
 
19857
   int dim;
 
19858
-  char * ext_name = (char*)xmalloc (len + 1);
 
19859
+  char * ext_name = xmalloc (len + 1);
 
19860
   memcpy (ext_name, nl->var_name, len-1);
 
19861
   memcpy (ext_name + len - 1, "%", 2);
 
19862
   for (nl = nl->next; nl; nl = nl->next)
 
19863
Index: libgfortran/io/unit.c
 
19864
===================================================================
 
19865
--- a/src/libgfortran/io/unit.c (.../tags/gcc_4_8_3_release)
 
19866
+++ b/src/libgfortran/io/unit.c (.../branches/gcc-4_8-branch)
 
19867
@@ -455,7 +455,7 @@
 
19868
     {
 
19869
       iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
 
19870
       iunit->ls = (array_loop_spec *)
 
19871
-       xmalloc (iunit->rank * sizeof (array_loop_spec));
 
19872
+       xmallocarray (iunit->rank, sizeof (array_loop_spec));
 
19873
       dtp->internal_unit_len *=
 
19874
        init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
 
19875
 
 
19876
Index: libgfortran/io/unix.c
 
19877
===================================================================
 
19878
--- a/src/libgfortran/io/unix.c (.../tags/gcc_4_8_3_release)
 
19879
+++ b/src/libgfortran/io/unix.c (.../branches/gcc-4_8-branch)
 
19880
@@ -407,7 +407,9 @@
 
19881
 {
 
19882
   int retval;
 
19883
   
 
19884
-  if (s->fd != STDOUT_FILENO
 
19885
+  if (s->fd == -1)
 
19886
+    retval = -1;
 
19887
+  else if (s->fd != STDOUT_FILENO
 
19888
       && s->fd != STDERR_FILENO
 
19889
       && s->fd != STDIN_FILENO)
 
19890
     retval = close (s->fd);
 
19891
@@ -983,7 +985,15 @@
 
19892
 
 
19893
   /* Get the current length of the file. */
 
19894
 
 
19895
-  fstat (fd, &statbuf);
 
19896
+  if (fstat (fd, &statbuf) == -1)
 
19897
+    {
 
19898
+      s->st_dev = s->st_ino = -1;
 
19899
+      s->file_length = 0;
 
19900
+      if (errno == EBADF)
 
19901
+       s->fd = -1;
 
19902
+      raw_init (s);
 
19903
+      return (stream *) s;
 
19904
+    }
 
19905
 
 
19906
   s->st_dev = statbuf.st_dev;
 
19907
   s->st_ino = statbuf.st_ino;
 
19908
Index: libgfortran/io/transfer.c
 
19909
===================================================================
 
19910
--- a/src/libgfortran/io/transfer.c     (.../tags/gcc_4_8_3_release)
 
19911
+++ b/src/libgfortran/io/transfer.c     (.../branches/gcc-4_8-branch)
 
19912
@@ -3776,9 +3776,9 @@
 
19913
   if (nml->var_rank > 0)
 
19914
     {
 
19915
       nml->dim = (descriptor_dimension*)
 
19916
-                  xmalloc (nml->var_rank * sizeof (descriptor_dimension));
 
19917
+       xmallocarray (nml->var_rank, sizeof (descriptor_dimension));
 
19918
       nml->ls = (array_loop_spec*)
 
19919
-                 xmalloc (nml->var_rank * sizeof (array_loop_spec));
 
19920
+       xmallocarray (nml->var_rank, sizeof (array_loop_spec));
 
19921
     }
 
19922
   else
 
19923
     {
 
19924
Index: libgfortran/io/write.c
 
19925
===================================================================
 
19926
--- a/src/libgfortran/io/write.c        (.../tags/gcc_4_8_3_release)
 
19927
+++ b/src/libgfortran/io/write.c        (.../branches/gcc-4_8-branch)
 
19928
@@ -1863,7 +1863,7 @@
 
19929
              base_var_name_len = base ? strlen (base->var_name) : 0;
 
19930
              ext_name_len = base_name_len + base_var_name_len 
 
19931
                + strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1;
 
19932
-             ext_name = (char*)xmalloc (ext_name_len);
 
19933
+             ext_name = xmalloc (ext_name_len);
 
19934
 
 
19935
              memcpy (ext_name, base_name, base_name_len);
 
19936
              clen = strlen (obj->var_name + base_var_name_len);
 
19937
@@ -1892,7 +1892,7 @@
 
19938
              /* Now obj_name.  */
 
19939
 
 
19940
              obj_name_len = strlen (obj->var_name) + 1;
 
19941
-             obj_name = xmalloc (obj_name_len+1);
 
19942
+             obj_name = xmalloc (obj_name_len + 1);
 
19943
              memcpy (obj_name, obj->var_name, obj_name_len-1);
 
19944
              memcpy (obj_name + obj_name_len-1, "%", 2);
 
19945
 
 
19946
Index: libada/Makefile.in
 
19947
===================================================================
 
19948
--- a/src/libada/Makefile.in    (.../tags/gcc_4_8_3_release)
 
19949
+++ b/src/libada/Makefile.in    (.../branches/gcc-4_8-branch)
 
19950
@@ -60,7 +60,7 @@
 
19951
 PICFLAG = @PICFLAG@
 
19952
 GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
 
19953
 GNATLIBCFLAGS= -g -O2
 
19954
-GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
 
19955
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
 
19956
        -fexceptions -DIN_RTS @have_getipinfo@
 
19957
 
 
19958
 host_subdir = @host_subdir@
 
19959
Index: libada/ChangeLog
 
19960
===================================================================
 
19961
--- a/src/libada/ChangeLog      (.../tags/gcc_4_8_3_release)
 
19962
+++ b/src/libada/ChangeLog      (.../branches/gcc-4_8-branch)
 
19963
@@ -1,3 +1,7 @@
 
19964
+2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
 
19965
+
 
19966
+       * Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.
 
19967
+
 
19968
 2014-05-22  Release Manager
 
19969
 
 
19970
        * GCC 4.8.3 released.
 
19971
Index: libffi/src/powerpc/linux64_closure.S
 
19972
===================================================================
 
19973
--- a/src/libffi/src/powerpc/linux64_closure.S  (.../tags/gcc_4_8_3_release)
 
19974
+++ b/src/libffi/src/powerpc/linux64_closure.S  (.../branches/gcc-4_8-branch)
 
19975
@@ -381,7 +381,8 @@
 
19976
        .align 3
 
19977
 .LEFDE1:
 
19978
 
 
19979
-# if defined __ELF__ && defined __linux__
 
19980
+#endif
 
19981
+
 
19982
+#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
 
19983
        .section        .note.GNU-stack,"",@progbits
 
19984
-# endif
 
19985
 #endif
 
19986
Index: libffi/src/powerpc/linux64.S
 
19987
===================================================================
 
19988
--- a/src/libffi/src/powerpc/linux64.S  (.../tags/gcc_4_8_3_release)
 
19989
+++ b/src/libffi/src/powerpc/linux64.S  (.../branches/gcc-4_8-branch)
 
19990
@@ -254,7 +254,8 @@
 
19991
        .align 3
 
19992
 .LEFDE1:
 
19993
 
 
19994
-# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
 
19995
+#endif
 
19996
+
 
19997
+#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
 
19998
        .section        .note.GNU-stack,"",@progbits
 
19999
-# endif
 
20000
 #endif
 
20001
Index: libffi/ChangeLog
 
20002
===================================================================
 
20003
--- a/src/libffi/ChangeLog      (.../tags/gcc_4_8_3_release)
 
20004
+++ b/src/libffi/ChangeLog      (.../branches/gcc-4_8-branch)
 
20005
@@ -1,3 +1,9 @@
 
20006
+2014-09-11  Jakub Jelinek  <jakub@redhat.com>
 
20007
+
 
20008
+       * src/powerpc/linux64.S: Emit .note.GNU-stack even when
 
20009
+       POWERPC64 is not defined.
 
20010
+       * src/powerpc/linux64_closure.S: Likewise.  Also test _CALL_ELF == 2.
 
20011
+
 
20012
 2014-05-22  Release Manager
 
20013
 
 
20014
        * GCC 4.8.3 released.
 
20015
Index: .
 
20016
===================================================================
 
20017
--- a/src/.     (.../tags/gcc_4_8_3_release)
 
20018
+++ b/src/.     (.../branches/gcc-4_8-branch)
 
20019
 
 
20020
Property changes on: .
 
20021
___________________________________________________________________
 
20022
Modified: svn:mergeinfo
 
20023
   Merged /trunk:r211733,215049