1
# DP: updates from the 4.8 branch upto 20140809 (r213778).
5
cat > ${dir}LAST_UPDATED <<EOF
6
Sat Aug 9 17:20:21 CEST 2014
7
Sat Aug 9 15:20:21 UTC 2014 (revision 213778)
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'
15
Index: libstdc++-v3/scripts/run_doxygen
16
===================================================================
17
--- a/src/libstdc++-v3/scripts/run_doxygen (.../tags/gcc_4_8_3_release)
18
+++ b/src/libstdc++-v3/scripts/run_doxygen (.../branches/gcc-4_8-branch)
23
- # Also drop in the header file and style sheet
24
- doxygen -w latex header.tex doxygen.sty
25
+ # Grrr, Doxygen 1.8.x changed the -w latex options.
26
+ need_footer=`doxygen -h | sed -n -e '/-w latex/s=.*footer.*=true=p'`
28
+ # Also drop in the header file (maybe footer file) and style sheet
29
+ if $need_footer; then
30
+ doxygen -w latex header.tex footer.tex doxygen.sty
32
+ doxygen -w latex header.tex doxygen.sty
36
echo :: LaTeX pages begin with
37
Index: libstdc++-v3/include/std/future
38
===================================================================
39
--- a/src/libstdc++-v3/include/std/future (.../tags/gcc_4_8_3_release)
40
+++ b/src/libstdc++-v3/include/std/future (.../branches/gcc-4_8-branch)
43
_M_set_result(function<_Ptr_type()> __res, bool __ignore_failure = false)
45
- bool __set = __ignore_failure;
47
// all calls to this function are serialized,
48
// side-effects of invoking __res only happen once
49
call_once(_M_once, &_State_base::_M_do_set, this, ref(__res),
53
+ _M_cond.notify_all();
54
+ else if (!__ignore_failure)
55
__throw_future_error(int(future_errc::promise_already_satisfied));
59
lock_guard<mutex> __lock(_M_mutex);
60
_M_result.swap(__res);
62
- _M_cond.notify_all();
68
set_value(const _Res& __r)
70
+ auto __future = _M_future;
71
auto __setter = _State::__setter(this, __r);
72
- _M_future->_M_set_result(std::move(__setter));
73
+ __future->_M_set_result(std::move(__setter));
79
+ auto __future = _M_future;
80
auto __setter = _State::__setter(this, std::move(__r));
81
- _M_future->_M_set_result(std::move(__setter));
82
+ __future->_M_set_result(std::move(__setter));
86
set_exception(exception_ptr __p)
88
+ auto __future = _M_future;
89
auto __setter = _State::__setter(__p, this);
90
- _M_future->_M_set_result(std::move(__setter));
91
+ __future->_M_set_result(std::move(__setter));
95
@@ -1081,15 +1085,17 @@
99
+ auto __future = _M_future;
100
auto __setter = _State::__setter(this, __r);
101
- _M_future->_M_set_result(std::move(__setter));
102
+ __future->_M_set_result(std::move(__setter));
106
set_exception(exception_ptr __p)
108
+ auto __future = _M_future;
109
auto __setter = _State::__setter(__p, this);
110
- _M_future->_M_set_result(std::move(__setter));
111
+ __future->_M_set_result(std::move(__setter));
115
@@ -1166,8 +1172,9 @@
117
set_exception(exception_ptr __p)
119
+ auto __future = _M_future;
120
auto __setter = _State::__setter(__p, this);
121
- _M_future->_M_set_result(std::move(__setter));
122
+ __future->_M_set_result(std::move(__setter));
126
@@ -1193,8 +1200,9 @@
128
promise<void>::set_value()
130
+ auto __future = _M_future;
131
auto __setter = _State::__setter(this);
132
- _M_future->_M_set_result(std::move(__setter));
133
+ __future->_M_set_result(std::move(__setter));
137
Index: libstdc++-v3/include/ext/rope
138
===================================================================
139
--- a/src/libstdc++-v3/include/ext/rope (.../tags/gcc_4_8_3_release)
140
+++ b/src/libstdc++-v3/include/ext/rope (.../branches/gcc-4_8-branch)
141
@@ -1544,7 +1544,7 @@
142
typedef typename _Base::allocator_type allocator_type;
143
using _Base::_M_tree_ptr;
144
using _Base::get_allocator;
145
- using _Base::_M_get_allocator;
146
+ using _Base::_M_get_allocator;
147
typedef __GC_CONST _CharT* _Cstrptr;
149
static _CharT _S_empty_c_str[1];
150
@@ -1876,8 +1876,9 @@
151
const allocator_type& __a = allocator_type())
154
- this->_M_tree_ptr = (0 == __len) ?
155
- 0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
156
+ this->_M_tree_ptr = (0 == __len)
158
+ : _S_new_RopeFunction(__fn, __len, __delete_fn, _M_get_allocator());
161
rope(const rope& __x, const allocator_type& __a = allocator_type())
162
Index: libstdc++-v3/include/bits/stl_tree.h
163
===================================================================
164
--- a/src/libstdc++-v3/include/bits/stl_tree.h (.../tags/gcc_4_8_3_release)
165
+++ b/src/libstdc++-v3/include/bits/stl_tree.h (.../branches/gcc-4_8-branch)
166
@@ -510,11 +510,11 @@
170
- { return static_cast<_Link_type>(&this->_M_impl._M_header); }
171
+ { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); }
175
- { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
176
+ { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); }
178
static const_reference
179
_S_value(_Const_Link_type __x)
180
Index: libstdc++-v3/include/tr2/bool_set
181
===================================================================
182
--- a/src/libstdc++-v3/include/tr2/bool_set (.../tags/gcc_4_8_3_release)
183
+++ b/src/libstdc++-v3/include/tr2/bool_set (.../branches/gcc-4_8-branch)
187
* See N2136, Bool_set: multi-valued logic
188
- * by Herv� Br�nnimann, Guillaume Melquiond, Sylvain Pion.
189
+ * by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.
191
* The implicit conversion to bool is slippery! I may use the new
192
* explicit conversion. This has been specialized in the language
193
Index: libstdc++-v3/ChangeLog
194
===================================================================
195
--- a/src/libstdc++-v3/ChangeLog (.../tags/gcc_4_8_3_release)
196
+++ b/src/libstdc++-v3/ChangeLog (.../branches/gcc-4_8-branch)
198
+2014-08-04 Jonathan Wakely <jwakely@redhat.com>
200
+ Backported from mainline
201
+ 2014-07-29 Jonathan Wakely <jwakely@redhat.com>
204
+ * include/ext/rope (rope::rope(char_producer<_CharT>*, size_t, bool,
205
+ const allocator_type&)): Pass non-const allocator to
206
+ _S_new_RopeFunction.
207
+ * testsuite/ext/rope/61946.cc: New.
209
+2014-08-04 Zifei Tong <zifeitong@gmail.com>
211
+ * libsupc++/atexit_thread.cc (HAVE___CXA_THREAD_ATEXIT_IMPL): Add
212
+ _GLIBCXX_ prefix to macro.
214
+2014-06-03 Jonathan Wakely <jwakely@redhat.com>
216
+ Backport from mainline
217
+ 2014-04-15 Jonathan Wakely <jwakely@redhat.com>
220
+ * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast.
222
+ Backport from mainline
223
+ 2014-05-16 Jonathan Wakely <jwakely@redhat.com>
226
+ * include/std/future (__future_base::_State_baseV2::_M_set_result):
227
+ Signal condition variable after call_once returns.
228
+ (__future_base::_State_baseV2::_M_do_set): Do not signal here.
229
+ (promise::set_value, promise::set_exception): Increment the reference
230
+ count on the shared state until the function returns.
231
+ * testsuite/30_threads/promise/60966.cc: New.
233
+2014-05-29 Jonathan Wakely <jwakely@redhat.com>
235
+ * include/tr2/bool_set: Use UTF-8 for accented characters.
236
+ * scripts/run_doxygen: Handle Doxygen 1.8.x change.
238
2014-05-22 Release Manager
240
* GCC 4.8.3 released.
241
Index: libstdc++-v3/libsupc++/atexit_thread.cc
242
===================================================================
243
--- a/src/libstdc++-v3/libsupc++/atexit_thread.cc (.../tags/gcc_4_8_3_release)
244
+++ b/src/libstdc++-v3/libsupc++/atexit_thread.cc (.../branches/gcc-4_8-branch)
247
#include "bits/gthr.h"
249
-#if HAVE___CXA_THREAD_ATEXIT_IMPL
250
+#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
252
extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
255
return __cxa_thread_atexit_impl (dtor, obj, dso_handle);
258
-#else /* HAVE___CXA_THREAD_ATEXIT_IMPL */
259
+#else /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
262
// One element in a singly-linked stack of cleanups.
267
-#endif /* HAVE___CXA_THREAD_ATEXIT_IMPL */
268
+#endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
269
Index: libstdc++-v3/testsuite/30_threads/promise/60966.cc
270
===================================================================
271
--- a/src/libstdc++-v3/testsuite/30_threads/promise/60966.cc (.../tags/gcc_4_8_3_release)
272
+++ b/src/libstdc++-v3/testsuite/30_threads/promise/60966.cc (.../branches/gcc-4_8-branch)
274
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
275
+// { dg-options " -std=gnu++11 -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
276
+// { dg-options " -std=gnu++11 -pthreads" { target *-*-solaris* } }
277
+// { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-darwin* } }
278
+// { dg-require-cstdint "" }
279
+// { dg-require-gthreads "" }
280
+// { dg-require-atomic-builtins "" }
282
+// Copyright (C) 2014 Free Software Foundation, Inc.
284
+// This file is part of the GNU ISO C++ Library. This library is free
285
+// software; you can redistribute it and/or modify it under the
286
+// terms of the GNU General Public License as published by the
287
+// Free Software Foundation; either version 3, or (at your option)
288
+// any later version.
290
+// This library is distributed in the hope that it will be useful,
291
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
292
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
293
+// GNU General Public License for more details.
295
+// You should have received a copy of the GNU General Public License along
296
+// with this library; see the file COPYING3. If not see
297
+// <http://www.gnu.org/licenses/>.
300
+// This test hangs if std::promise::~promise() destroys the
301
+// shared state before std::promise::set_value() finishes using it.
307
+const int THREADS = 10;
309
+void run_task(std::promise<void>* pr)
311
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
317
+ std::vector<std::promise<void>*> tasks(THREADS);
318
+ std::vector<std::thread> threads(THREADS);
319
+ std::vector<std::future<void>> futures(THREADS);
321
+ for (int i = 0; i < THREADS; ++i)
323
+ std::promise<void>* task = new std::promise<void>;
325
+ futures[i] = task->get_future();
326
+ threads[i] = std::thread(run_task, task);
329
+ for (int i = 0; i < THREADS; ++i)
331
+ // the temporary future releases the state as soon as wait() returns
332
+ std::future<void>(std::move(futures[i])).wait();
333
+ // state is ready, should now be safe to delete promise, so it
334
+ // releases the shared state too
338
+ for (auto& t : threads)
341
Index: libstdc++-v3/testsuite/ext/rope/61946.cc
342
===================================================================
343
--- a/src/libstdc++-v3/testsuite/ext/rope/61946.cc (.../tags/gcc_4_8_3_release)
344
+++ b/src/libstdc++-v3/testsuite/ext/rope/61946.cc (.../branches/gcc-4_8-branch)
346
+// Copyright (C) 2014 Free Software Foundation, Inc.
348
+// This file is part of the GNU ISO C++ Library. This library is free
349
+// software; you can redistribute it and/or modify it under the
350
+// terms of the GNU General Public License as published by the
351
+// Free Software Foundation; either version 3, or (at your option)
352
+// any later version.
354
+// This library is distributed in the hope that it will be useful,
355
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
356
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
357
+// GNU General Public License for more details.
359
+// You should have received a copy of the GNU General Public License along
360
+// with this library; see the file COPYING3. If not see
361
+// <http://www.gnu.org/licenses/>.
363
+// { dg-do compile }
367
+struct empty_char_prod : __gnu_cxx::char_producer<char>
369
+ virtual void operator()(size_t, size_t, char*) {}
374
+ empty_char_prod* ecp = new empty_char_prod;
375
+ __gnu_cxx::crope excrope( ecp, 10L, true );
378
===================================================================
379
--- a/src/configure.ac (.../tags/gcc_4_8_3_release)
380
+++ b/src/configure.ac (.../branches/gcc-4_8-branch)
381
@@ -1154,6 +1154,9 @@
383
host_makefile_frag="config/mh-mingw"
386
+ host_makefile_frag="config/mh-alpha-linux"
389
host_makefile_frag="config/mh-pa-hpux10"
392
===================================================================
393
--- a/src/ChangeLog (.../tags/gcc_4_8_3_release)
394
+++ b/src/ChangeLog (.../branches/gcc-4_8-branch)
396
+2014-07-26 Uros Bizjak <ubizjak@gmail.com>
399
+ * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
400
+ * configure: Regenerate.
402
2014-05-22 Release Manager
404
* GCC 4.8.3 released.
405
Index: contrib/ChangeLog
406
===================================================================
407
--- a/src/contrib/ChangeLog (.../tags/gcc_4_8_3_release)
408
+++ b/src/contrib/ChangeLog (.../branches/gcc-4_8-branch)
410
+2014-07-07 Richard Biener <rguenther@suse.de>
412
+ * gennews: Use gcc-3.0/index.html.
414
2014-05-22 Release Manager
416
* GCC 4.8.3 released.
417
Index: contrib/gennews
418
===================================================================
419
--- a/src/contrib/gennews (.../tags/gcc_4_8_3_release)
420
+++ b/src/contrib/gennews (.../branches/gcc-4_8-branch)
422
gcc-3.3/index.html gcc-3.3/changes.html
423
gcc-3.2/index.html gcc-3.2/changes.html
424
gcc-3.1/index.html gcc-3.1/changes.html
425
- gcc-3.0/gcc-3.0.html gcc-3.0/features.html gcc-3.0/caveats.html
426
+ gcc-3.0/index.html gcc-3.0/features.html gcc-3.0/caveats.html
427
gcc-2.95/index.html gcc-2.95/features.html gcc-2.95/caveats.html
428
egcs-1.1/index.html egcs-1.1/features.html egcs-1.1/caveats.html
429
egcs-1.0/index.html egcs-1.0/features.html egcs-1.0/caveats.html"
430
Index: config/mh-alpha-linux
431
===================================================================
432
--- a/src/config/mh-alpha-linux (.../tags/gcc_4_8_3_release)
433
+++ b/src/config/mh-alpha-linux (.../branches/gcc-4_8-branch)
435
+# Prevent GPREL16 relocation truncation
436
+LDFLAGS += -Wl,--no-relax
437
+BOOT_LDFLAGS += -Wl,--no-relax
438
Index: config/ChangeLog
439
===================================================================
440
--- a/src/config/ChangeLog (.../tags/gcc_4_8_3_release)
441
+++ b/src/config/ChangeLog (.../branches/gcc-4_8-branch)
443
+2014-07-26 Uros Bizjak <ubizjak@gmail.com>
446
+ * mh-alpha-linux: New file.
448
2014-05-22 Release Manager
450
* GCC 4.8.3 released.
451
Index: libjava/classpath
452
===================================================================
453
--- a/src/libjava/classpath (.../tags/gcc_4_8_3_release)
454
+++ b/src/libjava/classpath (.../branches/gcc-4_8-branch)
456
Property changes on: libjava/classpath
457
___________________________________________________________________
458
Modified: svn:mergeinfo
459
Merged /trunk/libjava/classpath:r211733
461
===================================================================
462
--- a/src/configure (.../tags/gcc_4_8_3_release)
463
+++ b/src/configure (.../branches/gcc-4_8-branch)
464
@@ -3834,6 +3834,9 @@
466
host_makefile_frag="config/mh-mingw"
469
+ host_makefile_frag="config/mh-alpha-linux"
472
host_makefile_frag="config/mh-pa-hpux10"
474
Index: gcc/tree-ssa-tail-merge.c
475
===================================================================
476
--- a/src/gcc/tree-ssa-tail-merge.c (.../tags/gcc_4_8_3_release)
477
+++ b/src/gcc/tree-ssa-tail-merge.c (.../branches/gcc-4_8-branch)
478
@@ -1060,6 +1060,24 @@
482
+/* Return true if gimple operands T1 and T2 have the same value. */
485
+gimple_operand_equal_value_p (tree t1, tree t2)
490
+ if (t1 == NULL_TREE
491
+ || t2 == NULL_TREE)
494
+ if (operand_equal_p (t1, t2, 0))
497
+ return gvn_uses_equal (t1, t2);
500
/* Return true if gimple statements S1 and S2 are equal. Gimple_bb (s1) and
501
gimple_bb (s2) are members of SAME_SUCC. */
503
@@ -1122,8 +1140,9 @@
504
lhs2 = gimple_get_lhs (s2);
505
if (TREE_CODE (lhs1) != SSA_NAME
506
&& TREE_CODE (lhs2) != SSA_NAME)
507
- return (vn_valueize (gimple_vdef (s1))
508
- == vn_valueize (gimple_vdef (s2)));
509
+ return (operand_equal_p (lhs1, lhs2, 0)
510
+ && gimple_operand_equal_value_p (gimple_assign_rhs1 (s1),
511
+ gimple_assign_rhs1 (s2)));
512
else if (TREE_CODE (lhs1) == SSA_NAME
513
&& TREE_CODE (lhs2) == SSA_NAME)
514
return vn_valueize (lhs1) == vn_valueize (lhs2);
516
===================================================================
517
--- a/src/gcc/DATESTAMP (.../tags/gcc_4_8_3_release)
518
+++ b/src/gcc/DATESTAMP (.../branches/gcc-4_8-branch)
523
===================================================================
524
--- a/src/gcc/ipa-cp.c (.../tags/gcc_4_8_3_release)
525
+++ b/src/gcc/ipa-cp.c (.../branches/gcc-4_8-branch)
527
else if (!opt_for_fn (node->symbol.decl, optimize)
528
|| !opt_for_fn (node->symbol.decl, flag_ipa_cp))
529
reason = "non-optimized function";
530
+ else if (node->tm_clone)
531
+ reason = "transactional memory clone";
533
if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
534
fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
536
===================================================================
537
--- a/src/gcc/omp-low.c (.../tags/gcc_4_8_3_release)
538
+++ b/src/gcc/omp-low.c (.../branches/gcc-4_8-branch)
539
@@ -1586,7 +1586,6 @@
540
TREE_STATIC (decl) = 1;
541
TREE_USED (decl) = 1;
542
DECL_ARTIFICIAL (decl) = 1;
543
- DECL_NAMELESS (decl) = 1;
544
DECL_IGNORED_P (decl) = 0;
545
TREE_PUBLIC (decl) = 0;
546
DECL_UNINLINABLE (decl) = 1;
548
===================================================================
549
--- a/src/gcc/toplev.c (.../tags/gcc_4_8_3_release)
550
+++ b/src/gcc/toplev.c (.../branches/gcc-4_8-branch)
551
@@ -1036,16 +1036,19 @@
553
if (warn_stack_usage >= 0)
555
+ const location_t loc = DECL_SOURCE_LOCATION (current_function_decl);
557
if (stack_usage_kind == DYNAMIC)
558
- warning (OPT_Wstack_usage_, "stack usage might be unbounded");
559
+ warning_at (loc, OPT_Wstack_usage_, "stack usage might be unbounded");
560
else if (stack_usage > warn_stack_usage)
562
if (stack_usage_kind == DYNAMIC_BOUNDED)
563
- warning (OPT_Wstack_usage_, "stack usage might be %wd bytes",
566
+ OPT_Wstack_usage_, "stack usage might be %wd bytes",
569
- warning (OPT_Wstack_usage_, "stack usage is %wd bytes",
571
+ warning_at (loc, OPT_Wstack_usage_, "stack usage is %wd bytes",
577
===================================================================
578
--- a/src/gcc/ChangeLog (.../tags/gcc_4_8_3_release)
579
+++ b/src/gcc/ChangeLog (.../branches/gcc-4_8-branch)
581
+2014-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
583
+ Backport from mainline
584
+ 2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
586
+ PR tree-optimization/61375
587
+ * tree-ssa-math-opts.c (find_bswap_or_nop_1): Cancel optimization if
588
+ symbolic number cannot be represented in an unsigned HOST_WIDE_INT.
589
+ (execute_optimize_bswap): Cancel optimization if CHAR_BIT != 8.
591
+2014-08-01 Richard Biener <rguenther@suse.de>
593
+ PR tree-optimization/61964
594
+ * tree-ssa-tail-merge.c (gimple_operand_equal_value_p): New
595
+ function merged from trunk.
596
+ (gimple_equal_p): Handle non-SSA LHS solely by structural
599
+2014-07-25 Uros Bizjak <ubizjak@gmail.com>
601
+ * config/alpha/elf.h: Define TARGET_UNWIND_TABLES_DEFAULT.
603
+2014-07-24 Kyle McMartin <kyle@redhat.com>
605
+ * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define.
607
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
609
+ * config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
611
+ * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
612
+ function. Issue -Wpsabi warning if future GCC releases will use
613
+ different field alignment rules for this type.
614
+ * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
615
+ * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
616
+ * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
618
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
620
+ * config/rs6000/rs6000.c (rs6000_function_arg_boundary): Issue
621
+ -Wpsabi note when encountering a type where future GCC releases
622
+ will apply different alignment requirements.
624
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
626
+ * config/rs6000/rs6000.c (rs6000_function_arg): If a float argument
627
+ does not fit fully into floating-point registers, and there is still
628
+ space in the register parameter area, issue -Wpsabi note that the ABI
629
+ will change in a future GCC release.
631
+2014-07-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
633
+ * config/arm/t-rtems-eabi: Add
634
+ mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard,
635
+ mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard,
636
+ mbig-endian/mthumb/march=armv7-r, and
637
+ mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
640
+2014-07-21 Peter Bergner <bergner@vnet.ibm.com>
642
+ * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define.
643
+ (LIBTSAN_EARLY_SPEC): Likewise.
644
+ (STATIC_LIBASAN_LIBS): Likewise.
645
+ (STATIC_LIBTSAN_LIBS): Likewise.
647
+2014-07-19 Eric Botcazou <ebotcazou@adacore.com>
649
+ * toplev.c (output_stack_usage): Adjust the location of the warning.
651
+2014-07-19 Daniel Cederman <cederman@gaisler.com>
653
+ * config/sparc/sync.md (*membar_storeload_leon3): New insn.
654
+ (*membar_storeload): Disable for LEON3.
656
+2014-07-17 Richard Biener <rguenther@suse.de>
658
+ PR rtl-optimization/61801
659
+ * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and
660
+ ASM_INPUT don't set reg_pending_barrier if it appears in a
663
+2014-07-16 Jakub Jelinek <jakub@redhat.com>
665
+ * omp-low.c (create_omp_child_function): Don't set DECL_NAMELESS
666
+ on the FUNCTION_DECL.
668
+2014-07-10 Tom G. Christensen <tgc@jupiterrise.com>
670
+ * doc/install.texi: Remove links to defunct package providers for
673
+2014-07-10 Eric Botcazou <ebotcazou@adacore.com>
675
+ PR middle-end/53590
676
+ * function.c (allocate_struct_function): Revert r188667 change.
678
+2014-07-04 Jakub Jelinek <jakub@redhat.com>
680
+ PR tree-optimization/61684
681
+ * tree-ssa-ifcombine.c (recognize_single_bit_test): Make sure
682
+ rhs1 of conversion is a SSA_NAME before using SSA_NAME_DEF_STMT on it.
684
+2014-06-30 Thomas Preud'homme <thomas.preudhomme@arm.com>
686
+ Backport from Mainline
687
+ 2014-06-20 Jakub Jelinek <jakub@redhat.com>
688
+ 2014-06-11 Thomas Preud'homme <thomas.preudhomme@arm.com>
690
+ PR tree-optimization/61306
691
+ * tree-ssa-math-opts.c (struct symbolic_number): Store type of
692
+ expression instead of its size.
693
+ (do_shift_rotate): Adapt to change in struct symbolic_number. Return
694
+ false to prevent optimization when the result is unpredictable due to
695
+ arithmetic right shift of signed type with highest byte is set.
696
+ (verify_symbolic_number_p): Adapt to change in struct symbolic_number.
697
+ (find_bswap_1): Likewise. Return NULL to prevent optimization when the
698
+ result is unpredictable due to sign extension.
699
+ (find_bswap): Adapt to change in struct symbolic_number.
701
+2014-06-27 Uros Bizjak <ubizjak@gmail.com>
703
+ Backport from mainline
704
+ 2014-06-26 Uros Bizjak <ubizjak@gmail.com>
707
+ * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX.
709
+2014-06-26 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
712
+ * config/rs6000/vsx.md (vsx_extract_v4sf): Fix bug with element
713
+ extraction other than index 3.
715
+2014-06-24 Jakub Jelinek <jakub@redhat.com>
718
+ * config/i386/driver-i386.c (host_detect_local_cpu): For unknown
719
+ model family 6 CPU with has_longmode never use a CPU without
722
+2014-06-20 Chung-Lin Tang <cltang@codesourcery.com>
724
+ Backport from mainline
726
+ 2014-06-20 Julian Brown <julian@codesourcery.com>
727
+ Chung-Lin Tang <cltang@codesourcery.com>
729
+ * config/arm/arm.c (arm_output_mi_thunk): Fix offset for
730
+ TARGET_THUMB1_ONLY. Add comments.
732
+2014-06-18 Uros Bizjak <ubizjak@gmail.com>
734
+ Backport from mainline
735
+ 2014-06-06 Uros Bizjak <ubizjak@gmail.com>
738
+ * config/i386/i386.md (*floatunssi<mode>2_i387_with_xmm): New
739
+ define_insn_and_split pattern, merged from *floatunssi<mode>2_1
740
+ and corresponding splitters. Zero extend general register
741
+ or memory input operand to XMM temporary. Enable for
742
+ TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
743
+ (floatunssi<mode>2): Update expander predicate.
745
+2014-06-18 Richard Henderson <rth@redhat.com>
748
+ * config/aarch64/aarch64.md (tlsdesc_small): Clobber CC_REGNUM.
750
+2014-06-17 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
752
+ Revert on gcc-4_8-branch.
753
+ * config/microblaze/microblaze.md: Add movsi4_rev insn pattern.
754
+ * config/microblaze/predicates.md: Add reg_or_mem_operand predicate.
756
+2014-06-17 Yufeng Zhang <yufeng.zhang@arm.com>
758
+ Backport from mainline
761
+ * config/aarch64/aarch64.c (aarch64_layout_arg): Add new local
762
+ variable 'size'; calculate 'size' right in the front; use
763
+ 'size' to compute 'nregs' (when 'allocate_ncrn != 0') and
764
+ pcum->aapcs_stack_words.
766
+2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
768
+ Backport from mainline
770
+ 2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
772
+ * config/rs6000/rs6000-builtin.def (BU_MISC_1): Delete.
773
+ (BU_MISC_2): Rename to ...
774
+ (BU_LDBL128_2): ... this.
775
+ * config/rs6000/rs6000.h (RS6000_BTM_LDBL128): New define.
776
+ (RS6000_BTM_COMMON): Add RS6000_BTM_LDBL128.
777
+ * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
778
+ RS6000_BTM_LDBL128.
779
+ (rs6000_invalid_builtin): Add long double 128-bit builtin support.
780
+ (rs6000_builtin_mask_names): Add RS6000_BTM_LDBL128.
781
+ * config/rs6000/rs6000.md (unpacktf_0): Remove define)expand.
782
+ (unpacktf_1): Likewise.
783
+ * doc/extend.texi (__builtin_longdouble_dw0): Remove documentation.
784
+ (__builtin_longdouble_dw1): Likewise.
785
+ * doc/sourcebuild.texi (longdouble128): Document.
787
+2014-06-13 Jason Merrill <jason@redhat.com>
790
+ * common.opt (-fno-gnu-unique): Add.
791
+ * config/elfos.h (USE_GNU_UNIQUE_OBJECT): Check it.
793
+2014-06-12 Georg-Johann Lay <avr@gjlay.de>
795
+ Backport from 2014-05-09 trunk r210272
797
+ * config/avr/avr-fixed.md (round<mode>3): Use -1U instead of -1 in
798
+ unsigned int initializers for regno_in, regno_out.
800
+ Backport from 2014-05-14 trunk r210418
801
+ * config/avr/avr.h (REG_CLASS_CONTENTS): Use unsigned suffix for
802
+ shifted values to avoid build warning.
804
+ Backport from 2014-06-12 trunk r211491
807
+ * config/avr/avr.md (push<mode>1): Avoid (subreg(mem)) when
808
+ loading from address spaces.
810
+2014-06-12 Alan Modra <amodra@gmail.com>
813
+ * doc/tm.texi.in (INCOMING_REG_PARM_STACK_SPACE): Document.
814
+ * doc/tm.texi: Regenerate.
815
+ * function.c (INCOMING_REG_PARM_STACK_SPACE): Provide default.
816
+ Use throughout in place of REG_PARM_STACK_SPACE.
817
+ * config/rs6000/rs6000.c (rs6000_reg_parm_stack_space): Add
818
+ "incoming" param. Pass to rs6000_function_parms_need_stack.
819
+ (rs6000_function_parms_need_stack): Add "incoming" param, ignore
820
+ prototype_p when incoming. Use function decl when incoming
821
+ to handle K&R style functions.
822
+ * config/rs6000/rs6000.h (REG_PARM_STACK_SPACE): Adjust.
823
+ (INCOMING_REG_PARM_STACK_SPACE): Define.
825
+2014-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
827
+ Back port from trunk
828
+ 2014-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
831
+ * config/rs6000/vsx.md (VSX_LE): Split VSX_D into 2 separate
832
+ iterators, VSX_D that handles 64-bit types, and VSX_LE that
833
+ handles swapping the two 64-bit double words on little endian
834
+ systems. Include V1TImode and optionally TImode in VSX_LE so that
835
+ these types are properly swapped. Change all of the insns and
836
+ splits that do the 64-bit swaps to use VSX_LE.
837
+ (vsx_le_perm_load_<mode>): Likewise.
838
+ (vsx_le_perm_store_<mode>): Likewise.
839
+ (splitters for little endian memory operations): Likewise.
840
+ (vsx_xxpermdi2_le_<mode>): Likewise.
841
+ (vsx_lxvd2x2_le_<mode>): Likewise.
842
+ (vsx_stxvd2x2_le_<mode>): Likewise.
844
+2014-06-05 Martin Jambor <mjambor@suse.cz>
847
+ * ipa-cp.c (determine_versionability): Pretend that tm_clones are
850
+2014-06-04 Richard Biener <rguenther@suse.de>
852
+ PR tree-optimization/61383
853
+ * tree-ssa-ifcombine.c (bb_no_side_effects_p): Make sure
856
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
858
+ Backport from mainline
859
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
861
+ PR rtl-optimization/60866
862
+ * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
863
+ Default it to -1. Pass it down to init_simplejump_data.
864
+ (init_simplejump_data): New parameter old_seqno. Pass it down
865
+ to get_seqno_for_a_jump.
866
+ (get_seqno_for_a_jump): New parameter old_seqno. Use it for
867
+ initializing new jump seqno as a last resort. Add comment.
868
+ (sel_redirect_edge_and_branch): Save old seqno of the conditional
869
+ jump and pass it down to sel_init_new_insn.
870
+ (sel_redirect_edge_and_branch_force): Likewise.
872
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
874
+ Backport from mainline
875
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
877
+ PR rtl-optimization/60901
878
+ * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
879
+ bb predecessor belongs to the same scheduling region. Adjust comment.
881
+2014-06-03 Uros Bizjak <ubizjak@gmail.com>
883
+ Backport from mainline
884
+ 2014-06-02 Uros Bizjak <ubizjak@gmail.com>
887
+ * config/i386/i386.c (ix86_expand_vec_perm) [case V32QImode]: Use
888
+ GEN_INT (-128) instead of GEN_INT (128) to set MSB of QImode constant.
890
+2014-05-28 Guozhi Wei <carrot@google.com>
893
+ * config/aarch64/arm_neon.h (vqdmulh_n_s16): Change the last operand's
895
+ (vqdmulhq_n_s16): Likewise.
897
+2014-05-28 Eric Botcazou <ebotcazou@adacore.com>
899
+ Backport from mainline
900
+ 2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
902
+ * double-int.c (div_and_round_double) <ROUND_DIV_EXPR>: Use the proper
903
+ predicate to detect a negative quotient.
905
+2014-05-28 Georg-Johann Lay <avr@gjlay.de>
908
+ * doc/extend.texi (Local Labels): Note that label differences are
909
+ not supported for AVR.
911
+2014-05-26 Michael Tautschnig <mt@debian.org>
914
+ * doc/extend.texi (X86 Built-in Functions): Fix parameter lists of
915
+ __builtin_ia32_vfrczs[sd] and __builtin_ia32_mpsadbw256.
917
+2014-05-23 Alan Modra <amodra@gmail.com>
920
+ * config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
921
+ * config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
922
+ Use "Y" constraint rather than "m".
924
+2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
926
+ Backport from mainline
927
+ 2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
929
+ * config/rs6000/htm.md (ttest): Use correct shift value to get CR0.
931
+2014-05-22 Richard Earnshaw <rearnsha@arm.com>
934
+ * arm.md (arm_cmpdi_unsigned): Fix length calculation for Thumb2.
936
2014-05-22 Release Manager
938
* GCC 4.8.3 released.
939
Index: gcc/testsuite/gcc.target/powerpc/tfmode_off.c
940
===================================================================
941
--- a/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../tags/gcc_4_8_3_release)
942
+++ b/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../branches/gcc-4_8-branch)
944
/* { dg-do assemble } */
945
/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
946
/* { dg-skip-if "no TFmode" { powerpc-*-eabi* } { "*" } { "" } } */
947
+/* { dg-require-effective-target longdouble128 } */
948
/* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
950
typedef float TFmode __attribute__ ((mode (TF)));
951
Index: gcc/testsuite/gcc.target/powerpc/pack02.c
952
===================================================================
953
--- a/src/gcc/testsuite/gcc.target/powerpc/pack02.c (.../tags/gcc_4_8_3_release)
954
+++ b/src/gcc/testsuite/gcc.target/powerpc/pack02.c (.../branches/gcc-4_8-branch)
956
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
957
/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
958
/* { dg-require-effective-target powerpc_fprs } */
959
+/* { dg-require-effective-target longdouble128 } */
960
/* { dg-options "-O2 -mhard-float" } */
963
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
964
===================================================================
965
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c (.../tags/gcc_4_8_3_release)
966
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c (.../branches/gcc-4_8-branch)
968
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
969
+/* { dg-options "-mabi=elfv2" } */
976
+void test (struct f8 a, struct f8 b) /* { dg-message "note: the ABI of passing homogeneous float aggregates will change" } */
980
Index: gcc/testsuite/gcc.target/powerpc/htm-ttest.c
981
===================================================================
982
--- a/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c (.../tags/gcc_4_8_3_release)
983
+++ b/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c (.../branches/gcc-4_8-branch)
985
+/* { dg-do compile { target { powerpc*-*-* } } } */
986
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
987
+/* { dg-require-effective-target powerpc_htm_ok } */
988
+/* { dg-options "-O2 -mhtm" } */
990
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,3,30,31" { target { ilp32 } } } } */
991
+/* { dg-final { scan-assembler "rldicl r?\[0-9\]+,r?\[0-9\]+,35,62" { target { lp64 } } } } */
993
+#include <htmintrin.h>
997
+ return _HTM_STATE(__builtin_ttest());
999
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c
1000
===================================================================
1001
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c (.../tags/gcc_4_8_3_release)
1002
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c (.../branches/gcc-4_8-branch)
1004
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
1005
+/* { dg-options "-mno-compat-align-parm" } */
1009
+ long a __attribute__((aligned (16)));
1012
+void test (struct test a) /* { dg-message "note: the ABI of passing aggregates with 16-byte alignment will change" } */
1016
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
1017
===================================================================
1018
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c (.../tags/gcc_4_8_3_release)
1019
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c (.../branches/gcc-4_8-branch)
1021
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
1022
+/* { dg-require-effective-target powerpc_altivec_ok } */
1023
+/* { dg-options "-maltivec" } */
1027
+ int a __attribute__((vector_size (8)));
1028
+ }; /* { dg-message "note: the layout of aggregates containing vectors with 8-byte alignment will change" } */
1030
Index: gcc/testsuite/gcc.target/alpha/pr61586.c
1031
===================================================================
1032
--- a/src/gcc/testsuite/gcc.target/alpha/pr61586.c (.../tags/gcc_4_8_3_release)
1033
+++ b/src/gcc/testsuite/gcc.target/alpha/pr61586.c (.../branches/gcc-4_8-branch)
1035
+/* { dg-do compile } */
1036
+/* { dg-options "-O2 -mieee" } */
1038
+void foo (int *dimensions, double **params, int hh)
1042
+ else if (dimensions[hh] > 0)
1043
+ params[hh][0] = 1.0f;
1045
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c
1046
===================================================================
1047
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c (.../tags/gcc_4_8_3_release)
1048
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c (.../branches/gcc-4_8-branch)
1050
+/* Test AAPCS64 layout and __builtin_va_start.
1052
+ Pass named HFA/HVA argument on stack. */
1054
+/* { dg-do run { target aarch64*-*-* } } */
1056
+#ifndef IN_FRAMEWORK
1057
+#define AAPCS64_TEST_STDARG
1058
+#define TESTFILE "va_arg-14.c"
1059
+#include "type-def.h"
1061
+struct hfa_fx2_t hfa_fx2 = {1.2f, 2.2f};
1062
+struct hfa_fx3_t hfa_fx3 = {3.2f, 4.2f, 5.2f};
1063
+vf4_t float32x4 = {6.2f, 7.2f, 8.2f, 9.2f};
1064
+vf4_t float32x4_2 = {10.2f, 11.2f, 12.2f, 13.2f};
1066
+#include "abitest.h"
1068
+ ARG (float, 1.0f, S0, 0)
1069
+ ARG (float, 2.0f, S1, 1)
1070
+ ARG (float, 3.0f, S2, 2)
1071
+ ARG (float, 4.0f, S3, 3)
1072
+ ARG (float, 5.0f, S4, 4)
1073
+ ARG (float, 6.0f, S5, 5)
1074
+ ARG (float, 7.0f, S6, 6)
1075
+ ARG (struct hfa_fx3_t, hfa_fx3, STACK, 7)
1076
+ /* Previous argument size has been rounded up to the nearest multiple of
1078
+ ARG (struct hfa_fx2_t, hfa_fx2, STACK + 16, 8)
1079
+ /* NSAA is rounded up to the nearest natural alignment of float32x4. */
1080
+ ARG (vf4_t, float32x4, STACK + 32, 9)
1081
+ ARG (vf4_t, float32x4_2, STACK + 48, LAST_NAMED_ARG_ID)
1083
+ LAST_ANON (double, 123456789.987, STACK + 64, 11)
1085
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
1086
===================================================================
1087
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h (.../tags/gcc_4_8_3_release)
1088
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h (.../branches/gcc-4_8-branch)
1103
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c
1104
===================================================================
1105
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c (.../tags/gcc_4_8_3_release)
1106
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c (.../branches/gcc-4_8-branch)
1108
+/* Test AAPCS64 layout and __builtin_va_start.
1110
+ Pass named HFA/HVA argument on stack. */
1112
+/* { dg-do run { target aarch64*-*-* } } */
1114
+#ifndef IN_FRAMEWORK
1115
+#define AAPCS64_TEST_STDARG
1116
+#define TESTFILE "va_arg-13.c"
1118
+struct float_float_t
1130
+#define HAS_DATA_INIT_FUNC
1134
+ float_float.a = 1.2f;
1135
+ float_float.b = 2.2f;
1137
+ float_int.b8 = 4983.80f;
1140
+#include "abitest.h"
1142
+ ARG (float, 1.0f, S0, 0)
1143
+ ARG (float, 2.0f, S1, 1)
1144
+ ARG (float, 3.0f, S2, 2)
1145
+ ARG (float, 4.0f, S3, 3)
1146
+ ARG (float, 5.0f, S4, 4)
1147
+ ARG (float, 6.0f, S5, 5)
1148
+ ARG (float, 7.0f, S6, 6)
1149
+ ARG (struct float_float_t, float_float, STACK, 7)
1150
+ ARG (int, 9, W0, 8)
1151
+ ARG (int, 10, W1, 9)
1152
+ ARG (int, 11, W2, 10)
1153
+ ARG (int, 12, W3, 11)
1154
+ ARG (int, 13, W4, 12)
1155
+ ARG (int, 14, W5, 13)
1156
+ ARG (int, 15, W6, LAST_NAMED_ARG_ID)
1158
+ /* Note on the reason of using 'X7' instead of 'W7' here:
1159
+ Using 'X7' makes sure the test works in the big-endian mode.
1160
+ According to PCS rules B.4 and C.10, the size of float_int is rounded
1161
+ to 8 bytes and prepared in the register X7 as if loaded via LDR from
1162
+ the memory, with the content of the other 4 bytes unspecified. The
1163
+ test framework will only compare the 4 relavent bytes. */
1164
+ ANON (union float_int_t, float_int, X7, 15)
1165
+ LAST_ANON (long long, 12683143434LL, STACK + 8, 16)
1167
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c
1168
===================================================================
1169
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c (.../tags/gcc_4_8_3_release)
1170
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c (.../branches/gcc-4_8-branch)
1172
+/* Test AAPCS64 layout and __builtin_va_start.
1174
+ Pass named __128int argument on stack. */
1176
+/* { dg-do run { target aarch64*-*-* } } */
1178
+#ifndef IN_FRAMEWORK
1179
+#define AAPCS64_TEST_STDARG
1180
+#define TESTFILE "va_arg-15.c"
1181
+#include "type-def.h"
1183
+union int128_t qword;
1185
+#define HAS_DATA_INIT_FUNC
1189
+ /* Init signed quad-word integer. */
1190
+ qword.l64 = 0xfdb9753102468aceLL;
1191
+ qword.h64 = 0xeca8642013579bdfLL;
1194
+#include "abitest.h"
1196
+ ARG (int, 1, W0, 0)
1197
+ ARG (int, 2, W1, 1)
1198
+ ARG (int, 3, W2, 2)
1199
+ ARG (int, 4, W3, 3)
1200
+ ARG (int, 5, W4, 4)
1201
+ ARG (int, 6, W5, 5)
1202
+ ARG (int, 7, W6, 6)
1203
+ ARG (__int128, qword.i, STACK, LAST_NAMED_ARG_ID)
1205
+#ifndef __AAPCS64_BIG_ENDIAN__
1206
+ LAST_ANON (int, 8, STACK + 16, 8)
1208
+ LAST_ANON (int, 8, STACK + 20, 8)
1211
Index: gcc/testsuite/gcc.target/avr/torture/pr61443.c
1212
===================================================================
1213
--- a/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c (.../tags/gcc_4_8_3_release)
1214
+++ b/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c (.../branches/gcc-4_8-branch)
1216
+/* { dg-do run } */
1217
+/* { dg-options "-std=gnu99" } */
1219
+#include <stdlib.h>
1220
+#include <stdarg.h>
1222
+#define NC __attribute__((noinline,noclone))
1224
+void NC vfun (char n, ...)
1235
+ if (11 != va_arg (ap, int))
1239
+ if (2222 != va_arg (ap, int))
1243
+ if (333333 != va_arg (ap, __int24))
1247
+ if (44444444 != va_arg (ap, long))
1251
+ if (8888888888888888 != va_arg (ap, long long))
1260
+void NC boo_qi (const __flash char *p)
1265
+void NC boox_qi (const __memx char *p)
1270
+void NC boo_hi (const __flash int *p)
1275
+void NC boox_hi (const __memx int *p)
1280
+void NC boo_psi (const __flash __int24 *p)
1285
+void NC boox_psi (const __memx __int24 *p)
1290
+void NC boo_si (const __flash long *p)
1295
+void NC boox_si (const __memx long *p)
1300
+void NC boo_di (const __flash long long *p)
1305
+void NC boox_di (const __memx long long *p)
1310
+const __flash char f_qi = 11;
1311
+const __flash int f_hi = 2222;
1312
+const __flash __int24 f_psi = 333333;
1313
+const __flash long f_si = 44444444;
1314
+const __flash long long f_di = 8888888888888888;
1316
+const __memx char x_qi = 11;
1317
+const __memx int x_hi = 2222;
1318
+const __memx __int24 x_psi = 333333;
1319
+const __memx long x_si = 44444444;
1320
+const __memx long long x_di = 8888888888888888;
1324
+__int24 r_psi = 333333;
1325
+long r_si = 44444444;
1326
+long long r_di = 8888888888888888;
1338
+ boox_psi (&x_psi);
1344
+ boox_psi (&r_psi);
1350
Index: gcc/testsuite/gcc.target/i386/pr61423.c
1351
===================================================================
1352
--- a/src/gcc/testsuite/gcc.target/i386/pr61423.c (.../tags/gcc_4_8_3_release)
1353
+++ b/src/gcc/testsuite/gcc.target/i386/pr61423.c (.../branches/gcc-4_8-branch)
1355
+/* PR target/61423 */
1356
+/* { dg-do run { target ia32 } } */
1357
+/* { dg-options "-O1 -ftree-vectorize -msse2 -mfpmath=387 -mtune=core2" } */
1360
+static unsigned int A[N];
1363
+__attribute__((noinline))
1366
+ unsigned int sum = 0;
1370
+ for (i = 0; i < N; i++)
1383
+ for(i = 0; i < N; i++)
1389
+ __builtin_abort ();
1393
Index: gcc/testsuite/gcc.target/i386/pr60901.c
1394
===================================================================
1395
--- a/src/gcc/testsuite/gcc.target/i386/pr60901.c (.../tags/gcc_4_8_3_release)
1396
+++ b/src/gcc/testsuite/gcc.target/i386/pr60901.c (.../branches/gcc-4_8-branch)
1398
+/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts" } */
1401
+extern void bar (void);
1402
+extern int baz (int);
1408
+ for (j = 0; j < n; j++)
1410
+ for (i = 1; i < j; i++)
1415
Index: gcc/testsuite/gcc.target/i386/pr61801.c
1416
===================================================================
1417
--- a/src/gcc/testsuite/gcc.target/i386/pr61801.c (.../tags/gcc_4_8_3_release)
1418
+++ b/src/gcc/testsuite/gcc.target/i386/pr61801.c (.../branches/gcc-4_8-branch)
1420
+/* PR rtl-optimization/61801 */
1421
+/* { dg-do compile } */
1422
+/* { dg-options "-Os -fcompare-debug" } */
1436
+ asm volatile ("" : "=a" (e) : "0" (a), "i" (0));
1441
Index: gcc/testsuite/gcc.target/i386/pr61446.c
1442
===================================================================
1443
--- a/src/gcc/testsuite/gcc.target/i386/pr61446.c (.../tags/gcc_4_8_3_release)
1444
+++ b/src/gcc/testsuite/gcc.target/i386/pr61446.c (.../branches/gcc-4_8-branch)
1446
+/* PR rtl-optimization/61446 */
1448
+/* { dg-do compile { target { ia32 } } } */
1449
+/* { dg-options "-O2 -march=corei7 -mfpmath=387" } */
1454
+ const double dfa = a;
1455
+ const unsigned int hi = dfa / 0x1p32f;
1456
+ const unsigned int lo = dfa - (double) hi * 0x1p32f;
1458
+ return ((unsigned long long) hi << (4 * (8))) | lo;
1460
Index: gcc/testsuite/lib/target-supports.exp
1461
===================================================================
1462
--- a/src/gcc/testsuite/lib/target-supports.exp (.../tags/gcc_4_8_3_release)
1463
+++ b/src/gcc/testsuite/lib/target-supports.exp (.../branches/gcc-4_8-branch)
1464
@@ -1790,6 +1790,15 @@
1468
+# Return 1 if the target supports long double of 128 bits,
1471
+proc check_effective_target_longdouble128 { } {
1472
+ return [check_no_compiler_messages longdouble128 object {
1473
+ int dummy[sizeof(long double) == 16 ? 1 : -1];
1477
# Return 1 if the target supports double of 64 bits,
1480
Index: gcc/testsuite/gfortran.dg/default_format_denormal_2.f90
1481
===================================================================
1482
--- a/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 (.../tags/gcc_4_8_3_release)
1483
+++ b/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 (.../branches/gcc-4_8-branch)
1485
! { dg-require-effective-target fortran_large_real }
1486
-! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } }
1487
-! Test XFAILed on these platforms because the system's printf() lacks
1488
+! { dg-do run { xfail powerpc*-apple-darwin* } }
1489
+! Test XFAILed on this platform because the system's printf() lacks
1490
! proper support for denormalized long doubles. See PR24685
1492
! This tests that the default formats for formatted I/O of reals are
1493
Index: gcc/testsuite/gfortran.dg/cray_pointers_10.f90
1494
===================================================================
1495
--- a/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 (.../tags/gcc_4_8_3_release)
1496
+++ b/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 (.../branches/gcc-4_8-branch)
1499
+! { dg-options "-fcray-pointer" }
1514
+ if (z /= 42) call abort
1516
Index: gcc/testsuite/gfortran.dg/dependency_44.f90
1517
===================================================================
1518
--- a/src/gcc/testsuite/gfortran.dg/dependency_44.f90 (.../tags/gcc_4_8_3_release)
1519
+++ b/src/gcc/testsuite/gfortran.dg/dependency_44.f90 (.../branches/gcc-4_8-branch)
1522
+! Tests fix for PR61780 in which the loop reversal mechanism was
1523
+! not accounting for the first index being an element so that no
1524
+! loop in this dimension is created.
1526
+! Contributed by Manfred Tietze on clf.
1530
+ integer, parameter :: n = 10, k = 3
1532
+ integer, dimension(n,n) :: y
1533
+ integer :: res1(n), res2(n)
1546
+ y(k,4:n) = y(k,3:n-1)
1550
+ y(k,n:4:-1) = y(k,n-1:3:-1)
1555
+ if (any(res1 /= res2)) call abort ()
1557
Index: gcc/testsuite/gfortran.dg/oldstyle_5.f
1558
===================================================================
1559
--- a/src/gcc/testsuite/gfortran.dg/oldstyle_5.f (.../tags/gcc_4_8_3_release)
1560
+++ b/src/gcc/testsuite/gfortran.dg/oldstyle_5.f (.../branches/gcc-4_8-branch)
1562
+C { dg-do compile }
1564
+ INTEGER A(2)/1,2/ ! { dg-error "Invalid old style initialization for derived type component" }
1567
+ INTEGER B/1/ ! { dg-error "Invalid old style initialization for derived type component" }
1570
Index: gcc/testsuite/gfortran.dg/nint_2.f90
1571
===================================================================
1572
--- a/src/gcc/testsuite/gfortran.dg/nint_2.f90 (.../tags/gcc_4_8_3_release)
1573
+++ b/src/gcc/testsuite/gfortran.dg/nint_2.f90 (.../branches/gcc-4_8-branch)
1575
! http://gcc.gnu.org/ml/fortran/2005-04/msg00139.html
1578
-! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc*-*-linux* *-*-mingw* } { "-O0" } { "" } }
1579
+! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc-*-linux* powerpc64-*-linux* *-*-mingw* } { "-O0" } { "" } }
1580
+! Note that this doesn't fail on powerpc64le-*-linux*.
1582
integer(kind=8) :: i1, i2
1584
Index: gcc/testsuite/gfortran.dg/pr45636.f90
1585
===================================================================
1586
--- a/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../tags/gcc_4_8_3_release)
1587
+++ b/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../branches/gcc-4_8-branch)
1592
-! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { mips*-*-* && { ! nomips16 } } } } }
1593
+! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { { hppa*-*-* && { ! lp64 } } || { mips*-*-* && { ! nomips16 } } } } } }
1594
! { dg-final { cleanup-tree-dump "forwprop2" } }
1595
Index: gcc/testsuite/gfortran.dg/allocatable_function_8.f90
1596
===================================================================
1597
--- a/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 (.../tags/gcc_4_8_3_release)
1598
+++ b/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 (.../branches/gcc-4_8-branch)
1601
+! Test the fix for PR61459.
1603
+! Contributed by John Wingate <johnww@tds.net>
1609
+ public :: f_segfault, f_segfault_plus, f_workaround
1610
+ integer, dimension(2,2) :: b = reshape([1,-1,1,1],[2,2])
1614
+ function f_segfault(x)
1615
+ real, dimension(:), allocatable :: f_segfault
1616
+ real, dimension(:), intent(in) :: x
1617
+ allocate(f_segfault(2))
1618
+ f_segfault = matmul(b,x)
1619
+ end function f_segfault
1621
+! Sefaulted without the ALLOCATE as well.
1622
+ function f_segfault_plus(x)
1623
+ real, dimension(:), allocatable :: f_segfault_plus
1624
+ real, dimension(:), intent(in) :: x
1625
+ f_segfault_plus = matmul(b,x)
1626
+ end function f_segfault_plus
1628
+ function f_workaround(x)
1629
+ real, dimension(:), allocatable :: f_workaround
1630
+ real, dimension(:), intent(in) :: x
1631
+ real, dimension(:), allocatable :: tmp
1632
+ allocate(f_workaround(2),tmp(2))
1634
+ f_workaround = tmp
1635
+ end function f_workaround
1642
+ real, dimension(2) :: x = 1.0, y
1643
+ y = f_workaround (x)
1644
+ if (any (f_segfault (x) .ne. y)) call abort
1645
+ if (any (f_segfault_plus (x) .ne. y)) call abort
1647
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-1.c
1648
===================================================================
1649
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c (.../tags/gcc_4_8_3_release)
1650
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c (.../branches/gcc-4_8-branch)
1652
+#ifdef __INT32_TYPE__
1653
+typedef __INT32_TYPE__ int32_t;
1655
+typedef int int32_t;
1658
+#ifdef __UINT32_TYPE__
1659
+typedef __UINT32_TYPE__ uint32_t;
1661
+typedef unsigned uint32_t;
1664
+#define __fake_const_swab32(x) ((uint32_t)( \
1665
+ (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
1666
+ (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
1667
+ (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
1668
+ (( (int32_t)(x) & (int32_t)0xff000000UL) >> 24)))
1670
+/* Previous version of bswap optimization failed to consider sign extension
1671
+ and as a result would replace an expression *not* doing a bswap by a
1674
+__attribute__ ((noinline, noclone)) uint32_t
1675
+fake_bswap32 (uint32_t in)
1677
+ return __fake_const_swab32 (in);
1683
+ if (sizeof (int32_t) * __CHAR_BIT__ != 32)
1685
+ if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
1687
+ if (fake_bswap32 (0x87654321) != 0xffffff87)
1688
+ __builtin_abort ();
1691
Index: gcc/testsuite/gcc.c-torture/execute/pr23135.x
1692
===================================================================
1693
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../tags/gcc_4_8_3_release)
1694
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../branches/gcc-4_8-branch)
1696
+set additional_flags "-Wno-psabi"
1698
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-3.c
1699
===================================================================
1700
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c (.../tags/gcc_4_8_3_release)
1701
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c (.../branches/gcc-4_8-branch)
1713
+ __builtin_abort ();
1716
Index: gcc/testsuite/gcc.c-torture/execute/20050604-1.x
1717
===================================================================
1718
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x (.../tags/gcc_4_8_3_release)
1719
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x (.../branches/gcc-4_8-branch)
1721
set additional_flags "-mno-mmx"
1724
+set additional_flags "-Wno-psabi"
1726
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-2.c
1727
===================================================================
1728
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c (.../tags/gcc_4_8_3_release)
1729
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c (.../branches/gcc-4_8-branch)
1731
+#ifdef __INT16_TYPE__
1732
+typedef __INT16_TYPE__ int16_t;
1734
+typedef short int16_t;
1737
+#ifdef __UINT32_TYPE__
1738
+typedef __UINT32_TYPE__ uint32_t;
1740
+typedef unsigned uint32_t;
1743
+#define __fake_const_swab32(x) ((uint32_t)( \
1744
+ (((uint32_t) (x) & (uint32_t)0x000000ffUL) << 24) | \
1745
+ (((uint32_t)(int16_t)(x) & (uint32_t)0x00ffff00UL) << 8) | \
1746
+ (((uint32_t) (x) & (uint32_t)0x00ff0000UL) >> 8) | \
1747
+ (((uint32_t) (x) & (uint32_t)0xff000000UL) >> 24)))
1750
+/* Previous version of bswap optimization failed to consider sign extension
1751
+ and as a result would replace an expression *not* doing a bswap by a
1754
+__attribute__ ((noinline, noclone)) uint32_t
1755
+fake_bswap32 (uint32_t in)
1757
+ return __fake_const_swab32 (in);
1763
+ if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
1765
+ if (sizeof (int16_t) * __CHAR_BIT__ != 16)
1767
+ if (fake_bswap32 (0x81828384) != 0xff838281)
1768
+ __builtin_abort ();
1771
Index: gcc/testsuite/gcc.c-torture/execute/pr61375.c
1772
===================================================================
1773
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../tags/gcc_4_8_3_release)
1774
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../branches/gcc-4_8-branch)
1776
+#ifdef __UINT64_TYPE__
1777
+typedef __UINT64_TYPE__ uint64_t;
1779
+typedef unsigned long long uint64_t;
1782
+#ifndef __SIZEOF_INT128__
1783
+#define __int128 long long
1786
+/* Some version of bswap optimization would ICE when analyzing a mask constant
1787
+ too big for an HOST_WIDE_INT (PR61375). */
1789
+__attribute__ ((noinline, noclone)) uint64_t
1790
+uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2)
1792
+ __int128 mask = (__int128)0xffff << 56;
1793
+ return ((in1 & mask) >> 56) | in2;
1800
+#ifdef __SIZEOF_INT128__
1803
+ if (sizeof (uint64_t) * __CHAR_BIT__ != 64)
1805
+ if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128)
1807
+ if (uint128_central_bitsi_ior (in, 2) != 0x102)
1808
+ __builtin_abort ();
1811
Index: gcc/testsuite/gcc.c-torture/execute/20050316-1.x
1812
===================================================================
1813
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x (.../tags/gcc_4_8_3_release)
1814
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x (.../branches/gcc-4_8-branch)
1819
+set additional_flags "-Wno-psabi"
1821
Index: gcc/testsuite/gcc.c-torture/execute/20050316-3.x
1822
===================================================================
1823
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x (.../tags/gcc_4_8_3_release)
1824
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x (.../branches/gcc-4_8-branch)
1826
+set additional_flags "-Wno-psabi"
1828
Index: gcc/testsuite/gcc.c-torture/compile/pr61684.c
1829
===================================================================
1830
--- a/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../tags/gcc_4_8_3_release)
1831
+++ b/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../branches/gcc-4_8-branch)
1833
+/* PR tree-optimization/61684 */
1838
+static short **e = 0;
1843
+ for (; c < 1; c++)
1846
+ a = d && (c && 1) & *b;
1848
Index: gcc/testsuite/gnat.dg/opt39.adb
1849
===================================================================
1850
--- a/src/gcc/testsuite/gnat.dg/opt39.adb (.../tags/gcc_4_8_3_release)
1851
+++ b/src/gcc/testsuite/gnat.dg/opt39.adb (.../branches/gcc-4_8-branch)
1853
+-- { dg-do compile }
1854
+-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" }
1856
+procedure Opt39 (I : Integer) is
1858
+ type Rec is record
1866
+ procedure Set (A : access Rec; I : Integer) is
1867
+ Tmp : Rec := A.all;
1876
+ Set (R'Access, I);
1878
+ raise Program_Error;
1882
+-- { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } }
1883
+-- { dg-final { cleanup-tree-dump "optimized" } }
1884
Index: gcc/testsuite/gnat.dg/overflow_fixed.adb
1885
===================================================================
1886
--- a/src/gcc/testsuite/gnat.dg/overflow_fixed.adb (.../tags/gcc_4_8_3_release)
1887
+++ b/src/gcc/testsuite/gnat.dg/overflow_fixed.adb (.../branches/gcc-4_8-branch)
1890
+-- { dg-options "-gnato -O" }
1892
+procedure Overflow_Fixed is
1894
+ type Unsigned_8_Bit is mod 2**8;
1896
+ procedure Fixed_To_Eight (Value : Duration) is
1897
+ Item : Unsigned_8_Bit;
1899
+ Item := Unsigned_8_Bit(Value);
1900
+ raise Program_Error;
1902
+ when Constraint_Error => null; -- expected case
1906
+ Fixed_To_Eight (-0.5);
1908
Index: gcc/testsuite/gnat.dg/aliasing1.adb
1909
===================================================================
1910
--- a/src/gcc/testsuite/gnat.dg/aliasing1.adb (.../tags/gcc_4_8_3_release)
1911
+++ b/src/gcc/testsuite/gnat.dg/aliasing1.adb (.../branches/gcc-4_8-branch)
1916
--- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } }
1917
+-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }
1918
-- { dg-final { cleanup-tree-dump "optimized" } }
1919
Index: gcc/testsuite/gcc.dg/pr60866.c
1920
===================================================================
1921
--- a/src/gcc/testsuite/gcc.dg/pr60866.c (.../tags/gcc_4_8_3_release)
1922
+++ b/src/gcc/testsuite/gcc.dg/pr60866.c (.../branches/gcc-4_8-branch)
1924
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
1925
+/* { dg-options "-O -fselective-scheduling -fno-if-conversion -fschedule-insns" } */
1930
+foo (int w, int **dnroot, int **dn)
1933
+ int *xchild = xchild;
1934
+ for (; w < n; w++)
1938
+ for (child = *dn; child; child = xchild)
1942
Index: gcc/testsuite/gcc.dg/pr51879-18.c
1943
===================================================================
1944
--- a/src/gcc/testsuite/gcc.dg/pr51879-18.c (.../tags/gcc_4_8_3_release)
1945
+++ b/src/gcc/testsuite/gcc.dg/pr51879-18.c (.../branches/gcc-4_8-branch)
1950
-/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
1951
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre" { xfail *-*-* } } } */
1952
/* { dg-final { cleanup-tree-dump "pre" } } */
1953
Index: gcc/testsuite/gcc.dg/torture/pr61964.c
1954
===================================================================
1955
--- a/src/gcc/testsuite/gcc.dg/torture/pr61964.c (.../tags/gcc_4_8_3_release)
1956
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61964.c (.../branches/gcc-4_8-branch)
1958
+/* { dg-do run } */
1960
+extern void abort (void);
1962
+struct node { struct node *next, *prev; } node;
1963
+struct head { struct node *first; } heads[5];
1965
+struct head *head = &heads[2];
1967
+static int __attribute__((noinline))
1970
+ node.prev = (void *)head;
1971
+ head->first = &node;
1973
+ struct node *n = head->first;
1974
+ struct head *h = &heads[k];
1976
+ if (n->prev == (void *)h)
1977
+ h->first = n->next;
1979
+ n->prev->next = n->next;
1981
+ n->next = h->first;
1982
+ return n->next == &node;
1991
Index: gcc/testsuite/gcc.dg/torture/pr61383-1.c
1992
===================================================================
1993
--- a/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c (.../tags/gcc_4_8_3_release)
1994
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c (.../branches/gcc-4_8-branch)
1996
+/* { dg-do run } */
1998
+int a, b = 1, c, d, e, f, g;
2007
+ g = g ? 0 : 1 % g;
2009
+ for (; d < 1; d = e)
2031
Index: gcc/testsuite/gcc.dg/stack-usage-2.c
2032
===================================================================
2033
--- a/src/gcc/testsuite/gcc.dg/stack-usage-2.c (.../tags/gcc_4_8_3_release)
2034
+++ b/src/gcc/testsuite/gcc.dg/stack-usage-2.c (.../branches/gcc-4_8-branch)
2036
/* { dg-do compile } */
2037
/* { dg-options "-Wstack-usage=512" } */
2040
+int foo1 (void) /* { dg-bogus "stack usage" } */
2045
-} /* { dg-bogus "stack usage" } */
2049
+int foo2 (void) /* { dg-warning "stack usage is \[0-9\]* bytes" } */
2054
-} /* { dg-warning "stack usage is \[0-9\]* bytes" } */
2058
+int foo3 (void) /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
2060
char arr[1024] __attribute__((aligned (512)));
2063
/* Force dynamic realignment of argument pointer. */
2064
__builtin_apply ((void (*)()) foo2, 0, 0);
2068
-} /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
2071
+int foo4 (int n) /* { dg-warning "stack usage might be unbounded" } */
2076
-} /* { dg-warning "stack usage might be unbounded" } */
2078
Index: gcc/testsuite/ChangeLog
2079
===================================================================
2080
--- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_4_8_3_release)
2081
+++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-4_8-branch)
2083
+2014-08-07 John David Anglin <danglin@gcc.gnu.org>
2085
+ PR tree-optimization/60707
2086
+ * gfortran.dg/pr45636.f90: xfail on 32-bit hppa*-*-*.
2088
+2014-08-06 Jakub Jelinek <jakub@redhat.com>
2090
+ PR rtl-optimization/61801
2091
+ * gcc.target/i386/pr61801.c: Rewritten.
2093
+2014-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
2095
+ Backport from mainline
2096
+ 2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
2098
+ PR tree-optimization/61375
2099
+ * gcc.c-torture/execute/pr61375-1.c: New test.
2101
+2014-08-01 Richard Biener <rguenther@suse.de>
2103
+ PR tree-optimization/61964
2104
+ * gcc.dg/torture/pr61964.c: New testcase.
2105
+ * gcc.dg/pr51879-18.c: XFAIL.
2107
+2014-07-28 Richard Biener <rguenther@suse.de>
2109
+ PR rtl-optimization/61801
2110
+ * gcc.target/i386/pr61801.c: Fix testcase.
2112
+2014-07-28 Richard Biener <rguenther@suse.de>
2114
+ PR rtl-optimization/61801
2115
+ * gcc.target/i386/pr61801.c: New testcase.
2117
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2119
+ Backport from mainline:
2120
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2122
+ * gcc.target/powerpc/ppc64-abi-warn-3.c: New test.
2124
+ * gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
2125
+ * gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
2126
+ * gcc.c-torture/execute/20050316-3.x: New file. Add -Wno-psabi.
2127
+ * gcc.c-torture/execute/pr23135.x: Likewise.
2129
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2131
+ Backport from mainline:
2132
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2134
+ * gcc.target/powerpc/ppc64-abi-warn-2.c: New test.
2136
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2138
+ Backport from mainline:
2139
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2141
+ * gcc.target/powerpc/ppc64-abi-warn-1.c: New test.
2143
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2145
+ Backport from mainline:
2146
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2148
+ * g++.dg/compat/struct-layout-1.exp: Load g++-dg.exp.
2150
+2014-07-19 Eric Botcazou <ebotcazou@adacore.com>
2152
+ * gcc.dg/stack-usage-2.c: Adjust.
2154
+2014-07-19 Paul Thomas <pault@gcc.gnu.org>
2156
+ Backport from trunk.
2158
+ * gfortran.dg/dependency_44.f90 : New test
2160
+2014-07-10 Eric Botcazou <ebotcazou@adacore.com>
2162
+ * gnat.dg/opt39.adb: New test.
2164
+2014-07-08 Paul Thomas <pault@gcc.gnu.org>
2168
+ * gfortran.dg/allocatable_function_8.f90 : New test
2170
+2014-07-04 Jakub Jelinek <jakub@redhat.com>
2172
+ PR tree-optimization/61684
2173
+ * gcc.c-torture/compile/pr61684.c: New test.
2175
+2014-07-02 Jakub Jelinek <jakub@redhat.com>
2176
+ Fritz Reese <Reese-Fritz@zai.com>
2178
+ * gfortran.dg/oldstyle_5.f: New test.
2180
+2014-06-30 Thomas Preud'homme <thomas.preudhomme@arm.com>
2182
+ Backport from mainline
2183
+ 2014-06-11 Thomas Preud'homme <thomas.preudhomme@arm.com>
2185
+ PR tree-optimization/61306
2186
+ * gcc.c-torture/execute/pr61306-1.c: New test.
2187
+ * gcc.c-torture/execute/pr61306-2.c: Likewise.
2188
+ * gcc.c-torture/execute/pr61306-3.c: Likewise.
2190
+2014-06-27 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2192
+ * gfortran.dg/nint_2.f90: Don't XFAIL for powerpc64le-*-linux*.
2194
+2014-06-27 Uros Bizjak <ubizjak@gmail.com>
2196
+ Backport from mainline
2197
+ 2014-06-26 Uros Bizjak <ubizjak@gmail.com>
2200
+ * gcc.target/alpha/pr61586.c: New test.
2202
+2014-06-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2204
+ * gfortran.dg/default_format_denormal_2.f90: Remove xfail for
2205
+ powerpc*-*-linux*.
2207
+2014-06-18 Uros Bizjak <ubizjak@gmail.com>
2209
+ Backport from mainline
2210
+ 2014-06-13 Ilya Enkovich <ilya.enkovich@intel.com>
2212
+ PR rtl-optimization/61094
2213
+ PR rtl-optimization/61446
2214
+ * gcc.target/i386/pr61446.c : New.
2216
+ Backport from mainline
2217
+ 2014-06-06 Uros Bizjak <ubizjak@gmail.com>
2220
+ * gcc.target/i386/pr61423.c: New test.
2222
+2014-06-17 Yufeng Zhang <yufeng.zhang@arm.com>
2224
+ Backport from mainline
2227
+ * gcc.target/aarch64/aapcs64/type-def.h (struct hfa_fx2_t): New type.
2228
+ * gcc.target/aarch64/aapcs64/va_arg-13.c: New test.
2229
+ * gcc.target/aarch64/aapcs64/va_arg-14.c: Ditto.
2230
+ * gcc.target/aarch64/aapcs64/va_arg-15.c: Ditto.
2232
+2014-06-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
2234
+ Backport from trunk.
2236
+ * gfortran.dg/cray_pointers_10.f90: New file.
2238
+2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
2240
+ Backport from mainline
2242
+ 2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
2244
+ * lib/target-supports.exp (check_effective_target_longdouble128): New.
2245
+ * gcc.target/powerpc/pack02.c: Use it.
2246
+ * gcc.target/powerpc/tfmode_off.c: Likewise.
2248
+2014-06-12 Georg-Johann Lay <avr@gjlay.de>
2250
+ Backport from 2014-06-12 trunk r211491
2253
+ * gcc.target/avr/torture/pr61443.c: New test.
2255
+2014-06-04 Richard Biener <rguenther@suse.de>
2257
+ PR tree-optimization/61383
2258
+ * gcc.dg/torture/pr61383-1.c: New testcase.
2260
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
2262
+ Backport from mainline
2263
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
2265
+ PR rtl-optimization/60866
2266
+ * gcc.dg/pr60866.c: New test.
2268
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
2270
+ Backport from mainline
2271
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
2273
+ PR rtl-optimization/60901
2274
+ * gcc.target/i386/pr60901.c: New test.
2276
+2014-05-28 Eric Botcazou <ebotcazou@adacore.com>
2278
+ Backport from mainline
2279
+ 2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
2281
+ * gnat.dg/overflow_fixed.adb: New test.
2283
+2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
2285
+ * gnat.dg/aliasing1.adb (dg-final): Robustify pattern matching.
2287
+2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
2289
+ Backport from mainline
2290
+ 2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
2292
+ * gcc.target/powerpc/htm-ttest.c: New test.
2294
2014-05-22 Release Manager
2296
* GCC 4.8.3 released.
2297
Index: gcc/testsuite/g++.dg/expr/cond12.C
2298
===================================================================
2299
--- a/src/gcc/testsuite/g++.dg/expr/cond12.C (.../tags/gcc_4_8_3_release)
2300
+++ b/src/gcc/testsuite/g++.dg/expr/cond12.C (.../branches/gcc-4_8-branch)
2306
+ X& operator=(const X&){}
2307
+ X& operator=(X&){__builtin_abort();}
2310
+int main(int argv,char**) {
2312
+ ((argv > 2) ? a : b) = X();
2314
Index: gcc/testsuite/g++.dg/parse/typename7.C
2315
===================================================================
2316
--- a/src/gcc/testsuite/g++.dg/parse/typename7.C (.../tags/gcc_4_8_3_release)
2317
+++ b/src/gcc/testsuite/g++.dg/parse/typename7.C (.../branches/gcc-4_8-branch)
2322
- template<typename> void foo(int); // { dg-message "note" }
2323
- template<typename T> void bar(T t) { // { dg-message "note" }
2324
+ template<typename> void foo(int);
2325
+ template<typename T> void bar(T t) {
2326
this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
2327
- // { dg-message "candidate" "candidate note" { target *-*-* } 12 }
2328
template<typename T> void bad(T t) {
2329
foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
2334
A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
2335
- // { dg-message "candidate" "candidate note" { target *-*-* } 22 }
2337
B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
2339
Index: gcc/testsuite/g++.dg/parse/parameter-declaration-2.C
2340
===================================================================
2341
--- a/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C (.../tags/gcc_4_8_3_release)
2342
+++ b/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C (.../branches/gcc-4_8-branch)
2344
-void f (int i, int p[i]); // { dg-error "use of parameter .i. outside function body" }
2345
+void f (int i, int p[i]); // { dg-error "use of parameter.*outside function body" }
2346
// { dg-prune-output "array bound" }
2347
Index: gcc/testsuite/g++.dg/parse/ambig7.C
2348
===================================================================
2349
--- a/src/gcc/testsuite/g++.dg/parse/ambig7.C (.../tags/gcc_4_8_3_release)
2350
+++ b/src/gcc/testsuite/g++.dg/parse/ambig7.C (.../branches/gcc-4_8-branch)
2356
+ Helper(int a, void (*pfunc)());
2359
+template <int I> void function();
2364
+Helper testOk(A, function<A>);
2365
+Helper testOk2(int(A), function<B>);
2366
+Helper testOk3((int(A)), function<A>);
2367
+Helper testFail(int(A), function<A>);
2368
Index: gcc/testsuite/g++.dg/compat/struct-layout-1.exp
2369
===================================================================
2370
--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp (.../tags/gcc_4_8_3_release)
2371
+++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp (.../branches/gcc-4_8-branch)
2373
# This must be done after the compat-use-*-compiler definitions.
2376
+# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
2377
+load_lib g++-dg.exp
2381
# Save variables for the C++ compiler under test, which each test will
2382
Index: gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C
2383
===================================================================
2384
--- a/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../tags/gcc_4_8_3_release)
2385
+++ b/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../branches/gcc-4_8-branch)
2388
+// { dg-do compile { target c++11 } }
2390
+template <class Coord> struct BasePoint
2393
+ constexpr BasePoint (Coord, Coord) : x (0), y (0) {}
2395
+template <class T> struct BaseCoord
2398
+ constexpr BaseCoord (T) : value (1) {}
2400
+template <class units> struct IntCoordTyped : BaseCoord<int>, units
2402
+ typedef BaseCoord Super;
2403
+ constexpr IntCoordTyped (int) : Super (0) {}
2405
+template <class units>
2406
+struct IntPointTyped : BasePoint<IntCoordTyped<units> >, units
2408
+ typedef BasePoint<IntCoordTyped<units> > Super;
2409
+ constexpr IntPointTyped (int, int) : Super (0, 0) {}
2414
+IntPointTyped<A> a (0, 0);
2415
Index: gcc/testsuite/g++.dg/cpp0x/variadic158.C
2416
===================================================================
2417
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C (.../tags/gcc_4_8_3_release)
2418
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C (.../branches/gcc-4_8-branch)
2421
+// { dg-do compile { target c++11 } }
2425
+template <typename>
2427
+ typedef const char* name;
2430
+template <typename VT, typename... Fields>
2431
+void New(const char* name,
2432
+ typename Fixed<Fields>::name... field_names);
2434
+template <typename VT, typename... Fields>
2435
+void CreateMetric(const char* name,
2436
+ typename Fixed<Fields>::name... field_names,
2442
+ CreateMetric<int, const char*>("abcd", "def", Base());
2444
Index: gcc/testsuite/g++.dg/cpp0x/variadic160.C
2445
===================================================================
2446
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C (.../tags/gcc_4_8_3_release)
2447
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C (.../branches/gcc-4_8-branch)
2450
+// { dg-do compile { target c++11 } }
2452
+template <typename _CharT> class A;
2453
+template <typename> class B;
2454
+template <class charT> class C;
2455
+template <> class C<char>
2457
+ virtual void xparse (int &, const B<A<char> > &) const;
2459
+template <class T, class charT = char> class G : C<charT>
2463
+ void default_value (const T &);
2464
+ void xparse (int &, const B<A<charT> > &) const;
2466
+template <class T, class charT>
2467
+void validate (int &, const B<A<charT> > &, T *, int);
2468
+template <class T, class charT>
2469
+void G<T, charT>::xparse (int &p1, const B<A<charT> > &p2) const
2471
+ validate (p1, p2, (T *)0, 0);
2473
+template <class T> G<T> *value (T *) { return new G<T>(0); }
2476
+template <typename T> struct D;
2477
+template <typename, int, int, int = 0, int = 0, int = 0 > class F;
2478
+template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
2480
+struct D<F<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
2482
+ typedef _Scalar Scalar;
2484
+template <typename, int, int, int, int, int _MaxCols> class F
2487
+ typedef typename Eigen::D<F>::Scalar Scalar;
2488
+ F (const Scalar &, const Scalar &, const Scalar &);
2490
+template <class... T>
2491
+void validate (int &, const B<A<char> > &, Eigen::F<T...> *);
2493
+int main (int, char *[])
2495
+ Eigen::F<double, 3, 1> a (0, 0, 0);
2496
+ value (&a)->default_value (Eigen::F<double, 3, 1>(0, 0, 0));
2498
Index: gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
2499
===================================================================
2500
--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../tags/gcc_4_8_3_release)
2501
+++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../branches/gcc-4_8-branch)
2504
+// { dg-do compile { target c++11 } }
2507
+ X& operator=(const X&) = delete;
2508
+ X& operator=(X&& ) = default;
2513
+ *(t ? &a : &b) = X();
2514
+ (t ? a : b) = X();
2516
Index: gcc/testsuite/g++.dg/cpp0x/overload3.C
2517
===================================================================
2518
--- a/src/gcc/testsuite/g++.dg/cpp0x/overload3.C (.../tags/gcc_4_8_3_release)
2519
+++ b/src/gcc/testsuite/g++.dg/cpp0x/overload3.C (.../branches/gcc-4_8-branch)
2522
+// { dg-options "-std=c++11" }
2526
+void f(X&&); // { dg-message "void f" }
2530
+ operator const X&() const;
2536
+ f(w); // { dg-error "lvalue" }
2538
Index: gcc/testsuite/g++.dg/template/local-fn1.C
2539
===================================================================
2540
--- a/src/gcc/testsuite/g++.dg/template/local-fn1.C (.../tags/gcc_4_8_3_release)
2541
+++ b/src/gcc/testsuite/g++.dg/template/local-fn1.C (.../branches/gcc-4_8-branch)
2545
+template <typename T = int>
2551
Index: gcc/testsuite/g++.dg/template/conv14.C
2552
===================================================================
2553
--- a/src/gcc/testsuite/g++.dg/template/conv14.C (.../tags/gcc_4_8_3_release)
2554
+++ b/src/gcc/testsuite/g++.dg/template/conv14.C (.../branches/gcc-4_8-branch)
2560
+template<typename Container, typename Key>
2563
+template<typename Container, typename Key, typename KeyStore = Key>
2569
+ Variant(Container st, const Key& i) : index(i), state(st) {}
2571
+ template<typename T>
2572
+ operator T() const {
2573
+ return Accessor<Container, KeyStore>::template get<T>(state, index);
2577
+class AutoCleanVariant : public Variant<XX*, int> {
2579
+ AutoCleanVariant(XX* st, int i) : Variant<XX*,int>(st,i) {}
2581
+ template<typename T>
2582
+ operator T() const {
2583
+ return Variant<XX*, int>::operator T();
2586
Index: gcc/testsuite/g++.dg/template/friend55.C
2587
===================================================================
2588
--- a/src/gcc/testsuite/g++.dg/template/friend55.C (.../tags/gcc_4_8_3_release)
2589
+++ b/src/gcc/testsuite/g++.dg/template/friend55.C (.../branches/gcc-4_8-branch)
2593
+template <int I> struct A;
2594
+template <int I> class B {
2596
+ template <int A_S> friend void A<A_S>::impl();
2600
+template<int I>struct A { void impl(); };
2603
+template<int I> void A<I>::impl() { ++b1.i; ++b2.i; }
2609
Index: gcc/testsuite/g++.dg/template/memclass5.C
2610
===================================================================
2611
--- a/src/gcc/testsuite/g++.dg/template/memclass5.C (.../tags/gcc_4_8_3_release)
2612
+++ b/src/gcc/testsuite/g++.dg/template/memclass5.C (.../branches/gcc-4_8-branch)
2616
+template <typename T>
2619
+ template <typename U>
2622
+ typedef T result2;
2625
+ typedef y<int> zy;
2632
+ typedef double result2;
2637
+ x<int>::zy::result2 xxx;
2638
+ x<int>::y<int>::result2 xxx2;
2640
Index: gcc/testsuite/g++.dg/template/ptrmem27.C
2641
===================================================================
2642
--- a/src/gcc/testsuite/g++.dg/template/ptrmem27.C (.../tags/gcc_4_8_3_release)
2643
+++ b/src/gcc/testsuite/g++.dg/template/ptrmem27.C (.../branches/gcc-4_8-branch)
2651
+ int foo(int X::* ptr);
2653
+ template <int X::* ptr>
2657
+int X::foo(int X::* ptr) {
2658
+ int* p = &(this->*ptr); // OK.
2662
+template <int X::* ptr>
2664
+ int* p = &(this->*ptr); // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
2667
Index: gcc/cp/tree.c
2668
===================================================================
2669
--- a/src/gcc/cp/tree.c (.../tags/gcc_4_8_3_release)
2670
+++ b/src/gcc/cp/tree.c (.../branches/gcc-4_8-branch)
2673
return lvalue_kind (TREE_OPERAND (ref, 0));
2676
+ case DOTSTAR_EXPR:
2677
+ if (TREE_CODE (ref) == MEMBER_REF)
2678
+ op1_lvalue_kind = clk_ordinary;
2680
+ op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
2681
+ if (TYPE_PTRMEMFUNC_P (TREE_TYPE (TREE_OPERAND (ref, 1))))
2682
+ op1_lvalue_kind = clk_none;
2683
+ return op1_lvalue_kind;
2686
op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
2687
/* Look at the member designator. */
2688
@@ -3738,6 +3748,10 @@
2690
init_expr = get_target_expr (exp);
2691
exp = TARGET_EXPR_SLOT (init_expr);
2692
+ if (CLASS_TYPE_P (TREE_TYPE (exp)))
2695
+ exp = rvalue (exp);
2699
Index: gcc/cp/ChangeLog
2700
===================================================================
2701
--- a/src/gcc/cp/ChangeLog (.../tags/gcc_4_8_3_release)
2702
+++ b/src/gcc/cp/ChangeLog (.../branches/gcc-4_8-branch)
2704
+2014-08-07 Jason Merrill <jason@redhat.com>
2707
+ * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
2710
+ * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
2712
+2014-01-27 Jason Merrill <jason@redhat.com>
2716
+ * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
2717
+ list-initialization. A conversion to rvalue ref that involves
2718
+ an lvalue-rvalue conversion is bad.
2719
+ (convert_like_real): Give helpful error message.
2721
+2014-01-29 Jason Merrill <jason@redhat.com>
2724
+ * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
2725
+ have a friend template in a class template.
2726
+ * pt.c (tsubst_friend_function): Look through it.
2727
+ (push_template_decl_real): A friend member template is
2730
+2014-02-21 Jason Merrill <jason@redhat.com>
2733
+ * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
2734
+ of the partial instantiation, not the most general template.
2735
+ (maybe_process_partial_specialization): Reassign everything on
2738
+2014-03-05 Jason Merrill <jason@redhat.com>
2741
+ * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
2742
+ if re-parsing might succeed.
2743
+ * semantics.c (finish_id_expression): Use of a parameter outside
2744
+ the function body is a parse error.
2746
+2014-06-30 Jason Merrill <jason@redhat.com>
2749
+ * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
2752
+ * pt.c (unify_one_argument): Type/expression mismatch just causes
2753
+ deduction failure.
2756
+ * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
2758
+2014-06-17 Jason Merrill <jason@redhat.com>
2761
+ * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
2763
+2014-06-02 Jason Merrill <jason@redhat.com>
2766
+ * pt.c (pack_deducible_p): Handle canonicalization.
2768
2014-05-22 Release Manager
2770
* GCC 4.8.3 released.
2772
===================================================================
2773
--- a/src/gcc/cp/pt.c (.../tags/gcc_4_8_3_release)
2774
+++ b/src/gcc/cp/pt.c (.../branches/gcc-4_8-branch)
2775
@@ -907,11 +907,13 @@
2776
t; t = TREE_CHAIN (t))
2778
tree inst = TREE_VALUE (t);
2779
- if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst))
2780
+ if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)
2781
+ || !COMPLETE_OR_OPEN_TYPE_P (inst))
2783
/* We already have a full specialization of this partial
2784
- instantiation. Reassign it to the new member
2785
- specialization template. */
2786
+ instantiation, or a full specialization has been
2787
+ looked up but not instantiated. Reassign it to the
2788
+ new member specialization template. */
2796
- else if (COMPLETE_OR_OPEN_TYPE_P (inst))
2798
/* But if we've had an implicit instantiation, that's a
2799
problem ([temp.expl.spec]/6). */
2800
error ("specialization %qT after instantiation %qT",
2801
@@ -4308,7 +4310,8 @@
2802
in the template-parameter-list of the definition of a member of a
2805
- if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL)
2806
+ if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL
2807
+ || (TREE_CODE (decl) == FUNCTION_DECL && DECL_LOCAL_FUNCTION_P (decl)))
2808
/* You can't have a function template declaration in a local
2809
scope, nor you can you define a member of a class template in a
2811
@@ -4572,7 +4575,8 @@
2812
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
2814
/* See if this is a primary template. */
2815
- if (is_friend && ctx)
2816
+ if (is_friend && ctx
2817
+ && uses_template_parms_level (ctx, processing_template_decl))
2818
/* A friend template that specifies a class context, i.e.
2819
template <typename T> friend void A<T>::f();
2821
@@ -7454,7 +7458,7 @@
2824
/* Let's consider the explicit specialization of a member
2825
- of a class template specialization that is implicitely instantiated,
2826
+ of a class template specialization that is implicitly instantiated,
2830
@@ -7552,9 +7556,9 @@
2832
/* Note this use of the partial instantiation so we can check it
2833
later in maybe_process_partial_specialization. */
2834
- DECL_TEMPLATE_INSTANTIATIONS (templ)
2835
+ DECL_TEMPLATE_INSTANTIATIONS (found)
2836
= tree_cons (arglist, t,
2837
- DECL_TEMPLATE_INSTANTIATIONS (templ));
2838
+ DECL_TEMPLATE_INSTANTIATIONS (found));
2840
if (TREE_CODE (template_type) == ENUMERAL_TYPE && !is_dependent_type)
2841
/* Now that the type has been registered on the instantiations
2842
@@ -8289,10 +8293,17 @@
2844
if (COMPLETE_TYPE_P (context))
2846
+ tree fn = new_friend;
2847
+ /* do_friend adds the TEMPLATE_DECL for any member friend
2848
+ template even if it isn't a member template, i.e.
2849
+ template <class T> friend A<T>::f();
2850
+ Look through it in that case. */
2851
+ if (TREE_CODE (fn) == TEMPLATE_DECL
2852
+ && !PRIMARY_TEMPLATE_P (fn))
2853
+ fn = DECL_TEMPLATE_RESULT (fn);
2854
/* Check to see that the declaration is really present, and,
2855
possibly obtain an improved declaration. */
2856
- tree fn = check_classfn (context,
2857
- new_friend, NULL_TREE);
2858
+ fn = check_classfn (context, fn, NULL_TREE);
2862
@@ -14934,7 +14945,7 @@
2864
for (packs = PACK_EXPANSION_PARAMETER_PACKS (type);
2865
packs; packs = TREE_CHAIN (packs))
2866
- if (TREE_VALUE (packs) == parm)
2867
+ if (template_args_equal (TREE_VALUE (packs), parm))
2869
/* The template parameter pack is used in a function parameter
2870
pack. If this is the end of the parameter list, the
2871
@@ -15502,8 +15513,9 @@
2872
maybe_adjust_types_for_deduction (strict, &parm, &arg, arg_expr);
2875
- gcc_assert ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
2876
- == (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL));
2877
+ if ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
2878
+ != (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL))
2879
+ return unify_template_argument_mismatch (explain_p, parm, arg);
2881
/* For deduction from an init-list we need the actual list. */
2882
if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr))
2883
@@ -20009,7 +20021,12 @@
2886
if (BASELINK_P (expression))
2887
- expression = BASELINK_FUNCTIONS (expression);
2889
+ if (BASELINK_OPTYPE (expression)
2890
+ && dependent_type_p (BASELINK_OPTYPE (expression)))
2892
+ expression = BASELINK_FUNCTIONS (expression);
2895
if (TREE_CODE (expression) == TEMPLATE_ID_EXPR)
2897
Index: gcc/cp/semantics.c
2898
===================================================================
2899
--- a/src/gcc/cp/semantics.c (.../tags/gcc_4_8_3_release)
2900
+++ b/src/gcc/cp/semantics.c (.../branches/gcc-4_8-branch)
2901
@@ -3108,7 +3108,7 @@
2902
&& DECL_CONTEXT (decl) == NULL_TREE
2903
&& !cp_unevaluated_operand)
2905
- error ("use of parameter %qD outside function body", decl);
2906
+ *error_msg = "use of parameter outside function body";
2907
return error_mark_node;
2910
@@ -7296,7 +7296,9 @@
2911
constructor_elt *inner = base_field_constructor_elt (n, ce->index);
2914
- else if (ce->index && TREE_CODE (ce->index) == NOP_EXPR)
2915
+ else if (ce->index
2916
+ && (TREE_CODE (ce->index) == NOP_EXPR
2917
+ || TREE_CODE (ce->index) == POINTER_PLUS_EXPR))
2919
/* This is an initializer for an empty base; now that we've
2920
checked that it's constant, we can ignore it. */
2921
Index: gcc/cp/parser.c
2922
===================================================================
2923
--- a/src/gcc/cp/parser.c (.../tags/gcc_4_8_3_release)
2924
+++ b/src/gcc/cp/parser.c (.../branches/gcc-4_8-branch)
2925
@@ -12831,7 +12831,12 @@
2926
the effort required to do the parse, nor will we issue duplicate
2927
error messages about problems during instantiation of the
2931
+ /* Don't do this if we had a parse error in a declarator; re-parsing
2932
+ might succeed if a name changes meaning (60361). */
2933
+ && !(cp_parser_error_occurred (parser)
2934
+ && cp_parser_parsing_tentatively (parser)
2935
+ && parser->in_declarator_p))
2937
cp_token *token = cp_lexer_token_at (parser->lexer, start_of_id);
2939
Index: gcc/cp/call.c
2940
===================================================================
2941
--- a/src/gcc/cp/call.c (.../tags/gcc_4_8_3_release)
2942
+++ b/src/gcc/cp/call.c (.../branches/gcc-4_8-branch)
2943
@@ -1464,7 +1464,7 @@
2945
maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
2946
conv = implicit_conversion (to, from, expr, c_cast_p,
2948
+ flags|LOOKUP_NO_TEMP_BIND, complain);
2949
if (!CLASS_TYPE_P (to)
2950
&& CONSTRUCTOR_NELTS (expr) == 1)
2952
@@ -1624,9 +1624,9 @@
2956
- Otherwise, the reference shall be to a non-volatile const type.
2958
- Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */
2959
+ Otherwise, the reference shall be an lvalue reference to a
2960
+ non-volatile const type, or the reference shall be an rvalue
2962
if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto))
2965
@@ -1664,7 +1664,16 @@
2966
/* This reference binding, unlike those above, requires the
2967
creation of a temporary. */
2968
conv->need_temporary_p = true;
2969
- conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto);
2970
+ if (TYPE_REF_IS_RVALUE (rto))
2972
+ conv->rvaluedness_matches_p = 1;
2973
+ /* In the second case, if the reference is an rvalue reference and
2974
+ the second standard conversion sequence of the user-defined
2975
+ conversion sequence includes an lvalue-to-rvalue conversion, the
2976
+ program is ill-formed. */
2977
+ if (conv->user_conv_p && next_conversion (conv)->kind == ck_rvalue)
2983
@@ -5811,7 +5820,7 @@
2984
&& convs->kind != ck_list
2985
&& convs->kind != ck_ambig
2986
&& (convs->kind != ck_ref_bind
2987
- || convs->user_conv_p)
2988
+ || (convs->user_conv_p && next_conversion (convs)->bad_p))
2989
&& (convs->kind != ck_rvalue
2990
|| SCALAR_TYPE_P (totype))
2991
&& convs->kind != ck_base)
2992
@@ -6110,7 +6119,8 @@
2993
if (convs->bad_p && !next_conversion (convs)->bad_p)
2995
gcc_assert (TYPE_REF_IS_RVALUE (ref_type)
2996
- && real_lvalue_p (expr));
2997
+ && (real_lvalue_p (expr)
2998
+ || next_conversion(convs)->kind == ck_rvalue));
3000
error_at (loc, "cannot bind %qT lvalue to %qT",
3001
TREE_TYPE (expr), totype);
3002
Index: gcc/cp/friend.c
3003
===================================================================
3004
--- a/src/gcc/cp/friend.c (.../tags/gcc_4_8_3_release)
3005
+++ b/src/gcc/cp/friend.c (.../branches/gcc-4_8-branch)
3006
@@ -502,7 +502,13 @@
3007
? current_template_parms
3010
- if (template_member_p && decl && TREE_CODE (decl) == FUNCTION_DECL)
3011
+ if ((template_member_p
3012
+ /* Always pull out the TEMPLATE_DECL if we have a friend
3013
+ template in a class template so that it gets tsubsted
3014
+ properly later on (59956). tsubst_friend_function knows
3015
+ how to tell this apart from a member template. */
3016
+ || (class_template_depth && friend_depth))
3017
+ && decl && TREE_CODE (decl) == FUNCTION_DECL)
3018
decl = DECL_TI_TEMPLATE (decl);
3021
Index: gcc/double-int.c
3022
===================================================================
3023
--- a/src/gcc/double-int.c (.../tags/gcc_4_8_3_release)
3024
+++ b/src/gcc/double-int.c (.../branches/gcc-4_8-branch)
3026
== (unsigned HOST_WIDE_INT) htwice)
3027
&& (labs_den <= ltwice)))
3031
/* quo = quo - 1; */
3032
add_double (*lquo, *hquo,
3033
(HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
3034
Index: gcc/tree-ssa-math-opts.c
3035
===================================================================
3036
--- a/src/gcc/tree-ssa-math-opts.c (.../tags/gcc_4_8_3_release)
3037
+++ b/src/gcc/tree-ssa-math-opts.c (.../branches/gcc-4_8-branch)
3038
@@ -1537,7 +1537,7 @@
3040
struct symbolic_number {
3041
unsigned HOST_WIDEST_INT n;
3046
/* Perform a SHIFT or ROTATE operation by COUNT bits on symbolic
3047
@@ -1549,13 +1549,15 @@
3048
struct symbolic_number *n,
3051
+ int bitsize = TYPE_PRECISION (n->type);
3056
/* Zero out the extra bits of N in order to avoid them being shifted
3057
into the significant bits. */
3058
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
3059
- n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
3060
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
3061
+ n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
3065
@@ -1563,20 +1565,24 @@
3069
+ /* Arithmetic shift of signed type: result is dependent on the value. */
3070
+ if (!TYPE_UNSIGNED (n->type)
3071
+ && (n->n & ((unsigned HOST_WIDEST_INT) 0xff << (bitsize - 8))))
3076
- n->n = (n->n << count) | (n->n >> ((n->size * BITS_PER_UNIT) - count));
3077
+ n->n = (n->n << count) | (n->n >> (bitsize - count));
3080
- n->n = (n->n >> count) | (n->n << ((n->size * BITS_PER_UNIT) - count));
3081
+ n->n = (n->n >> count) | (n->n << (bitsize - count));
3086
/* Zero unused bits for size. */
3087
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
3088
- n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
3089
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
3090
+ n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
3094
@@ -1593,7 +1599,7 @@
3095
if (TREE_CODE (lhs_type) != INTEGER_TYPE)
3098
- if (TYPE_PRECISION (lhs_type) != n->size * BITS_PER_UNIT)
3099
+ if (TYPE_PRECISION (lhs_type) != TYPE_PRECISION (n->type))
3103
@@ -1650,20 +1656,25 @@
3104
to initialize the symbolic number. */
3109
/* Set up the symbolic number N by setting each byte to a
3110
value between 1 and the byte size of rhs1. The highest
3111
order byte is set to n->size and the lowest order
3113
- n->size = TYPE_PRECISION (TREE_TYPE (rhs1));
3114
- if (n->size % BITS_PER_UNIT != 0)
3115
+ n->type = TREE_TYPE (rhs1);
3116
+ size = TYPE_PRECISION (n->type);
3117
+ if (size % BITS_PER_UNIT != 0)
3119
- n->size /= BITS_PER_UNIT;
3120
+ if (size > HOST_BITS_PER_WIDEST_INT)
3122
+ size /= BITS_PER_UNIT;
3123
n->n = (sizeof (HOST_WIDEST_INT) < 8 ? 0 :
3124
(unsigned HOST_WIDEST_INT)0x08070605 << 32 | 0x04030201);
3126
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
3127
+ if (size < (int)sizeof (HOST_WIDEST_INT))
3128
n->n &= ((unsigned HOST_WIDEST_INT)1 <<
3129
- (n->size * BITS_PER_UNIT)) - 1;
3130
+ (size * BITS_PER_UNIT)) - 1;
3132
source_expr1 = rhs1;
3134
@@ -1672,12 +1683,12 @@
3139
+ int i, size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
3140
unsigned HOST_WIDEST_INT val = widest_int_cst_value (rhs2);
3141
unsigned HOST_WIDEST_INT tmp = val;
3143
/* Only constants masking full bytes are allowed. */
3144
- for (i = 0; i < n->size; i++, tmp >>= BITS_PER_UNIT)
3145
+ for (i = 0; i < size; i++, tmp >>= BITS_PER_UNIT)
3146
if ((tmp & 0xff) != 0 && (tmp & 0xff) != 0xff)
3149
@@ -1693,12 +1704,24 @@
3154
+ int type_size, old_type_size;
3157
- type_size = TYPE_PRECISION (gimple_expr_type (stmt));
3158
+ type = gimple_expr_type (stmt);
3159
+ type_size = TYPE_PRECISION (type);
3160
if (type_size % BITS_PER_UNIT != 0)
3162
+ if (type_size > (int) HOST_BITS_PER_WIDEST_INT)
3165
+ /* Sign extension: result is dependent on the value. */
3166
+ old_type_size = TYPE_PRECISION (n->type);
3167
+ if (!TYPE_UNSIGNED (n->type)
3168
+ && type_size > old_type_size
3170
+ ((unsigned HOST_WIDEST_INT) 0xff << (old_type_size - 8)))
3173
if (type_size / BITS_PER_UNIT < (int)(sizeof (HOST_WIDEST_INT)))
3175
/* If STMT casts to a smaller type mask out the bits not
3176
@@ -1705,7 +1728,7 @@
3177
belonging to the target type. */
3178
n->n &= ((unsigned HOST_WIDEST_INT)1 << type_size) - 1;
3180
- n->size = type_size / BITS_PER_UNIT;
3185
@@ -1718,7 +1741,7 @@
3187
if (rhs_class == GIMPLE_BINARY_RHS)
3191
struct symbolic_number n1, n2;
3192
unsigned HOST_WIDEST_INT mask;
3194
@@ -1742,11 +1765,12 @@
3195
source_expr2 = find_bswap_1 (rhs2_stmt, &n2, limit - 1);
3197
if (source_expr1 != source_expr2
3198
- || n1.size != n2.size)
3199
+ || TYPE_PRECISION (n1.type) != TYPE_PRECISION (n2.type))
3202
- n->size = n1.size;
3203
- for (i = 0, mask = 0xff; i < n->size; i++, mask <<= BITS_PER_UNIT)
3204
+ n->type = n1.type;
3205
+ size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
3206
+ for (i = 0, mask = 0xff; i < size; i++, mask <<= BITS_PER_UNIT)
3208
unsigned HOST_WIDEST_INT masked1, masked2;
3210
@@ -1785,7 +1809,7 @@
3212
struct symbolic_number n;
3215
+ int limit, bitsize;
3217
/* The last parameter determines the depth search limit. It usually
3218
correlates directly to the number of bytes to be touched. We
3219
@@ -1800,13 +1824,14 @@
3222
/* Zero out the extra bits of N and CMP. */
3223
- if (n.size < (int)sizeof (HOST_WIDEST_INT))
3224
+ bitsize = TYPE_PRECISION (n.type);
3225
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
3227
unsigned HOST_WIDEST_INT mask =
3228
- ((unsigned HOST_WIDEST_INT)1 << (n.size * BITS_PER_UNIT)) - 1;
3229
+ ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
3232
- cmp >>= (sizeof (HOST_WIDEST_INT) - n.size) * BITS_PER_UNIT;
3233
+ cmp >>= sizeof (HOST_WIDEST_INT) * BITS_PER_UNIT - bitsize;
3236
/* A complete byte swap should make the symbolic number to start
3237
@@ -1828,7 +1853,7 @@
3238
bool changed = false;
3239
tree bswap16_type = NULL_TREE, bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
3241
- if (BITS_PER_UNIT != 8)
3242
+ if (BITS_PER_UNIT != 8 || CHAR_BIT != 8)
3245
if (sizeof (HOST_WIDEST_INT) < 8)
3246
Index: gcc/tree-ssa-ifcombine.c
3247
===================================================================
3248
--- a/src/gcc/tree-ssa-ifcombine.c (.../tags/gcc_4_8_3_release)
3249
+++ b/src/gcc/tree-ssa-ifcombine.c (.../branches/gcc-4_8-branch)
3250
@@ -105,7 +105,11 @@
3252
gimple stmt = gsi_stmt (gsi);
3254
+ if (is_gimple_debug (stmt))
3257
if (gimple_has_side_effects (stmt)
3258
+ || gimple_could_trap_p (stmt)
3259
|| gimple_vuse (stmt))
3263
while (is_gimple_assign (stmt)
3264
&& ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
3265
&& (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (stmt)))
3266
- <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
3267
+ <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt))))
3268
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
3269
|| gimple_assign_ssa_name_copy_p (stmt)))
3270
stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
3272
Index: gcc/sel-sched-ir.c
3273
===================================================================
3274
--- a/src/gcc/sel-sched-ir.c (.../tags/gcc_4_8_3_release)
3275
+++ b/src/gcc/sel-sched-ir.c (.../branches/gcc-4_8-branch)
3277
static void free_av_set (basic_block);
3278
static void invalidate_av_set (basic_block);
3279
static void extend_insn_data (void);
3280
-static void sel_init_new_insn (insn_t, int);
3281
+static void sel_init_new_insn (insn_t, int, int = -1);
3282
static void finish_insns (void);
3284
/* Various list functions. */
3285
@@ -4011,9 +4011,10 @@
3289
-/* Compute seqno for INSN by its preds or succs. */
3290
+/* Compute seqno for INSN by its preds or succs. Use OLD_SEQNO to compute
3291
+ seqno in corner cases. */
3293
-get_seqno_for_a_jump (insn_t insn)
3294
+get_seqno_for_a_jump (insn_t insn, int old_seqno)
3298
@@ -4069,8 +4070,16 @@
3300
seqno = get_seqno_by_succs (insn);
3304
+ /* The only case where this could be here legally is that the only
3305
+ unscheduled insn was a conditional jump that got removed and turned
3306
+ into this unconditional one. Initialize from the old seqno
3307
+ of that jump passed down to here. */
3308
+ seqno = old_seqno;
3311
gcc_assert (seqno >= 0);
3316
@@ -4250,22 +4259,24 @@
3319
/* This is used to initialize spurious jumps generated by
3320
- sel_redirect_edge (). */
3321
+ sel_redirect_edge (). OLD_SEQNO is used for initializing seqnos
3322
+ in corner cases within get_seqno_for_a_jump. */
3324
-init_simplejump_data (insn_t insn)
3325
+init_simplejump_data (insn_t insn, int old_seqno)
3327
init_expr (INSN_EXPR (insn), vinsn_create (insn, false), 0,
3328
REG_BR_PROB_BASE, 0, 0, 0, 0, 0, 0,
3329
vNULL, true, false, false,
3331
- INSN_SEQNO (insn) = get_seqno_for_a_jump (insn);
3332
+ INSN_SEQNO (insn) = get_seqno_for_a_jump (insn, old_seqno);
3333
init_first_time_insn_data (insn);
3336
/* Perform deferred initialization of insns. This is used to process
3337
- a new jump that may be created by redirect_edge. */
3339
-sel_init_new_insn (insn_t insn, int flags)
3340
+ a new jump that may be created by redirect_edge. OLD_SEQNO is used
3341
+ for initializing simplejumps in init_simplejump_data. */
3343
+sel_init_new_insn (insn_t insn, int flags, int old_seqno)
3345
/* We create data structures for bb when the first insn is emitted in it. */
3347
@@ -4292,7 +4303,7 @@
3348
if (flags & INSN_INIT_TODO_SIMPLEJUMP)
3350
extend_insn_data ();
3351
- init_simplejump_data (insn);
3352
+ init_simplejump_data (insn, old_seqno);
3355
gcc_assert (CONTAINING_RGN (BLOCK_NUM (insn))
3356
@@ -5578,8 +5589,7 @@
3359
/* A wrapper for redirect_edge_and_branch_force, which also initializes
3360
- data structures for possibly created bb and insns. Returns the newly
3361
- added bb or NULL, when a bb was not needed. */
3362
+ data structures for possibly created bb and insns. */
3364
sel_redirect_edge_and_branch_force (edge e, basic_block to)
3366
@@ -5586,6 +5596,7 @@
3367
basic_block jump_bb, src, orig_dest = e->dest;
3370
+ int old_seqno = -1;
3372
/* This function is now used only for bookkeeping code creation, where
3373
we'll never get the single pred of orig_dest block and thus will not
3374
@@ -5594,8 +5605,13 @@
3375
&& !single_pred_p (orig_dest));
3377
prev_max_uid = get_max_uid ();
3378
+ /* Compute and pass old_seqno down to sel_init_new_insn only for the case
3379
+ when the conditional jump being redirected may become unconditional. */
3380
+ if (any_condjump_p (BB_END (src))
3381
+ && INSN_SEQNO (BB_END (src)) >= 0)
3382
+ old_seqno = INSN_SEQNO (BB_END (src));
3384
jump_bb = redirect_edge_and_branch_force (e, to);
3386
if (jump_bb != NULL)
3387
sel_add_bb (jump_bb);
3389
@@ -5607,7 +5623,8 @@
3391
jump = find_new_jump (src, jump_bb, prev_max_uid);
3393
- sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
3394
+ sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP,
3396
set_immediate_dominator (CDI_DOMINATORS, to,
3397
recompute_dominator (CDI_DOMINATORS, to));
3398
set_immediate_dominator (CDI_DOMINATORS, orig_dest,
3399
@@ -5626,6 +5643,7 @@
3401
bool recompute_toporder_p = false;
3402
bool maybe_unreachable = single_pred_p (orig_dest);
3403
+ int old_seqno = -1;
3405
latch_edge_p = (pipelining_p
3406
&& current_loop_nest
3407
@@ -5634,6 +5652,12 @@
3409
prev_max_uid = get_max_uid ();
3411
+ /* Compute and pass old_seqno down to sel_init_new_insn only for the case
3412
+ when the conditional jump being redirected may become unconditional. */
3413
+ if (any_condjump_p (BB_END (src))
3414
+ && INSN_SEQNO (BB_END (src)) >= 0)
3415
+ old_seqno = INSN_SEQNO (BB_END (src));
3417
redirected = redirect_edge_and_branch (e, to);
3419
gcc_assert (redirected && !last_added_blocks.exists ());
3420
@@ -5654,7 +5678,7 @@
3422
jump = find_new_jump (src, NULL, prev_max_uid);
3424
- sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
3425
+ sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP, old_seqno);
3427
/* Only update dominator info when we don't have unreachable blocks.
3428
Otherwise we'll update in maybe_tidy_empty_bb. */
3429
Index: gcc/fortran/trans-expr.c
3430
===================================================================
3431
--- a/src/gcc/fortran/trans-expr.c (.../tags/gcc_4_8_3_release)
3432
+++ b/src/gcc/fortran/trans-expr.c (.../branches/gcc-4_8-branch)
3433
@@ -7096,7 +7096,7 @@
3435
res_desc = gfc_evaluate_now (desc, &se->pre);
3436
gfc_conv_descriptor_data_set (&se->pre, res_desc, null_pointer_node);
3437
- se->expr = gfc_build_addr_expr (TREE_TYPE (se->expr), res_desc);
3438
+ se->expr = gfc_build_addr_expr (NULL_TREE, res_desc);
3440
/* Free the lhs after the function call and copy the result data to
3441
the lhs descriptor. */
3442
Index: gcc/fortran/decl.c
3443
===================================================================
3444
--- a/src/gcc/fortran/decl.c (.../tags/gcc_4_8_3_release)
3445
+++ b/src/gcc/fortran/decl.c (.../branches/gcc-4_8-branch)
3446
@@ -1996,6 +1996,13 @@
3447
if (gfc_notify_std (GFC_STD_GNU, "Old-style "
3448
"initialization at %C") == FAILURE)
3450
+ else if (gfc_current_state () == COMP_DERIVED)
3452
+ gfc_error ("Invalid old style initialization for derived type "
3453
+ "component at %C");
3458
return match_old_style_init (name);
3460
Index: gcc/fortran/ChangeLog
3461
===================================================================
3462
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_8_3_release)
3463
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch)
3465
+2014-07-19 Paul Thomas <pault@gcc.gnu.org>
3467
+ Backport from trunk.
3469
+ * dependency.c (gfc_dep_resolver): Index the 'reverse' array so
3470
+ that elements are skipped. This then correctly aligns 'reverse'
3471
+ with the scalarizer loops.
3473
+2014-07-08 Paul Thomas <pault@gcc.gnu.org>
3477
+ * trans-expr.c (fcncall_realloc_result): Use the natural type
3478
+ for the address expression of 'res_desc'.
3480
+2014-07-02 Jakub Jelinek <jakub@redhat.com>
3481
+ Fritz Reese <Reese-Fritz@zai.com>
3483
+ * decl.c (variable_decl): Reject old style initialization
3484
+ for derived type components.
3486
+2014-06-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
3488
+ Backport from trunk.
3490
+ * trans-decl.c (gfc_create_module_variable): Don't create
3491
+ Cray-pointee decls twice.
3493
+2014-05-26 Janne Blomqvist <jb@gcc.gnu.org>
3495
+ Backport from mainline
3496
+ PR libfortran/61310
3497
+ * intrinsics.texi (CTIME): Remove mention of locale-dependent
3500
2014-05-22 Release Manager
3502
* GCC 4.8.3 released.
3503
Index: gcc/fortran/trans-decl.c
3504
===================================================================
3505
--- a/src/gcc/fortran/trans-decl.c (.../tags/gcc_4_8_3_release)
3506
+++ b/src/gcc/fortran/trans-decl.c (.../branches/gcc-4_8-branch)
3507
@@ -4084,8 +4084,8 @@
3510
/* Don't generate variables from other modules. Variables from
3511
- COMMONs will already have been generated. */
3512
- if (sym->attr.use_assoc || sym->attr.in_common)
3513
+ COMMONs and Cray pointees will already have been generated. */
3514
+ if (sym->attr.use_assoc || sym->attr.in_common || sym->attr.cray_pointee)
3517
/* Equivalenced variables arrive here after creation. */
3518
Index: gcc/fortran/dependency.c
3519
===================================================================
3520
--- a/src/gcc/fortran/dependency.c (.../tags/gcc_4_8_3_release)
3521
+++ b/src/gcc/fortran/dependency.c (.../branches/gcc-4_8-branch)
3522
@@ -1779,6 +1779,7 @@
3523
gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
3527
gfc_dependency fin_dep;
3528
gfc_dependency this_dep;
3530
@@ -1828,6 +1829,8 @@
3534
+ /* Index for the reverse array. */
3536
for (n=0; n < lref->u.ar.dimen; n++)
3538
/* Assume dependency when either of array reference is vector
3539
@@ -1862,31 +1865,37 @@
3540
The ability to reverse or not is set by previous conditions
3541
in this dimension. If reversal is not activated, the
3542
value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP. */
3544
+ /* Get the indexing right for the scalarizing loop. If this
3545
+ is an element, there is no corresponding loop. */
3546
+ if (lref->u.ar.dimen_type[n] != DIMEN_ELEMENT)
3549
if (rref->u.ar.dimen_type[n] == DIMEN_RANGE
3550
&& lref->u.ar.dimen_type[n] == DIMEN_RANGE)
3552
/* Set reverse if backward dependence and not inhibited. */
3553
- if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
3554
- reverse[n] = (this_dep == GFC_DEP_BACKWARD) ?
3555
- GFC_REVERSE_SET : reverse[n];
3556
+ if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
3557
+ reverse[m] = (this_dep == GFC_DEP_BACKWARD) ?
3558
+ GFC_REVERSE_SET : reverse[m];
3560
/* Set forward if forward dependence and not inhibited. */
3561
- if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
3562
- reverse[n] = (this_dep == GFC_DEP_FORWARD) ?
3563
- GFC_FORWARD_SET : reverse[n];
3564
+ if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
3565
+ reverse[m] = (this_dep == GFC_DEP_FORWARD) ?
3566
+ GFC_FORWARD_SET : reverse[m];
3568
/* Flag up overlap if dependence not compatible with
3569
the overall state of the expression. */
3570
- if (reverse && reverse[n] == GFC_REVERSE_SET
3571
+ if (reverse && reverse[m] == GFC_REVERSE_SET
3572
&& this_dep == GFC_DEP_FORWARD)
3574
- reverse[n] = GFC_INHIBIT_REVERSE;
3575
+ reverse[m] = GFC_INHIBIT_REVERSE;
3576
this_dep = GFC_DEP_OVERLAP;
3578
- else if (reverse && reverse[n] == GFC_FORWARD_SET
3579
+ else if (reverse && reverse[m] == GFC_FORWARD_SET
3580
&& this_dep == GFC_DEP_BACKWARD)
3582
- reverse[n] = GFC_INHIBIT_REVERSE;
3583
+ reverse[m] = GFC_INHIBIT_REVERSE;
3584
this_dep = GFC_DEP_OVERLAP;
3587
@@ -1893,7 +1902,7 @@
3588
/* If no intention of reversing or reversing is explicitly
3589
inhibited, convert backward dependence to overlap. */
3590
if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
3591
- || (reverse != NULL && reverse[n] == GFC_INHIBIT_REVERSE))
3592
+ || (reverse != NULL && reverse[m] == GFC_INHIBIT_REVERSE))
3593
this_dep = GFC_DEP_OVERLAP;
3596
Index: gcc/function.c
3597
===================================================================
3598
--- a/src/gcc/function.c (.../tags/gcc_4_8_3_release)
3599
+++ b/src/gcc/function.c (.../branches/gcc-4_8-branch)
3600
@@ -1354,9 +1354,13 @@
3601
#define STACK_POINTER_OFFSET 0
3604
+#if defined (REG_PARM_STACK_SPACE) && !defined (INCOMING_REG_PARM_STACK_SPACE)
3605
+#define INCOMING_REG_PARM_STACK_SPACE REG_PARM_STACK_SPACE
3608
/* If not defined, pick an appropriate default for the offset of dynamically
3609
allocated memory depending on the value of ACCUMULATE_OUTGOING_ARGS,
3610
- REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE. */
3611
+ INCOMING_REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE. */
3613
#ifndef STACK_DYNAMIC_OFFSET
3615
@@ -1368,12 +1372,12 @@
3616
`crtl->outgoing_args_size'. Nevertheless, we must allow
3617
for it when allocating stack dynamic objects. */
3619
-#if defined(REG_PARM_STACK_SPACE)
3620
+#ifdef INCOMING_REG_PARM_STACK_SPACE
3621
#define STACK_DYNAMIC_OFFSET(FNDECL) \
3622
((ACCUMULATE_OUTGOING_ARGS \
3623
? (crtl->outgoing_args_size \
3624
+ (OUTGOING_REG_PARM_STACK_SPACE ((!(FNDECL) ? NULL_TREE : TREE_TYPE (FNDECL))) ? 0 \
3625
- : REG_PARM_STACK_SPACE (FNDECL))) \
3626
+ : INCOMING_REG_PARM_STACK_SPACE (FNDECL))) \
3627
: 0) + (STACK_POINTER_OFFSET))
3629
#define STACK_DYNAMIC_OFFSET(FNDECL) \
3630
@@ -2211,8 +2215,9 @@
3632
all->args_so_far = pack_cumulative_args (&all->args_so_far_v);
3634
-#ifdef REG_PARM_STACK_SPACE
3635
- all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl);
3636
+#ifdef INCOMING_REG_PARM_STACK_SPACE
3637
+ all->reg_parm_stack_space
3638
+ = INCOMING_REG_PARM_STACK_SPACE (current_function_decl);
3642
@@ -4518,6 +4523,7 @@
3643
/* ??? This could be set on a per-function basis by the front-end
3644
but is this worth the hassle? */
3645
cfun->can_throw_non_call_exceptions = flag_non_call_exceptions;
3646
+ cfun->can_delete_dead_exceptions = flag_delete_dead_exceptions;
3650
Index: gcc/common.opt
3651
===================================================================
3652
--- a/src/gcc/common.opt (.../tags/gcc_4_8_3_release)
3653
+++ b/src/gcc/common.opt (.../branches/gcc-4_8-branch)
3654
@@ -1226,6 +1226,10 @@
3655
Common Report Var(flag_tm)
3656
Enable support for GNU transactional memory
3659
+Common Report Var(flag_gnu_unique) Init(1)
3660
+Use STB_GNU_UNIQUE if supported by the assembler
3664
Does nothing. Preserved for backward compatibility.
3665
Index: gcc/sched-deps.c
3666
===================================================================
3667
--- a/src/gcc/sched-deps.c (.../tags/gcc_4_8_3_release)
3668
+++ b/src/gcc/sched-deps.c (.../branches/gcc-4_8-branch)
3669
@@ -2744,7 +2744,8 @@
3670
Consider for instance a volatile asm that changes the fpu rounding
3671
mode. An insn should not be moved across this even if it only uses
3672
pseudo-regs because it might give an incorrectly rounded result. */
3673
- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
3674
+ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
3675
+ && !DEBUG_INSN_P (insn))
3676
reg_pending_barrier = TRUE_BARRIER;
3678
/* For all ASM_OPERANDS, we must traverse the vector of input operands.
3679
Index: gcc/config/alpha/elf.h
3680
===================================================================
3681
--- a/src/gcc/config/alpha/elf.h (.../tags/gcc_4_8_3_release)
3682
+++ b/src/gcc/config/alpha/elf.h (.../branches/gcc-4_8-branch)
3683
@@ -126,6 +126,10 @@
3684
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
3685
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
3687
+/* This variable should be set to 'true' if the target ABI requires
3688
+ unwinding tables even when exceptions are not used. */
3689
+#define TARGET_UNWIND_TABLES_DEFAULT true
3691
/* Select a format to encode pointers in exception handling data. CODE
3692
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
3693
true if the symbol may be affected by dynamic relocations.
3694
Index: gcc/config/alpha/alpha.c
3695
===================================================================
3696
--- a/src/gcc/config/alpha/alpha.c (.../tags/gcc_4_8_3_release)
3697
+++ b/src/gcc/config/alpha/alpha.c (.../branches/gcc-4_8-branch)
3698
@@ -8658,6 +8658,11 @@
3703
+ /* __builtin_unreachable can expand to no code at all,
3704
+ leaving (barrier) RTXes in the instruction stream. */
3705
+ goto close_shadow_notrapb;
3710
@@ -8673,6 +8678,7 @@
3711
n = emit_insn_before (gen_trapb (), i);
3712
PUT_MODE (n, TImode);
3713
PUT_MODE (i, TImode);
3714
+ close_shadow_notrapb:
3718
Index: gcc/config/elfos.h
3719
===================================================================
3720
--- a/src/gcc/config/elfos.h (.../tags/gcc_4_8_3_release)
3721
+++ b/src/gcc/config/elfos.h (.../branches/gcc-4_8-branch)
3723
/* Write the extra assembler code needed to declare an object properly. */
3725
#ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
3726
-#define USE_GNU_UNIQUE_OBJECT 1
3727
+#define USE_GNU_UNIQUE_OBJECT flag_gnu_unique
3729
#define USE_GNU_UNIQUE_OBJECT 0
3731
Index: gcc/config/sparc/sync.md
3732
===================================================================
3733
--- a/src/gcc/config/sparc/sync.md (.../tags/gcc_4_8_3_release)
3734
+++ b/src/gcc/config/sparc/sync.md (.../branches/gcc-4_8-branch)
3737
[(set_attr "type" "multi")])
3739
+;; For LEON3, STB has the effect of membar #StoreLoad.
3740
+(define_insn "*membar_storeload_leon3"
3741
+ [(set (match_operand:BLK 0 "" "")
3742
+ (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
3744
+ "stb\t%%g0, [%%sp-1]"
3745
+ [(set_attr "type" "store")])
3747
;; For V8, LDSTUB has the effect of membar #StoreLoad.
3748
(define_insn "*membar_storeload"
3749
[(set (match_operand:BLK 0 "" "")
3750
(unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
3752
+ "TARGET_V8 && !TARGET_LEON3"
3753
"ldstub\t[%%sp-1], %%g0"
3754
[(set_attr "type" "multi")])
3756
Index: gcc/config/i386/i386.md
3757
===================================================================
3758
--- a/src/gcc/config/i386/i386.md (.../tags/gcc_4_8_3_release)
3759
+++ b/src/gcc/config/i386/i386.md (.../branches/gcc-4_8-branch)
3760
@@ -5339,66 +5339,37 @@
3762
;; Avoid store forwarding (partial memory) stall penalty by extending
3763
;; SImode value to DImode through XMM register instead of pushing two
3764
-;; SImode values to stack. Note that even !TARGET_INTER_UNIT_MOVES
3765
-;; targets benefit from this optimization. Also note that fild
3766
-;; loads from memory only.
3767
+;; SImode values to stack. Also note that fild loads from memory only.
3769
-(define_insn "*floatunssi<mode>2_1"
3770
- [(set (match_operand:X87MODEF 0 "register_operand" "=f,f")
3771
+(define_insn_and_split "*floatunssi<mode>2_i387_with_xmm"
3772
+ [(set (match_operand:X87MODEF 0 "register_operand" "=f")
3773
(unsigned_float:X87MODEF
3774
- (match_operand:SI 1 "nonimmediate_operand" "x,m")))
3775
- (clobber (match_operand:DI 2 "memory_operand" "=m,m"))
3776
- (clobber (match_scratch:SI 3 "=X,x"))]
3777
+ (match_operand:SI 1 "nonimmediate_operand" "rm")))
3778
+ (clobber (match_scratch:DI 3 "=x"))
3779
+ (clobber (match_operand:DI 2 "memory_operand" "=m"))]
3781
&& TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
3783
+ && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES"
3785
+ "&& reload_completed"
3786
+ [(set (match_dup 3) (zero_extend:DI (match_dup 1)))
3787
+ (set (match_dup 2) (match_dup 3))
3788
+ (set (match_dup 0)
3789
+ (float:X87MODEF (match_dup 2)))]
3791
[(set_attr "type" "multi")
3792
(set_attr "mode" "<MODE>")])
3795
- [(set (match_operand:X87MODEF 0 "register_operand")
3796
- (unsigned_float:X87MODEF
3797
- (match_operand:SI 1 "register_operand")))
3798
- (clobber (match_operand:DI 2 "memory_operand"))
3799
- (clobber (match_scratch:SI 3))]
3801
- && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
3803
- && reload_completed"
3804
- [(set (match_dup 2) (match_dup 1))
3805
- (set (match_dup 0)
3806
- (float:X87MODEF (match_dup 2)))]
3807
- "operands[1] = simplify_gen_subreg (DImode, operands[1], SImode, 0);")
3810
- [(set (match_operand:X87MODEF 0 "register_operand")
3811
- (unsigned_float:X87MODEF
3812
- (match_operand:SI 1 "memory_operand")))
3813
- (clobber (match_operand:DI 2 "memory_operand"))
3814
- (clobber (match_scratch:SI 3))]
3816
- && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
3818
- && reload_completed"
3819
- [(set (match_dup 2) (match_dup 3))
3820
- (set (match_dup 0)
3821
- (float:X87MODEF (match_dup 2)))]
3823
- emit_move_insn (operands[3], operands[1]);
3824
- operands[3] = simplify_gen_subreg (DImode, operands[3], SImode, 0);
3827
(define_expand "floatunssi<mode>2"
3829
[(set (match_operand:X87MODEF 0 "register_operand")
3830
(unsigned_float:X87MODEF
3831
(match_operand:SI 1 "nonimmediate_operand")))
3832
- (clobber (match_dup 2))
3833
- (clobber (match_scratch:SI 3))])]
3834
+ (clobber (match_scratch:DI 3))
3835
+ (clobber (match_dup 2))])]
3837
&& ((TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
3839
+ && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES)
3840
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))"
3842
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
3843
Index: gcc/config/i386/driver-i386.c
3844
===================================================================
3845
--- a/src/gcc/config/i386/driver-i386.c (.../tags/gcc_4_8_3_release)
3846
+++ b/src/gcc/config/i386/driver-i386.c (.../branches/gcc-4_8-branch)
3847
@@ -713,6 +713,11 @@
3848
/* Assume Core 2. */
3851
+ else if (has_longmode)
3852
+ /* Perhaps some emulator? Assume x86-64, otherwise gcc
3853
+ -march=native would be unusable for 64-bit compilations,
3854
+ as all the CPUs below are 32-bit only. */
3857
/* It is Core Duo. */
3859
Index: gcc/config/i386/i386.c
3860
===================================================================
3861
--- a/src/gcc/config/i386/i386.c (.../tags/gcc_4_8_3_release)
3862
+++ b/src/gcc/config/i386/i386.c (.../branches/gcc-4_8-branch)
3863
@@ -20505,7 +20505,7 @@
3864
t1 = gen_reg_rtx (V32QImode);
3865
t2 = gen_reg_rtx (V32QImode);
3866
t3 = gen_reg_rtx (V32QImode);
3867
- vt2 = GEN_INT (128);
3868
+ vt2 = GEN_INT (-128);
3869
for (i = 0; i < 32; i++)
3871
vt = gen_rtx_CONST_VECTOR (V32QImode, gen_rtvec_v (32, vec));
3872
@@ -24640,13 +24640,17 @@
3876
- /* Assume that region is SCC, i.e. all immediate predecessors
3877
- of non-head block are in the same region. */
3879
+ /* Regions are SCCs with the exception of selective
3880
+ scheduling with pipelining of outer blocks enabled.
3881
+ So also check that immediate predecessors of a non-head
3882
+ block are in the same region. */
3883
FOR_EACH_EDGE (e, ei, bb->preds)
3885
/* Avoid creating of loop-carried dependencies through
3886
- using topological odering in region. */
3887
- if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
3888
+ using topological ordering in the region. */
3889
+ if (rgn == CONTAINING_RGN (e->src->index)
3890
+ && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
3891
add_dependee_for_func_arg (first_arg, e->src);
3894
Index: gcc/config/microblaze/predicates.md
3895
===================================================================
3896
--- a/src/gcc/config/microblaze/predicates.md (.../tags/gcc_4_8_3_release)
3897
+++ b/src/gcc/config/microblaze/predicates.md (.../branches/gcc-4_8-branch)
3899
(ior (match_operand 0 "const_0_operand")
3900
(match_operand 0 "register_operand")))
3902
-(define_predicate "reg_or_mem_operand"
3903
- (ior (match_operand 0 "memory_operand")
3904
- (match_operand 0 "register_operand")))
3906
;; Return if the operand is either the PC or a label_ref.
3907
(define_special_predicate "pc_or_label_operand"
3908
(ior (match_code "pc,label_ref")
3909
Index: gcc/config/microblaze/microblaze.md
3910
===================================================================
3911
--- a/src/gcc/config/microblaze/microblaze.md (.../tags/gcc_4_8_3_release)
3912
+++ b/src/gcc/config/microblaze/microblaze.md (.../branches/gcc-4_8-branch)
3913
@@ -1119,18 +1119,6 @@
3917
-;;Load and store reverse
3918
-(define_insn "movsi4_rev"
3919
- [(set (match_operand:SI 0 "reg_or_mem_operand" "=r,Q")
3920
- (bswap:SI (match_operand:SF 1 "reg_or_mem_operand" "Q,r")))]
3925
- [(set_attr "type" "load,store")
3926
- (set_attr "mode" "SI")
3927
- (set_attr "length" "4,4")])
3929
;; 32-bit floating point moves
3931
(define_expand "movsf"
3932
Index: gcc/config/avr/avr-fixed.md
3933
===================================================================
3934
--- a/src/gcc/config/avr/avr-fixed.md (.../tags/gcc_4_8_3_release)
3935
+++ b/src/gcc/config/avr/avr-fixed.md (.../branches/gcc-4_8-branch)
3939
// Input and output of the libgcc function
3940
- const unsigned int regno_in[] = { -1, 22, 22, -1, 18 };
3941
- const unsigned int regno_out[] = { -1, 24, 24, -1, 22 };
3942
+ const unsigned int regno_in[] = { -1U, 22, 22, -1U, 18 };
3943
+ const unsigned int regno_out[] = { -1U, 24, 24, -1U, 22 };
3945
operands[3] = gen_rtx_REG (<MODE>mode, regno_out[(size_t) GET_MODE_SIZE (<MODE>mode)]);
3946
operands[4] = gen_rtx_REG (<MODE>mode, regno_in[(size_t) GET_MODE_SIZE (<MODE>mode)]);
3947
Index: gcc/config/avr/avr.md
3948
===================================================================
3949
--- a/src/gcc/config/avr/avr.md (.../tags/gcc_4_8_3_release)
3950
+++ b/src/gcc/config/avr/avr.md (.../branches/gcc-4_8-branch)
3951
@@ -367,6 +367,15 @@
3956
+ // Avoid (subreg (mem)) for non-generic address spaces below. Because
3957
+ // of the poor addressing capabilities of these spaces it's better to
3958
+ // load them in one chunk. And it avoids PR61443.
3960
+ if (MEM_P (operands[0])
3961
+ && !ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[0])))
3962
+ operands[0] = copy_to_mode_reg (<MODE>mode, operands[0]);
3964
for (i = GET_MODE_SIZE (<MODE>mode) - 1; i >= 0; --i)
3966
rtx part = simplify_gen_subreg (QImode, operands[0], <MODE>mode, i);
3967
Index: gcc/config/avr/avr.h
3968
===================================================================
3969
--- a/src/gcc/config/avr/avr.h (.../tags/gcc_4_8_3_release)
3970
+++ b/src/gcc/config/avr/avr.h (.../branches/gcc-4_8-branch)
3971
@@ -250,18 +250,18 @@
3972
#define REG_CLASS_CONTENTS { \
3973
{0x00000000,0x00000000}, /* NO_REGS */ \
3974
{0x00000001,0x00000000}, /* R0_REG */ \
3975
- {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
3976
- {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
3977
- {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
3978
+ {3u << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
3979
+ {3u << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
3980
+ {3u << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
3981
{0x00000000,0x00000003}, /* STACK_REG, STACK */ \
3982
- {(3 << REG_Y) | (3 << REG_Z), \
3983
+ {(3u << REG_Y) | (3u << REG_Z), \
3984
0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \
3985
- {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \
3986
+ {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z), \
3987
0x00000000}, /* POINTER_REGS, r26 - r31 */ \
3988
- {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \
3989
+ {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z) | (3u << REG_W), \
3990
0x00000000}, /* ADDW_REGS, r24 - r31 */ \
3991
{0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \
3992
- {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \
3993
+ {(3u << REG_X)|(3u << REG_Y)|(3u << REG_Z)|(3u << REG_W)|(0xffu << 16),\
3994
0x00000000}, /* LD_REGS, r16 - r31 */ \
3995
{0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \
3996
{0xffffffff,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \
3997
Index: gcc/config/aarch64/arm_neon.h
3998
===================================================================
3999
--- a/src/gcc/config/aarch64/arm_neon.h (.../tags/gcc_4_8_3_release)
4000
+++ b/src/gcc/config/aarch64/arm_neon.h (.../branches/gcc-4_8-branch)
4001
@@ -13815,7 +13815,7 @@
4003
__asm__ ("sqdmulh %0.4h,%1.4h,%2.h[0]"
4007
: /* No clobbers */);
4010
@@ -13837,7 +13837,7 @@
4012
__asm__ ("sqdmulh %0.8h,%1.8h,%2.h[0]"
4016
: /* No clobbers */);
4019
Index: gcc/config/aarch64/aarch64.md
4020
===================================================================
4021
--- a/src/gcc/config/aarch64/aarch64.md (.../tags/gcc_4_8_3_release)
4022
+++ b/src/gcc/config/aarch64/aarch64.md (.../branches/gcc-4_8-branch)
4023
@@ -3292,6 +3292,7 @@
4024
(unspec:DI [(match_operand:DI 0 "aarch64_valid_symref" "S")]
4026
(clobber (reg:DI LR_REGNUM))
4027
+ (clobber (reg:CC CC_REGNUM))
4028
(clobber (match_scratch:DI 1 "=r"))]
4030
"adrp\\tx0, %A0\;ldr\\t%1, [x0, #%L0]\;add\\tx0, x0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"
4031
Index: gcc/config/aarch64/aarch64.c
4032
===================================================================
4033
--- a/src/gcc/config/aarch64/aarch64.c (.../tags/gcc_4_8_3_release)
4034
+++ b/src/gcc/config/aarch64/aarch64.c (.../branches/gcc-4_8-branch)
4035
@@ -1201,6 +1201,7 @@
4036
CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v);
4037
int ncrn, nvrn, nregs;
4038
bool allocate_ncrn, allocate_nvrn;
4039
+ HOST_WIDE_INT size;
4041
/* We need to do this once per argument. */
4042
if (pcum->aapcs_arg_processed)
4043
@@ -1208,6 +1209,11 @@
4045
pcum->aapcs_arg_processed = true;
4047
+ /* Size in bytes, rounded to the nearest multiple of 8 bytes. */
4049
+ = AARCH64_ROUND_UP (type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode),
4052
allocate_ncrn = (type) ? !(FLOAT_TYPE_P (type)) : !FLOAT_MODE_P (mode);
4053
allocate_nvrn = aarch64_vfp_is_call_candidate (pcum_v,
4055
@@ -1258,10 +1264,8 @@
4058
ncrn = pcum->aapcs_ncrn;
4059
- nregs = ((type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode))
4060
- + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
4061
+ nregs = size / UNITS_PER_WORD;
4064
/* C6 - C9. though the sign and zero extension semantics are
4065
handled elsewhere. This is the case where the argument fits
4066
entirely general registers. */
4067
@@ -1309,13 +1313,12 @@
4068
pcum->aapcs_nextncrn = NUM_ARG_REGS;
4070
/* The argument is passed on stack; record the needed number of words for
4071
- this argument (we can re-use NREGS) and align the total size if
4073
+ this argument and align the total size if necessary. */
4075
- pcum->aapcs_stack_words = nregs;
4076
+ pcum->aapcs_stack_words = size / UNITS_PER_WORD;
4077
if (aarch64_function_arg_alignment (mode, type) == 16 * BITS_PER_UNIT)
4078
pcum->aapcs_stack_size = AARCH64_ROUND_UP (pcum->aapcs_stack_size,
4079
- 16 / UNITS_PER_WORD) + 1;
4080
+ 16 / UNITS_PER_WORD);
4084
Index: gcc/config/aarch64/aarch64-linux.h
4085
===================================================================
4086
--- a/src/gcc/config/aarch64/aarch64-linux.h (.../tags/gcc_4_8_3_release)
4087
+++ b/src/gcc/config/aarch64/aarch64-linux.h (.../branches/gcc-4_8-branch)
4092
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
4094
#endif /* GCC_AARCH64_LINUX_H */
4095
Index: gcc/config/rs6000/htm.md
4096
===================================================================
4097
--- a/src/gcc/config/rs6000/htm.md (.../tags/gcc_4_8_3_release)
4098
+++ b/src/gcc/config/rs6000/htm.md (.../branches/gcc-4_8-branch)
4101
UNSPECV_HTM_TABORTWCI))
4102
(set (subreg:CC (match_dup 2) 0) (match_dup 1))
4103
- (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 24)))
4104
+ (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 28)))
4105
(parallel [(set (match_operand:SI 0 "int_reg_operand" "")
4106
(and:SI (match_dup 3) (const_int 15)))
4107
(clobber (scratch:CC))])]
4108
Index: gcc/config/rs6000/freebsd64.h
4109
===================================================================
4110
--- a/src/gcc/config/rs6000/freebsd64.h (.../tags/gcc_4_8_3_release)
4111
+++ b/src/gcc/config/rs6000/freebsd64.h (.../branches/gcc-4_8-branch)
4113
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
4114
#undef ADJUST_FIELD_ALIGN
4115
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
4116
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
4117
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
4120
&& TARGET_ALIGN_NATURAL == 0 \
4121
Index: gcc/config/rs6000/rs6000-protos.h
4122
===================================================================
4123
--- a/src/gcc/config/rs6000/rs6000-protos.h (.../tags/gcc_4_8_3_release)
4124
+++ b/src/gcc/config/rs6000/rs6000-protos.h (.../branches/gcc-4_8-branch)
4128
extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
4129
+extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
4130
extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
4132
extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
4134
extern rtx rs6000_libcall_value (enum machine_mode);
4135
extern rtx rs6000_va_arg (tree, tree);
4136
extern int function_ok_for_sibcall (tree);
4137
-extern int rs6000_reg_parm_stack_space (tree);
4138
+extern int rs6000_reg_parm_stack_space (tree, bool);
4139
extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
4140
extern bool rs6000_elf_in_small_data_p (const_tree);
4141
#ifdef ARGS_SIZE_RTX
4142
Index: gcc/config/rs6000/rs6000-builtin.def
4143
===================================================================
4144
--- a/src/gcc/config/rs6000/rs6000-builtin.def (.../tags/gcc_4_8_3_release)
4145
+++ b/src/gcc/config/rs6000/rs6000-builtin.def (.../branches/gcc-4_8-branch)
4146
@@ -622,20 +622,13 @@
4147
| RS6000_BTC_TERNARY), \
4148
CODE_FOR_ ## ICODE) /* ICODE */
4150
-/* Miscellaneous builtins. */
4151
-#define BU_MISC_1(ENUM, NAME, ATTR, ICODE) \
4152
+/* 128-bit long double floating point builtins. */
4153
+#define BU_LDBL128_2(ENUM, NAME, ATTR, ICODE) \
4154
RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
4155
"__builtin_" NAME, /* NAME */ \
4156
- RS6000_BTM_HARD_FLOAT, /* MASK */ \
4157
+ (RS6000_BTM_HARD_FLOAT /* MASK */ \
4158
+ | RS6000_BTM_LDBL128), \
4159
(RS6000_BTC_ ## ATTR /* ATTR */ \
4160
- | RS6000_BTC_UNARY), \
4161
- CODE_FOR_ ## ICODE) /* ICODE */
4163
-#define BU_MISC_2(ENUM, NAME, ATTR, ICODE) \
4164
- RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
4165
- "__builtin_" NAME, /* NAME */ \
4166
- RS6000_BTM_HARD_FLOAT, /* MASK */ \
4167
- (RS6000_BTC_ ## ATTR /* ATTR */ \
4168
| RS6000_BTC_BINARY), \
4169
CODE_FOR_ ## ICODE) /* ICODE */
4171
@@ -1593,10 +1586,8 @@
4172
BU_DFP_MISC_2 (PACK_TD, "pack_dec128", CONST, packtd)
4173
BU_DFP_MISC_2 (UNPACK_TD, "unpack_dec128", CONST, unpacktd)
4175
-BU_MISC_2 (PACK_TF, "pack_longdouble", CONST, packtf)
4176
-BU_MISC_2 (UNPACK_TF, "unpack_longdouble", CONST, unpacktf)
4177
-BU_MISC_1 (UNPACK_TF_0, "longdouble_dw0", CONST, unpacktf_0)
4178
-BU_MISC_1 (UNPACK_TF_1, "longdouble_dw1", CONST, unpacktf_1)
4179
+BU_LDBL128_2 (PACK_TF, "pack_longdouble", CONST, packtf)
4180
+BU_LDBL128_2 (UNPACK_TF, "unpack_longdouble", CONST, unpacktf)
4182
BU_P7_MISC_2 (PACK_V1TI, "pack_vector_int128", CONST, packv1ti)
4183
BU_P7_MISC_2 (UNPACK_V1TI, "unpack_vector_int128", CONST, unpackv1ti)
4184
Index: gcc/config/rs6000/linux64.h
4185
===================================================================
4186
--- a/src/gcc/config/rs6000/linux64.h (.../tags/gcc_4_8_3_release)
4187
+++ b/src/gcc/config/rs6000/linux64.h (.../branches/gcc-4_8-branch)
4189
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
4190
#undef ADJUST_FIELD_ALIGN
4191
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
4192
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
4193
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
4196
&& TARGET_ALIGN_NATURAL == 0 \
4197
Index: gcc/config/rs6000/rs6000.c
4198
===================================================================
4199
--- a/src/gcc/config/rs6000/rs6000.c (.../tags/gcc_4_8_3_release)
4200
+++ b/src/gcc/config/rs6000/rs6000.c (.../branches/gcc-4_8-branch)
4201
@@ -3014,7 +3014,8 @@
4202
| ((TARGET_CRYPTO) ? RS6000_BTM_CRYPTO : 0)
4203
| ((TARGET_HTM) ? RS6000_BTM_HTM : 0)
4204
| ((TARGET_DFP) ? RS6000_BTM_DFP : 0)
4205
- | ((TARGET_HARD_FLOAT) ? RS6000_BTM_HARD_FLOAT : 0));
4206
+ | ((TARGET_HARD_FLOAT) ? RS6000_BTM_HARD_FLOAT : 0)
4207
+ | ((TARGET_LONG_DOUBLE_128) ? RS6000_BTM_LDBL128 : 0));
4210
/* Override command line options. Mostly we process the processor type and
4211
@@ -5861,6 +5862,34 @@
4215
+/* Previous GCC releases forced all vector types to have 16-byte alignment. */
4218
+rs6000_special_adjust_field_align_p (tree field, unsigned int computed)
4220
+ if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE)
4222
+ if (computed != 128)
4224
+ static bool warned;
4225
+ if (!warned && warn_psabi)
4228
+ inform (input_location,
4229
+ "the layout of aggregates containing vectors with"
4230
+ " %d-byte alignment will change in a future GCC release",
4231
+ computed / BITS_PER_UNIT);
4234
+ /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
4235
+ keep the special treatment of vector types, but warn if there will
4236
+ be differences in future GCC releases. */
4243
/* AIX increases natural record alignment to doubleword if the first
4244
field is an FP double while the FP fields remain word aligned. */
4246
@@ -6109,7 +6138,8 @@
4249
extra = GET_MODE_SIZE (mode) - UNITS_PER_WORD;
4250
- gcc_assert (extra >= 0);
4254
if (GET_CODE (addr) == LO_SUM)
4255
/* For lo_sum addresses, we must allow any offset except one that
4256
@@ -9198,14 +9228,51 @@
4257
|| (type && TREE_CODE (type) == VECTOR_TYPE
4258
&& int_size_in_bytes (type) >= 16))
4260
- else if (((TARGET_MACHO && rs6000_darwin64_abi)
4261
- || DEFAULT_ABI == ABI_ELFv2
4262
- || (DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm))
4263
- && mode == BLKmode
4264
- && type && TYPE_ALIGN (type) > 64)
4266
+ /* Aggregate types that need > 8 byte alignment are quadword-aligned
4267
+ in the parameter area in the ELFv2 ABI, and in the AIX ABI unless
4268
+ -mcompat-align-parm is used. */
4269
+ if (((DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm)
4270
+ || DEFAULT_ABI == ABI_ELFv2)
4271
+ && type && TYPE_ALIGN (type) > 64)
4273
+ /* "Aggregate" means any AGGREGATE_TYPE except for single-element
4274
+ or homogeneous float/vector aggregates here. We already handled
4275
+ vector aggregates above, but still need to check for float here. */
4276
+ bool aggregate_p = (AGGREGATE_TYPE_P (type)
4277
+ && !SCALAR_FLOAT_MODE_P (elt_mode));
4279
+ /* We used to check for BLKmode instead of the above aggregate type
4280
+ check. Warn when this results in any difference to the ABI. */
4281
+ if (aggregate_p != (mode == BLKmode))
4283
+ static bool warned;
4284
+ if (!warned && warn_psabi)
4287
+ inform (input_location,
4288
+ "the ABI of passing aggregates with %d-byte alignment"
4289
+ " will change in a future GCC release",
4290
+ (int) TYPE_ALIGN (type) / BITS_PER_UNIT);
4294
+ /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
4295
+ keep using the BLKmode check, but warn if there will be differences
4296
+ in future GCC releases. */
4297
+ if (mode == BLKmode)
4301
+ /* Similar for the Darwin64 ABI. Note that for historical reasons we
4302
+ implement the "aggregate type" check as a BLKmode check here; this
4303
+ means certain aggregate types are in fact not aligned. */
4304
+ if (TARGET_MACHO && rs6000_darwin64_abi
4305
+ && mode == BLKmode
4306
+ && type && TYPE_ALIGN (type) > 64)
4309
- return PARM_BOUNDARY;
4311
+ return PARM_BOUNDARY;
4314
/* The offset in words to the start of the parameter save area. */
4315
@@ -10243,6 +10310,7 @@
4318
unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
4321
/* Do we also need to pass this argument in the parameter
4323
@@ -10271,6 +10339,37 @@
4324
rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off);
4327
+ /* If there were not enough FPRs to hold the argument, the rest
4328
+ usually goes into memory. However, if the current position
4329
+ is still within the register parameter area, a portion may
4330
+ actually have to go into GPRs.
4332
+ Note that it may happen that the portion of the argument
4333
+ passed in the first "half" of the first GPR was already
4334
+ passed in the last FPR as well.
4336
+ For unnamed arguments, we already set up GPRs to cover the
4337
+ whole argument in rs6000_psave_function_arg, so there is
4338
+ nothing further to do at this point.
4340
+ GCC 4.8/4.9 Note: This was implemented incorrectly in earlier
4341
+ GCC releases. To avoid any ABI change on the release branch,
4342
+ we retain that original implementation here, but warn if we
4343
+ encounter a case where the ABI will change in the future. */
4344
+ fpr_words = (i * GET_MODE_SIZE (elt_mode)) / (TARGET_32BIT ? 4 : 8);
4345
+ if (i < n_elts && align_words + fpr_words < GP_ARG_NUM_REG
4346
+ && cum->nargs_prototype > 0)
4348
+ static bool warned;
4349
+ if (!warned && warn_psabi)
4352
+ inform (input_location,
4353
+ "the ABI of passing homogeneous float aggregates"
4354
+ " will change in a future GCC release");
4358
return rs6000_finish_function_arg (mode, rvec, k);
4360
else if (align_words < GP_ARG_NUM_REG)
4361
@@ -10497,10 +10596,9 @@
4362
list, or passes any parameter in memory. */
4365
-rs6000_function_parms_need_stack (tree fun)
4366
+rs6000_function_parms_need_stack (tree fun, bool incoming)
4368
- function_args_iterator args_iter;
4370
+ tree fntype, result;
4371
CUMULATIVE_ARGS args_so_far_v;
4372
cumulative_args_t args_so_far;
4374
@@ -10507,26 +10605,57 @@
4376
/* Must be a libcall, all of which only use reg parms. */
4381
- fun = TREE_TYPE (fun);
4382
+ fntype = TREE_TYPE (fun);
4384
/* Varargs functions need the parameter save area. */
4385
- if (!prototype_p (fun) || stdarg_p (fun))
4386
+ if ((!incoming && !prototype_p (fntype)) || stdarg_p (fntype))
4389
- INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fun, NULL_RTX);
4390
+ INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fntype, NULL_RTX);
4391
args_so_far = pack_cumulative_args (&args_so_far_v);
4393
- if (aggregate_value_p (TREE_TYPE (fun), fun))
4394
+ /* When incoming, we will have been passed the function decl.
4395
+ It is necessary to use the decl to handle K&R style functions,
4396
+ where TYPE_ARG_TYPES may not be available. */
4399
- tree type = build_pointer_type (TREE_TYPE (fun));
4400
- rs6000_parm_needs_stack (args_so_far, type);
4401
+ gcc_assert (DECL_P (fun));
4402
+ result = DECL_RESULT (fun);
4405
+ result = TREE_TYPE (fntype);
4407
- FOREACH_FUNCTION_ARGS (fun, arg_type, args_iter)
4408
- if (rs6000_parm_needs_stack (args_so_far, arg_type))
4410
+ if (result && aggregate_value_p (result, fntype))
4412
+ if (!TYPE_P (result))
4413
+ result = TREE_TYPE (result);
4414
+ result = build_pointer_type (result);
4415
+ rs6000_parm_needs_stack (args_so_far, result);
4422
+ for (parm = DECL_ARGUMENTS (fun);
4423
+ parm && parm != void_list_node;
4424
+ parm = TREE_CHAIN (parm))
4425
+ if (rs6000_parm_needs_stack (args_so_far, TREE_TYPE (parm)))
4430
+ function_args_iterator args_iter;
4433
+ FOREACH_FUNCTION_ARGS (fntype, arg_type, args_iter)
4434
+ if (rs6000_parm_needs_stack (args_so_far, arg_type))
4441
@@ -10537,7 +10666,7 @@
4442
all parameters in registers. */
4445
-rs6000_reg_parm_stack_space (tree fun)
4446
+rs6000_reg_parm_stack_space (tree fun, bool incoming)
4448
int reg_parm_stack_space;
4450
@@ -10555,7 +10684,7 @@
4452
/* ??? Recomputing this every time is a bit expensive. Is there
4453
a place to cache this information? */
4454
- if (rs6000_function_parms_need_stack (fun))
4455
+ if (rs6000_function_parms_need_stack (fun, incoming))
4456
reg_parm_stack_space = TARGET_64BIT ? 64 : 32;
4458
reg_parm_stack_space = 0;
4459
@@ -13544,11 +13673,15 @@
4460
else if ((fnmask & (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
4461
== (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
4462
error ("Builtin function %s requires the -mhard-dfp and"
4463
- "-mpower8-vector options", name);
4464
+ " -mpower8-vector options", name);
4465
else if ((fnmask & RS6000_BTM_DFP) != 0)
4466
error ("Builtin function %s requires the -mhard-dfp option", name);
4467
else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
4468
error ("Builtin function %s requires the -mpower8-vector option", name);
4469
+ else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
4470
+ == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
4471
+ error ("Builtin function %s requires the -mhard-float and"
4472
+ " -mlong-double-128 options", name);
4473
else if ((fnmask & RS6000_BTM_HARD_FLOAT) != 0)
4474
error ("Builtin function %s requires the -mhard-float option", name);
4476
@@ -31413,6 +31546,7 @@
4477
{ "htm", RS6000_BTM_HTM, false, false },
4478
{ "hard-dfp", RS6000_BTM_DFP, false, false },
4479
{ "hard-float", RS6000_BTM_HARD_FLOAT, false, false },
4480
+ { "long-double-128", RS6000_BTM_LDBL128, false, false },
4483
/* Option variables that we want to support inside attribute((target)) and
4484
Index: gcc/config/rs6000/vsx.md
4485
===================================================================
4486
--- a/src/gcc/config/rs6000/vsx.md (.../tags/gcc_4_8_3_release)
4487
+++ b/src/gcc/config/rs6000/vsx.md (.../branches/gcc-4_8-branch)
4489
;; Iterator for the 2 64-bit vector types
4490
(define_mode_iterator VSX_D [V2DF V2DI])
4492
+;; Iterator for the 2 64-bit vector types + 128-bit types that are loaded with
4493
+;; lxvd2x to properly handle swapping words on little endian
4494
+(define_mode_iterator VSX_LE [V2DF
4497
+ (TI "VECTOR_MEM_VSX_P (TImode)")])
4499
;; Iterator for the 2 32-bit vector types
4500
(define_mode_iterator VSX_W [V4SF V4SI])
4503
;; The patterns for LE permuted loads and stores come before the general
4504
;; VSX moves so they match first.
4505
(define_insn_and_split "*vsx_le_perm_load_<mode>"
4506
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
4507
- (match_operand:VSX_D 1 "memory_operand" "Z"))]
4508
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
4509
+ (match_operand:VSX_LE 1 "memory_operand" "Z"))]
4510
"!BYTES_BIG_ENDIAN && TARGET_VSX"
4512
"!BYTES_BIG_ENDIAN && TARGET_VSX"
4514
(set_attr "length" "8")])
4516
(define_insn "*vsx_le_perm_store_<mode>"
4517
- [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
4518
- (match_operand:VSX_D 1 "vsx_register_operand" "+wa"))]
4519
+ [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
4520
+ (match_operand:VSX_LE 1 "vsx_register_operand" "+wa"))]
4521
"!BYTES_BIG_ENDIAN && TARGET_VSX"
4523
[(set_attr "type" "vecstore")
4525
(set_attr "length" "12")])
4528
- [(set (match_operand:VSX_D 0 "memory_operand" "")
4529
- (match_operand:VSX_D 1 "vsx_register_operand" ""))]
4530
+ [(set (match_operand:VSX_LE 0 "memory_operand" "")
4531
+ (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
4532
"!BYTES_BIG_ENDIAN && TARGET_VSX && !reload_completed"
4536
;; The post-reload split requires that we re-permute the source
4537
;; register in case it is still live.
4539
- [(set (match_operand:VSX_D 0 "memory_operand" "")
4540
- (match_operand:VSX_D 1 "vsx_register_operand" ""))]
4541
+ [(set (match_operand:VSX_LE 0 "memory_operand" "")
4542
+ (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
4543
"!BYTES_BIG_ENDIAN && TARGET_VSX && reload_completed"
4546
@@ -1352,9 +1359,9 @@
4547
;; xxpermdi for little endian loads and stores. We need several of
4548
;; these since the form of the PARALLEL differs by mode.
4549
(define_insn "*vsx_xxpermdi2_le_<mode>"
4550
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
4552
- (match_operand:VSX_D 1 "vsx_register_operand" "wa")
4553
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
4554
+ (vec_select:VSX_LE
4555
+ (match_operand:VSX_LE 1 "vsx_register_operand" "wa")
4556
(parallel [(const_int 1) (const_int 0)])))]
4557
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
4558
"xxpermdi %x0,%x1,%x1,2"
4559
@@ -1401,9 +1408,9 @@
4560
;; lxvd2x for little endian loads. We need several of
4561
;; these since the form of the PARALLEL differs by mode.
4562
(define_insn "*vsx_lxvd2x2_le_<mode>"
4563
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
4565
- (match_operand:VSX_D 1 "memory_operand" "Z")
4566
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
4567
+ (vec_select:VSX_LE
4568
+ (match_operand:VSX_LE 1 "memory_operand" "Z")
4569
(parallel [(const_int 1) (const_int 0)])))]
4570
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
4572
@@ -1450,9 +1457,9 @@
4573
;; stxvd2x for little endian stores. We need several of
4574
;; these since the form of the PARALLEL differs by mode.
4575
(define_insn "*vsx_stxvd2x2_le_<mode>"
4576
- [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
4578
- (match_operand:VSX_D 1 "vsx_register_operand" "wa")
4579
+ [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
4580
+ (vec_select:VSX_LE
4581
+ (match_operand:VSX_LE 1 "vsx_register_operand" "wa")
4582
(parallel [(const_int 1) (const_int 0)])))]
4583
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
4585
@@ -1606,7 +1613,7 @@
4587
if (GET_CODE (op3) == SCRATCH)
4588
op3 = gen_reg_rtx (V4SFmode);
4589
- emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, op2));
4590
+ emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, GEN_INT (ele)));
4593
emit_insn (gen_vsx_xscvspdp_scalar2 (op0, tmp));
4594
Index: gcc/config/rs6000/rs6000.h
4595
===================================================================
4596
--- a/src/gcc/config/rs6000/rs6000.h (.../tags/gcc_4_8_3_release)
4597
+++ b/src/gcc/config/rs6000/rs6000.h (.../branches/gcc-4_8-branch)
4598
@@ -1593,8 +1593,15 @@
4599
/* Define this if stack space is still allocated for a parameter passed
4600
in a register. The value is the number of bytes allocated to this
4602
-#define REG_PARM_STACK_SPACE(FNDECL) rs6000_reg_parm_stack_space((FNDECL))
4603
+#define REG_PARM_STACK_SPACE(FNDECL) \
4604
+ rs6000_reg_parm_stack_space ((FNDECL), false)
4606
+/* Define this macro if space guaranteed when compiling a function body
4607
+ is different to space required when making a call, a situation that
4608
+ can arise with K&R style function definitions. */
4609
+#define INCOMING_REG_PARM_STACK_SPACE(FNDECL) \
4610
+ rs6000_reg_parm_stack_space ((FNDECL), true)
4612
/* Define this if the above stack space is to be considered part of the
4613
space allocated by the caller. */
4614
#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
4615
@@ -2483,8 +2490,8 @@
4616
#define RS6000_BTC_SAT RS6000_BTC_MISC /* saturate sets VSCR. */
4618
/* Builtin targets. For now, we reuse the masks for those options that are in
4619
- target flags, and pick two random bits for SPE and paired which aren't in
4621
+ target flags, and pick three random bits for SPE, paired and ldbl128 which
4622
+ aren't in target_flags. */
4623
#define RS6000_BTM_ALWAYS 0 /* Always enabled. */
4624
#define RS6000_BTM_ALTIVEC MASK_ALTIVEC /* VMX/altivec vectors. */
4625
#define RS6000_BTM_VSX MASK_VSX /* VSX (vector/scalar). */
4626
@@ -2501,6 +2508,7 @@
4627
#define RS6000_BTM_CELL MASK_FPRND /* Target is cell powerpc. */
4628
#define RS6000_BTM_DFP MASK_DFP /* Decimal floating point. */
4629
#define RS6000_BTM_HARD_FLOAT MASK_SOFT_FLOAT /* Hardware floating point. */
4630
+#define RS6000_BTM_LDBL128 MASK_MULTIPLE /* 128-bit long double. */
4632
#define RS6000_BTM_COMMON (RS6000_BTM_ALTIVEC \
4634
@@ -2514,7 +2522,8 @@
4635
| RS6000_BTM_POPCNTD \
4638
- | RS6000_BTM_HARD_FLOAT)
4639
+ | RS6000_BTM_HARD_FLOAT \
4640
+ | RS6000_BTM_LDBL128)
4642
/* Define builtin enum index. */
4644
Index: gcc/config/rs6000/rs6000.md
4645
===================================================================
4646
--- a/src/gcc/config/rs6000/rs6000.md (.../tags/gcc_4_8_3_release)
4647
+++ b/src/gcc/config/rs6000/rs6000.md (.../branches/gcc-4_8-branch)
4650
(define_insn "*extendsidi2_lfiwax"
4651
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
4652
- (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
4653
+ (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
4654
"TARGET_POWERPC64 && TARGET_LFIWAX"
4659
(define_insn "*extendsidi2_nocell"
4660
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
4661
- (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
4662
+ (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r")))]
4663
"TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
4666
@@ -15847,26 +15847,6 @@
4670
-;; The Advance Toolchain 7.0-3 added private builtins: __builtin_longdouble_dw0
4671
-;; and __builtin_longdouble_dw1 to optimize glibc. Add support for these
4674
-(define_expand "unpacktf_0"
4675
- [(set (match_operand:DF 0 "nonimmediate_operand" "")
4676
- (unspec:DF [(match_operand:TF 1 "register_operand" "")
4678
- UNSPEC_UNPACK_128BIT))]
4682
-(define_expand "unpacktf_1"
4683
- [(set (match_operand:DF 0 "nonimmediate_operand" "")
4684
- (unspec:DF [(match_operand:TF 1 "register_operand" "")
4686
- UNSPEC_UNPACK_128BIT))]
4690
(define_insn_and_split "unpack<mode>_dm"
4691
[(set (match_operand:<FP128_64> 0 "nonimmediate_operand" "=d,m,d,r,m")
4693
Index: gcc/config/rs6000/sysv4.h
4694
===================================================================
4695
--- a/src/gcc/config/rs6000/sysv4.h (.../tags/gcc_4_8_3_release)
4696
+++ b/src/gcc/config/rs6000/sysv4.h (.../branches/gcc-4_8-branch)
4698
/* An expression for the alignment of a structure field FIELD if the
4699
alignment computed in the usual way is COMPUTED. */
4700
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
4701
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
4702
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
4705
#undef BIGGEST_FIELD_ALIGNMENT
4706
@@ -949,3 +949,27 @@
4707
#define TARGET_USES_SYSV4_OPT 1
4709
#undef DBX_REGISTER_NUMBER
4711
+/* Link -lasan early on the command line. For -static-libasan, don't link
4712
+ it for -shared link, the executable should be compiled with -static-libasan
4713
+ in that case, and for executable link link with --{,no-}whole-archive around
4714
+ it to force everything into the executable. And similarly for -ltsan. */
4715
+#if defined(HAVE_LD_STATIC_DYNAMIC)
4716
+#undef LIBASAN_EARLY_SPEC
4717
+#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
4718
+ "%{static-libasan:%{!shared:" \
4719
+ LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
4720
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
4721
+#undef LIBTSAN_EARLY_SPEC
4722
+#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
4723
+ LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
4724
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
4727
+/* Additional libraries needed by -static-libasan. */
4728
+#undef STATIC_LIBASAN_LIBS
4729
+#define STATIC_LIBASAN_LIBS "-ldl -lpthread"
4731
+/* Additional libraries needed by -static-libtsan. */
4732
+#undef STATIC_LIBTSAN_LIBS
4733
+#define STATIC_LIBTSAN_LIBS "-ldl -lpthread"
4734
Index: gcc/config/arm/arm.c
4735
===================================================================
4736
--- a/src/gcc/config/arm/arm.c (.../tags/gcc_4_8_3_release)
4737
+++ b/src/gcc/config/arm/arm.c (.../branches/gcc-4_8-branch)
4738
@@ -24476,9 +24476,13 @@
4739
fputs (":\n", file);
4742
- /* Output ".word .LTHUNKn-7-.LTHUNKPCn". */
4743
+ /* Output ".word .LTHUNKn-[3,7]-.LTHUNKPCn". */
4744
rtx tem = XEXP (DECL_RTL (function), 0);
4745
- tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
4746
+ /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC
4747
+ pipeline offset is four rather than eight. Adjust the offset
4749
+ tem = plus_constant (GET_MODE (tem), tem,
4750
+ TARGET_THUMB1_ONLY ? -3 : -7);
4751
tem = gen_rtx_MINUS (GET_MODE (tem),
4753
gen_rtx_SYMBOL_REF (Pmode,
4754
Index: gcc/config/arm/arm.md
4755
===================================================================
4756
--- a/src/gcc/config/arm/arm.md (.../tags/gcc_4_8_3_release)
4757
+++ b/src/gcc/config/arm/arm.md (.../branches/gcc-4_8-branch)
4758
@@ -7630,12 +7630,13 @@
4760
(define_insn "*arm_cmpdi_unsigned"
4761
[(set (reg:CC_CZ CC_REGNUM)
4762
- (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
4763
- (match_operand:DI 1 "arm_di_operand" "rDi")))]
4764
+ (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r,r")
4765
+ (match_operand:DI 1 "arm_di_operand" "rDi,rDi")))]
4767
"cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
4768
[(set_attr "conds" "set")
4769
- (set_attr "length" "8")]
4770
+ (set_attr "arch" "a,t2")
4771
+ (set_attr "length" "8,10")]
4774
(define_insn "*arm_cmpdi_zero"
4775
Index: gcc/config/arm/t-rtems-eabi
4776
===================================================================
4777
--- a/src/gcc/config/arm/t-rtems-eabi (.../tags/gcc_4_8_3_release)
4778
+++ b/src/gcc/config/arm/t-rtems-eabi (.../branches/gcc-4_8-branch)
4780
# Custom RTEMS EABI multilibs
4782
-MULTILIB_OPTIONS = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard
4783
-MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard
4784
+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
4785
+MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard
4787
# Enumeration of multilibs
4789
MULTILIB_EXCEPTIONS =
4790
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
4791
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon
4792
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
4793
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16
4794
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
4795
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16
4796
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard
4797
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m
4798
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
4799
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon
4800
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
4801
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16
4802
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
4803
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16
4804
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard
4805
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a
4806
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
4807
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon
4808
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
4809
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16
4810
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
4811
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16
4812
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard
4813
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r
4814
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
4815
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon
4816
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
4817
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16
4818
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
4819
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16
4820
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard
4821
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m
4822
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard
4823
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon
4824
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
4825
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16
4826
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
4827
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16
4828
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard
4829
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb
4830
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard
4831
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon
4832
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
4833
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16
4834
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
4835
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16
4836
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard
4837
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m
4838
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard
4839
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon
4840
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
4841
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16
4842
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
4843
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16
4844
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfloat-abi=hard
4845
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a
4846
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon/mfloat-abi=hard
4847
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon
4848
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
4849
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16
4850
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
4851
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16
4852
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfloat-abi=hard
4853
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r
4854
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon/mfloat-abi=hard
4855
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon
4856
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
4857
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16
4858
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
4859
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16
4860
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfloat-abi=hard
4861
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m
4862
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon/mfloat-abi=hard
4863
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon
4864
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16/mfloat-abi=hard
4865
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16
4866
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16/mfloat-abi=hard
4867
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16
4868
+MULTILIB_EXCEPTIONS += mbig-endian/mfloat-abi=hard
4869
+MULTILIB_EXCEPTIONS += mbig-endian
4870
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
4871
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon
4872
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
4873
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16
4874
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
4875
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16
4876
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfloat-abi=hard
4877
# MULTILIB_EXCEPTIONS += mthumb/march=armv6-m
4878
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
4879
MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon
4880
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
4881
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16
4882
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
4883
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16
4884
MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfloat-abi=hard
4885
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-a
4886
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
4887
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon
4888
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
4889
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16
4890
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
4891
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16
4892
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfloat-abi=hard
4893
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r
4894
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
4895
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon
4896
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
4897
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16
4898
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
4899
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16
4900
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfloat-abi=hard
4901
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m
4902
MULTILIB_EXCEPTIONS += mthumb/mfpu=neon/mfloat-abi=hard
4903
MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
4904
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
4905
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16
4906
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
4907
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16
4908
MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard
4909
# MULTILIB_EXCEPTIONS += mthumb
4910
MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon/mfloat-abi=hard
4911
MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon
4912
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
4913
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16
4914
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
4915
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16
4916
MULTILIB_EXCEPTIONS += march=armv6-m/mfloat-abi=hard
4917
MULTILIB_EXCEPTIONS += march=armv6-m
4918
MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon/mfloat-abi=hard
4919
MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon
4920
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
4921
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16
4922
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
4923
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16
4924
MULTILIB_EXCEPTIONS += march=armv7-a/mfloat-abi=hard
4925
MULTILIB_EXCEPTIONS += march=armv7-a
4926
MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon/mfloat-abi=hard
4927
MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon
4928
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
4929
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16
4930
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
4931
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16
4932
MULTILIB_EXCEPTIONS += march=armv7-r/mfloat-abi=hard
4933
MULTILIB_EXCEPTIONS += march=armv7-r
4934
MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon/mfloat-abi=hard
4935
MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon
4936
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
4937
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16
4938
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
4939
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16
4940
MULTILIB_EXCEPTIONS += march=armv7-m/mfloat-abi=hard
4941
MULTILIB_EXCEPTIONS += march=armv7-m
4942
MULTILIB_EXCEPTIONS += mfpu=neon/mfloat-abi=hard
4943
MULTILIB_EXCEPTIONS += mfpu=neon
4944
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16/mfloat-abi=hard
4945
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16
4946
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16/mfloat-abi=hard
4947
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16
4948
MULTILIB_EXCEPTIONS += mfloat-abi=hard
4949
Index: libobjc/encoding.c
4950
===================================================================
4951
--- a/src/libobjc/encoding.c (.../tags/gcc_4_8_3_release)
4952
+++ b/src/libobjc/encoding.c (.../branches/gcc-4_8-branch)
4954
? MAX (MAX (COMPUTED, SPECIFIED), 64) \
4955
: MAX (COMPUTED, SPECIFIED));})
4957
+#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
4958
+ (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
4960
/* Skip a variable name, enclosed in quotes ("). */
4962
Index: libobjc/ChangeLog
4963
===================================================================
4964
--- a/src/libobjc/ChangeLog (.../tags/gcc_4_8_3_release)
4965
+++ b/src/libobjc/ChangeLog (.../branches/gcc-4_8-branch)
4967
+2014-07-27 Ulrich Weigand <uweigand@de.ibm.com>
4970
+ * encoding.c (rs6000_special_adjust_field_align_p): Use definition
4971
+ that matches the 4.8 branch ABI.
4973
+2014-07-27 Alan Modra <amodra@gmail.com>
4974
+ Matthias Klose <doko@ubuntu.com>
4978
+ * encoding.c: Define rs6000_special_adjust_field_align_p.
4980
2014-05-22 Release Manager
4982
* GCC 4.8.3 released.
4983
Index: libgfortran/m4/in_pack.m4
4984
===================================================================
4985
--- a/src/libgfortran/m4/in_pack.m4 (.../tags/gcc_4_8_3_release)
4986
+++ b/src/libgfortran/m4/in_pack.m4 (.../branches/gcc-4_8-branch)
4988
return source->base_addr;
4990
/* Allocate storage for the destination. */
4991
- destptr = ('rtype_name` *)xmalloc (ssize * sizeof ('rtype_name`));
4992
+ destptr = xmallocarray (ssize, sizeof ('rtype_name`));
4994
src = source->base_addr;
4995
stride0 = stride[0];
4996
Index: libgfortran/m4/pack.m4
4997
===================================================================
4998
--- a/src/libgfortran/m4/pack.m4 (.../tags/gcc_4_8_3_release)
4999
+++ b/src/libgfortran/m4/pack.m4 (.../branches/gcc-4_8-branch)
5004
- /* xmalloc allocates a single byte for zero size. */
5005
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * total);
5006
+ /* xmallocarray allocates a single byte for zero size. */
5007
+ ret->base_addr = xmallocarray (total, sizeof ('rtype_name`));
5011
Index: libgfortran/m4/spread.m4
5012
===================================================================
5013
--- a/src/libgfortran/m4/spread.m4 (.../tags/gcc_4_8_3_release)
5014
+++ b/src/libgfortran/m4/spread.m4 (.../branches/gcc-4_8-branch)
5019
- /* xmalloc allocates a single byte for zero size. */
5020
- ret->base_addr = xmalloc (rs * sizeof('rtype_name`));
5021
+ /* xmallocarray allocates a single byte for zero size. */
5022
+ ret->base_addr = xmallocarray (rs, sizeof('rtype_name`));
5028
if (ret->base_addr == NULL)
5030
- ret->base_addr = xmalloc (ncopies * sizeof ('rtype_name`));
5031
+ ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`));
5033
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
5035
Index: libgfortran/m4/transpose.m4
5036
===================================================================
5037
--- a/src/libgfortran/m4/transpose.m4 (.../tags/gcc_4_8_3_release)
5038
+++ b/src/libgfortran/m4/transpose.m4 (.../branches/gcc-4_8-branch)
5040
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
5041
GFC_DESCRIPTOR_EXTENT(source, 1));
5043
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) ret));
5044
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
5045
+ sizeof ('rtype_name`));
5047
} else if (unlikely (compile_options.bounds_check))
5049
Index: libgfortran/m4/iforeach.m4
5050
===================================================================
5051
--- a/src/libgfortran/m4/iforeach.m4 (.../tags/gcc_4_8_3_release)
5052
+++ b/src/libgfortran/m4/iforeach.m4 (.../branches/gcc-4_8-branch)
5054
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
5055
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
5056
retarray->offset = 0;
5057
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
5058
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
5063
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
5064
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
5065
retarray->offset = 0;
5066
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
5067
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
5072
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
5073
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
5074
retarray->offset = 0;
5075
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
5076
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
5078
else if (unlikely (compile_options.bounds_check))
5080
Index: libgfortran/m4/eoshift1.m4
5081
===================================================================
5082
--- a/src/libgfortran/m4/eoshift1.m4 (.../tags/gcc_4_8_3_release)
5083
+++ b/src/libgfortran/m4/eoshift1.m4 (.../branches/gcc-4_8-branch)
5085
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
5088
- /* xmalloc allocates a single byte for zero size. */
5089
- ret->base_addr = xmalloc (size * arraysize);
5090
+ /* xmallocarray allocates a single byte for zero size. */
5091
+ ret->base_addr = xmallocarray (arraysize, size);
5094
else if (unlikely (compile_options.bounds_check))
5095
Index: libgfortran/m4/eoshift3.m4
5096
===================================================================
5097
--- a/src/libgfortran/m4/eoshift3.m4 (.../tags/gcc_4_8_3_release)
5098
+++ b/src/libgfortran/m4/eoshift3.m4 (.../branches/gcc-4_8-branch)
5103
- ret->base_addr = xmalloc (size * arraysize);
5104
+ ret->base_addr = xmallocarray (arraysize, size);
5106
ret->dtype = array->dtype;
5107
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
5109
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
5112
- /* xmalloc allocates a single byte for zero size. */
5113
- ret->base_addr = xmalloc (size * arraysize);
5114
+ /* xmallocarray allocates a single byte for zero size. */
5115
+ ret->base_addr = xmallocarray (arraysize, size);
5118
else if (unlikely (compile_options.bounds_check))
5119
Index: libgfortran/m4/shape.m4
5120
===================================================================
5121
--- a/src/libgfortran/m4/shape.m4 (.../tags/gcc_4_8_3_release)
5122
+++ b/src/libgfortran/m4/shape.m4 (.../branches/gcc-4_8-branch)
5125
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
5127
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * rank);
5128
+ ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`));
5131
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
5132
Index: libgfortran/m4/cshift1.m4
5133
===================================================================
5134
--- a/src/libgfortran/m4/cshift1.m4 (.../tags/gcc_4_8_3_release)
5135
+++ b/src/libgfortran/m4/cshift1.m4 (.../branches/gcc-4_8-branch)
5140
- ret->base_addr = xmalloc (size * arraysize);
5141
+ ret->base_addr = xmallocarray (arraysize, size);
5143
ret->dtype = array->dtype;
5144
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
5145
Index: libgfortran/m4/matmull.m4
5146
===================================================================
5147
--- a/src/libgfortran/m4/matmull.m4 (.../tags/gcc_4_8_3_release)
5148
+++ b/src/libgfortran/m4/matmull.m4 (.../branches/gcc-4_8-branch)
5153
- = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
5154
+ = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
5155
retarray->offset = 0;
5157
else if (unlikely (compile_options.bounds_check))
5158
Index: libgfortran/m4/bessel.m4
5159
===================================================================
5160
--- a/src/libgfortran/m4/bessel.m4 (.../tags/gcc_4_8_3_release)
5161
+++ b/src/libgfortran/m4/bessel.m4 (.../branches/gcc-4_8-branch)
5164
size_t size = n2 < n1 ? 0 : n2-n1+1;
5165
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
5166
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
5167
+ ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
5173
size_t size = n2 < n1 ? 0 : n2-n1+1;
5174
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
5175
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
5176
+ ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
5180
Index: libgfortran/m4/unpack.m4
5181
===================================================================
5182
--- a/src/libgfortran/m4/unpack.m4 (.../tags/gcc_4_8_3_release)
5183
+++ b/src/libgfortran/m4/unpack.m4 (.../branches/gcc-4_8-branch)
5188
- ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
5189
+ ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
5197
- ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
5198
+ ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
5202
Index: libgfortran/m4/reshape.m4
5203
===================================================================
5204
--- a/src/libgfortran/m4/reshape.m4 (.../tags/gcc_4_8_3_release)
5205
+++ b/src/libgfortran/m4/reshape.m4 (.../branches/gcc-4_8-branch)
5206
@@ -115,11 +115,11 @@
5209
if (unlikely (rs < 1))
5213
- alloc_size = rs * sizeof ('rtype_name`);
5216
- ret->base_addr = xmalloc (alloc_size);
5217
+ ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`));
5218
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
5221
Index: libgfortran/m4/ifunction_logical.m4
5222
===================================================================
5223
--- a/src/libgfortran/m4/ifunction_logical.m4 (.../tags/gcc_4_8_3_release)
5224
+++ b/src/libgfortran/m4/ifunction_logical.m4 (.../branches/gcc-4_8-branch)
5226
retarray->offset = 0;
5227
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5229
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5231
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5233
if (alloc_size == 0)
5239
- retarray->base_addr = xmalloc (alloc_size);
5240
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
5244
Index: libgfortran/m4/ifunction.m4
5245
===================================================================
5246
--- a/src/libgfortran/m4/ifunction.m4 (.../tags/gcc_4_8_3_release)
5247
+++ b/src/libgfortran/m4/ifunction.m4 (.../branches/gcc-4_8-branch)
5249
retarray->offset = 0;
5250
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5252
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5254
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5256
- retarray->base_addr = xmalloc (alloc_size);
5257
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
5258
if (alloc_size == 0)
5260
/* Make sure we have a zero-sized array. */
5265
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5267
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5269
retarray->offset = 0;
5270
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5275
- retarray->base_addr = xmalloc (alloc_size);
5276
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
5281
retarray->offset = 0;
5282
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5284
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5286
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5288
if (alloc_size == 0)
5294
- retarray->base_addr = xmalloc (alloc_size);
5295
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
5299
Index: libgfortran/m4/matmul.m4
5300
===================================================================
5301
--- a/src/libgfortran/m4/matmul.m4 (.../tags/gcc_4_8_3_release)
5302
+++ b/src/libgfortran/m4/matmul.m4 (.../branches/gcc-4_8-branch)
5307
- = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
5308
+ = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
5309
retarray->offset = 0;
5311
else if (unlikely (compile_options.bounds_check))
5312
Index: libgfortran/runtime/in_pack_generic.c
5313
===================================================================
5314
--- a/src/libgfortran/runtime/in_pack_generic.c (.../tags/gcc_4_8_3_release)
5315
+++ b/src/libgfortran/runtime/in_pack_generic.c (.../branches/gcc-4_8-branch)
5317
return source->base_addr;
5319
/* Allocate storage for the destination. */
5320
- destptr = xmalloc (ssize * size);
5321
+ destptr = xmallocarray (ssize, size);
5322
dest = (char *)destptr;
5323
src = source->base_addr;
5324
stride0 = stride[0] * size;
5325
Index: libgfortran/runtime/memory.c
5326
===================================================================
5327
--- a/src/libgfortran/runtime/memory.c (.../tags/gcc_4_8_3_release)
5328
+++ b/src/libgfortran/runtime/memory.c (.../branches/gcc-4_8-branch)
5331
#include "libgfortran.h"
5336
+#define SIZE_MAX ((size_t)-1)
5348
+xmallocarray (size_t nmemb, size_t size)
5352
+ if (!nmemb || !size)
5354
+ else if (nmemb > SIZE_MAX / size)
5357
+ os_error ("Integer overflow in xmallocarray");
5360
+ p = malloc (nmemb * size);
5363
+ os_error ("Memory allocation failed in xmallocarray");
5369
/* calloc wrapper that aborts on error. */
5372
xcalloc (size_t nmemb, size_t size)
5374
- if (nmemb * size == 0)
5375
+ if (!nmemb || !size)
5378
void *p = calloc (nmemb, size);
5379
Index: libgfortran/runtime/convert_char.c
5380
===================================================================
5381
--- a/src/libgfortran/runtime/convert_char.c (.../tags/gcc_4_8_3_release)
5382
+++ b/src/libgfortran/runtime/convert_char.c (.../branches/gcc-4_8-branch)
5384
gfc_charlen_type i, l;
5386
l = len > 0 ? len : 0;
5387
- *dst = xmalloc ((l + 1) * sizeof (gfc_char4_t));
5388
+ *dst = xmallocarray ((l + 1), sizeof (gfc_char4_t));
5390
for (i = 0; i < l; i++)
5393
gfc_charlen_type i, l;
5395
l = len > 0 ? len : 0;
5396
- *dst = xmalloc ((l + 1) * sizeof (unsigned char));
5397
+ *dst = xmalloc (l + 1);
5399
for (i = 0; i < l; i++)
5401
Index: libgfortran/runtime/environ.c
5402
===================================================================
5403
--- a/src/libgfortran/runtime/environ.c (.../tags/gcc_4_8_3_release)
5404
+++ b/src/libgfortran/runtime/environ.c (.../branches/gcc-4_8-branch)
5409
- elist = xmalloc (unit_count * sizeof (exception_t));
5410
+ elist = xmallocarray (unit_count, sizeof (exception_t));
5414
Index: libgfortran/intrinsics/string_intrinsics_inc.c
5415
===================================================================
5416
--- a/src/libgfortran/intrinsics/string_intrinsics_inc.c (.../tags/gcc_4_8_3_release)
5417
+++ b/src/libgfortran/intrinsics/string_intrinsics_inc.c (.../branches/gcc-4_8-branch)
5421
/* Allocate space for result string. */
5422
- *dest = xmalloc (*len * sizeof (CHARTYPE));
5423
+ *dest = xmallocarray (*len, sizeof (CHARTYPE));
5425
/* Copy string if necessary. */
5426
memcpy (*dest, src, *len * sizeof (CHARTYPE));
5428
*dest = &zero_length_string;
5431
- CHARTYPE *tmp = xmalloc (*rlen * sizeof (CHARTYPE));
5432
+ CHARTYPE *tmp = xmallocarray (*rlen, sizeof (CHARTYPE));
5433
memcpy (tmp, res, reslen * sizeof (CHARTYPE));
5434
MEMSET (&tmp[reslen], ' ', *rlen - reslen);
5436
Index: libgfortran/intrinsics/pack_generic.c
5437
===================================================================
5438
--- a/src/libgfortran/intrinsics/pack_generic.c (.../tags/gcc_4_8_3_release)
5439
+++ b/src/libgfortran/intrinsics/pack_generic.c (.../branches/gcc-4_8-branch)
5441
GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
5444
- /* xmalloc allocates a single byte for zero size. */
5445
- ret->base_addr = xmalloc (size * total);
5446
+ /* xmallocarray allocates a single byte for zero size. */
5447
+ ret->base_addr = xmallocarray (total, size);
5450
return; /* In this case, nothing remains to be done. */
5455
- ret->base_addr = xmalloc (size * total);
5456
+ ret->base_addr = xmallocarray (total, size);
5460
Index: libgfortran/intrinsics/transpose_generic.c
5461
===================================================================
5462
--- a/src/libgfortran/intrinsics/transpose_generic.c (.../tags/gcc_4_8_3_release)
5463
+++ b/src/libgfortran/intrinsics/transpose_generic.c (.../branches/gcc-4_8-branch)
5465
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
5466
GFC_DESCRIPTOR_EXTENT(source, 1));
5468
- ret->base_addr = xmalloc (size * size0 ((array_t*)ret));
5469
+ ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
5472
else if (unlikely (compile_options.bounds_check))
5473
Index: libgfortran/intrinsics/cshift0.c
5474
===================================================================
5475
--- a/src/libgfortran/intrinsics/cshift0.c (.../tags/gcc_4_8_3_release)
5476
+++ b/src/libgfortran/intrinsics/cshift0.c (.../branches/gcc-4_8-branch)
5478
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
5481
- /* xmalloc allocates a single byte for zero size. */
5482
- ret->base_addr = xmalloc (size * arraysize);
5483
+ /* xmallocarray allocates a single byte for zero size. */
5484
+ ret->base_addr = xmallocarray (arraysize, size);
5486
else if (unlikely (compile_options.bounds_check))
5488
Index: libgfortran/intrinsics/ctime.c
5489
===================================================================
5490
--- a/src/libgfortran/intrinsics/ctime.c (.../tags/gcc_4_8_3_release)
5491
+++ b/src/libgfortran/intrinsics/ctime.c (.../branches/gcc-4_8-branch)
5496
-/* strftime-like function that fills a C string with %c format which
5497
- is identical to ctime in the default locale. As ctime and ctime_r
5498
- are poorly specified and their usage not recommended, the
5499
- implementation instead uses strftime. */
5500
+/* Maximum space a ctime-like string might need. A "normal" ctime
5501
+ string is 26 bytes, and in our case 24 bytes as we don't include
5502
+ the trailing newline and null. However, the longest possible year
5503
+ number is -2,147,481,748 (1900 - 2,147,483,648, since tm_year is a
5504
+ 32-bit signed integer) so an extra 7 bytes are needed. */
5505
+#define CTIME_BUFSZ 31
5508
-strctime (char *s, size_t max, const time_t *timep)
5510
+/* Thread-safe ctime-like function that fills a Fortran
5511
+ string. ctime_r is a portability headache and marked as obsolescent
5512
+ in POSIX 2008, which recommends strftime in its place. However,
5513
+ strftime(..., "%c",...) doesn't produce ctime-like output on
5514
+ MinGW, so do it manually with snprintf. */
5517
+gf_ctime (char *s, size_t max, const time_t timev)
5521
+ char buf[CTIME_BUFSZ + 1];
5522
/* Some targets provide a localtime_r based on a draft of the POSIX
5523
standard where the return type is int rather than the
5524
standardized struct tm*. */
5525
- __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, <m))
5526
+ __builtin_choose_expr (__builtin_classify_type (localtime_r (&timev, <m))
5528
- failed = localtime_r (timep, <m) == NULL,
5529
- failed = localtime_r (timep, <m) != 0);
5530
+ failed = localtime_r (&timev, <m) == NULL,
5531
+ failed = localtime_r (&timev, <m) != 0);
5534
- return strftime (s, max, "%c", <m);
5536
+ int n = snprintf (buf, sizeof (buf),
5537
+ "%3.3s %3.3s%3d %.2d:%.2d:%.2d %d",
5538
+ "SunMonTueWedThuFriSat" + ltm.tm_wday * 3,
5539
+ "JanFebMarAprMayJunJulAugSepOctNovDec" + ltm.tm_mon * 3,
5540
+ ltm.tm_mday, ltm.tm_hour, ltm.tm_min, ltm.tm_sec,
5541
+ 1900 + ltm.tm_year);
5544
+ if ((size_t) n <= max)
5546
+ cf_strcpy (s, max, buf);
5550
+ memset (s, ' ', max);
5554
-/* In the default locale, the date and time representation fits in 26
5555
- bytes. However, other locales might need more space. */
5558
extern void fdate (char **, gfc_charlen_type *);
5559
export_proto(fdate);
5561
fdate (char ** date, gfc_charlen_type * date_len)
5563
time_t now = time(NULL);
5564
- *date = xmalloc (CSZ);
5565
- *date_len = strctime (*date, CSZ, &now);
5566
+ *date = xmalloc (CTIME_BUFSZ);
5567
+ *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
5572
fdate_sub (char * date, gfc_charlen_type date_len)
5574
time_t now = time(NULL);
5575
- char *s = xmalloc (date_len + 1);
5576
- size_t n = strctime (s, date_len + 1, &now);
5577
- fstrcpy (date, date_len, s, n);
5579
+ gf_ctime (date, date_len, now);
5584
PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t)
5587
- *date = xmalloc (CSZ);
5588
- *date_len = strctime (*date, CSZ, &now);
5589
+ *date = xmalloc (CTIME_BUFSZ);
5590
+ *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
5595
ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len)
5598
- char *s = xmalloc (date_len + 1);
5599
- size_t n = strctime (s, date_len + 1, &now);
5600
- fstrcpy (date, date_len, s, n);
5602
+ gf_ctime (date, date_len, now);
5604
Index: libgfortran/intrinsics/spread_generic.c
5605
===================================================================
5606
--- a/src/libgfortran/intrinsics/spread_generic.c (.../tags/gcc_4_8_3_release)
5607
+++ b/src/libgfortran/intrinsics/spread_generic.c (.../branches/gcc-4_8-branch)
5609
GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
5612
- ret->base_addr = xmalloc (rs * size);
5613
+ ret->base_addr = xmallocarray (rs, size);
5619
if (ret->base_addr == NULL)
5621
- ret->base_addr = xmalloc (ncopies * size);
5622
+ ret->base_addr = xmallocarray (ncopies, size);
5624
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
5626
Index: libgfortran/intrinsics/unpack_generic.c
5627
===================================================================
5628
--- a/src/libgfortran/intrinsics/unpack_generic.c (.../tags/gcc_4_8_3_release)
5629
+++ b/src/libgfortran/intrinsics/unpack_generic.c (.../branches/gcc-4_8-branch)
5634
- ret->base_addr = xmalloc (rs * size);
5635
+ ret->base_addr = xmallocarray (rs, size);
5639
Index: libgfortran/intrinsics/eoshift0.c
5640
===================================================================
5641
--- a/src/libgfortran/intrinsics/eoshift0.c (.../tags/gcc_4_8_3_release)
5642
+++ b/src/libgfortran/intrinsics/eoshift0.c (.../branches/gcc-4_8-branch)
5647
- /* xmalloc allocates a single byte for zero size. */
5648
- ret->base_addr = xmalloc (size * arraysize);
5649
+ /* xmallocarray allocates a single byte for zero size. */
5650
+ ret->base_addr = xmallocarray (arraysize, size);
5652
else if (unlikely (compile_options.bounds_check))
5654
Index: libgfortran/intrinsics/eoshift2.c
5655
===================================================================
5656
--- a/src/libgfortran/intrinsics/eoshift2.c (.../tags/gcc_4_8_3_release)
5657
+++ b/src/libgfortran/intrinsics/eoshift2.c (.../branches/gcc-4_8-branch)
5660
ret->dtype = array->dtype;
5662
- /* xmalloc allocates a single byte for zero size. */
5663
- ret->base_addr = xmalloc (size * arraysize);
5664
+ /* xmallocarray allocates a single byte for zero size. */
5665
+ ret->base_addr = xmallocarray (arraysize, size);
5667
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
5669
Index: libgfortran/intrinsics/reshape_generic.c
5670
===================================================================
5671
--- a/src/libgfortran/intrinsics/reshape_generic.c (.../tags/gcc_4_8_3_release)
5672
+++ b/src/libgfortran/intrinsics/reshape_generic.c (.../branches/gcc-4_8-branch)
5676
if (unlikely (rs < 1))
5678
+ alloc_size = 0; /* xmalloc will allocate 1 byte. */
5680
- alloc_size = rs * size;
5683
- ret->base_addr = xmalloc (alloc_size);
5684
+ ret->base_addr = xmallocarray (alloc_size, size);
5686
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
5688
Index: libgfortran/ChangeLog
5689
===================================================================
5690
--- a/src/libgfortran/ChangeLog (.../tags/gcc_4_8_3_release)
5691
+++ b/src/libgfortran/ChangeLog (.../branches/gcc-4_8-branch)
5693
+2014-07-31 Janne Blomqvist <jb@gcc.gnu.org>
5695
+ Backport from mainline
5697
+ * libgfortran.h (xmallocarray): New prototype.
5698
+ * runtime/memory.c (xmallocarray): New function.
5699
+ (xcalloc): Check for nonzero separately instead of multiplying.
5700
+ * generated/*.c: Regenerated.
5701
+ * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of
5703
+ * intrinsics/eoshift0.c (eoshift0): Likewise.
5704
+ * intrinsics/eoshift2.c (eoshift2): Likewise.
5705
+ * intrinsics/pack_generic.c (pack_internal): Likewise.
5706
+ (pack_s_internal): Likewise.
5707
+ * intrinsics/reshape_generic.c (reshape_internal): Likewise.
5708
+ * intrinsics/spread_generic.c (spread_internal): Likewise.
5709
+ (spread_internal_scalar): Likewise.
5710
+ * intrinsics/string_intrinsics_inc.c (string_trim): Likewise.
5711
+ (string_minmax): Likewise.
5712
+ * intrinsics/transpose_generic.c (transpose_internal): Likewise.
5713
+ * intrinsics/unpack_generic.c (unpack_internal): Likewise.
5714
+ * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value.
5715
+ * io/transfer.c (st_set_nml_var): Call xmallocarray instead of
5717
+ * io/unit.c (get_internal_unit): Likewise.
5718
+ (filename_from_unit): Don't cast xmalloc return value.
5719
+ * io/write.c (nml_write_obj): Likewise, formatting.
5720
+ * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray
5721
+ instead of xmalloc.
5722
+ (besse_yn_r'rtype_kind`): Likewise.
5723
+ * m4/cshift1.m4 (cshift1): Likewise.
5724
+ * m4/eoshift1.m4 (eoshift1): Likewise.
5725
+ * m4/eoshift3.m4 (eoshift3): Likewise.
5726
+ * m4/iforeach.m4: Likewise.
5727
+ * m4/ifunction.m4: Likewise.
5728
+ * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
5730
+ * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise.
5731
+ * m4/matmul.m4 (matmul_'rtype_code`): Likewise.
5732
+ * m4/matmull.m4 (matmul_'rtype_code`): Likewise.
5733
+ * m4/pack.m4 (pack_'rtype_code`): Likewise.
5734
+ * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise.
5735
+ * m4/shape.m4 (shape_'rtype_kind`): Likewise.
5736
+ * m4/spread.m4 (spread_'rtype_code`): Likewise.
5737
+ (spread_scalar_'rtype_code`): Likewise.
5738
+ * m4/transpose.m4 (transpose_'rtype_code`): Likewise.
5739
+ * m4/unpack.m4 (unpack0_'rtype_code`): Likewise.
5740
+ (unpack1_'rtype_code`): Likewise.
5741
+ * runtime/convert_char.c (convert_char1_to_char4): Likewise.
5742
+ (convert_char4_to_char1): Simplify.
5743
+ * runtime/environ.c (init_unformatted): Call xmallocarray instead
5745
+ * runtime/in_pack_generic.c (internal_pack): Likewise.
5747
+2014-05-26 Janne Blomqvist <jb@gcc.gnu.org>
5749
+ Backport from mainline
5750
+ PR libfortran/61310
5751
+ * intrinsics/ctime.c (strctime): Rename to gf_ctime, use snprintf
5752
+ instead of strftime.
5753
+ (fdate): Use gf_ctime.
5754
+ (fdate_sub): Likewise.
5755
+ (ctime): Likewise.
5756
+ (ctime_sub): Likewise.
5758
+2014-05-25 Janne Blomqvist <jb@gcc.gnu.org>
5760
+ Backport from trunk.
5761
+ PR libfortran/61187
5762
+ * io/unix.c (raw_close): Check if s->fd is -1.
5763
+ (fd_to_stream): Check return value of fstat(), handle error.
5765
2014-05-22 Release Manager
5767
* GCC 4.8.3 released.
5768
Index: libgfortran/generated/spread_r10.c
5769
===================================================================
5770
--- a/src/libgfortran/generated/spread_r10.c (.../tags/gcc_4_8_3_release)
5771
+++ b/src/libgfortran/generated/spread_r10.c (.../branches/gcc-4_8-branch)
5776
- /* xmalloc allocates a single byte for zero size. */
5777
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_10));
5778
+ /* xmallocarray allocates a single byte for zero size. */
5779
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_10));
5785
if (ret->base_addr == NULL)
5787
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_10));
5788
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_10));
5790
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
5792
Index: libgfortran/generated/maxloc1_4_r8.c
5793
===================================================================
5794
--- a/src/libgfortran/generated/maxloc1_4_r8.c (.../tags/gcc_4_8_3_release)
5795
+++ b/src/libgfortran/generated/maxloc1_4_r8.c (.../branches/gcc-4_8-branch)
5797
retarray->offset = 0;
5798
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5800
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5802
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5804
- retarray->base_addr = xmalloc (alloc_size);
5805
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
5806
if (alloc_size == 0)
5808
/* Make sure we have a zero-sized array. */
5813
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5815
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5817
retarray->offset = 0;
5818
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5823
- retarray->base_addr = xmalloc (alloc_size);
5824
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
5829
retarray->offset = 0;
5830
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5832
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5834
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5836
if (alloc_size == 0)
5842
- retarray->base_addr = xmalloc (alloc_size);
5843
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
5847
Index: libgfortran/generated/norm2_r4.c
5848
===================================================================
5849
--- a/src/libgfortran/generated/norm2_r4.c (.../tags/gcc_4_8_3_release)
5850
+++ b/src/libgfortran/generated/norm2_r4.c (.../branches/gcc-4_8-branch)
5851
@@ -101,10 +101,9 @@
5852
retarray->offset = 0;
5853
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5855
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5857
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5859
- retarray->base_addr = xmalloc (alloc_size);
5860
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
5861
if (alloc_size == 0)
5863
/* Make sure we have a zero-sized array. */
5864
Index: libgfortran/generated/parity_l2.c
5865
===================================================================
5866
--- a/src/libgfortran/generated/parity_l2.c (.../tags/gcc_4_8_3_release)
5867
+++ b/src/libgfortran/generated/parity_l2.c (.../branches/gcc-4_8-branch)
5869
retarray->offset = 0;
5870
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5872
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5874
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5876
- retarray->base_addr = xmalloc (alloc_size);
5877
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
5878
if (alloc_size == 0)
5880
/* Make sure we have a zero-sized array. */
5881
Index: libgfortran/generated/eoshift3_4.c
5882
===================================================================
5883
--- a/src/libgfortran/generated/eoshift3_4.c (.../tags/gcc_4_8_3_release)
5884
+++ b/src/libgfortran/generated/eoshift3_4.c (.../branches/gcc-4_8-branch)
5889
- ret->base_addr = xmalloc (size * arraysize);
5890
+ ret->base_addr = xmallocarray (arraysize, size);
5892
ret->dtype = array->dtype;
5893
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
5895
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
5898
- /* xmalloc allocates a single byte for zero size. */
5899
- ret->base_addr = xmalloc (size * arraysize);
5900
+ /* xmallocarray allocates a single byte for zero size. */
5901
+ ret->base_addr = xmallocarray (arraysize, size);
5904
else if (unlikely (compile_options.bounds_check))
5905
Index: libgfortran/generated/transpose_c8.c
5906
===================================================================
5907
--- a/src/libgfortran/generated/transpose_c8.c (.../tags/gcc_4_8_3_release)
5908
+++ b/src/libgfortran/generated/transpose_c8.c (.../branches/gcc-4_8-branch)
5910
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
5911
GFC_DESCRIPTOR_EXTENT(source, 1));
5913
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
5914
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
5915
+ sizeof (GFC_COMPLEX_8));
5917
} else if (unlikely (compile_options.bounds_check))
5919
Index: libgfortran/generated/eoshift1_8.c
5920
===================================================================
5921
--- a/src/libgfortran/generated/eoshift1_8.c (.../tags/gcc_4_8_3_release)
5922
+++ b/src/libgfortran/generated/eoshift1_8.c (.../branches/gcc-4_8-branch)
5924
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
5927
- /* xmalloc allocates a single byte for zero size. */
5928
- ret->base_addr = xmalloc (size * arraysize);
5929
+ /* xmallocarray allocates a single byte for zero size. */
5930
+ ret->base_addr = xmallocarray (arraysize, size);
5933
else if (unlikely (compile_options.bounds_check))
5934
Index: libgfortran/generated/reshape_r16.c
5935
===================================================================
5936
--- a/src/libgfortran/generated/reshape_r16.c (.../tags/gcc_4_8_3_release)
5937
+++ b/src/libgfortran/generated/reshape_r16.c (.../branches/gcc-4_8-branch)
5938
@@ -111,11 +111,11 @@
5941
if (unlikely (rs < 1))
5945
- alloc_size = rs * sizeof (GFC_REAL_16);
5948
- ret->base_addr = xmalloc (alloc_size);
5949
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
5950
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
5953
Index: libgfortran/generated/bessel_r4.c
5954
===================================================================
5955
--- a/src/libgfortran/generated/bessel_r4.c (.../tags/gcc_4_8_3_release)
5956
+++ b/src/libgfortran/generated/bessel_r4.c (.../branches/gcc-4_8-branch)
5959
size_t size = n2 < n1 ? 0 : n2-n1+1;
5960
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
5961
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
5962
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
5968
size_t size = n2 < n1 ? 0 : n2-n1+1;
5969
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
5970
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
5971
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
5975
Index: libgfortran/generated/any_l2.c
5976
===================================================================
5977
--- a/src/libgfortran/generated/any_l2.c (.../tags/gcc_4_8_3_release)
5978
+++ b/src/libgfortran/generated/any_l2.c (.../branches/gcc-4_8-branch)
5980
retarray->offset = 0;
5981
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
5983
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
5985
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
5987
if (alloc_size == 0)
5993
- retarray->base_addr = xmalloc (alloc_size);
5994
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
5998
Index: libgfortran/generated/product_r4.c
5999
===================================================================
6000
--- a/src/libgfortran/generated/product_r4.c (.../tags/gcc_4_8_3_release)
6001
+++ b/src/libgfortran/generated/product_r4.c (.../branches/gcc-4_8-branch)
6003
retarray->offset = 0;
6004
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6006
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6008
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6010
- retarray->base_addr = xmalloc (alloc_size);
6011
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
6012
if (alloc_size == 0)
6014
/* Make sure we have a zero-sized array. */
6019
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6021
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6023
retarray->offset = 0;
6024
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6029
- retarray->base_addr = xmalloc (alloc_size);
6030
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
6035
retarray->offset = 0;
6036
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6038
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6040
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6042
if (alloc_size == 0)
6048
- retarray->base_addr = xmalloc (alloc_size);
6049
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
6053
Index: libgfortran/generated/iany_i1.c
6054
===================================================================
6055
--- a/src/libgfortran/generated/iany_i1.c (.../tags/gcc_4_8_3_release)
6056
+++ b/src/libgfortran/generated/iany_i1.c (.../branches/gcc-4_8-branch)
6058
retarray->offset = 0;
6059
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6061
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6063
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6065
- retarray->base_addr = xmalloc (alloc_size);
6066
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
6067
if (alloc_size == 0)
6069
/* Make sure we have a zero-sized array. */
6074
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6076
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6078
retarray->offset = 0;
6079
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6084
- retarray->base_addr = xmalloc (alloc_size);
6085
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
6090
retarray->offset = 0;
6091
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6093
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6095
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6097
if (alloc_size == 0)
6103
- retarray->base_addr = xmalloc (alloc_size);
6104
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
6108
Index: libgfortran/generated/parity_l16.c
6109
===================================================================
6110
--- a/src/libgfortran/generated/parity_l16.c (.../tags/gcc_4_8_3_release)
6111
+++ b/src/libgfortran/generated/parity_l16.c (.../branches/gcc-4_8-branch)
6113
retarray->offset = 0;
6114
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6116
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6118
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6120
- retarray->base_addr = xmalloc (alloc_size);
6121
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
6122
if (alloc_size == 0)
6124
/* Make sure we have a zero-sized array. */
6125
Index: libgfortran/generated/in_pack_r4.c
6126
===================================================================
6127
--- a/src/libgfortran/generated/in_pack_r4.c (.../tags/gcc_4_8_3_release)
6128
+++ b/src/libgfortran/generated/in_pack_r4.c (.../branches/gcc-4_8-branch)
6130
return source->base_addr;
6132
/* Allocate storage for the destination. */
6133
- destptr = (GFC_REAL_4 *)xmalloc (ssize * sizeof (GFC_REAL_4));
6134
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_4));
6136
src = source->base_addr;
6137
stride0 = stride[0];
6138
Index: libgfortran/generated/product_i2.c
6139
===================================================================
6140
--- a/src/libgfortran/generated/product_i2.c (.../tags/gcc_4_8_3_release)
6141
+++ b/src/libgfortran/generated/product_i2.c (.../branches/gcc-4_8-branch)
6143
retarray->offset = 0;
6144
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6146
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6148
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6150
- retarray->base_addr = xmalloc (alloc_size);
6151
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
6152
if (alloc_size == 0)
6154
/* Make sure we have a zero-sized array. */
6159
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6161
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6163
retarray->offset = 0;
6164
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6169
- retarray->base_addr = xmalloc (alloc_size);
6170
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
6175
retarray->offset = 0;
6176
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6178
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6180
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6182
if (alloc_size == 0)
6188
- retarray->base_addr = xmalloc (alloc_size);
6189
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
6193
Index: libgfortran/generated/iparity_i4.c
6194
===================================================================
6195
--- a/src/libgfortran/generated/iparity_i4.c (.../tags/gcc_4_8_3_release)
6196
+++ b/src/libgfortran/generated/iparity_i4.c (.../branches/gcc-4_8-branch)
6198
retarray->offset = 0;
6199
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6201
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6203
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6205
- retarray->base_addr = xmalloc (alloc_size);
6206
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
6207
if (alloc_size == 0)
6209
/* Make sure we have a zero-sized array. */
6214
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6216
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6218
retarray->offset = 0;
6219
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6224
- retarray->base_addr = xmalloc (alloc_size);
6225
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
6230
retarray->offset = 0;
6231
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6233
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6235
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6237
if (alloc_size == 0)
6243
- retarray->base_addr = xmalloc (alloc_size);
6244
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
6248
Index: libgfortran/generated/minloc0_4_i1.c
6249
===================================================================
6250
--- a/src/libgfortran/generated/minloc0_4_i1.c (.../tags/gcc_4_8_3_release)
6251
+++ b/src/libgfortran/generated/minloc0_4_i1.c (.../branches/gcc-4_8-branch)
6253
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6254
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6255
retarray->offset = 0;
6256
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6257
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6262
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
6263
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6264
retarray->offset = 0;
6265
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6266
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6271
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6272
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6273
retarray->offset = 0;
6274
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6275
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6277
else if (unlikely (compile_options.bounds_check))
6279
Index: libgfortran/generated/reshape_c4.c
6280
===================================================================
6281
--- a/src/libgfortran/generated/reshape_c4.c (.../tags/gcc_4_8_3_release)
6282
+++ b/src/libgfortran/generated/reshape_c4.c (.../branches/gcc-4_8-branch)
6283
@@ -111,11 +111,11 @@
6286
if (unlikely (rs < 1))
6290
- alloc_size = rs * sizeof (GFC_COMPLEX_4);
6293
- ret->base_addr = xmalloc (alloc_size);
6294
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
6295
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
6298
Index: libgfortran/generated/maxloc0_4_r16.c
6299
===================================================================
6300
--- a/src/libgfortran/generated/maxloc0_4_r16.c (.../tags/gcc_4_8_3_release)
6301
+++ b/src/libgfortran/generated/maxloc0_4_r16.c (.../branches/gcc-4_8-branch)
6303
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6304
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6305
retarray->offset = 0;
6306
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6307
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6312
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
6313
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6314
retarray->offset = 0;
6315
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6316
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6321
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6322
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6323
retarray->offset = 0;
6324
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6325
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6327
else if (unlikely (compile_options.bounds_check))
6329
Index: libgfortran/generated/iall_i8.c
6330
===================================================================
6331
--- a/src/libgfortran/generated/iall_i8.c (.../tags/gcc_4_8_3_release)
6332
+++ b/src/libgfortran/generated/iall_i8.c (.../branches/gcc-4_8-branch)
6334
retarray->offset = 0;
6335
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6337
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6339
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6341
- retarray->base_addr = xmalloc (alloc_size);
6342
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6343
if (alloc_size == 0)
6345
/* Make sure we have a zero-sized array. */
6350
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6352
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6354
retarray->offset = 0;
6355
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6360
- retarray->base_addr = xmalloc (alloc_size);
6361
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6366
retarray->offset = 0;
6367
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6369
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6371
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6373
if (alloc_size == 0)
6379
- retarray->base_addr = xmalloc (alloc_size);
6380
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6384
Index: libgfortran/generated/maxloc1_8_r16.c
6385
===================================================================
6386
--- a/src/libgfortran/generated/maxloc1_8_r16.c (.../tags/gcc_4_8_3_release)
6387
+++ b/src/libgfortran/generated/maxloc1_8_r16.c (.../branches/gcc-4_8-branch)
6389
retarray->offset = 0;
6390
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6392
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6394
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6396
- retarray->base_addr = xmalloc (alloc_size);
6397
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6398
if (alloc_size == 0)
6400
/* Make sure we have a zero-sized array. */
6405
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6407
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6409
retarray->offset = 0;
6410
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6415
- retarray->base_addr = xmalloc (alloc_size);
6416
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6421
retarray->offset = 0;
6422
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6424
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6426
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6428
if (alloc_size == 0)
6434
- retarray->base_addr = xmalloc (alloc_size);
6435
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6439
Index: libgfortran/generated/sum_r16.c
6440
===================================================================
6441
--- a/src/libgfortran/generated/sum_r16.c (.../tags/gcc_4_8_3_release)
6442
+++ b/src/libgfortran/generated/sum_r16.c (.../branches/gcc-4_8-branch)
6444
retarray->offset = 0;
6445
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6447
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6449
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6451
- retarray->base_addr = xmalloc (alloc_size);
6452
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
6453
if (alloc_size == 0)
6455
/* Make sure we have a zero-sized array. */
6460
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6462
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6464
retarray->offset = 0;
6465
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6470
- retarray->base_addr = xmalloc (alloc_size);
6471
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
6476
retarray->offset = 0;
6477
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6479
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6481
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6483
if (alloc_size == 0)
6489
- retarray->base_addr = xmalloc (alloc_size);
6490
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
6494
Index: libgfortran/generated/sum_i1.c
6495
===================================================================
6496
--- a/src/libgfortran/generated/sum_i1.c (.../tags/gcc_4_8_3_release)
6497
+++ b/src/libgfortran/generated/sum_i1.c (.../branches/gcc-4_8-branch)
6499
retarray->offset = 0;
6500
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6502
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6504
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6506
- retarray->base_addr = xmalloc (alloc_size);
6507
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
6508
if (alloc_size == 0)
6510
/* Make sure we have a zero-sized array. */
6515
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6517
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6519
retarray->offset = 0;
6520
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6525
- retarray->base_addr = xmalloc (alloc_size);
6526
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
6531
retarray->offset = 0;
6532
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6534
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6536
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6538
if (alloc_size == 0)
6544
- retarray->base_addr = xmalloc (alloc_size);
6545
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
6549
Index: libgfortran/generated/in_pack_i2.c
6550
===================================================================
6551
--- a/src/libgfortran/generated/in_pack_i2.c (.../tags/gcc_4_8_3_release)
6552
+++ b/src/libgfortran/generated/in_pack_i2.c (.../branches/gcc-4_8-branch)
6554
return source->base_addr;
6556
/* Allocate storage for the destination. */
6557
- destptr = (GFC_INTEGER_2 *)xmalloc (ssize * sizeof (GFC_INTEGER_2));
6558
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_2));
6560
src = source->base_addr;
6561
stride0 = stride[0];
6562
Index: libgfortran/generated/transpose_r10.c
6563
===================================================================
6564
--- a/src/libgfortran/generated/transpose_r10.c (.../tags/gcc_4_8_3_release)
6565
+++ b/src/libgfortran/generated/transpose_r10.c (.../branches/gcc-4_8-branch)
6567
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
6568
GFC_DESCRIPTOR_EXTENT(source, 1));
6570
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
6571
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
6572
+ sizeof (GFC_REAL_10));
6574
} else if (unlikely (compile_options.bounds_check))
6576
Index: libgfortran/generated/maxloc1_16_r16.c
6577
===================================================================
6578
--- a/src/libgfortran/generated/maxloc1_16_r16.c (.../tags/gcc_4_8_3_release)
6579
+++ b/src/libgfortran/generated/maxloc1_16_r16.c (.../branches/gcc-4_8-branch)
6581
retarray->offset = 0;
6582
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6584
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6586
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6588
- retarray->base_addr = xmalloc (alloc_size);
6589
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
6590
if (alloc_size == 0)
6592
/* Make sure we have a zero-sized array. */
6597
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6599
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6601
retarray->offset = 0;
6602
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6607
- retarray->base_addr = xmalloc (alloc_size);
6608
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
6613
retarray->offset = 0;
6614
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6616
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6618
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6620
if (alloc_size == 0)
6626
- retarray->base_addr = xmalloc (alloc_size);
6627
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
6631
Index: libgfortran/generated/maxloc1_16_i4.c
6632
===================================================================
6633
--- a/src/libgfortran/generated/maxloc1_16_i4.c (.../tags/gcc_4_8_3_release)
6634
+++ b/src/libgfortran/generated/maxloc1_16_i4.c (.../branches/gcc-4_8-branch)
6636
retarray->offset = 0;
6637
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6639
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6641
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6643
- retarray->base_addr = xmalloc (alloc_size);
6644
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
6645
if (alloc_size == 0)
6647
/* Make sure we have a zero-sized array. */
6652
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6654
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6656
retarray->offset = 0;
6657
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6662
- retarray->base_addr = xmalloc (alloc_size);
6663
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
6668
retarray->offset = 0;
6669
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6671
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6673
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6675
if (alloc_size == 0)
6681
- retarray->base_addr = xmalloc (alloc_size);
6682
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
6686
Index: libgfortran/generated/spread_i1.c
6687
===================================================================
6688
--- a/src/libgfortran/generated/spread_i1.c (.../tags/gcc_4_8_3_release)
6689
+++ b/src/libgfortran/generated/spread_i1.c (.../branches/gcc-4_8-branch)
6694
- /* xmalloc allocates a single byte for zero size. */
6695
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
6696
+ /* xmallocarray allocates a single byte for zero size. */
6697
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
6703
if (ret->base_addr == NULL)
6705
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
6706
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
6708
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
6710
Index: libgfortran/generated/maxloc0_16_i8.c
6711
===================================================================
6712
--- a/src/libgfortran/generated/maxloc0_16_i8.c (.../tags/gcc_4_8_3_release)
6713
+++ b/src/libgfortran/generated/maxloc0_16_i8.c (.../branches/gcc-4_8-branch)
6715
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6716
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6717
retarray->offset = 0;
6718
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
6719
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
6724
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
6725
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6726
retarray->offset = 0;
6727
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
6728
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
6733
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6734
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6735
retarray->offset = 0;
6736
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
6737
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
6739
else if (unlikely (compile_options.bounds_check))
6741
Index: libgfortran/generated/maxval_r16.c
6742
===================================================================
6743
--- a/src/libgfortran/generated/maxval_r16.c (.../tags/gcc_4_8_3_release)
6744
+++ b/src/libgfortran/generated/maxval_r16.c (.../branches/gcc-4_8-branch)
6746
retarray->offset = 0;
6747
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6749
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6751
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6753
- retarray->base_addr = xmalloc (alloc_size);
6754
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
6755
if (alloc_size == 0)
6757
/* Make sure we have a zero-sized array. */
6762
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6764
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6766
retarray->offset = 0;
6767
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6772
- retarray->base_addr = xmalloc (alloc_size);
6773
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
6778
retarray->offset = 0;
6779
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6781
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6783
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6785
if (alloc_size == 0)
6791
- retarray->base_addr = xmalloc (alloc_size);
6792
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
6796
Index: libgfortran/generated/product_c10.c
6797
===================================================================
6798
--- a/src/libgfortran/generated/product_c10.c (.../tags/gcc_4_8_3_release)
6799
+++ b/src/libgfortran/generated/product_c10.c (.../branches/gcc-4_8-branch)
6801
retarray->offset = 0;
6802
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6804
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6806
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6808
- retarray->base_addr = xmalloc (alloc_size);
6809
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
6810
if (alloc_size == 0)
6812
/* Make sure we have a zero-sized array. */
6817
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6819
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6821
retarray->offset = 0;
6822
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6827
- retarray->base_addr = xmalloc (alloc_size);
6828
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
6833
retarray->offset = 0;
6834
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6836
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6838
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6840
if (alloc_size == 0)
6846
- retarray->base_addr = xmalloc (alloc_size);
6847
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
6851
Index: libgfortran/generated/minloc1_8_i4.c
6852
===================================================================
6853
--- a/src/libgfortran/generated/minloc1_8_i4.c (.../tags/gcc_4_8_3_release)
6854
+++ b/src/libgfortran/generated/minloc1_8_i4.c (.../branches/gcc-4_8-branch)
6856
retarray->offset = 0;
6857
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6859
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6861
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6863
- retarray->base_addr = xmalloc (alloc_size);
6864
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6865
if (alloc_size == 0)
6867
/* Make sure we have a zero-sized array. */
6872
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6874
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6876
retarray->offset = 0;
6877
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6882
- retarray->base_addr = xmalloc (alloc_size);
6883
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6888
retarray->offset = 0;
6889
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6891
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6893
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6895
if (alloc_size == 0)
6901
- retarray->base_addr = xmalloc (alloc_size);
6902
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
6906
Index: libgfortran/generated/minloc0_16_i16.c
6907
===================================================================
6908
--- a/src/libgfortran/generated/minloc0_16_i16.c (.../tags/gcc_4_8_3_release)
6909
+++ b/src/libgfortran/generated/minloc0_16_i16.c (.../branches/gcc-4_8-branch)
6911
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6912
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6913
retarray->offset = 0;
6914
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
6915
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
6920
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
6921
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6922
retarray->offset = 0;
6923
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
6924
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
6929
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6930
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6931
retarray->offset = 0;
6932
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
6933
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
6935
else if (unlikely (compile_options.bounds_check))
6937
Index: libgfortran/generated/matmul_r16.c
6938
===================================================================
6939
--- a/src/libgfortran/generated/matmul_r16.c (.../tags/gcc_4_8_3_release)
6940
+++ b/src/libgfortran/generated/matmul_r16.c (.../branches/gcc-4_8-branch)
6945
- = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
6946
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_16));
6947
retarray->offset = 0;
6949
else if (unlikely (compile_options.bounds_check))
6950
Index: libgfortran/generated/minloc0_4_r4.c
6951
===================================================================
6952
--- a/src/libgfortran/generated/minloc0_4_r4.c (.../tags/gcc_4_8_3_release)
6953
+++ b/src/libgfortran/generated/minloc0_4_r4.c (.../branches/gcc-4_8-branch)
6955
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6956
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6957
retarray->offset = 0;
6958
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6959
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6964
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
6965
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6966
retarray->offset = 0;
6967
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6968
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6973
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
6974
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
6975
retarray->offset = 0;
6976
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
6977
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
6979
else if (unlikely (compile_options.bounds_check))
6981
Index: libgfortran/generated/iany_i2.c
6982
===================================================================
6983
--- a/src/libgfortran/generated/iany_i2.c (.../tags/gcc_4_8_3_release)
6984
+++ b/src/libgfortran/generated/iany_i2.c (.../branches/gcc-4_8-branch)
6986
retarray->offset = 0;
6987
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
6989
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
6991
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
6993
- retarray->base_addr = xmalloc (alloc_size);
6994
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
6995
if (alloc_size == 0)
6997
/* Make sure we have a zero-sized array. */
7002
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7004
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7006
retarray->offset = 0;
7007
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7012
- retarray->base_addr = xmalloc (alloc_size);
7013
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
7018
retarray->offset = 0;
7019
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7021
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7023
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7025
if (alloc_size == 0)
7031
- retarray->base_addr = xmalloc (alloc_size);
7032
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
7036
Index: libgfortran/generated/sum_r4.c
7037
===================================================================
7038
--- a/src/libgfortran/generated/sum_r4.c (.../tags/gcc_4_8_3_release)
7039
+++ b/src/libgfortran/generated/sum_r4.c (.../branches/gcc-4_8-branch)
7041
retarray->offset = 0;
7042
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7044
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7046
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7048
- retarray->base_addr = xmalloc (alloc_size);
7049
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
7050
if (alloc_size == 0)
7052
/* Make sure we have a zero-sized array. */
7057
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7059
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7061
retarray->offset = 0;
7062
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7067
- retarray->base_addr = xmalloc (alloc_size);
7068
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
7073
retarray->offset = 0;
7074
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7076
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7078
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7080
if (alloc_size == 0)
7086
- retarray->base_addr = xmalloc (alloc_size);
7087
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
7091
Index: libgfortran/generated/unpack_c8.c
7092
===================================================================
7093
--- a/src/libgfortran/generated/unpack_c8.c (.../tags/gcc_4_8_3_release)
7094
+++ b/src/libgfortran/generated/unpack_c8.c (.../branches/gcc-4_8-branch)
7099
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
7100
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
7108
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
7109
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
7113
Index: libgfortran/generated/in_pack_c16.c
7114
===================================================================
7115
--- a/src/libgfortran/generated/in_pack_c16.c (.../tags/gcc_4_8_3_release)
7116
+++ b/src/libgfortran/generated/in_pack_c16.c (.../branches/gcc-4_8-branch)
7118
return source->base_addr;
7120
/* Allocate storage for the destination. */
7121
- destptr = (GFC_COMPLEX_16 *)xmalloc (ssize * sizeof (GFC_COMPLEX_16));
7122
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_16));
7124
src = source->base_addr;
7125
stride0 = stride[0];
7126
Index: libgfortran/generated/minloc0_4_i2.c
7127
===================================================================
7128
--- a/src/libgfortran/generated/minloc0_4_i2.c (.../tags/gcc_4_8_3_release)
7129
+++ b/src/libgfortran/generated/minloc0_4_i2.c (.../branches/gcc-4_8-branch)
7131
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7132
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7133
retarray->offset = 0;
7134
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
7135
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
7140
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
7141
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7142
retarray->offset = 0;
7143
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
7144
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
7149
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7150
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7151
retarray->offset = 0;
7152
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
7153
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
7155
else if (unlikely (compile_options.bounds_check))
7157
Index: libgfortran/generated/spread_c10.c
7158
===================================================================
7159
--- a/src/libgfortran/generated/spread_c10.c (.../tags/gcc_4_8_3_release)
7160
+++ b/src/libgfortran/generated/spread_c10.c (.../branches/gcc-4_8-branch)
7165
- /* xmalloc allocates a single byte for zero size. */
7166
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_10));
7167
+ /* xmallocarray allocates a single byte for zero size. */
7168
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_10));
7174
if (ret->base_addr == NULL)
7176
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_10));
7177
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_10));
7179
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
7181
Index: libgfortran/generated/maxloc0_8_i1.c
7182
===================================================================
7183
--- a/src/libgfortran/generated/maxloc0_8_i1.c (.../tags/gcc_4_8_3_release)
7184
+++ b/src/libgfortran/generated/maxloc0_8_i1.c (.../branches/gcc-4_8-branch)
7186
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7187
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7188
retarray->offset = 0;
7189
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7190
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7195
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
7196
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7197
retarray->offset = 0;
7198
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7199
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7204
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7205
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7206
retarray->offset = 0;
7207
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7208
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7210
else if (unlikely (compile_options.bounds_check))
7212
Index: libgfortran/generated/spread_r4.c
7213
===================================================================
7214
--- a/src/libgfortran/generated/spread_r4.c (.../tags/gcc_4_8_3_release)
7215
+++ b/src/libgfortran/generated/spread_r4.c (.../branches/gcc-4_8-branch)
7220
- /* xmalloc allocates a single byte for zero size. */
7221
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4));
7222
+ /* xmallocarray allocates a single byte for zero size. */
7223
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4));
7229
if (ret->base_addr == NULL)
7231
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4));
7232
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4));
7234
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
7236
Index: libgfortran/generated/minloc0_8_i8.c
7237
===================================================================
7238
--- a/src/libgfortran/generated/minloc0_8_i8.c (.../tags/gcc_4_8_3_release)
7239
+++ b/src/libgfortran/generated/minloc0_8_i8.c (.../branches/gcc-4_8-branch)
7241
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7242
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7243
retarray->offset = 0;
7244
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7245
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7250
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
7251
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7252
retarray->offset = 0;
7253
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7254
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7259
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7260
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7261
retarray->offset = 0;
7262
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7263
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7265
else if (unlikely (compile_options.bounds_check))
7267
Index: libgfortran/generated/matmul_c8.c
7268
===================================================================
7269
--- a/src/libgfortran/generated/matmul_c8.c (.../tags/gcc_4_8_3_release)
7270
+++ b/src/libgfortran/generated/matmul_c8.c (.../branches/gcc-4_8-branch)
7275
- = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
7276
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_8));
7277
retarray->offset = 0;
7279
else if (unlikely (compile_options.bounds_check))
7280
Index: libgfortran/generated/minloc1_16_r10.c
7281
===================================================================
7282
--- a/src/libgfortran/generated/minloc1_16_r10.c (.../tags/gcc_4_8_3_release)
7283
+++ b/src/libgfortran/generated/minloc1_16_r10.c (.../branches/gcc-4_8-branch)
7285
retarray->offset = 0;
7286
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7288
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7290
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7292
- retarray->base_addr = xmalloc (alloc_size);
7293
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
7294
if (alloc_size == 0)
7296
/* Make sure we have a zero-sized array. */
7301
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7303
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7305
retarray->offset = 0;
7306
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7311
- retarray->base_addr = xmalloc (alloc_size);
7312
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
7317
retarray->offset = 0;
7318
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7320
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7322
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7324
if (alloc_size == 0)
7330
- retarray->base_addr = xmalloc (alloc_size);
7331
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
7335
Index: libgfortran/generated/sum_i2.c
7336
===================================================================
7337
--- a/src/libgfortran/generated/sum_i2.c (.../tags/gcc_4_8_3_release)
7338
+++ b/src/libgfortran/generated/sum_i2.c (.../branches/gcc-4_8-branch)
7340
retarray->offset = 0;
7341
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7343
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7345
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7347
- retarray->base_addr = xmalloc (alloc_size);
7348
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
7349
if (alloc_size == 0)
7351
/* Make sure we have a zero-sized array. */
7356
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7358
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7360
retarray->offset = 0;
7361
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7366
- retarray->base_addr = xmalloc (alloc_size);
7367
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
7372
retarray->offset = 0;
7373
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7375
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7377
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7379
if (alloc_size == 0)
7385
- retarray->base_addr = xmalloc (alloc_size);
7386
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
7390
Index: libgfortran/generated/iparity_i16.c
7391
===================================================================
7392
--- a/src/libgfortran/generated/iparity_i16.c (.../tags/gcc_4_8_3_release)
7393
+++ b/src/libgfortran/generated/iparity_i16.c (.../branches/gcc-4_8-branch)
7395
retarray->offset = 0;
7396
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7398
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7400
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7402
- retarray->base_addr = xmalloc (alloc_size);
7403
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
7404
if (alloc_size == 0)
7406
/* Make sure we have a zero-sized array. */
7411
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7413
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7415
retarray->offset = 0;
7416
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7421
- retarray->base_addr = xmalloc (alloc_size);
7422
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
7427
retarray->offset = 0;
7428
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7430
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7432
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7434
if (alloc_size == 0)
7440
- retarray->base_addr = xmalloc (alloc_size);
7441
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
7445
Index: libgfortran/generated/minloc0_16_i1.c
7446
===================================================================
7447
--- a/src/libgfortran/generated/minloc0_16_i1.c (.../tags/gcc_4_8_3_release)
7448
+++ b/src/libgfortran/generated/minloc0_16_i1.c (.../branches/gcc-4_8-branch)
7450
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7451
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7452
retarray->offset = 0;
7453
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
7454
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
7459
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
7460
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7461
retarray->offset = 0;
7462
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
7463
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
7468
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7469
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7470
retarray->offset = 0;
7471
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
7472
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
7474
else if (unlikely (compile_options.bounds_check))
7476
Index: libgfortran/generated/reshape_c16.c
7477
===================================================================
7478
--- a/src/libgfortran/generated/reshape_c16.c (.../tags/gcc_4_8_3_release)
7479
+++ b/src/libgfortran/generated/reshape_c16.c (.../branches/gcc-4_8-branch)
7480
@@ -111,11 +111,11 @@
7483
if (unlikely (rs < 1))
7487
- alloc_size = rs * sizeof (GFC_COMPLEX_16);
7490
- ret->base_addr = xmalloc (alloc_size);
7491
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
7492
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
7495
Index: libgfortran/generated/pack_c4.c
7496
===================================================================
7497
--- a/src/libgfortran/generated/pack_c4.c (.../tags/gcc_4_8_3_release)
7498
+++ b/src/libgfortran/generated/pack_c4.c (.../branches/gcc-4_8-branch)
7503
- /* xmalloc allocates a single byte for zero size. */
7504
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * total);
7505
+ /* xmallocarray allocates a single byte for zero size. */
7506
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_4));
7510
Index: libgfortran/generated/parity_l4.c
7511
===================================================================
7512
--- a/src/libgfortran/generated/parity_l4.c (.../tags/gcc_4_8_3_release)
7513
+++ b/src/libgfortran/generated/parity_l4.c (.../branches/gcc-4_8-branch)
7515
retarray->offset = 0;
7516
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7518
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7520
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7522
- retarray->base_addr = xmalloc (alloc_size);
7523
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
7524
if (alloc_size == 0)
7526
/* Make sure we have a zero-sized array. */
7527
Index: libgfortran/generated/spread_i2.c
7528
===================================================================
7529
--- a/src/libgfortran/generated/spread_i2.c (.../tags/gcc_4_8_3_release)
7530
+++ b/src/libgfortran/generated/spread_i2.c (.../branches/gcc-4_8-branch)
7535
- /* xmalloc allocates a single byte for zero size. */
7536
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_2));
7537
+ /* xmallocarray allocates a single byte for zero size. */
7538
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_2));
7544
if (ret->base_addr == NULL)
7546
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_2));
7547
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_2));
7549
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
7551
Index: libgfortran/generated/any_l4.c
7552
===================================================================
7553
--- a/src/libgfortran/generated/any_l4.c (.../tags/gcc_4_8_3_release)
7554
+++ b/src/libgfortran/generated/any_l4.c (.../branches/gcc-4_8-branch)
7556
retarray->offset = 0;
7557
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7559
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7561
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7563
if (alloc_size == 0)
7569
- retarray->base_addr = xmalloc (alloc_size);
7570
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
7574
Index: libgfortran/generated/maxloc1_4_i8.c
7575
===================================================================
7576
--- a/src/libgfortran/generated/maxloc1_4_i8.c (.../tags/gcc_4_8_3_release)
7577
+++ b/src/libgfortran/generated/maxloc1_4_i8.c (.../branches/gcc-4_8-branch)
7579
retarray->offset = 0;
7580
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7582
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7584
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7586
- retarray->base_addr = xmalloc (alloc_size);
7587
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7588
if (alloc_size == 0)
7590
/* Make sure we have a zero-sized array. */
7595
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7597
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7599
retarray->offset = 0;
7600
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7605
- retarray->base_addr = xmalloc (alloc_size);
7606
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7611
retarray->offset = 0;
7612
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7614
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7616
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7618
if (alloc_size == 0)
7624
- retarray->base_addr = xmalloc (alloc_size);
7625
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7629
Index: libgfortran/generated/maxloc0_8_r4.c
7630
===================================================================
7631
--- a/src/libgfortran/generated/maxloc0_8_r4.c (.../tags/gcc_4_8_3_release)
7632
+++ b/src/libgfortran/generated/maxloc0_8_r4.c (.../branches/gcc-4_8-branch)
7634
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7635
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7636
retarray->offset = 0;
7637
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7638
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7643
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
7644
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7645
retarray->offset = 0;
7646
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7647
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7652
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7653
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7654
retarray->offset = 0;
7655
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7656
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7658
else if (unlikely (compile_options.bounds_check))
7660
Index: libgfortran/generated/maxloc1_4_i16.c
7661
===================================================================
7662
--- a/src/libgfortran/generated/maxloc1_4_i16.c (.../tags/gcc_4_8_3_release)
7663
+++ b/src/libgfortran/generated/maxloc1_4_i16.c (.../branches/gcc-4_8-branch)
7665
retarray->offset = 0;
7666
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7668
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7670
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7672
- retarray->base_addr = xmalloc (alloc_size);
7673
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7674
if (alloc_size == 0)
7676
/* Make sure we have a zero-sized array. */
7681
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7683
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7685
retarray->offset = 0;
7686
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7691
- retarray->base_addr = xmalloc (alloc_size);
7692
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7697
retarray->offset = 0;
7698
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7700
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7702
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7704
if (alloc_size == 0)
7710
- retarray->base_addr = xmalloc (alloc_size);
7711
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7715
Index: libgfortran/generated/minloc0_4_r10.c
7716
===================================================================
7717
--- a/src/libgfortran/generated/minloc0_4_r10.c (.../tags/gcc_4_8_3_release)
7718
+++ b/src/libgfortran/generated/minloc0_4_r10.c (.../branches/gcc-4_8-branch)
7720
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7721
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7722
retarray->offset = 0;
7723
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
7724
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
7729
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
7730
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7731
retarray->offset = 0;
7732
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
7733
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
7738
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7739
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7740
retarray->offset = 0;
7741
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
7742
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
7744
else if (unlikely (compile_options.bounds_check))
7746
Index: libgfortran/generated/minloc0_8_i16.c
7747
===================================================================
7748
--- a/src/libgfortran/generated/minloc0_8_i16.c (.../tags/gcc_4_8_3_release)
7749
+++ b/src/libgfortran/generated/minloc0_8_i16.c (.../branches/gcc-4_8-branch)
7751
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7752
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7753
retarray->offset = 0;
7754
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7755
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7760
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
7761
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7762
retarray->offset = 0;
7763
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7764
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7769
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7770
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7771
retarray->offset = 0;
7772
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
7773
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
7775
else if (unlikely (compile_options.bounds_check))
7777
Index: libgfortran/generated/minloc1_8_r10.c
7778
===================================================================
7779
--- a/src/libgfortran/generated/minloc1_8_r10.c (.../tags/gcc_4_8_3_release)
7780
+++ b/src/libgfortran/generated/minloc1_8_r10.c (.../branches/gcc-4_8-branch)
7782
retarray->offset = 0;
7783
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7785
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7787
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7789
- retarray->base_addr = xmalloc (alloc_size);
7790
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
7791
if (alloc_size == 0)
7793
/* Make sure we have a zero-sized array. */
7798
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7800
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7802
retarray->offset = 0;
7803
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7808
- retarray->base_addr = xmalloc (alloc_size);
7809
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
7814
retarray->offset = 0;
7815
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7817
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7819
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7821
if (alloc_size == 0)
7827
- retarray->base_addr = xmalloc (alloc_size);
7828
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
7832
Index: libgfortran/generated/minloc0_16_r4.c
7833
===================================================================
7834
--- a/src/libgfortran/generated/minloc0_16_r4.c (.../tags/gcc_4_8_3_release)
7835
+++ b/src/libgfortran/generated/minloc0_16_r4.c (.../branches/gcc-4_8-branch)
7837
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7838
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7839
retarray->offset = 0;
7840
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
7841
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
7846
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
7847
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7848
retarray->offset = 0;
7849
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
7850
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
7855
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
7856
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
7857
retarray->offset = 0;
7858
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
7859
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
7861
else if (unlikely (compile_options.bounds_check))
7863
Index: libgfortran/generated/product_i4.c
7864
===================================================================
7865
--- a/src/libgfortran/generated/product_i4.c (.../tags/gcc_4_8_3_release)
7866
+++ b/src/libgfortran/generated/product_i4.c (.../branches/gcc-4_8-branch)
7868
retarray->offset = 0;
7869
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7871
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7873
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7875
- retarray->base_addr = xmalloc (alloc_size);
7876
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7877
if (alloc_size == 0)
7879
/* Make sure we have a zero-sized array. */
7884
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7886
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7888
retarray->offset = 0;
7889
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7894
- retarray->base_addr = xmalloc (alloc_size);
7895
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7900
retarray->offset = 0;
7901
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7903
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7905
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7907
if (alloc_size == 0)
7913
- retarray->base_addr = xmalloc (alloc_size);
7914
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
7918
Index: libgfortran/generated/sum_c16.c
7919
===================================================================
7920
--- a/src/libgfortran/generated/sum_c16.c (.../tags/gcc_4_8_3_release)
7921
+++ b/src/libgfortran/generated/sum_c16.c (.../branches/gcc-4_8-branch)
7923
retarray->offset = 0;
7924
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7926
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7928
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7930
- retarray->base_addr = xmalloc (alloc_size);
7931
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
7932
if (alloc_size == 0)
7934
/* Make sure we have a zero-sized array. */
7939
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7941
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7943
retarray->offset = 0;
7944
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7949
- retarray->base_addr = xmalloc (alloc_size);
7950
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
7955
retarray->offset = 0;
7956
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7958
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7960
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7962
if (alloc_size == 0)
7968
- retarray->base_addr = xmalloc (alloc_size);
7969
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
7973
Index: libgfortran/generated/transpose_c10.c
7974
===================================================================
7975
--- a/src/libgfortran/generated/transpose_c10.c (.../tags/gcc_4_8_3_release)
7976
+++ b/src/libgfortran/generated/transpose_c10.c (.../branches/gcc-4_8-branch)
7978
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
7979
GFC_DESCRIPTOR_EXTENT(source, 1));
7981
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
7982
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
7983
+ sizeof (GFC_COMPLEX_10));
7985
} else if (unlikely (compile_options.bounds_check))
7987
Index: libgfortran/generated/maxloc1_16_r8.c
7988
===================================================================
7989
--- a/src/libgfortran/generated/maxloc1_16_r8.c (.../tags/gcc_4_8_3_release)
7990
+++ b/src/libgfortran/generated/maxloc1_16_r8.c (.../branches/gcc-4_8-branch)
7992
retarray->offset = 0;
7993
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
7995
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
7997
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
7999
- retarray->base_addr = xmalloc (alloc_size);
8000
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
8001
if (alloc_size == 0)
8003
/* Make sure we have a zero-sized array. */
8008
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8010
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8012
retarray->offset = 0;
8013
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8018
- retarray->base_addr = xmalloc (alloc_size);
8019
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
8024
retarray->offset = 0;
8025
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8027
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8029
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8031
if (alloc_size == 0)
8037
- retarray->base_addr = xmalloc (alloc_size);
8038
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
8042
Index: libgfortran/generated/transpose_r4.c
8043
===================================================================
8044
--- a/src/libgfortran/generated/transpose_r4.c (.../tags/gcc_4_8_3_release)
8045
+++ b/src/libgfortran/generated/transpose_r4.c (.../branches/gcc-4_8-branch)
8047
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
8048
GFC_DESCRIPTOR_EXTENT(source, 1));
8050
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
8051
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
8052
+ sizeof (GFC_REAL_4));
8054
} else if (unlikely (compile_options.bounds_check))
8056
Index: libgfortran/generated/cshift1_4.c
8057
===================================================================
8058
--- a/src/libgfortran/generated/cshift1_4.c (.../tags/gcc_4_8_3_release)
8059
+++ b/src/libgfortran/generated/cshift1_4.c (.../branches/gcc-4_8-branch)
8064
- ret->base_addr = xmalloc (size * arraysize);
8065
+ ret->base_addr = xmallocarray (arraysize, size);
8067
ret->dtype = array->dtype;
8068
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
8069
Index: libgfortran/generated/maxloc0_8_i2.c
8070
===================================================================
8071
--- a/src/libgfortran/generated/maxloc0_8_i2.c (.../tags/gcc_4_8_3_release)
8072
+++ b/src/libgfortran/generated/maxloc0_8_i2.c (.../branches/gcc-4_8-branch)
8074
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8075
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8076
retarray->offset = 0;
8077
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
8078
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
8083
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
8084
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8085
retarray->offset = 0;
8086
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
8087
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
8092
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8093
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8094
retarray->offset = 0;
8095
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
8096
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
8098
else if (unlikely (compile_options.bounds_check))
8100
Index: libgfortran/generated/count_8_l.c
8101
===================================================================
8102
--- a/src/libgfortran/generated/count_8_l.c (.../tags/gcc_4_8_3_release)
8103
+++ b/src/libgfortran/generated/count_8_l.c (.../branches/gcc-4_8-branch)
8105
retarray->offset = 0;
8106
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8108
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8110
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8112
if (alloc_size == 0)
8118
- retarray->base_addr = xmalloc (alloc_size);
8119
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
8123
Index: libgfortran/generated/in_pack_i4.c
8124
===================================================================
8125
--- a/src/libgfortran/generated/in_pack_i4.c (.../tags/gcc_4_8_3_release)
8126
+++ b/src/libgfortran/generated/in_pack_i4.c (.../branches/gcc-4_8-branch)
8128
return source->base_addr;
8130
/* Allocate storage for the destination. */
8131
- destptr = (GFC_INTEGER_4 *)xmalloc (ssize * sizeof (GFC_INTEGER_4));
8132
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_4));
8134
src = source->base_addr;
8135
stride0 = stride[0];
8136
Index: libgfortran/generated/minloc0_16_i2.c
8137
===================================================================
8138
--- a/src/libgfortran/generated/minloc0_16_i2.c (.../tags/gcc_4_8_3_release)
8139
+++ b/src/libgfortran/generated/minloc0_16_i2.c (.../branches/gcc-4_8-branch)
8141
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8142
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8143
retarray->offset = 0;
8144
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
8145
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
8150
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
8151
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8152
retarray->offset = 0;
8153
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
8154
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
8159
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8160
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8161
retarray->offset = 0;
8162
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
8163
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
8165
else if (unlikely (compile_options.bounds_check))
8167
Index: libgfortran/generated/minloc1_8_r8.c
8168
===================================================================
8169
--- a/src/libgfortran/generated/minloc1_8_r8.c (.../tags/gcc_4_8_3_release)
8170
+++ b/src/libgfortran/generated/minloc1_8_r8.c (.../branches/gcc-4_8-branch)
8172
retarray->offset = 0;
8173
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8175
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8177
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8179
- retarray->base_addr = xmalloc (alloc_size);
8180
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
8181
if (alloc_size == 0)
8183
/* Make sure we have a zero-sized array. */
8188
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8190
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8192
retarray->offset = 0;
8193
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8198
- retarray->base_addr = xmalloc (alloc_size);
8199
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
8204
retarray->offset = 0;
8205
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8207
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8209
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8211
if (alloc_size == 0)
8217
- retarray->base_addr = xmalloc (alloc_size);
8218
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
8222
Index: libgfortran/generated/matmul_c16.c
8223
===================================================================
8224
--- a/src/libgfortran/generated/matmul_c16.c (.../tags/gcc_4_8_3_release)
8225
+++ b/src/libgfortran/generated/matmul_c16.c (.../branches/gcc-4_8-branch)
8230
- = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
8231
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_16));
8232
retarray->offset = 0;
8234
else if (unlikely (compile_options.bounds_check))
8235
Index: libgfortran/generated/minval_i1.c
8236
===================================================================
8237
--- a/src/libgfortran/generated/minval_i1.c (.../tags/gcc_4_8_3_release)
8238
+++ b/src/libgfortran/generated/minval_i1.c (.../branches/gcc-4_8-branch)
8240
retarray->offset = 0;
8241
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8243
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8245
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8247
- retarray->base_addr = xmalloc (alloc_size);
8248
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
8249
if (alloc_size == 0)
8251
/* Make sure we have a zero-sized array. */
8256
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8258
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8260
retarray->offset = 0;
8261
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8266
- retarray->base_addr = xmalloc (alloc_size);
8267
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
8272
retarray->offset = 0;
8273
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8275
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8277
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8279
if (alloc_size == 0)
8285
- retarray->base_addr = xmalloc (alloc_size);
8286
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
8290
Index: libgfortran/generated/shape_i16.c
8291
===================================================================
8292
--- a/src/libgfortran/generated/shape_i16.c (.../tags/gcc_4_8_3_release)
8293
+++ b/src/libgfortran/generated/shape_i16.c (.../branches/gcc-4_8-branch)
8296
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
8298
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
8299
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
8302
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
8303
Index: libgfortran/generated/iany_i4.c
8304
===================================================================
8305
--- a/src/libgfortran/generated/iany_i4.c (.../tags/gcc_4_8_3_release)
8306
+++ b/src/libgfortran/generated/iany_i4.c (.../branches/gcc-4_8-branch)
8308
retarray->offset = 0;
8309
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8311
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8313
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8315
- retarray->base_addr = xmalloc (alloc_size);
8316
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8317
if (alloc_size == 0)
8319
/* Make sure we have a zero-sized array. */
8324
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8326
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8328
retarray->offset = 0;
8329
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8334
- retarray->base_addr = xmalloc (alloc_size);
8335
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8340
retarray->offset = 0;
8341
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8343
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8345
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8347
if (alloc_size == 0)
8353
- retarray->base_addr = xmalloc (alloc_size);
8354
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8358
Index: libgfortran/generated/minloc0_16_r16.c
8359
===================================================================
8360
--- a/src/libgfortran/generated/minloc0_16_r16.c (.../tags/gcc_4_8_3_release)
8361
+++ b/src/libgfortran/generated/minloc0_16_r16.c (.../branches/gcc-4_8-branch)
8363
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8364
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8365
retarray->offset = 0;
8366
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
8367
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
8372
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
8373
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8374
retarray->offset = 0;
8375
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
8376
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
8381
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8382
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8383
retarray->offset = 0;
8384
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
8385
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
8387
else if (unlikely (compile_options.bounds_check))
8389
Index: libgfortran/generated/product_i16.c
8390
===================================================================
8391
--- a/src/libgfortran/generated/product_i16.c (.../tags/gcc_4_8_3_release)
8392
+++ b/src/libgfortran/generated/product_i16.c (.../branches/gcc-4_8-branch)
8394
retarray->offset = 0;
8395
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8397
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8399
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8401
- retarray->base_addr = xmalloc (alloc_size);
8402
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
8403
if (alloc_size == 0)
8405
/* Make sure we have a zero-sized array. */
8410
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8412
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8414
retarray->offset = 0;
8415
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8420
- retarray->base_addr = xmalloc (alloc_size);
8421
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
8426
retarray->offset = 0;
8427
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8429
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8431
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8433
if (alloc_size == 0)
8439
- retarray->base_addr = xmalloc (alloc_size);
8440
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
8444
Index: libgfortran/generated/unpack_i1.c
8445
===================================================================
8446
--- a/src/libgfortran/generated/unpack_i1.c (.../tags/gcc_4_8_3_release)
8447
+++ b/src/libgfortran/generated/unpack_i1.c (.../branches/gcc-4_8-branch)
8452
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
8453
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
8461
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
8462
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
8466
Index: libgfortran/generated/minloc0_4_i4.c
8467
===================================================================
8468
--- a/src/libgfortran/generated/minloc0_4_i4.c (.../tags/gcc_4_8_3_release)
8469
+++ b/src/libgfortran/generated/minloc0_4_i4.c (.../branches/gcc-4_8-branch)
8471
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8472
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8473
retarray->offset = 0;
8474
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
8475
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
8480
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
8481
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8482
retarray->offset = 0;
8483
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
8484
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
8489
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8490
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8491
retarray->offset = 0;
8492
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
8493
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
8495
else if (unlikely (compile_options.bounds_check))
8497
Index: libgfortran/generated/matmul_i1.c
8498
===================================================================
8499
--- a/src/libgfortran/generated/matmul_i1.c (.../tags/gcc_4_8_3_release)
8500
+++ b/src/libgfortran/generated/matmul_i1.c (.../branches/gcc-4_8-branch)
8505
- = xmalloc (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
8506
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_1));
8507
retarray->offset = 0;
8509
else if (unlikely (compile_options.bounds_check))
8510
Index: libgfortran/generated/minval_r4.c
8511
===================================================================
8512
--- a/src/libgfortran/generated/minval_r4.c (.../tags/gcc_4_8_3_release)
8513
+++ b/src/libgfortran/generated/minval_r4.c (.../branches/gcc-4_8-branch)
8515
retarray->offset = 0;
8516
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8518
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8520
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8522
- retarray->base_addr = xmalloc (alloc_size);
8523
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
8524
if (alloc_size == 0)
8526
/* Make sure we have a zero-sized array. */
8531
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8533
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8535
retarray->offset = 0;
8536
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8541
- retarray->base_addr = xmalloc (alloc_size);
8542
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
8547
retarray->offset = 0;
8548
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8550
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8552
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8554
if (alloc_size == 0)
8560
- retarray->base_addr = xmalloc (alloc_size);
8561
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
8565
Index: libgfortran/generated/spread_i16.c
8566
===================================================================
8567
--- a/src/libgfortran/generated/spread_i16.c (.../tags/gcc_4_8_3_release)
8568
+++ b/src/libgfortran/generated/spread_i16.c (.../branches/gcc-4_8-branch)
8573
- /* xmalloc allocates a single byte for zero size. */
8574
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_16));
8575
+ /* xmallocarray allocates a single byte for zero size. */
8576
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_16));
8582
if (ret->base_addr == NULL)
8584
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_16));
8585
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_16));
8587
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
8589
Index: libgfortran/generated/sum_i4.c
8590
===================================================================
8591
--- a/src/libgfortran/generated/sum_i4.c (.../tags/gcc_4_8_3_release)
8592
+++ b/src/libgfortran/generated/sum_i4.c (.../branches/gcc-4_8-branch)
8594
retarray->offset = 0;
8595
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8597
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8599
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8601
- retarray->base_addr = xmalloc (alloc_size);
8602
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8603
if (alloc_size == 0)
8605
/* Make sure we have a zero-sized array. */
8610
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8612
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8614
retarray->offset = 0;
8615
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8620
- retarray->base_addr = xmalloc (alloc_size);
8621
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8626
retarray->offset = 0;
8627
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8629
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8631
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8633
if (alloc_size == 0)
8639
- retarray->base_addr = xmalloc (alloc_size);
8640
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8644
Index: libgfortran/generated/unpack_r10.c
8645
===================================================================
8646
--- a/src/libgfortran/generated/unpack_r10.c (.../tags/gcc_4_8_3_release)
8647
+++ b/src/libgfortran/generated/unpack_r10.c (.../branches/gcc-4_8-branch)
8652
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
8653
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
8661
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
8662
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
8666
Index: libgfortran/generated/bessel_r16.c
8667
===================================================================
8668
--- a/src/libgfortran/generated/bessel_r16.c (.../tags/gcc_4_8_3_release)
8669
+++ b/src/libgfortran/generated/bessel_r16.c (.../branches/gcc-4_8-branch)
8672
size_t size = n2 < n1 ? 0 : n2-n1+1;
8673
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
8674
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
8675
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
8681
size_t size = n2 < n1 ? 0 : n2-n1+1;
8682
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
8683
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
8684
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
8688
Index: libgfortran/generated/norm2_r8.c
8689
===================================================================
8690
--- a/src/libgfortran/generated/norm2_r8.c (.../tags/gcc_4_8_3_release)
8691
+++ b/src/libgfortran/generated/norm2_r8.c (.../branches/gcc-4_8-branch)
8692
@@ -101,10 +101,9 @@
8693
retarray->offset = 0;
8694
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8696
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8698
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8700
- retarray->base_addr = xmalloc (alloc_size);
8701
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
8702
if (alloc_size == 0)
8704
/* Make sure we have a zero-sized array. */
8705
Index: libgfortran/generated/spread_i4.c
8706
===================================================================
8707
--- a/src/libgfortran/generated/spread_i4.c (.../tags/gcc_4_8_3_release)
8708
+++ b/src/libgfortran/generated/spread_i4.c (.../branches/gcc-4_8-branch)
8713
- /* xmalloc allocates a single byte for zero size. */
8714
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_4));
8715
+ /* xmallocarray allocates a single byte for zero size. */
8716
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_4));
8722
if (ret->base_addr == NULL)
8724
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_4));
8725
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_4));
8727
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
8729
Index: libgfortran/generated/eoshift3_8.c
8730
===================================================================
8731
--- a/src/libgfortran/generated/eoshift3_8.c (.../tags/gcc_4_8_3_release)
8732
+++ b/src/libgfortran/generated/eoshift3_8.c (.../branches/gcc-4_8-branch)
8737
- ret->base_addr = xmalloc (size * arraysize);
8738
+ ret->base_addr = xmallocarray (arraysize, size);
8740
ret->dtype = array->dtype;
8741
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
8743
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
8746
- /* xmalloc allocates a single byte for zero size. */
8747
- ret->base_addr = xmalloc (size * arraysize);
8748
+ /* xmallocarray allocates a single byte for zero size. */
8749
+ ret->base_addr = xmallocarray (arraysize, size);
8752
else if (unlikely (compile_options.bounds_check))
8753
Index: libgfortran/generated/minloc1_4_i1.c
8754
===================================================================
8755
--- a/src/libgfortran/generated/minloc1_4_i1.c (.../tags/gcc_4_8_3_release)
8756
+++ b/src/libgfortran/generated/minloc1_4_i1.c (.../branches/gcc-4_8-branch)
8758
retarray->offset = 0;
8759
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8761
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8763
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8765
- retarray->base_addr = xmalloc (alloc_size);
8766
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8767
if (alloc_size == 0)
8769
/* Make sure we have a zero-sized array. */
8774
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8776
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8778
retarray->offset = 0;
8779
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8784
- retarray->base_addr = xmalloc (alloc_size);
8785
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8790
retarray->offset = 0;
8791
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8793
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8795
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8797
if (alloc_size == 0)
8803
- retarray->base_addr = xmalloc (alloc_size);
8804
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
8808
Index: libgfortran/generated/minval_i2.c
8809
===================================================================
8810
--- a/src/libgfortran/generated/minval_i2.c (.../tags/gcc_4_8_3_release)
8811
+++ b/src/libgfortran/generated/minval_i2.c (.../branches/gcc-4_8-branch)
8813
retarray->offset = 0;
8814
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8816
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8818
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8820
- retarray->base_addr = xmalloc (alloc_size);
8821
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
8822
if (alloc_size == 0)
8824
/* Make sure we have a zero-sized array. */
8829
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8831
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8833
retarray->offset = 0;
8834
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8839
- retarray->base_addr = xmalloc (alloc_size);
8840
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
8845
retarray->offset = 0;
8846
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8848
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8850
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8852
if (alloc_size == 0)
8858
- retarray->base_addr = xmalloc (alloc_size);
8859
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
8863
Index: libgfortran/generated/bessel_r8.c
8864
===================================================================
8865
--- a/src/libgfortran/generated/bessel_r8.c (.../tags/gcc_4_8_3_release)
8866
+++ b/src/libgfortran/generated/bessel_r8.c (.../branches/gcc-4_8-branch)
8869
size_t size = n2 < n1 ? 0 : n2-n1+1;
8870
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
8871
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
8872
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
8878
size_t size = n2 < n1 ? 0 : n2-n1+1;
8879
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
8880
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
8881
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
8885
Index: libgfortran/generated/unpack_r4.c
8886
===================================================================
8887
--- a/src/libgfortran/generated/unpack_r4.c (.../tags/gcc_4_8_3_release)
8888
+++ b/src/libgfortran/generated/unpack_r4.c (.../branches/gcc-4_8-branch)
8893
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
8894
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
8902
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
8903
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
8907
Index: libgfortran/generated/product_r8.c
8908
===================================================================
8909
--- a/src/libgfortran/generated/product_r8.c (.../tags/gcc_4_8_3_release)
8910
+++ b/src/libgfortran/generated/product_r8.c (.../branches/gcc-4_8-branch)
8912
retarray->offset = 0;
8913
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8915
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8917
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8919
- retarray->base_addr = xmalloc (alloc_size);
8920
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
8921
if (alloc_size == 0)
8923
/* Make sure we have a zero-sized array. */
8928
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8930
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8932
retarray->offset = 0;
8933
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8938
- retarray->base_addr = xmalloc (alloc_size);
8939
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
8944
retarray->offset = 0;
8945
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
8947
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
8949
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
8951
if (alloc_size == 0)
8957
- retarray->base_addr = xmalloc (alloc_size);
8958
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
8962
Index: libgfortran/generated/matmul_r4.c
8963
===================================================================
8964
--- a/src/libgfortran/generated/matmul_r4.c (.../tags/gcc_4_8_3_release)
8965
+++ b/src/libgfortran/generated/matmul_r4.c (.../branches/gcc-4_8-branch)
8970
- = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
8971
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_4));
8972
retarray->offset = 0;
8974
else if (unlikely (compile_options.bounds_check))
8975
Index: libgfortran/generated/unpack_i2.c
8976
===================================================================
8977
--- a/src/libgfortran/generated/unpack_i2.c (.../tags/gcc_4_8_3_release)
8978
+++ b/src/libgfortran/generated/unpack_i2.c (.../branches/gcc-4_8-branch)
8983
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
8984
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
8992
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
8993
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
8997
Index: libgfortran/generated/in_pack_r8.c
8998
===================================================================
8999
--- a/src/libgfortran/generated/in_pack_r8.c (.../tags/gcc_4_8_3_release)
9000
+++ b/src/libgfortran/generated/in_pack_r8.c (.../branches/gcc-4_8-branch)
9002
return source->base_addr;
9004
/* Allocate storage for the destination. */
9005
- destptr = (GFC_REAL_8 *)xmalloc (ssize * sizeof (GFC_REAL_8));
9006
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_8));
9008
src = source->base_addr;
9009
stride0 = stride[0];
9010
Index: libgfortran/generated/maxloc1_4_r16.c
9011
===================================================================
9012
--- a/src/libgfortran/generated/maxloc1_4_r16.c (.../tags/gcc_4_8_3_release)
9013
+++ b/src/libgfortran/generated/maxloc1_4_r16.c (.../branches/gcc-4_8-branch)
9015
retarray->offset = 0;
9016
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9018
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9020
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9022
- retarray->base_addr = xmalloc (alloc_size);
9023
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9024
if (alloc_size == 0)
9026
/* Make sure we have a zero-sized array. */
9031
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9033
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9035
retarray->offset = 0;
9036
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9041
- retarray->base_addr = xmalloc (alloc_size);
9042
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9047
retarray->offset = 0;
9048
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9050
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9052
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9054
if (alloc_size == 0)
9060
- retarray->base_addr = xmalloc (alloc_size);
9061
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9065
Index: libgfortran/generated/minloc0_8_r16.c
9066
===================================================================
9067
--- a/src/libgfortran/generated/minloc0_8_r16.c (.../tags/gcc_4_8_3_release)
9068
+++ b/src/libgfortran/generated/minloc0_8_r16.c (.../branches/gcc-4_8-branch)
9070
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
9071
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9072
retarray->offset = 0;
9073
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
9074
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
9079
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
9080
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9081
retarray->offset = 0;
9082
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
9083
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
9088
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
9089
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9090
retarray->offset = 0;
9091
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
9092
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
9094
else if (unlikely (compile_options.bounds_check))
9096
Index: libgfortran/generated/reshape_c8.c
9097
===================================================================
9098
--- a/src/libgfortran/generated/reshape_c8.c (.../tags/gcc_4_8_3_release)
9099
+++ b/src/libgfortran/generated/reshape_c8.c (.../branches/gcc-4_8-branch)
9100
@@ -111,11 +111,11 @@
9103
if (unlikely (rs < 1))
9107
- alloc_size = rs * sizeof (GFC_COMPLEX_8);
9110
- ret->base_addr = xmalloc (alloc_size);
9111
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
9112
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
9115
Index: libgfortran/generated/iparity_i8.c
9116
===================================================================
9117
--- a/src/libgfortran/generated/iparity_i8.c (.../tags/gcc_4_8_3_release)
9118
+++ b/src/libgfortran/generated/iparity_i8.c (.../branches/gcc-4_8-branch)
9120
retarray->offset = 0;
9121
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9123
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9125
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9127
- retarray->base_addr = xmalloc (alloc_size);
9128
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9129
if (alloc_size == 0)
9131
/* Make sure we have a zero-sized array. */
9136
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9138
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9140
retarray->offset = 0;
9141
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9146
- retarray->base_addr = xmalloc (alloc_size);
9147
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9152
retarray->offset = 0;
9153
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9155
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9157
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9159
if (alloc_size == 0)
9165
- retarray->base_addr = xmalloc (alloc_size);
9166
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9170
Index: libgfortran/generated/count_1_l.c
9171
===================================================================
9172
--- a/src/libgfortran/generated/count_1_l.c (.../tags/gcc_4_8_3_release)
9173
+++ b/src/libgfortran/generated/count_1_l.c (.../branches/gcc-4_8-branch)
9175
retarray->offset = 0;
9176
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9178
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9180
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9182
if (alloc_size == 0)
9188
- retarray->base_addr = xmalloc (alloc_size);
9189
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
9193
Index: libgfortran/generated/maxloc0_8_i4.c
9194
===================================================================
9195
--- a/src/libgfortran/generated/maxloc0_8_i4.c (.../tags/gcc_4_8_3_release)
9196
+++ b/src/libgfortran/generated/maxloc0_8_i4.c (.../branches/gcc-4_8-branch)
9198
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
9199
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9200
retarray->offset = 0;
9201
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
9202
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
9207
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
9208
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9209
retarray->offset = 0;
9210
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
9211
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
9216
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
9217
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9218
retarray->offset = 0;
9219
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
9220
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
9222
else if (unlikely (compile_options.bounds_check))
9224
Index: libgfortran/generated/matmul_i2.c
9225
===================================================================
9226
--- a/src/libgfortran/generated/matmul_i2.c (.../tags/gcc_4_8_3_release)
9227
+++ b/src/libgfortran/generated/matmul_i2.c (.../branches/gcc-4_8-branch)
9232
- = xmalloc (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
9233
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_2));
9234
retarray->offset = 0;
9236
else if (unlikely (compile_options.bounds_check))
9237
Index: libgfortran/generated/minloc1_4_r4.c
9238
===================================================================
9239
--- a/src/libgfortran/generated/minloc1_4_r4.c (.../tags/gcc_4_8_3_release)
9240
+++ b/src/libgfortran/generated/minloc1_4_r4.c (.../branches/gcc-4_8-branch)
9242
retarray->offset = 0;
9243
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9245
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9247
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9249
- retarray->base_addr = xmalloc (alloc_size);
9250
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9251
if (alloc_size == 0)
9253
/* Make sure we have a zero-sized array. */
9258
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9260
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9262
retarray->offset = 0;
9263
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9268
- retarray->base_addr = xmalloc (alloc_size);
9269
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9274
retarray->offset = 0;
9275
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9277
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9279
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9281
if (alloc_size == 0)
9287
- retarray->base_addr = xmalloc (alloc_size);
9288
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9292
Index: libgfortran/generated/transpose_i16.c
9293
===================================================================
9294
--- a/src/libgfortran/generated/transpose_i16.c (.../tags/gcc_4_8_3_release)
9295
+++ b/src/libgfortran/generated/transpose_i16.c (.../branches/gcc-4_8-branch)
9297
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
9298
GFC_DESCRIPTOR_EXTENT(source, 1));
9300
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
9301
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
9302
+ sizeof (GFC_INTEGER_16));
9304
} else if (unlikely (compile_options.bounds_check))
9306
Index: libgfortran/generated/minloc0_16_i4.c
9307
===================================================================
9308
--- a/src/libgfortran/generated/minloc0_16_i4.c (.../tags/gcc_4_8_3_release)
9309
+++ b/src/libgfortran/generated/minloc0_16_i4.c (.../branches/gcc-4_8-branch)
9311
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
9312
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9313
retarray->offset = 0;
9314
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
9315
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
9320
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
9321
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9322
retarray->offset = 0;
9323
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
9324
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
9329
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
9330
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9331
retarray->offset = 0;
9332
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
9333
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
9335
else if (unlikely (compile_options.bounds_check))
9337
Index: libgfortran/generated/transpose_i4.c
9338
===================================================================
9339
--- a/src/libgfortran/generated/transpose_i4.c (.../tags/gcc_4_8_3_release)
9340
+++ b/src/libgfortran/generated/transpose_i4.c (.../branches/gcc-4_8-branch)
9342
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
9343
GFC_DESCRIPTOR_EXTENT(source, 1));
9345
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
9346
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
9347
+ sizeof (GFC_INTEGER_4));
9349
} else if (unlikely (compile_options.bounds_check))
9351
Index: libgfortran/generated/maxloc1_16_i8.c
9352
===================================================================
9353
--- a/src/libgfortran/generated/maxloc1_16_i8.c (.../tags/gcc_4_8_3_release)
9354
+++ b/src/libgfortran/generated/maxloc1_16_i8.c (.../branches/gcc-4_8-branch)
9356
retarray->offset = 0;
9357
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9359
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9361
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9363
- retarray->base_addr = xmalloc (alloc_size);
9364
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9365
if (alloc_size == 0)
9367
/* Make sure we have a zero-sized array. */
9372
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9374
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9376
retarray->offset = 0;
9377
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9382
- retarray->base_addr = xmalloc (alloc_size);
9383
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9388
retarray->offset = 0;
9389
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9391
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9393
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9395
if (alloc_size == 0)
9401
- retarray->base_addr = xmalloc (alloc_size);
9402
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9406
Index: libgfortran/generated/minloc1_4_i2.c
9407
===================================================================
9408
--- a/src/libgfortran/generated/minloc1_4_i2.c (.../tags/gcc_4_8_3_release)
9409
+++ b/src/libgfortran/generated/minloc1_4_i2.c (.../branches/gcc-4_8-branch)
9411
retarray->offset = 0;
9412
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9414
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9416
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9418
- retarray->base_addr = xmalloc (alloc_size);
9419
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9420
if (alloc_size == 0)
9422
/* Make sure we have a zero-sized array. */
9427
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9429
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9431
retarray->offset = 0;
9432
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9437
- retarray->base_addr = xmalloc (alloc_size);
9438
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9443
retarray->offset = 0;
9444
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9446
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9448
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9450
if (alloc_size == 0)
9456
- retarray->base_addr = xmalloc (alloc_size);
9457
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9461
Index: libgfortran/generated/matmul_l16.c
9462
===================================================================
9463
--- a/src/libgfortran/generated/matmul_l16.c (.../tags/gcc_4_8_3_release)
9464
+++ b/src/libgfortran/generated/matmul_l16.c (.../branches/gcc-4_8-branch)
9469
- = xmalloc (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
9470
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_16));
9471
retarray->offset = 0;
9473
else if (unlikely (compile_options.bounds_check))
9474
Index: libgfortran/generated/maxloc1_8_i1.c
9475
===================================================================
9476
--- a/src/libgfortran/generated/maxloc1_8_i1.c (.../tags/gcc_4_8_3_release)
9477
+++ b/src/libgfortran/generated/maxloc1_8_i1.c (.../branches/gcc-4_8-branch)
9479
retarray->offset = 0;
9480
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9482
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9484
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9486
- retarray->base_addr = xmalloc (alloc_size);
9487
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9488
if (alloc_size == 0)
9490
/* Make sure we have a zero-sized array. */
9495
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9497
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9499
retarray->offset = 0;
9500
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9505
- retarray->base_addr = xmalloc (alloc_size);
9506
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9511
retarray->offset = 0;
9512
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9514
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9516
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9518
if (alloc_size == 0)
9524
- retarray->base_addr = xmalloc (alloc_size);
9525
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9529
Index: libgfortran/generated/minloc1_8_i8.c
9530
===================================================================
9531
--- a/src/libgfortran/generated/minloc1_8_i8.c (.../tags/gcc_4_8_3_release)
9532
+++ b/src/libgfortran/generated/minloc1_8_i8.c (.../branches/gcc-4_8-branch)
9534
retarray->offset = 0;
9535
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9537
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9539
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9541
- retarray->base_addr = xmalloc (alloc_size);
9542
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9543
if (alloc_size == 0)
9545
/* Make sure we have a zero-sized array. */
9550
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9552
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9554
retarray->offset = 0;
9555
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9560
- retarray->base_addr = xmalloc (alloc_size);
9561
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9566
retarray->offset = 0;
9567
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9569
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9571
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9573
if (alloc_size == 0)
9579
- retarray->base_addr = xmalloc (alloc_size);
9580
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9584
Index: libgfortran/generated/minloc0_4_r8.c
9585
===================================================================
9586
--- a/src/libgfortran/generated/minloc0_4_r8.c (.../tags/gcc_4_8_3_release)
9587
+++ b/src/libgfortran/generated/minloc0_4_r8.c (.../branches/gcc-4_8-branch)
9589
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
9590
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9591
retarray->offset = 0;
9592
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
9593
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
9598
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
9599
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9600
retarray->offset = 0;
9601
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
9602
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
9607
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
9608
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
9609
retarray->offset = 0;
9610
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
9611
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
9613
else if (unlikely (compile_options.bounds_check))
9615
Index: libgfortran/generated/product_r16.c
9616
===================================================================
9617
--- a/src/libgfortran/generated/product_r16.c (.../tags/gcc_4_8_3_release)
9618
+++ b/src/libgfortran/generated/product_r16.c (.../branches/gcc-4_8-branch)
9620
retarray->offset = 0;
9621
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9623
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9625
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9627
- retarray->base_addr = xmalloc (alloc_size);
9628
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
9629
if (alloc_size == 0)
9631
/* Make sure we have a zero-sized array. */
9636
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9638
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9640
retarray->offset = 0;
9641
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9646
- retarray->base_addr = xmalloc (alloc_size);
9647
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
9652
retarray->offset = 0;
9653
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9655
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9657
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9659
if (alloc_size == 0)
9665
- retarray->base_addr = xmalloc (alloc_size);
9666
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
9670
Index: libgfortran/generated/sum_r8.c
9671
===================================================================
9672
--- a/src/libgfortran/generated/sum_r8.c (.../tags/gcc_4_8_3_release)
9673
+++ b/src/libgfortran/generated/sum_r8.c (.../branches/gcc-4_8-branch)
9675
retarray->offset = 0;
9676
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9678
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9680
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9682
- retarray->base_addr = xmalloc (alloc_size);
9683
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
9684
if (alloc_size == 0)
9686
/* Make sure we have a zero-sized array. */
9691
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9693
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9695
retarray->offset = 0;
9696
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9701
- retarray->base_addr = xmalloc (alloc_size);
9702
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
9707
retarray->offset = 0;
9708
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9710
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9712
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9714
if (alloc_size == 0)
9720
- retarray->base_addr = xmalloc (alloc_size);
9721
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
9725
Index: libgfortran/generated/norm2_r10.c
9726
===================================================================
9727
--- a/src/libgfortran/generated/norm2_r10.c (.../tags/gcc_4_8_3_release)
9728
+++ b/src/libgfortran/generated/norm2_r10.c (.../branches/gcc-4_8-branch)
9729
@@ -101,10 +101,9 @@
9730
retarray->offset = 0;
9731
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9733
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9735
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9737
- retarray->base_addr = xmalloc (alloc_size);
9738
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
9739
if (alloc_size == 0)
9741
/* Make sure we have a zero-sized array. */
9742
Index: libgfortran/generated/unpack_c10.c
9743
===================================================================
9744
--- a/src/libgfortran/generated/unpack_c10.c (.../tags/gcc_4_8_3_release)
9745
+++ b/src/libgfortran/generated/unpack_c10.c (.../branches/gcc-4_8-branch)
9750
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
9751
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
9759
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
9760
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
9764
Index: libgfortran/generated/spread_r8.c
9765
===================================================================
9766
--- a/src/libgfortran/generated/spread_r8.c (.../tags/gcc_4_8_3_release)
9767
+++ b/src/libgfortran/generated/spread_r8.c (.../branches/gcc-4_8-branch)
9772
- /* xmalloc allocates a single byte for zero size. */
9773
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
9774
+ /* xmallocarray allocates a single byte for zero size. */
9775
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
9781
if (ret->base_addr == NULL)
9783
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
9784
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
9786
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
9788
Index: libgfortran/generated/minloc1_16_i16.c
9789
===================================================================
9790
--- a/src/libgfortran/generated/minloc1_16_i16.c (.../tags/gcc_4_8_3_release)
9791
+++ b/src/libgfortran/generated/minloc1_16_i16.c (.../branches/gcc-4_8-branch)
9793
retarray->offset = 0;
9794
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9796
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9798
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9800
- retarray->base_addr = xmalloc (alloc_size);
9801
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9802
if (alloc_size == 0)
9804
/* Make sure we have a zero-sized array. */
9809
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9811
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9813
retarray->offset = 0;
9814
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9819
- retarray->base_addr = xmalloc (alloc_size);
9820
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9825
retarray->offset = 0;
9826
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9828
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9830
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9832
if (alloc_size == 0)
9838
- retarray->base_addr = xmalloc (alloc_size);
9839
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9843
Index: libgfortran/generated/maxloc1_8_r4.c
9844
===================================================================
9845
--- a/src/libgfortran/generated/maxloc1_8_r4.c (.../tags/gcc_4_8_3_release)
9846
+++ b/src/libgfortran/generated/maxloc1_8_r4.c (.../branches/gcc-4_8-branch)
9848
retarray->offset = 0;
9849
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9851
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9853
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9855
- retarray->base_addr = xmalloc (alloc_size);
9856
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9857
if (alloc_size == 0)
9859
/* Make sure we have a zero-sized array. */
9864
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9866
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9868
retarray->offset = 0;
9869
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9874
- retarray->base_addr = xmalloc (alloc_size);
9875
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9880
retarray->offset = 0;
9881
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9883
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9885
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9887
if (alloc_size == 0)
9893
- retarray->base_addr = xmalloc (alloc_size);
9894
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
9898
Index: libgfortran/generated/minloc1_16_i1.c
9899
===================================================================
9900
--- a/src/libgfortran/generated/minloc1_16_i1.c (.../tags/gcc_4_8_3_release)
9901
+++ b/src/libgfortran/generated/minloc1_16_i1.c (.../branches/gcc-4_8-branch)
9903
retarray->offset = 0;
9904
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9906
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9908
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9910
- retarray->base_addr = xmalloc (alloc_size);
9911
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9912
if (alloc_size == 0)
9914
/* Make sure we have a zero-sized array. */
9919
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9921
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9923
retarray->offset = 0;
9924
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9929
- retarray->base_addr = xmalloc (alloc_size);
9930
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9935
retarray->offset = 0;
9936
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9938
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9940
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9942
if (alloc_size == 0)
9948
- retarray->base_addr = xmalloc (alloc_size);
9949
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
9953
Index: libgfortran/generated/spread_r16.c
9954
===================================================================
9955
--- a/src/libgfortran/generated/spread_r16.c (.../tags/gcc_4_8_3_release)
9956
+++ b/src/libgfortran/generated/spread_r16.c (.../branches/gcc-4_8-branch)
9961
- /* xmalloc allocates a single byte for zero size. */
9962
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_16));
9963
+ /* xmallocarray allocates a single byte for zero size. */
9964
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_16));
9970
if (ret->base_addr == NULL)
9972
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_16));
9973
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_16));
9975
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
9977
Index: libgfortran/generated/pack_c8.c
9978
===================================================================
9979
--- a/src/libgfortran/generated/pack_c8.c (.../tags/gcc_4_8_3_release)
9980
+++ b/src/libgfortran/generated/pack_c8.c (.../branches/gcc-4_8-branch)
9985
- /* xmalloc allocates a single byte for zero size. */
9986
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * total);
9987
+ /* xmallocarray allocates a single byte for zero size. */
9988
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_8));
9992
Index: libgfortran/generated/minval_r10.c
9993
===================================================================
9994
--- a/src/libgfortran/generated/minval_r10.c (.../tags/gcc_4_8_3_release)
9995
+++ b/src/libgfortran/generated/minval_r10.c (.../branches/gcc-4_8-branch)
9997
retarray->offset = 0;
9998
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10000
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10001
- * extent[rank-1];
10002
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10004
- retarray->base_addr = xmalloc (alloc_size);
10005
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
10006
if (alloc_size == 0)
10008
/* Make sure we have a zero-sized array. */
10009
@@ -286,8 +285,7 @@
10013
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10014
- * extent[rank-1];
10015
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10017
retarray->offset = 0;
10018
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10019
@@ -299,7 +297,7 @@
10023
- retarray->base_addr = xmalloc (alloc_size);
10024
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
10028
@@ -472,8 +470,7 @@
10029
retarray->offset = 0;
10030
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10032
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10033
- * extent[rank-1];
10034
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10036
if (alloc_size == 0)
10038
@@ -482,7 +479,7 @@
10042
- retarray->base_addr = xmalloc (alloc_size);
10043
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
10047
Index: libgfortran/generated/parity_l8.c
10048
===================================================================
10049
--- a/src/libgfortran/generated/parity_l8.c (.../tags/gcc_4_8_3_release)
10050
+++ b/src/libgfortran/generated/parity_l8.c (.../branches/gcc-4_8-branch)
10052
retarray->offset = 0;
10053
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10055
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10056
- * extent[rank-1];
10057
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10059
- retarray->base_addr = xmalloc (alloc_size);
10060
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
10061
if (alloc_size == 0)
10063
/* Make sure we have a zero-sized array. */
10064
Index: libgfortran/generated/minval_i4.c
10065
===================================================================
10066
--- a/src/libgfortran/generated/minval_i4.c (.../tags/gcc_4_8_3_release)
10067
+++ b/src/libgfortran/generated/minval_i4.c (.../branches/gcc-4_8-branch)
10069
retarray->offset = 0;
10070
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10072
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10073
- * extent[rank-1];
10074
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10076
- retarray->base_addr = xmalloc (alloc_size);
10077
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10078
if (alloc_size == 0)
10080
/* Make sure we have a zero-sized array. */
10081
@@ -286,8 +285,7 @@
10085
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10086
- * extent[rank-1];
10087
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10089
retarray->offset = 0;
10090
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10091
@@ -299,7 +297,7 @@
10095
- retarray->base_addr = xmalloc (alloc_size);
10096
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10100
@@ -472,8 +470,7 @@
10101
retarray->offset = 0;
10102
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10104
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10105
- * extent[rank-1];
10106
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10108
if (alloc_size == 0)
10110
@@ -482,7 +479,7 @@
10114
- retarray->base_addr = xmalloc (alloc_size);
10115
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10119
Index: libgfortran/generated/maxloc1_8_i2.c
10120
===================================================================
10121
--- a/src/libgfortran/generated/maxloc1_8_i2.c (.../tags/gcc_4_8_3_release)
10122
+++ b/src/libgfortran/generated/maxloc1_8_i2.c (.../branches/gcc-4_8-branch)
10124
retarray->offset = 0;
10125
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10127
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10128
- * extent[rank-1];
10129
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10131
- retarray->base_addr = xmalloc (alloc_size);
10132
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10133
if (alloc_size == 0)
10135
/* Make sure we have a zero-sized array. */
10136
@@ -294,8 +293,7 @@
10140
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10141
- * extent[rank-1];
10142
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10144
retarray->offset = 0;
10145
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10146
@@ -307,7 +305,7 @@
10150
- retarray->base_addr = xmalloc (alloc_size);
10151
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10155
@@ -485,8 +483,7 @@
10156
retarray->offset = 0;
10157
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10159
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10160
- * extent[rank-1];
10161
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10163
if (alloc_size == 0)
10165
@@ -495,7 +492,7 @@
10169
- retarray->base_addr = xmalloc (alloc_size);
10170
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10174
Index: libgfortran/generated/any_l8.c
10175
===================================================================
10176
--- a/src/libgfortran/generated/any_l8.c (.../tags/gcc_4_8_3_release)
10177
+++ b/src/libgfortran/generated/any_l8.c (.../branches/gcc-4_8-branch)
10178
@@ -101,8 +101,7 @@
10179
retarray->offset = 0;
10180
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10182
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10183
- * extent[rank-1];
10184
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10186
if (alloc_size == 0)
10188
@@ -111,7 +110,7 @@
10192
- retarray->base_addr = xmalloc (alloc_size);
10193
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
10197
Index: libgfortran/generated/maxloc0_16_r10.c
10198
===================================================================
10199
--- a/src/libgfortran/generated/maxloc0_16_r10.c (.../tags/gcc_4_8_3_release)
10200
+++ b/src/libgfortran/generated/maxloc0_16_r10.c (.../branches/gcc-4_8-branch)
10202
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10203
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10204
retarray->offset = 0;
10205
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10206
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10210
@@ -199,7 +199,7 @@
10211
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10212
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10213
retarray->offset = 0;
10214
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10215
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10219
@@ -367,7 +367,7 @@
10220
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10221
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10222
retarray->offset = 0;
10223
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10224
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10226
else if (unlikely (compile_options.bounds_check))
10228
Index: libgfortran/generated/minloc0_4_i16.c
10229
===================================================================
10230
--- a/src/libgfortran/generated/minloc0_4_i16.c (.../tags/gcc_4_8_3_release)
10231
+++ b/src/libgfortran/generated/minloc0_4_i16.c (.../branches/gcc-4_8-branch)
10233
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10234
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10235
retarray->offset = 0;
10236
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10237
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10241
@@ -199,7 +199,7 @@
10242
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10243
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10244
retarray->offset = 0;
10245
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10246
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10250
@@ -367,7 +367,7 @@
10251
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10252
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10253
retarray->offset = 0;
10254
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10255
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10257
else if (unlikely (compile_options.bounds_check))
10259
Index: libgfortran/generated/maxloc0_8_r8.c
10260
===================================================================
10261
--- a/src/libgfortran/generated/maxloc0_8_r8.c (.../tags/gcc_4_8_3_release)
10262
+++ b/src/libgfortran/generated/maxloc0_8_r8.c (.../branches/gcc-4_8-branch)
10264
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10265
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10266
retarray->offset = 0;
10267
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
10268
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
10272
@@ -199,7 +199,7 @@
10273
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10274
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10275
retarray->offset = 0;
10276
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
10277
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
10281
@@ -367,7 +367,7 @@
10282
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10283
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10284
retarray->offset = 0;
10285
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
10286
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
10288
else if (unlikely (compile_options.bounds_check))
10290
Index: libgfortran/generated/minloc1_4_r10.c
10291
===================================================================
10292
--- a/src/libgfortran/generated/minloc1_4_r10.c (.../tags/gcc_4_8_3_release)
10293
+++ b/src/libgfortran/generated/minloc1_4_r10.c (.../branches/gcc-4_8-branch)
10295
retarray->offset = 0;
10296
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10298
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10299
- * extent[rank-1];
10300
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10302
- retarray->base_addr = xmalloc (alloc_size);
10303
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10304
if (alloc_size == 0)
10306
/* Make sure we have a zero-sized array. */
10307
@@ -294,8 +293,7 @@
10311
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10312
- * extent[rank-1];
10313
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10315
retarray->offset = 0;
10316
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10317
@@ -307,7 +305,7 @@
10321
- retarray->base_addr = xmalloc (alloc_size);
10322
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10326
@@ -485,8 +483,7 @@
10327
retarray->offset = 0;
10328
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10330
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10331
- * extent[rank-1];
10332
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10334
if (alloc_size == 0)
10336
@@ -495,7 +492,7 @@
10340
- retarray->base_addr = xmalloc (alloc_size);
10341
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10345
Index: libgfortran/generated/minloc1_8_i16.c
10346
===================================================================
10347
--- a/src/libgfortran/generated/minloc1_8_i16.c (.../tags/gcc_4_8_3_release)
10348
+++ b/src/libgfortran/generated/minloc1_8_i16.c (.../branches/gcc-4_8-branch)
10350
retarray->offset = 0;
10351
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10353
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10354
- * extent[rank-1];
10355
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10357
- retarray->base_addr = xmalloc (alloc_size);
10358
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10359
if (alloc_size == 0)
10361
/* Make sure we have a zero-sized array. */
10362
@@ -294,8 +293,7 @@
10366
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10367
- * extent[rank-1];
10368
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10370
retarray->offset = 0;
10371
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10372
@@ -307,7 +305,7 @@
10376
- retarray->base_addr = xmalloc (alloc_size);
10377
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10381
@@ -485,8 +483,7 @@
10382
retarray->offset = 0;
10383
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10385
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10386
- * extent[rank-1];
10387
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10389
if (alloc_size == 0)
10391
@@ -495,7 +492,7 @@
10395
- retarray->base_addr = xmalloc (alloc_size);
10396
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10400
Index: libgfortran/generated/maxloc0_8_r10.c
10401
===================================================================
10402
--- a/src/libgfortran/generated/maxloc0_8_r10.c (.../tags/gcc_4_8_3_release)
10403
+++ b/src/libgfortran/generated/maxloc0_8_r10.c (.../branches/gcc-4_8-branch)
10405
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10406
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10407
retarray->offset = 0;
10408
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
10409
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
10413
@@ -199,7 +199,7 @@
10414
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10415
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10416
retarray->offset = 0;
10417
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
10418
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
10422
@@ -367,7 +367,7 @@
10423
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10424
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10425
retarray->offset = 0;
10426
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
10427
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
10429
else if (unlikely (compile_options.bounds_check))
10431
Index: libgfortran/generated/unpack_i4.c
10432
===================================================================
10433
--- a/src/libgfortran/generated/unpack_i4.c (.../tags/gcc_4_8_3_release)
10434
+++ b/src/libgfortran/generated/unpack_i4.c (.../branches/gcc-4_8-branch)
10439
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
10440
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
10444
@@ -244,7 +244,7 @@
10448
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
10449
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
10453
Index: libgfortran/generated/minloc1_16_r4.c
10454
===================================================================
10455
--- a/src/libgfortran/generated/minloc1_16_r4.c (.../tags/gcc_4_8_3_release)
10456
+++ b/src/libgfortran/generated/minloc1_16_r4.c (.../branches/gcc-4_8-branch)
10458
retarray->offset = 0;
10459
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10461
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10462
- * extent[rank-1];
10463
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10465
- retarray->base_addr = xmalloc (alloc_size);
10466
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10467
if (alloc_size == 0)
10469
/* Make sure we have a zero-sized array. */
10470
@@ -294,8 +293,7 @@
10474
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10475
- * extent[rank-1];
10476
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10478
retarray->offset = 0;
10479
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10480
@@ -307,7 +305,7 @@
10484
- retarray->base_addr = xmalloc (alloc_size);
10485
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10489
@@ -485,8 +483,7 @@
10490
retarray->offset = 0;
10491
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10493
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10494
- * extent[rank-1];
10495
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10497
if (alloc_size == 0)
10499
@@ -495,7 +492,7 @@
10503
- retarray->base_addr = xmalloc (alloc_size);
10504
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10508
Index: libgfortran/generated/product_i8.c
10509
===================================================================
10510
--- a/src/libgfortran/generated/product_i8.c (.../tags/gcc_4_8_3_release)
10511
+++ b/src/libgfortran/generated/product_i8.c (.../branches/gcc-4_8-branch)
10513
retarray->offset = 0;
10514
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10516
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10517
- * extent[rank-1];
10518
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10520
- retarray->base_addr = xmalloc (alloc_size);
10521
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10522
if (alloc_size == 0)
10524
/* Make sure we have a zero-sized array. */
10525
@@ -272,8 +271,7 @@
10529
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10530
- * extent[rank-1];
10531
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10533
retarray->offset = 0;
10534
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10535
@@ -285,7 +283,7 @@
10539
- retarray->base_addr = xmalloc (alloc_size);
10540
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10544
@@ -430,8 +428,7 @@
10545
retarray->offset = 0;
10546
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10548
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10549
- * extent[rank-1];
10550
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10552
if (alloc_size == 0)
10554
@@ -440,7 +437,7 @@
10558
- retarray->base_addr = xmalloc (alloc_size);
10559
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10563
Index: libgfortran/generated/minloc0_16_r8.c
10564
===================================================================
10565
--- a/src/libgfortran/generated/minloc0_16_r8.c (.../tags/gcc_4_8_3_release)
10566
+++ b/src/libgfortran/generated/minloc0_16_r8.c (.../branches/gcc-4_8-branch)
10568
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10569
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10570
retarray->offset = 0;
10571
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10572
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10576
@@ -199,7 +199,7 @@
10577
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10578
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10579
retarray->offset = 0;
10580
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10581
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10585
@@ -367,7 +367,7 @@
10586
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10587
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10588
retarray->offset = 0;
10589
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10590
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10592
else if (unlikely (compile_options.bounds_check))
10594
Index: libgfortran/generated/count_2_l.c
10595
===================================================================
10596
--- a/src/libgfortran/generated/count_2_l.c (.../tags/gcc_4_8_3_release)
10597
+++ b/src/libgfortran/generated/count_2_l.c (.../branches/gcc-4_8-branch)
10598
@@ -101,8 +101,7 @@
10599
retarray->offset = 0;
10600
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10602
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10603
- * extent[rank-1];
10604
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10606
if (alloc_size == 0)
10608
@@ -111,7 +110,7 @@
10612
- retarray->base_addr = xmalloc (alloc_size);
10613
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
10617
Index: libgfortran/generated/transpose_r8.c
10618
===================================================================
10619
--- a/src/libgfortran/generated/transpose_r8.c (.../tags/gcc_4_8_3_release)
10620
+++ b/src/libgfortran/generated/transpose_r8.c (.../branches/gcc-4_8-branch)
10622
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
10623
GFC_DESCRIPTOR_EXTENT(source, 1));
10625
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
10626
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
10627
+ sizeof (GFC_REAL_8));
10629
} else if (unlikely (compile_options.bounds_check))
10631
Index: libgfortran/generated/cshift1_8.c
10632
===================================================================
10633
--- a/src/libgfortran/generated/cshift1_8.c (.../tags/gcc_4_8_3_release)
10634
+++ b/src/libgfortran/generated/cshift1_8.c (.../branches/gcc-4_8-branch)
10639
- ret->base_addr = xmalloc (size * arraysize);
10640
+ ret->base_addr = xmallocarray (arraysize, size);
10642
ret->dtype = array->dtype;
10643
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
10644
Index: libgfortran/generated/matmul_i4.c
10645
===================================================================
10646
--- a/src/libgfortran/generated/matmul_i4.c (.../tags/gcc_4_8_3_release)
10647
+++ b/src/libgfortran/generated/matmul_i4.c (.../branches/gcc-4_8-branch)
10648
@@ -124,7 +124,7 @@
10651
retarray->base_addr
10652
- = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
10653
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_4));
10654
retarray->offset = 0;
10656
else if (unlikely (compile_options.bounds_check))
10657
Index: libgfortran/generated/pack_r10.c
10658
===================================================================
10659
--- a/src/libgfortran/generated/pack_r10.c (.../tags/gcc_4_8_3_release)
10660
+++ b/src/libgfortran/generated/pack_r10.c (.../branches/gcc-4_8-branch)
10661
@@ -167,8 +167,8 @@
10665
- /* xmalloc allocates a single byte for zero size. */
10666
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * total);
10667
+ /* xmallocarray allocates a single byte for zero size. */
10668
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_10));
10672
Index: libgfortran/generated/minloc1_16_i2.c
10673
===================================================================
10674
--- a/src/libgfortran/generated/minloc1_16_i2.c (.../tags/gcc_4_8_3_release)
10675
+++ b/src/libgfortran/generated/minloc1_16_i2.c (.../branches/gcc-4_8-branch)
10677
retarray->offset = 0;
10678
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10680
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10681
- * extent[rank-1];
10682
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10684
- retarray->base_addr = xmalloc (alloc_size);
10685
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10686
if (alloc_size == 0)
10688
/* Make sure we have a zero-sized array. */
10689
@@ -294,8 +293,7 @@
10693
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10694
- * extent[rank-1];
10695
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10697
retarray->offset = 0;
10698
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10699
@@ -307,7 +305,7 @@
10703
- retarray->base_addr = xmalloc (alloc_size);
10704
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10708
@@ -485,8 +483,7 @@
10709
retarray->offset = 0;
10710
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10712
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10713
- * extent[rank-1];
10714
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10716
if (alloc_size == 0)
10718
@@ -495,7 +492,7 @@
10722
- retarray->base_addr = xmalloc (alloc_size);
10723
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10727
Index: libgfortran/generated/in_pack_i8.c
10728
===================================================================
10729
--- a/src/libgfortran/generated/in_pack_i8.c (.../tags/gcc_4_8_3_release)
10730
+++ b/src/libgfortran/generated/in_pack_i8.c (.../branches/gcc-4_8-branch)
10732
return source->base_addr;
10734
/* Allocate storage for the destination. */
10735
- destptr = (GFC_INTEGER_8 *)xmalloc (ssize * sizeof (GFC_INTEGER_8));
10736
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_8));
10738
src = source->base_addr;
10739
stride0 = stride[0];
10740
Index: libgfortran/generated/transpose_r16.c
10741
===================================================================
10742
--- a/src/libgfortran/generated/transpose_r16.c (.../tags/gcc_4_8_3_release)
10743
+++ b/src/libgfortran/generated/transpose_r16.c (.../branches/gcc-4_8-branch)
10745
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
10746
GFC_DESCRIPTOR_EXTENT(source, 1));
10748
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
10749
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
10750
+ sizeof (GFC_REAL_16));
10752
} else if (unlikely (compile_options.bounds_check))
10754
Index: libgfortran/generated/minloc1_4_i4.c
10755
===================================================================
10756
--- a/src/libgfortran/generated/minloc1_4_i4.c (.../tags/gcc_4_8_3_release)
10757
+++ b/src/libgfortran/generated/minloc1_4_i4.c (.../branches/gcc-4_8-branch)
10759
retarray->offset = 0;
10760
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10762
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10763
- * extent[rank-1];
10764
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10766
- retarray->base_addr = xmalloc (alloc_size);
10767
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10768
if (alloc_size == 0)
10770
/* Make sure we have a zero-sized array. */
10771
@@ -294,8 +293,7 @@
10775
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10776
- * extent[rank-1];
10777
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10779
retarray->offset = 0;
10780
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10781
@@ -307,7 +305,7 @@
10785
- retarray->base_addr = xmalloc (alloc_size);
10786
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10790
@@ -485,8 +483,7 @@
10791
retarray->offset = 0;
10792
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10794
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10795
- * extent[rank-1];
10796
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10798
if (alloc_size == 0)
10800
@@ -495,7 +492,7 @@
10804
- retarray->base_addr = xmalloc (alloc_size);
10805
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10809
Index: libgfortran/generated/maxval_i1.c
10810
===================================================================
10811
--- a/src/libgfortran/generated/maxval_i1.c (.../tags/gcc_4_8_3_release)
10812
+++ b/src/libgfortran/generated/maxval_i1.c (.../branches/gcc-4_8-branch)
10814
retarray->offset = 0;
10815
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10817
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10818
- * extent[rank-1];
10819
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10821
- retarray->base_addr = xmalloc (alloc_size);
10822
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
10823
if (alloc_size == 0)
10825
/* Make sure we have a zero-sized array. */
10826
@@ -286,8 +285,7 @@
10830
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10831
- * extent[rank-1];
10832
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10834
retarray->offset = 0;
10835
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10836
@@ -299,7 +297,7 @@
10840
- retarray->base_addr = xmalloc (alloc_size);
10841
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
10845
@@ -472,8 +470,7 @@
10846
retarray->offset = 0;
10847
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10849
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10850
- * extent[rank-1];
10851
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10853
if (alloc_size == 0)
10855
@@ -482,7 +479,7 @@
10859
- retarray->base_addr = xmalloc (alloc_size);
10860
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
10864
Index: libgfortran/generated/product_c16.c
10865
===================================================================
10866
--- a/src/libgfortran/generated/product_c16.c (.../tags/gcc_4_8_3_release)
10867
+++ b/src/libgfortran/generated/product_c16.c (.../branches/gcc-4_8-branch)
10869
retarray->offset = 0;
10870
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10872
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10873
- * extent[rank-1];
10874
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10876
- retarray->base_addr = xmalloc (alloc_size);
10877
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
10878
if (alloc_size == 0)
10880
/* Make sure we have a zero-sized array. */
10881
@@ -272,8 +271,7 @@
10885
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10886
- * extent[rank-1];
10887
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10889
retarray->offset = 0;
10890
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10891
@@ -285,7 +283,7 @@
10895
- retarray->base_addr = xmalloc (alloc_size);
10896
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
10900
@@ -430,8 +428,7 @@
10901
retarray->offset = 0;
10902
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10904
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10905
- * extent[rank-1];
10906
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10908
if (alloc_size == 0)
10910
@@ -440,7 +437,7 @@
10914
- retarray->base_addr = xmalloc (alloc_size);
10915
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
10919
Index: libgfortran/generated/reshape_r4.c
10920
===================================================================
10921
--- a/src/libgfortran/generated/reshape_r4.c (.../tags/gcc_4_8_3_release)
10922
+++ b/src/libgfortran/generated/reshape_r4.c (.../branches/gcc-4_8-branch)
10923
@@ -111,11 +111,11 @@
10926
if (unlikely (rs < 1))
10930
- alloc_size = rs * sizeof (GFC_REAL_4);
10933
- ret->base_addr = xmalloc (alloc_size);
10934
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
10935
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
10938
Index: libgfortran/generated/iany_i8.c
10939
===================================================================
10940
--- a/src/libgfortran/generated/iany_i8.c (.../tags/gcc_4_8_3_release)
10941
+++ b/src/libgfortran/generated/iany_i8.c (.../branches/gcc-4_8-branch)
10943
retarray->offset = 0;
10944
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10946
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10947
- * extent[rank-1];
10948
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10950
- retarray->base_addr = xmalloc (alloc_size);
10951
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10952
if (alloc_size == 0)
10954
/* Make sure we have a zero-sized array. */
10955
@@ -272,8 +271,7 @@
10959
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10960
- * extent[rank-1];
10961
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10963
retarray->offset = 0;
10964
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10965
@@ -285,7 +283,7 @@
10969
- retarray->base_addr = xmalloc (alloc_size);
10970
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10974
@@ -430,8 +428,7 @@
10975
retarray->offset = 0;
10976
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10978
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10979
- * extent[rank-1];
10980
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10982
if (alloc_size == 0)
10984
@@ -440,7 +437,7 @@
10988
- retarray->base_addr = xmalloc (alloc_size);
10989
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10993
Index: libgfortran/generated/cshift1_16.c
10994
===================================================================
10995
--- a/src/libgfortran/generated/cshift1_16.c (.../tags/gcc_4_8_3_release)
10996
+++ b/src/libgfortran/generated/cshift1_16.c (.../branches/gcc-4_8-branch)
11001
- ret->base_addr = xmalloc (size * arraysize);
11002
+ ret->base_addr = xmallocarray (arraysize, size);
11004
ret->dtype = array->dtype;
11005
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
11006
Index: libgfortran/generated/maxloc0_4_i1.c
11007
===================================================================
11008
--- a/src/libgfortran/generated/maxloc0_4_i1.c (.../tags/gcc_4_8_3_release)
11009
+++ b/src/libgfortran/generated/maxloc0_4_i1.c (.../branches/gcc-4_8-branch)
11011
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11012
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11013
retarray->offset = 0;
11014
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11015
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11019
@@ -199,7 +199,7 @@
11020
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11021
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11022
retarray->offset = 0;
11023
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11024
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11028
@@ -367,7 +367,7 @@
11029
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11030
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11031
retarray->offset = 0;
11032
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11033
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11035
else if (unlikely (compile_options.bounds_check))
11037
Index: libgfortran/generated/minloc0_4_i8.c
11038
===================================================================
11039
--- a/src/libgfortran/generated/minloc0_4_i8.c (.../tags/gcc_4_8_3_release)
11040
+++ b/src/libgfortran/generated/minloc0_4_i8.c (.../branches/gcc-4_8-branch)
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_4) * rank);
11046
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11050
@@ -199,7 +199,7 @@
11051
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11052
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11053
retarray->offset = 0;
11054
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11055
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11059
@@ -367,7 +367,7 @@
11060
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11061
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11062
retarray->offset = 0;
11063
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11064
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11066
else if (unlikely (compile_options.bounds_check))
11068
Index: libgfortran/generated/spread_c16.c
11069
===================================================================
11070
--- a/src/libgfortran/generated/spread_c16.c (.../tags/gcc_4_8_3_release)
11071
+++ b/src/libgfortran/generated/spread_c16.c (.../branches/gcc-4_8-branch)
11072
@@ -101,8 +101,8 @@
11076
- /* xmalloc allocates a single byte for zero size. */
11077
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_16));
11078
+ /* xmallocarray allocates a single byte for zero size. */
11079
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_16));
11083
@@ -244,7 +244,7 @@
11085
if (ret->base_addr == NULL)
11087
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_16));
11088
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_16));
11090
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
11092
Index: libgfortran/generated/maxval_r4.c
11093
===================================================================
11094
--- a/src/libgfortran/generated/maxval_r4.c (.../tags/gcc_4_8_3_release)
11095
+++ b/src/libgfortran/generated/maxval_r4.c (.../branches/gcc-4_8-branch)
11097
retarray->offset = 0;
11098
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11100
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11101
- * extent[rank-1];
11102
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11104
- retarray->base_addr = xmalloc (alloc_size);
11105
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
11106
if (alloc_size == 0)
11108
/* Make sure we have a zero-sized array. */
11109
@@ -286,8 +285,7 @@
11113
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11114
- * extent[rank-1];
11115
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11117
retarray->offset = 0;
11118
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11119
@@ -299,7 +297,7 @@
11123
- retarray->base_addr = xmalloc (alloc_size);
11124
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
11128
@@ -472,8 +470,7 @@
11129
retarray->offset = 0;
11130
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11132
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11133
- * extent[rank-1];
11134
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11136
if (alloc_size == 0)
11138
@@ -482,7 +479,7 @@
11142
- retarray->base_addr = xmalloc (alloc_size);
11143
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
11147
Index: libgfortran/generated/minval_r8.c
11148
===================================================================
11149
--- a/src/libgfortran/generated/minval_r8.c (.../tags/gcc_4_8_3_release)
11150
+++ b/src/libgfortran/generated/minval_r8.c (.../branches/gcc-4_8-branch)
11152
retarray->offset = 0;
11153
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11155
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11156
- * extent[rank-1];
11157
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11159
- retarray->base_addr = xmalloc (alloc_size);
11160
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
11161
if (alloc_size == 0)
11163
/* Make sure we have a zero-sized array. */
11164
@@ -286,8 +285,7 @@
11168
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11169
- * extent[rank-1];
11170
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11172
retarray->offset = 0;
11173
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11174
@@ -299,7 +297,7 @@
11178
- retarray->base_addr = xmalloc (alloc_size);
11179
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
11183
@@ -472,8 +470,7 @@
11184
retarray->offset = 0;
11185
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11187
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11188
- * extent[rank-1];
11189
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11191
if (alloc_size == 0)
11193
@@ -482,7 +479,7 @@
11197
- retarray->base_addr = xmalloc (alloc_size);
11198
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
11202
Index: libgfortran/generated/minloc1_16_r16.c
11203
===================================================================
11204
--- a/src/libgfortran/generated/minloc1_16_r16.c (.../tags/gcc_4_8_3_release)
11205
+++ b/src/libgfortran/generated/minloc1_16_r16.c (.../branches/gcc-4_8-branch)
11207
retarray->offset = 0;
11208
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11210
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11211
- * extent[rank-1];
11212
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11214
- retarray->base_addr = xmalloc (alloc_size);
11215
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11216
if (alloc_size == 0)
11218
/* Make sure we have a zero-sized array. */
11219
@@ -294,8 +293,7 @@
11223
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11224
- * extent[rank-1];
11225
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11227
retarray->offset = 0;
11228
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11229
@@ -307,7 +305,7 @@
11233
- retarray->base_addr = xmalloc (alloc_size);
11234
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11238
@@ -485,8 +483,7 @@
11239
retarray->offset = 0;
11240
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11242
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11243
- * extent[rank-1];
11244
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11246
if (alloc_size == 0)
11248
@@ -495,7 +492,7 @@
11252
- retarray->base_addr = xmalloc (alloc_size);
11253
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11257
Index: libgfortran/generated/unpack_i16.c
11258
===================================================================
11259
--- a/src/libgfortran/generated/unpack_i16.c (.../tags/gcc_4_8_3_release)
11260
+++ b/src/libgfortran/generated/unpack_i16.c (.../branches/gcc-4_8-branch)
11265
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
11266
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
11270
@@ -244,7 +244,7 @@
11274
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
11275
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
11279
Index: libgfortran/generated/sum_i8.c
11280
===================================================================
11281
--- a/src/libgfortran/generated/sum_i8.c (.../tags/gcc_4_8_3_release)
11282
+++ b/src/libgfortran/generated/sum_i8.c (.../branches/gcc-4_8-branch)
11284
retarray->offset = 0;
11285
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11287
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11288
- * extent[rank-1];
11289
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11291
- retarray->base_addr = xmalloc (alloc_size);
11292
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11293
if (alloc_size == 0)
11295
/* Make sure we have a zero-sized array. */
11296
@@ -272,8 +271,7 @@
11300
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11301
- * extent[rank-1];
11302
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11304
retarray->offset = 0;
11305
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11306
@@ -285,7 +283,7 @@
11310
- retarray->base_addr = xmalloc (alloc_size);
11311
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11315
@@ -430,8 +428,7 @@
11316
retarray->offset = 0;
11317
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11319
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11320
- * extent[rank-1];
11321
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11323
if (alloc_size == 0)
11325
@@ -440,7 +437,7 @@
11329
- retarray->base_addr = xmalloc (alloc_size);
11330
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11334
Index: libgfortran/generated/pack_i1.c
11335
===================================================================
11336
--- a/src/libgfortran/generated/pack_i1.c (.../tags/gcc_4_8_3_release)
11337
+++ b/src/libgfortran/generated/pack_i1.c (.../branches/gcc-4_8-branch)
11338
@@ -167,8 +167,8 @@
11342
- /* xmalloc allocates a single byte for zero size. */
11343
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_1) * total);
11344
+ /* xmallocarray allocates a single byte for zero size. */
11345
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_1));
11349
Index: libgfortran/generated/any_l16.c
11350
===================================================================
11351
--- a/src/libgfortran/generated/any_l16.c (.../tags/gcc_4_8_3_release)
11352
+++ b/src/libgfortran/generated/any_l16.c (.../branches/gcc-4_8-branch)
11353
@@ -101,8 +101,7 @@
11354
retarray->offset = 0;
11355
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11357
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11358
- * extent[rank-1];
11359
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11361
if (alloc_size == 0)
11363
@@ -111,7 +110,7 @@
11367
- retarray->base_addr = xmalloc (alloc_size);
11368
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
11372
Index: libgfortran/generated/spread_i8.c
11373
===================================================================
11374
--- a/src/libgfortran/generated/spread_i8.c (.../tags/gcc_4_8_3_release)
11375
+++ b/src/libgfortran/generated/spread_i8.c (.../branches/gcc-4_8-branch)
11376
@@ -101,8 +101,8 @@
11380
- /* xmalloc allocates a single byte for zero size. */
11381
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_8));
11382
+ /* xmallocarray allocates a single byte for zero size. */
11383
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_8));
11387
@@ -244,7 +244,7 @@
11389
if (ret->base_addr == NULL)
11391
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_8));
11392
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_8));
11394
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
11396
Index: libgfortran/generated/maxval_i2.c
11397
===================================================================
11398
--- a/src/libgfortran/generated/maxval_i2.c (.../tags/gcc_4_8_3_release)
11399
+++ b/src/libgfortran/generated/maxval_i2.c (.../branches/gcc-4_8-branch)
11401
retarray->offset = 0;
11402
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11404
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11405
- * extent[rank-1];
11406
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11408
- retarray->base_addr = xmalloc (alloc_size);
11409
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11410
if (alloc_size == 0)
11412
/* Make sure we have a zero-sized array. */
11413
@@ -286,8 +285,7 @@
11417
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11418
- * extent[rank-1];
11419
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11421
retarray->offset = 0;
11422
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11423
@@ -299,7 +297,7 @@
11427
- retarray->base_addr = xmalloc (alloc_size);
11428
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11432
@@ -472,8 +470,7 @@
11433
retarray->offset = 0;
11434
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11436
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11437
- * extent[rank-1];
11438
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11440
if (alloc_size == 0)
11442
@@ -482,7 +479,7 @@
11446
- retarray->base_addr = xmalloc (alloc_size);
11447
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11451
Index: libgfortran/generated/maxloc1_8_i4.c
11452
===================================================================
11453
--- a/src/libgfortran/generated/maxloc1_8_i4.c (.../tags/gcc_4_8_3_release)
11454
+++ b/src/libgfortran/generated/maxloc1_8_i4.c (.../branches/gcc-4_8-branch)
11456
retarray->offset = 0;
11457
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11459
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11460
- * extent[rank-1];
11461
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11463
- retarray->base_addr = xmalloc (alloc_size);
11464
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11465
if (alloc_size == 0)
11467
/* Make sure we have a zero-sized array. */
11468
@@ -294,8 +293,7 @@
11472
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11473
- * extent[rank-1];
11474
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11476
retarray->offset = 0;
11477
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11478
@@ -307,7 +305,7 @@
11482
- retarray->base_addr = xmalloc (alloc_size);
11483
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11487
@@ -485,8 +483,7 @@
11488
retarray->offset = 0;
11489
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11491
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11492
- * extent[rank-1];
11493
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11495
if (alloc_size == 0)
11497
@@ -495,7 +492,7 @@
11501
- retarray->base_addr = xmalloc (alloc_size);
11502
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11506
Index: libgfortran/generated/unpack_r8.c
11507
===================================================================
11508
--- a/src/libgfortran/generated/unpack_r8.c (.../tags/gcc_4_8_3_release)
11509
+++ b/src/libgfortran/generated/unpack_r8.c (.../branches/gcc-4_8-branch)
11514
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
11515
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
11519
@@ -244,7 +244,7 @@
11523
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
11524
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
11528
Index: libgfortran/generated/maxloc0_4_r4.c
11529
===================================================================
11530
--- a/src/libgfortran/generated/maxloc0_4_r4.c (.../tags/gcc_4_8_3_release)
11531
+++ b/src/libgfortran/generated/maxloc0_4_r4.c (.../branches/gcc-4_8-branch)
11533
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11534
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11535
retarray->offset = 0;
11536
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11537
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11541
@@ -199,7 +199,7 @@
11542
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11543
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11544
retarray->offset = 0;
11545
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11546
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11550
@@ -367,7 +367,7 @@
11551
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11552
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11553
retarray->offset = 0;
11554
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11555
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11557
else if (unlikely (compile_options.bounds_check))
11559
Index: libgfortran/generated/all_l1.c
11560
===================================================================
11561
--- a/src/libgfortran/generated/all_l1.c (.../tags/gcc_4_8_3_release)
11562
+++ b/src/libgfortran/generated/all_l1.c (.../branches/gcc-4_8-branch)
11563
@@ -101,8 +101,7 @@
11564
retarray->offset = 0;
11565
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11567
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11568
- * extent[rank-1];
11569
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11571
if (alloc_size == 0)
11573
@@ -111,7 +110,7 @@
11577
- retarray->base_addr = xmalloc (alloc_size);
11578
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
11582
Index: libgfortran/generated/matmul_r8.c
11583
===================================================================
11584
--- a/src/libgfortran/generated/matmul_r8.c (.../tags/gcc_4_8_3_release)
11585
+++ b/src/libgfortran/generated/matmul_r8.c (.../branches/gcc-4_8-branch)
11586
@@ -124,7 +124,7 @@
11589
retarray->base_addr
11590
- = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
11591
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_8));
11592
retarray->offset = 0;
11594
else if (unlikely (compile_options.bounds_check))
11595
Index: libgfortran/generated/minloc0_4_r16.c
11596
===================================================================
11597
--- a/src/libgfortran/generated/minloc0_4_r16.c (.../tags/gcc_4_8_3_release)
11598
+++ b/src/libgfortran/generated/minloc0_4_r16.c (.../branches/gcc-4_8-branch)
11600
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11601
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11602
retarray->offset = 0;
11603
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11604
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11608
@@ -199,7 +199,7 @@
11609
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11610
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11611
retarray->offset = 0;
11612
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11613
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11617
@@ -367,7 +367,7 @@
11618
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11619
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11620
retarray->offset = 0;
11621
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11622
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11624
else if (unlikely (compile_options.bounds_check))
11626
Index: libgfortran/generated/maxloc0_4_i2.c
11627
===================================================================
11628
--- a/src/libgfortran/generated/maxloc0_4_i2.c (.../tags/gcc_4_8_3_release)
11629
+++ b/src/libgfortran/generated/maxloc0_4_i2.c (.../branches/gcc-4_8-branch)
11631
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11632
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11633
retarray->offset = 0;
11634
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11635
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11639
@@ -199,7 +199,7 @@
11640
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11641
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11642
retarray->offset = 0;
11643
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11644
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11648
@@ -367,7 +367,7 @@
11649
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11650
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11651
retarray->offset = 0;
11652
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11653
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11655
else if (unlikely (compile_options.bounds_check))
11657
Index: libgfortran/generated/minloc1_8_r16.c
11658
===================================================================
11659
--- a/src/libgfortran/generated/minloc1_8_r16.c (.../tags/gcc_4_8_3_release)
11660
+++ b/src/libgfortran/generated/minloc1_8_r16.c (.../branches/gcc-4_8-branch)
11662
retarray->offset = 0;
11663
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11665
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11666
- * extent[rank-1];
11667
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11669
- retarray->base_addr = xmalloc (alloc_size);
11670
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11671
if (alloc_size == 0)
11673
/* Make sure we have a zero-sized array. */
11674
@@ -294,8 +293,7 @@
11678
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11679
- * extent[rank-1];
11680
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11682
retarray->offset = 0;
11683
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11684
@@ -307,7 +305,7 @@
11688
- retarray->base_addr = xmalloc (alloc_size);
11689
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11693
@@ -485,8 +483,7 @@
11694
retarray->offset = 0;
11695
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11697
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11698
- * extent[rank-1];
11699
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11701
if (alloc_size == 0)
11703
@@ -495,7 +492,7 @@
11707
- retarray->base_addr = xmalloc (alloc_size);
11708
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11712
Index: libgfortran/generated/pack_c10.c
11713
===================================================================
11714
--- a/src/libgfortran/generated/pack_c10.c (.../tags/gcc_4_8_3_release)
11715
+++ b/src/libgfortran/generated/pack_c10.c (.../branches/gcc-4_8-branch)
11716
@@ -167,8 +167,8 @@
11720
- /* xmalloc allocates a single byte for zero size. */
11721
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * total);
11722
+ /* xmallocarray allocates a single byte for zero size. */
11723
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
11727
Index: libgfortran/generated/pack_r4.c
11728
===================================================================
11729
--- a/src/libgfortran/generated/pack_r4.c (.../tags/gcc_4_8_3_release)
11730
+++ b/src/libgfortran/generated/pack_r4.c (.../branches/gcc-4_8-branch)
11731
@@ -167,8 +167,8 @@
11735
- /* xmalloc allocates a single byte for zero size. */
11736
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * total);
11737
+ /* xmallocarray allocates a single byte for zero size. */
11738
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_4));
11742
Index: libgfortran/generated/transpose_c16.c
11743
===================================================================
11744
--- a/src/libgfortran/generated/transpose_c16.c (.../tags/gcc_4_8_3_release)
11745
+++ b/src/libgfortran/generated/transpose_c16.c (.../branches/gcc-4_8-branch)
11747
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
11748
GFC_DESCRIPTOR_EXTENT(source, 1));
11750
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
11751
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
11752
+ sizeof (GFC_COMPLEX_16));
11754
} else if (unlikely (compile_options.bounds_check))
11756
Index: libgfortran/generated/maxloc0_8_i8.c
11757
===================================================================
11758
--- a/src/libgfortran/generated/maxloc0_8_i8.c (.../tags/gcc_4_8_3_release)
11759
+++ b/src/libgfortran/generated/maxloc0_8_i8.c (.../branches/gcc-4_8-branch)
11761
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11762
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11763
retarray->offset = 0;
11764
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11765
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11769
@@ -199,7 +199,7 @@
11770
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11771
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11772
retarray->offset = 0;
11773
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11774
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11778
@@ -367,7 +367,7 @@
11779
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11780
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11781
retarray->offset = 0;
11782
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11783
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11785
else if (unlikely (compile_options.bounds_check))
11787
Index: libgfortran/generated/minloc1_4_r8.c
11788
===================================================================
11789
--- a/src/libgfortran/generated/minloc1_4_r8.c (.../tags/gcc_4_8_3_release)
11790
+++ b/src/libgfortran/generated/minloc1_4_r8.c (.../branches/gcc-4_8-branch)
11792
retarray->offset = 0;
11793
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11795
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11796
- * extent[rank-1];
11797
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11799
- retarray->base_addr = xmalloc (alloc_size);
11800
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11801
if (alloc_size == 0)
11803
/* Make sure we have a zero-sized array. */
11804
@@ -294,8 +293,7 @@
11808
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11809
- * extent[rank-1];
11810
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11812
retarray->offset = 0;
11813
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11814
@@ -307,7 +305,7 @@
11818
- retarray->base_addr = xmalloc (alloc_size);
11819
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11823
@@ -485,8 +483,7 @@
11824
retarray->offset = 0;
11825
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11827
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11828
- * extent[rank-1];
11829
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11831
if (alloc_size == 0)
11833
@@ -495,7 +492,7 @@
11837
- retarray->base_addr = xmalloc (alloc_size);
11838
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11842
Index: libgfortran/generated/minloc1_16_i4.c
11843
===================================================================
11844
--- a/src/libgfortran/generated/minloc1_16_i4.c (.../tags/gcc_4_8_3_release)
11845
+++ b/src/libgfortran/generated/minloc1_16_i4.c (.../branches/gcc-4_8-branch)
11847
retarray->offset = 0;
11848
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11850
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11851
- * extent[rank-1];
11852
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11854
- retarray->base_addr = xmalloc (alloc_size);
11855
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11856
if (alloc_size == 0)
11858
/* Make sure we have a zero-sized array. */
11859
@@ -294,8 +293,7 @@
11863
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11864
- * extent[rank-1];
11865
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11867
retarray->offset = 0;
11868
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11869
@@ -307,7 +305,7 @@
11873
- retarray->base_addr = xmalloc (alloc_size);
11874
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11878
@@ -485,8 +483,7 @@
11879
retarray->offset = 0;
11880
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11882
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11883
- * extent[rank-1];
11884
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11886
if (alloc_size == 0)
11888
@@ -495,7 +492,7 @@
11892
- retarray->base_addr = xmalloc (alloc_size);
11893
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11897
Index: libgfortran/generated/minloc0_16_i8.c
11898
===================================================================
11899
--- a/src/libgfortran/generated/minloc0_16_i8.c (.../tags/gcc_4_8_3_release)
11900
+++ b/src/libgfortran/generated/minloc0_16_i8.c (.../branches/gcc-4_8-branch)
11902
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11903
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11904
retarray->offset = 0;
11905
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11906
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11910
@@ -199,7 +199,7 @@
11911
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11912
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11913
retarray->offset = 0;
11914
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11915
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11919
@@ -367,7 +367,7 @@
11920
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11921
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11922
retarray->offset = 0;
11923
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11924
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11926
else if (unlikely (compile_options.bounds_check))
11928
Index: libgfortran/generated/pack_i2.c
11929
===================================================================
11930
--- a/src/libgfortran/generated/pack_i2.c (.../tags/gcc_4_8_3_release)
11931
+++ b/src/libgfortran/generated/pack_i2.c (.../branches/gcc-4_8-branch)
11932
@@ -167,8 +167,8 @@
11936
- /* xmalloc allocates a single byte for zero size. */
11937
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_2) * total);
11938
+ /* xmallocarray allocates a single byte for zero size. */
11939
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_2));
11943
Index: libgfortran/generated/transpose_i8.c
11944
===================================================================
11945
--- a/src/libgfortran/generated/transpose_i8.c (.../tags/gcc_4_8_3_release)
11946
+++ b/src/libgfortran/generated/transpose_i8.c (.../branches/gcc-4_8-branch)
11948
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
11949
GFC_DESCRIPTOR_EXTENT(source, 1));
11951
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
11952
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
11953
+ sizeof (GFC_INTEGER_8));
11955
} else if (unlikely (compile_options.bounds_check))
11957
Index: libgfortran/generated/eoshift1_16.c
11958
===================================================================
11959
--- a/src/libgfortran/generated/eoshift1_16.c (.../tags/gcc_4_8_3_release)
11960
+++ b/src/libgfortran/generated/eoshift1_16.c (.../branches/gcc-4_8-branch)
11961
@@ -105,8 +105,8 @@
11962
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
11965
- /* xmalloc allocates a single byte for zero size. */
11966
- ret->base_addr = xmalloc (size * arraysize);
11967
+ /* xmallocarray allocates a single byte for zero size. */
11968
+ ret->base_addr = xmallocarray (arraysize, size);
11971
else if (unlikely (compile_options.bounds_check))
11972
Index: libgfortran/generated/all_l2.c
11973
===================================================================
11974
--- a/src/libgfortran/generated/all_l2.c (.../tags/gcc_4_8_3_release)
11975
+++ b/src/libgfortran/generated/all_l2.c (.../branches/gcc-4_8-branch)
11976
@@ -101,8 +101,7 @@
11977
retarray->offset = 0;
11978
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11980
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11981
- * extent[rank-1];
11982
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11984
if (alloc_size == 0)
11986
@@ -111,7 +110,7 @@
11990
- retarray->base_addr = xmalloc (alloc_size);
11991
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
11995
Index: libgfortran/generated/product_c4.c
11996
===================================================================
11997
--- a/src/libgfortran/generated/product_c4.c (.../tags/gcc_4_8_3_release)
11998
+++ b/src/libgfortran/generated/product_c4.c (.../branches/gcc-4_8-branch)
12000
retarray->offset = 0;
12001
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12003
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12004
- * extent[rank-1];
12005
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12007
- retarray->base_addr = xmalloc (alloc_size);
12008
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
12009
if (alloc_size == 0)
12011
/* Make sure we have a zero-sized array. */
12012
@@ -272,8 +271,7 @@
12016
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12017
- * extent[rank-1];
12018
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12020
retarray->offset = 0;
12021
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12022
@@ -285,7 +283,7 @@
12026
- retarray->base_addr = xmalloc (alloc_size);
12027
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
12031
@@ -430,8 +428,7 @@
12032
retarray->offset = 0;
12033
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12035
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12036
- * extent[rank-1];
12037
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12039
if (alloc_size == 0)
12041
@@ -440,7 +437,7 @@
12045
- retarray->base_addr = xmalloc (alloc_size);
12046
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
12050
Index: libgfortran/generated/iall_i1.c
12051
===================================================================
12052
--- a/src/libgfortran/generated/iall_i1.c (.../tags/gcc_4_8_3_release)
12053
+++ b/src/libgfortran/generated/iall_i1.c (.../branches/gcc-4_8-branch)
12055
retarray->offset = 0;
12056
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12058
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12059
- * extent[rank-1];
12060
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12062
- retarray->base_addr = xmalloc (alloc_size);
12063
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
12064
if (alloc_size == 0)
12066
/* Make sure we have a zero-sized array. */
12067
@@ -272,8 +271,7 @@
12071
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12072
- * extent[rank-1];
12073
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12075
retarray->offset = 0;
12076
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12077
@@ -285,7 +283,7 @@
12081
- retarray->base_addr = xmalloc (alloc_size);
12082
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
12086
@@ -430,8 +428,7 @@
12087
retarray->offset = 0;
12088
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12090
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12091
- * extent[rank-1];
12092
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12094
if (alloc_size == 0)
12096
@@ -440,7 +437,7 @@
12100
- retarray->base_addr = xmalloc (alloc_size);
12101
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
12105
Index: libgfortran/generated/reshape_i4.c
12106
===================================================================
12107
--- a/src/libgfortran/generated/reshape_i4.c (.../tags/gcc_4_8_3_release)
12108
+++ b/src/libgfortran/generated/reshape_i4.c (.../branches/gcc-4_8-branch)
12109
@@ -111,11 +111,11 @@
12112
if (unlikely (rs < 1))
12116
- alloc_size = rs * sizeof (GFC_INTEGER_4);
12119
- ret->base_addr = xmalloc (alloc_size);
12120
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12121
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
12124
Index: libgfortran/generated/in_pack_r10.c
12125
===================================================================
12126
--- a/src/libgfortran/generated/in_pack_r10.c (.../tags/gcc_4_8_3_release)
12127
+++ b/src/libgfortran/generated/in_pack_r10.c (.../branches/gcc-4_8-branch)
12129
return source->base_addr;
12131
/* Allocate storage for the destination. */
12132
- destptr = (GFC_REAL_10 *)xmalloc (ssize * sizeof (GFC_REAL_10));
12133
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_10));
12135
src = source->base_addr;
12136
stride0 = stride[0];
12137
Index: libgfortran/generated/in_pack_c4.c
12138
===================================================================
12139
--- a/src/libgfortran/generated/in_pack_c4.c (.../tags/gcc_4_8_3_release)
12140
+++ b/src/libgfortran/generated/in_pack_c4.c (.../branches/gcc-4_8-branch)
12142
return source->base_addr;
12144
/* Allocate storage for the destination. */
12145
- destptr = (GFC_COMPLEX_4 *)xmalloc (ssize * sizeof (GFC_COMPLEX_4));
12146
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_4));
12148
src = source->base_addr;
12149
stride0 = stride[0];
12150
Index: libgfortran/generated/all_l16.c
12151
===================================================================
12152
--- a/src/libgfortran/generated/all_l16.c (.../tags/gcc_4_8_3_release)
12153
+++ b/src/libgfortran/generated/all_l16.c (.../branches/gcc-4_8-branch)
12154
@@ -101,8 +101,7 @@
12155
retarray->offset = 0;
12156
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12158
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12159
- * extent[rank-1];
12160
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12162
if (alloc_size == 0)
12164
@@ -111,7 +110,7 @@
12168
- retarray->base_addr = xmalloc (alloc_size);
12169
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
12173
Index: libgfortran/generated/maxloc0_16_i1.c
12174
===================================================================
12175
--- a/src/libgfortran/generated/maxloc0_16_i1.c (.../tags/gcc_4_8_3_release)
12176
+++ b/src/libgfortran/generated/maxloc0_16_i1.c (.../branches/gcc-4_8-branch)
12178
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12179
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12180
retarray->offset = 0;
12181
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12182
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12186
@@ -199,7 +199,7 @@
12187
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12188
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12189
retarray->offset = 0;
12190
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12191
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12195
@@ -367,7 +367,7 @@
12196
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12197
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12198
retarray->offset = 0;
12199
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12200
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12202
else if (unlikely (compile_options.bounds_check))
12204
Index: libgfortran/generated/maxloc1_8_r8.c
12205
===================================================================
12206
--- a/src/libgfortran/generated/maxloc1_8_r8.c (.../tags/gcc_4_8_3_release)
12207
+++ b/src/libgfortran/generated/maxloc1_8_r8.c (.../branches/gcc-4_8-branch)
12209
retarray->offset = 0;
12210
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12212
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12213
- * extent[rank-1];
12214
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12216
- retarray->base_addr = xmalloc (alloc_size);
12217
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12218
if (alloc_size == 0)
12220
/* Make sure we have a zero-sized array. */
12221
@@ -294,8 +293,7 @@
12225
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12226
- * extent[rank-1];
12227
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12229
retarray->offset = 0;
12230
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12231
@@ -307,7 +305,7 @@
12235
- retarray->base_addr = xmalloc (alloc_size);
12236
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12240
@@ -485,8 +483,7 @@
12241
retarray->offset = 0;
12242
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12244
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12245
- * extent[rank-1];
12246
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12248
if (alloc_size == 0)
12250
@@ -495,7 +492,7 @@
12254
- retarray->base_addr = xmalloc (alloc_size);
12255
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12259
Index: libgfortran/generated/minval_i16.c
12260
===================================================================
12261
--- a/src/libgfortran/generated/minval_i16.c (.../tags/gcc_4_8_3_release)
12262
+++ b/src/libgfortran/generated/minval_i16.c (.../branches/gcc-4_8-branch)
12264
retarray->offset = 0;
12265
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
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];
12271
- retarray->base_addr = xmalloc (alloc_size);
12272
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12273
if (alloc_size == 0)
12275
/* Make sure we have a zero-sized array. */
12276
@@ -286,8 +285,7 @@
12280
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12281
- * extent[rank-1];
12282
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12284
retarray->offset = 0;
12285
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12286
@@ -299,7 +297,7 @@
12290
- retarray->base_addr = xmalloc (alloc_size);
12291
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12295
@@ -472,8 +470,7 @@
12296
retarray->offset = 0;
12297
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12299
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12300
- * extent[rank-1];
12301
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12303
if (alloc_size == 0)
12305
@@ -482,7 +479,7 @@
12309
- retarray->base_addr = xmalloc (alloc_size);
12310
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12314
Index: libgfortran/generated/reshape_r10.c
12315
===================================================================
12316
--- a/src/libgfortran/generated/reshape_r10.c (.../tags/gcc_4_8_3_release)
12317
+++ b/src/libgfortran/generated/reshape_r10.c (.../branches/gcc-4_8-branch)
12318
@@ -111,11 +111,11 @@
12321
if (unlikely (rs < 1))
12325
- alloc_size = rs * sizeof (GFC_REAL_10);
12328
- ret->base_addr = xmalloc (alloc_size);
12329
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
12330
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
12333
Index: libgfortran/generated/unpack_r16.c
12334
===================================================================
12335
--- a/src/libgfortran/generated/unpack_r16.c (.../tags/gcc_4_8_3_release)
12336
+++ b/src/libgfortran/generated/unpack_r16.c (.../branches/gcc-4_8-branch)
12341
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
12342
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
12346
@@ -244,7 +244,7 @@
12350
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
12351
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
12355
Index: libgfortran/generated/maxval_i4.c
12356
===================================================================
12357
--- a/src/libgfortran/generated/maxval_i4.c (.../tags/gcc_4_8_3_release)
12358
+++ b/src/libgfortran/generated/maxval_i4.c (.../branches/gcc-4_8-branch)
12360
retarray->offset = 0;
12361
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12363
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12364
- * extent[rank-1];
12365
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12367
- retarray->base_addr = xmalloc (alloc_size);
12368
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12369
if (alloc_size == 0)
12371
/* Make sure we have a zero-sized array. */
12372
@@ -286,8 +285,7 @@
12376
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12377
- * extent[rank-1];
12378
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12380
retarray->offset = 0;
12381
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12382
@@ -299,7 +297,7 @@
12386
- retarray->base_addr = xmalloc (alloc_size);
12387
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12391
@@ -472,8 +470,7 @@
12392
retarray->offset = 0;
12393
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12395
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12396
- * extent[rank-1];
12397
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12399
if (alloc_size == 0)
12401
@@ -482,7 +479,7 @@
12405
- retarray->base_addr = xmalloc (alloc_size);
12406
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12410
Index: libgfortran/generated/minval_i8.c
12411
===================================================================
12412
--- a/src/libgfortran/generated/minval_i8.c (.../tags/gcc_4_8_3_release)
12413
+++ b/src/libgfortran/generated/minval_i8.c (.../branches/gcc-4_8-branch)
12415
retarray->offset = 0;
12416
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12418
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12419
- * extent[rank-1];
12420
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12422
- retarray->base_addr = xmalloc (alloc_size);
12423
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12424
if (alloc_size == 0)
12426
/* Make sure we have a zero-sized array. */
12427
@@ -286,8 +285,7 @@
12431
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12432
- * extent[rank-1];
12433
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12435
retarray->offset = 0;
12436
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12437
@@ -299,7 +297,7 @@
12441
- retarray->base_addr = xmalloc (alloc_size);
12442
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12446
@@ -472,8 +470,7 @@
12447
retarray->offset = 0;
12448
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12450
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12451
- * extent[rank-1];
12452
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12454
if (alloc_size == 0)
12456
@@ -482,7 +479,7 @@
12460
- retarray->base_addr = xmalloc (alloc_size);
12461
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12465
Index: libgfortran/generated/maxloc0_16_i16.c
12466
===================================================================
12467
--- a/src/libgfortran/generated/maxloc0_16_i16.c (.../tags/gcc_4_8_3_release)
12468
+++ b/src/libgfortran/generated/maxloc0_16_i16.c (.../branches/gcc-4_8-branch)
12470
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12471
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12472
retarray->offset = 0;
12473
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12474
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12478
@@ -199,7 +199,7 @@
12479
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12480
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12481
retarray->offset = 0;
12482
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12483
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12487
@@ -367,7 +367,7 @@
12488
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12489
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12490
retarray->offset = 0;
12491
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12492
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12494
else if (unlikely (compile_options.bounds_check))
12496
Index: libgfortran/generated/shape_i4.c
12497
===================================================================
12498
--- a/src/libgfortran/generated/shape_i4.c (.../tags/gcc_4_8_3_release)
12499
+++ b/src/libgfortran/generated/shape_i4.c (.../branches/gcc-4_8-branch)
12502
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
12504
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12505
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12508
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
12509
Index: libgfortran/generated/minloc1_4_i16.c
12510
===================================================================
12511
--- a/src/libgfortran/generated/minloc1_4_i16.c (.../tags/gcc_4_8_3_release)
12512
+++ b/src/libgfortran/generated/minloc1_4_i16.c (.../branches/gcc-4_8-branch)
12514
retarray->offset = 0;
12515
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12517
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12518
- * extent[rank-1];
12519
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12521
- retarray->base_addr = xmalloc (alloc_size);
12522
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12523
if (alloc_size == 0)
12525
/* Make sure we have a zero-sized array. */
12526
@@ -294,8 +293,7 @@
12530
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12531
- * extent[rank-1];
12532
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12534
retarray->offset = 0;
12535
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12536
@@ -307,7 +305,7 @@
12540
- retarray->base_addr = xmalloc (alloc_size);
12541
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12545
@@ -485,8 +483,7 @@
12546
retarray->offset = 0;
12547
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12549
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12550
- * extent[rank-1];
12551
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12553
if (alloc_size == 0)
12555
@@ -495,7 +492,7 @@
12559
- retarray->base_addr = xmalloc (alloc_size);
12560
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12564
Index: libgfortran/generated/maxloc0_4_r10.c
12565
===================================================================
12566
--- a/src/libgfortran/generated/maxloc0_4_r10.c (.../tags/gcc_4_8_3_release)
12567
+++ b/src/libgfortran/generated/maxloc0_4_r10.c (.../branches/gcc-4_8-branch)
12569
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12570
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12571
retarray->offset = 0;
12572
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12573
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12577
@@ -199,7 +199,7 @@
12578
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12579
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12580
retarray->offset = 0;
12581
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12582
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12586
@@ -367,7 +367,7 @@
12587
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12588
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12589
retarray->offset = 0;
12590
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12591
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12593
else if (unlikely (compile_options.bounds_check))
12595
Index: libgfortran/generated/maxloc0_8_i16.c
12596
===================================================================
12597
--- a/src/libgfortran/generated/maxloc0_8_i16.c (.../tags/gcc_4_8_3_release)
12598
+++ b/src/libgfortran/generated/maxloc0_8_i16.c (.../branches/gcc-4_8-branch)
12600
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12601
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12602
retarray->offset = 0;
12603
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12604
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12608
@@ -199,7 +199,7 @@
12609
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12610
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12611
retarray->offset = 0;
12612
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12613
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12617
@@ -367,7 +367,7 @@
12618
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12619
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12620
retarray->offset = 0;
12621
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12622
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12624
else if (unlikely (compile_options.bounds_check))
12626
Index: libgfortran/generated/iall_i2.c
12627
===================================================================
12628
--- a/src/libgfortran/generated/iall_i2.c (.../tags/gcc_4_8_3_release)
12629
+++ b/src/libgfortran/generated/iall_i2.c (.../branches/gcc-4_8-branch)
12631
retarray->offset = 0;
12632
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12634
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12635
- * extent[rank-1];
12636
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12638
- retarray->base_addr = xmalloc (alloc_size);
12639
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12640
if (alloc_size == 0)
12642
/* Make sure we have a zero-sized array. */
12643
@@ -272,8 +271,7 @@
12647
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12648
- * extent[rank-1];
12649
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12651
retarray->offset = 0;
12652
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12653
@@ -285,7 +283,7 @@
12657
- retarray->base_addr = xmalloc (alloc_size);
12658
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12662
@@ -430,8 +428,7 @@
12663
retarray->offset = 0;
12664
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12666
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12667
- * extent[rank-1];
12668
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12670
if (alloc_size == 0)
12672
@@ -440,7 +437,7 @@
12676
- retarray->base_addr = xmalloc (alloc_size);
12677
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12681
Index: libgfortran/generated/maxloc1_8_r10.c
12682
===================================================================
12683
--- a/src/libgfortran/generated/maxloc1_8_r10.c (.../tags/gcc_4_8_3_release)
12684
+++ b/src/libgfortran/generated/maxloc1_8_r10.c (.../branches/gcc-4_8-branch)
12686
retarray->offset = 0;
12687
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12689
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12690
- * extent[rank-1];
12691
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12693
- retarray->base_addr = xmalloc (alloc_size);
12694
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12695
if (alloc_size == 0)
12697
/* Make sure we have a zero-sized array. */
12698
@@ -294,8 +293,7 @@
12702
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12703
- * extent[rank-1];
12704
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12706
retarray->offset = 0;
12707
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12708
@@ -307,7 +305,7 @@
12712
- retarray->base_addr = xmalloc (alloc_size);
12713
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12717
@@ -485,8 +483,7 @@
12718
retarray->offset = 0;
12719
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12721
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12722
- * extent[rank-1];
12723
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12725
if (alloc_size == 0)
12727
@@ -495,7 +492,7 @@
12731
- retarray->base_addr = xmalloc (alloc_size);
12732
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12736
Index: libgfortran/generated/maxloc0_16_r4.c
12737
===================================================================
12738
--- a/src/libgfortran/generated/maxloc0_16_r4.c (.../tags/gcc_4_8_3_release)
12739
+++ b/src/libgfortran/generated/maxloc0_16_r4.c (.../branches/gcc-4_8-branch)
12741
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12742
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12743
retarray->offset = 0;
12744
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12745
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12749
@@ -199,7 +199,7 @@
12750
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12751
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12752
retarray->offset = 0;
12753
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12754
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12758
@@ -367,7 +367,7 @@
12759
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12760
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12761
retarray->offset = 0;
12762
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12763
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12765
else if (unlikely (compile_options.bounds_check))
12767
Index: libgfortran/generated/minloc0_8_i1.c
12768
===================================================================
12769
--- a/src/libgfortran/generated/minloc0_8_i1.c (.../tags/gcc_4_8_3_release)
12770
+++ b/src/libgfortran/generated/minloc0_8_i1.c (.../branches/gcc-4_8-branch)
12772
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12773
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12774
retarray->offset = 0;
12775
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12776
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12780
@@ -199,7 +199,7 @@
12781
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12782
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12783
retarray->offset = 0;
12784
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12785
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12789
@@ -367,7 +367,7 @@
12790
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12791
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12792
retarray->offset = 0;
12793
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12794
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12796
else if (unlikely (compile_options.bounds_check))
12798
Index: libgfortran/generated/minloc1_16_r8.c
12799
===================================================================
12800
--- a/src/libgfortran/generated/minloc1_16_r8.c (.../tags/gcc_4_8_3_release)
12801
+++ b/src/libgfortran/generated/minloc1_16_r8.c (.../branches/gcc-4_8-branch)
12803
retarray->offset = 0;
12804
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12806
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12807
- * extent[rank-1];
12808
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12810
- retarray->base_addr = xmalloc (alloc_size);
12811
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12812
if (alloc_size == 0)
12814
/* Make sure we have a zero-sized array. */
12815
@@ -294,8 +293,7 @@
12819
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12820
- * extent[rank-1];
12821
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12823
retarray->offset = 0;
12824
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12825
@@ -307,7 +305,7 @@
12829
- retarray->base_addr = xmalloc (alloc_size);
12830
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12834
@@ -485,8 +483,7 @@
12835
retarray->offset = 0;
12836
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12838
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12839
- * extent[rank-1];
12840
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12842
if (alloc_size == 0)
12844
@@ -495,7 +492,7 @@
12848
- retarray->base_addr = xmalloc (alloc_size);
12849
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12853
Index: libgfortran/generated/unpack_i8.c
12854
===================================================================
12855
--- a/src/libgfortran/generated/unpack_i8.c (.../tags/gcc_4_8_3_release)
12856
+++ b/src/libgfortran/generated/unpack_i8.c (.../branches/gcc-4_8-branch)
12861
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
12862
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
12866
@@ -244,7 +244,7 @@
12870
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
12871
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
12875
Index: libgfortran/generated/maxloc0_4_i4.c
12876
===================================================================
12877
--- a/src/libgfortran/generated/maxloc0_4_i4.c (.../tags/gcc_4_8_3_release)
12878
+++ b/src/libgfortran/generated/maxloc0_4_i4.c (.../branches/gcc-4_8-branch)
12880
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12881
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12882
retarray->offset = 0;
12883
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12884
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12888
@@ -199,7 +199,7 @@
12889
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12890
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12891
retarray->offset = 0;
12892
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12893
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12897
@@ -367,7 +367,7 @@
12898
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12899
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12900
retarray->offset = 0;
12901
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12902
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12904
else if (unlikely (compile_options.bounds_check))
12906
Index: libgfortran/generated/count_4_l.c
12907
===================================================================
12908
--- a/src/libgfortran/generated/count_4_l.c (.../tags/gcc_4_8_3_release)
12909
+++ b/src/libgfortran/generated/count_4_l.c (.../branches/gcc-4_8-branch)
12910
@@ -101,8 +101,7 @@
12911
retarray->offset = 0;
12912
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12914
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12915
- * extent[rank-1];
12916
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12918
if (alloc_size == 0)
12920
@@ -111,7 +110,7 @@
12924
- retarray->base_addr = xmalloc (alloc_size);
12925
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12929
Index: libgfortran/generated/sum_r10.c
12930
===================================================================
12931
--- a/src/libgfortran/generated/sum_r10.c (.../tags/gcc_4_8_3_release)
12932
+++ b/src/libgfortran/generated/sum_r10.c (.../branches/gcc-4_8-branch)
12934
retarray->offset = 0;
12935
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12937
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12938
- * extent[rank-1];
12939
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12941
- retarray->base_addr = xmalloc (alloc_size);
12942
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
12943
if (alloc_size == 0)
12945
/* Make sure we have a zero-sized array. */
12946
@@ -272,8 +271,7 @@
12950
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12951
- * extent[rank-1];
12952
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12954
retarray->offset = 0;
12955
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12956
@@ -285,7 +283,7 @@
12960
- retarray->base_addr = xmalloc (alloc_size);
12961
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
12965
@@ -430,8 +428,7 @@
12966
retarray->offset = 0;
12967
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12969
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12970
- * extent[rank-1];
12971
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12973
if (alloc_size == 0)
12975
@@ -440,7 +437,7 @@
12979
- retarray->base_addr = xmalloc (alloc_size);
12980
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
12984
Index: libgfortran/generated/sum_c4.c
12985
===================================================================
12986
--- a/src/libgfortran/generated/sum_c4.c (.../tags/gcc_4_8_3_release)
12987
+++ b/src/libgfortran/generated/sum_c4.c (.../branches/gcc-4_8-branch)
12989
retarray->offset = 0;
12990
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12992
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12993
- * extent[rank-1];
12994
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12996
- retarray->base_addr = xmalloc (alloc_size);
12997
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
12998
if (alloc_size == 0)
13000
/* Make sure we have a zero-sized array. */
13001
@@ -272,8 +271,7 @@
13005
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13006
- * extent[rank-1];
13007
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13009
retarray->offset = 0;
13010
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13011
@@ -285,7 +283,7 @@
13015
- retarray->base_addr = xmalloc (alloc_size);
13016
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
13020
@@ -430,8 +428,7 @@
13021
retarray->offset = 0;
13022
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13024
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13025
- * extent[rank-1];
13026
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13028
if (alloc_size == 0)
13030
@@ -440,7 +437,7 @@
13034
- retarray->base_addr = xmalloc (alloc_size);
13035
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
13039
Index: libgfortran/generated/maxloc1_16_r10.c
13040
===================================================================
13041
--- a/src/libgfortran/generated/maxloc1_16_r10.c (.../tags/gcc_4_8_3_release)
13042
+++ b/src/libgfortran/generated/maxloc1_16_r10.c (.../branches/gcc-4_8-branch)
13044
retarray->offset = 0;
13045
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13047
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13048
- * extent[rank-1];
13049
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13051
- retarray->base_addr = xmalloc (alloc_size);
13052
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13053
if (alloc_size == 0)
13055
/* Make sure we have a zero-sized array. */
13056
@@ -294,8 +293,7 @@
13060
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13061
- * extent[rank-1];
13062
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13064
retarray->offset = 0;
13065
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13066
@@ -307,7 +305,7 @@
13070
- retarray->base_addr = xmalloc (alloc_size);
13071
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13075
@@ -485,8 +483,7 @@
13076
retarray->offset = 0;
13077
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13079
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13080
- * extent[rank-1];
13081
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13083
if (alloc_size == 0)
13085
@@ -495,7 +492,7 @@
13089
- retarray->base_addr = xmalloc (alloc_size);
13090
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13094
Index: libgfortran/generated/pack_i16.c
13095
===================================================================
13096
--- a/src/libgfortran/generated/pack_i16.c (.../tags/gcc_4_8_3_release)
13097
+++ b/src/libgfortran/generated/pack_i16.c (.../branches/gcc-4_8-branch)
13098
@@ -167,8 +167,8 @@
13102
- /* xmalloc allocates a single byte for zero size. */
13103
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
13104
+ /* xmallocarray allocates a single byte for zero size. */
13105
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
13109
Index: libgfortran/generated/matmul_i8.c
13110
===================================================================
13111
--- a/src/libgfortran/generated/matmul_i8.c (.../tags/gcc_4_8_3_release)
13112
+++ b/src/libgfortran/generated/matmul_i8.c (.../branches/gcc-4_8-branch)
13113
@@ -124,7 +124,7 @@
13116
retarray->base_addr
13117
- = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
13118
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_8));
13119
retarray->offset = 0;
13121
else if (unlikely (compile_options.bounds_check))
13122
Index: libgfortran/generated/maxloc0_16_i2.c
13123
===================================================================
13124
--- a/src/libgfortran/generated/maxloc0_16_i2.c (.../tags/gcc_4_8_3_release)
13125
+++ b/src/libgfortran/generated/maxloc0_16_i2.c (.../branches/gcc-4_8-branch)
13127
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13128
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13129
retarray->offset = 0;
13130
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13131
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13135
@@ -199,7 +199,7 @@
13136
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13137
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13138
retarray->offset = 0;
13139
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13140
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13144
@@ -367,7 +367,7 @@
13145
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13146
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13147
retarray->offset = 0;
13148
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13149
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13151
else if (unlikely (compile_options.bounds_check))
13153
Index: libgfortran/generated/spread_c4.c
13154
===================================================================
13155
--- a/src/libgfortran/generated/spread_c4.c (.../tags/gcc_4_8_3_release)
13156
+++ b/src/libgfortran/generated/spread_c4.c (.../branches/gcc-4_8-branch)
13157
@@ -101,8 +101,8 @@
13161
- /* xmalloc allocates a single byte for zero size. */
13162
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_4));
13163
+ /* xmallocarray allocates a single byte for zero size. */
13164
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_4));
13168
@@ -244,7 +244,7 @@
13170
if (ret->base_addr == NULL)
13172
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_4));
13173
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_4));
13175
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
13177
Index: libgfortran/generated/maxval_r10.c
13178
===================================================================
13179
--- a/src/libgfortran/generated/maxval_r10.c (.../tags/gcc_4_8_3_release)
13180
+++ b/src/libgfortran/generated/maxval_r10.c (.../branches/gcc-4_8-branch)
13182
retarray->offset = 0;
13183
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13185
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13186
- * extent[rank-1];
13187
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13189
- retarray->base_addr = xmalloc (alloc_size);
13190
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
13191
if (alloc_size == 0)
13193
/* Make sure we have a zero-sized array. */
13194
@@ -286,8 +285,7 @@
13198
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13199
- * extent[rank-1];
13200
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13202
retarray->offset = 0;
13203
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13204
@@ -299,7 +297,7 @@
13208
- retarray->base_addr = xmalloc (alloc_size);
13209
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
13213
@@ -472,8 +470,7 @@
13214
retarray->offset = 0;
13215
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13217
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13218
- * extent[rank-1];
13219
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13221
if (alloc_size == 0)
13223
@@ -482,7 +479,7 @@
13227
- retarray->base_addr = xmalloc (alloc_size);
13228
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
13232
Index: libgfortran/generated/pack_i4.c
13233
===================================================================
13234
--- a/src/libgfortran/generated/pack_i4.c (.../tags/gcc_4_8_3_release)
13235
+++ b/src/libgfortran/generated/pack_i4.c (.../branches/gcc-4_8-branch)
13236
@@ -167,8 +167,8 @@
13240
- /* xmalloc allocates a single byte for zero size. */
13241
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * total);
13242
+ /* xmallocarray allocates a single byte for zero size. */
13243
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_4));
13247
Index: libgfortran/generated/maxloc1_4_i1.c
13248
===================================================================
13249
--- a/src/libgfortran/generated/maxloc1_4_i1.c (.../tags/gcc_4_8_3_release)
13250
+++ b/src/libgfortran/generated/maxloc1_4_i1.c (.../branches/gcc-4_8-branch)
13252
retarray->offset = 0;
13253
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13255
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13256
- * extent[rank-1];
13257
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13259
- retarray->base_addr = xmalloc (alloc_size);
13260
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13261
if (alloc_size == 0)
13263
/* Make sure we have a zero-sized array. */
13264
@@ -294,8 +293,7 @@
13268
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13269
- * extent[rank-1];
13270
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13272
retarray->offset = 0;
13273
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13274
@@ -307,7 +305,7 @@
13278
- retarray->base_addr = xmalloc (alloc_size);
13279
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13283
@@ -485,8 +483,7 @@
13284
retarray->offset = 0;
13285
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13287
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13288
- * extent[rank-1];
13289
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13291
if (alloc_size == 0)
13293
@@ -495,7 +492,7 @@
13297
- retarray->base_addr = xmalloc (alloc_size);
13298
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13302
Index: libgfortran/generated/matmul_r10.c
13303
===================================================================
13304
--- a/src/libgfortran/generated/matmul_r10.c (.../tags/gcc_4_8_3_release)
13305
+++ b/src/libgfortran/generated/matmul_r10.c (.../branches/gcc-4_8-branch)
13306
@@ -124,7 +124,7 @@
13309
retarray->base_addr
13310
- = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
13311
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_10));
13312
retarray->offset = 0;
13314
else if (unlikely (compile_options.bounds_check))
13315
Index: libgfortran/generated/minloc1_4_i8.c
13316
===================================================================
13317
--- a/src/libgfortran/generated/minloc1_4_i8.c (.../tags/gcc_4_8_3_release)
13318
+++ b/src/libgfortran/generated/minloc1_4_i8.c (.../branches/gcc-4_8-branch)
13320
retarray->offset = 0;
13321
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13323
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13324
- * extent[rank-1];
13325
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13327
- retarray->base_addr = xmalloc (alloc_size);
13328
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13329
if (alloc_size == 0)
13331
/* Make sure we have a zero-sized array. */
13332
@@ -294,8 +293,7 @@
13336
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13337
- * extent[rank-1];
13338
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13340
retarray->offset = 0;
13341
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13342
@@ -307,7 +305,7 @@
13346
- retarray->base_addr = xmalloc (alloc_size);
13347
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13351
@@ -485,8 +483,7 @@
13352
retarray->offset = 0;
13353
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13355
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13356
- * extent[rank-1];
13357
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13359
if (alloc_size == 0)
13361
@@ -495,7 +492,7 @@
13365
- retarray->base_addr = xmalloc (alloc_size);
13366
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13370
Index: libgfortran/generated/minloc0_8_r4.c
13371
===================================================================
13372
--- a/src/libgfortran/generated/minloc0_8_r4.c (.../tags/gcc_4_8_3_release)
13373
+++ b/src/libgfortran/generated/minloc0_8_r4.c (.../branches/gcc-4_8-branch)
13375
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13376
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13377
retarray->offset = 0;
13378
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13379
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13383
@@ -199,7 +199,7 @@
13384
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13385
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13386
retarray->offset = 0;
13387
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13388
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13392
@@ -367,7 +367,7 @@
13393
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13394
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13395
retarray->offset = 0;
13396
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13397
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13399
else if (unlikely (compile_options.bounds_check))
13401
Index: libgfortran/generated/matmul_l4.c
13402
===================================================================
13403
--- a/src/libgfortran/generated/matmul_l4.c (.../tags/gcc_4_8_3_release)
13404
+++ b/src/libgfortran/generated/matmul_l4.c (.../branches/gcc-4_8-branch)
13408
retarray->base_addr
13409
- = xmalloc (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
13410
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_4));
13411
retarray->offset = 0;
13413
else if (unlikely (compile_options.bounds_check))
13414
Index: libgfortran/generated/reshape_r8.c
13415
===================================================================
13416
--- a/src/libgfortran/generated/reshape_r8.c (.../tags/gcc_4_8_3_release)
13417
+++ b/src/libgfortran/generated/reshape_r8.c (.../branches/gcc-4_8-branch)
13418
@@ -111,11 +111,11 @@
13421
if (unlikely (rs < 1))
13425
- alloc_size = rs * sizeof (GFC_REAL_8);
13428
- ret->base_addr = xmalloc (alloc_size);
13429
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
13430
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
13433
Index: libgfortran/generated/in_pack_c10.c
13434
===================================================================
13435
--- a/src/libgfortran/generated/in_pack_c10.c (.../tags/gcc_4_8_3_release)
13436
+++ b/src/libgfortran/generated/in_pack_c10.c (.../branches/gcc-4_8-branch)
13438
return source->base_addr;
13440
/* Allocate storage for the destination. */
13441
- destptr = (GFC_COMPLEX_10 *)xmalloc (ssize * sizeof (GFC_COMPLEX_10));
13442
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_10));
13444
src = source->base_addr;
13445
stride0 = stride[0];
13446
Index: libgfortran/generated/all_l4.c
13447
===================================================================
13448
--- a/src/libgfortran/generated/all_l4.c (.../tags/gcc_4_8_3_release)
13449
+++ b/src/libgfortran/generated/all_l4.c (.../branches/gcc-4_8-branch)
13450
@@ -101,8 +101,7 @@
13451
retarray->offset = 0;
13452
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13454
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13455
- * extent[rank-1];
13456
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13458
if (alloc_size == 0)
13460
@@ -111,7 +110,7 @@
13464
- retarray->base_addr = xmalloc (alloc_size);
13465
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
13469
Index: libgfortran/generated/minloc0_8_i2.c
13470
===================================================================
13471
--- a/src/libgfortran/generated/minloc0_8_i2.c (.../tags/gcc_4_8_3_release)
13472
+++ b/src/libgfortran/generated/minloc0_8_i2.c (.../branches/gcc-4_8-branch)
13474
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13475
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13476
retarray->offset = 0;
13477
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13478
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13482
@@ -199,7 +199,7 @@
13483
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13484
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13485
retarray->offset = 0;
13486
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13487
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13491
@@ -367,7 +367,7 @@
13492
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13493
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13494
retarray->offset = 0;
13495
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13496
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13498
else if (unlikely (compile_options.bounds_check))
13500
Index: libgfortran/generated/norm2_r16.c
13501
===================================================================
13502
--- a/src/libgfortran/generated/norm2_r16.c (.../tags/gcc_4_8_3_release)
13503
+++ b/src/libgfortran/generated/norm2_r16.c (.../branches/gcc-4_8-branch)
13504
@@ -105,10 +105,9 @@
13505
retarray->offset = 0;
13506
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13508
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13509
- * extent[rank-1];
13510
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13512
- retarray->base_addr = xmalloc (alloc_size);
13513
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
13514
if (alloc_size == 0)
13516
/* Make sure we have a zero-sized array. */
13517
Index: libgfortran/generated/reshape_c10.c
13518
===================================================================
13519
--- a/src/libgfortran/generated/reshape_c10.c (.../tags/gcc_4_8_3_release)
13520
+++ b/src/libgfortran/generated/reshape_c10.c (.../branches/gcc-4_8-branch)
13521
@@ -111,11 +111,11 @@
13524
if (unlikely (rs < 1))
13528
- alloc_size = rs * sizeof (GFC_COMPLEX_10);
13531
- ret->base_addr = xmalloc (alloc_size);
13532
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
13533
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
13536
Index: libgfortran/generated/unpack_c16.c
13537
===================================================================
13538
--- a/src/libgfortran/generated/unpack_c16.c (.../tags/gcc_4_8_3_release)
13539
+++ b/src/libgfortran/generated/unpack_c16.c (.../branches/gcc-4_8-branch)
13544
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
13545
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
13549
@@ -244,7 +244,7 @@
13553
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
13554
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
13558
Index: libgfortran/generated/maxloc1_4_r4.c
13559
===================================================================
13560
--- a/src/libgfortran/generated/maxloc1_4_r4.c (.../tags/gcc_4_8_3_release)
13561
+++ b/src/libgfortran/generated/maxloc1_4_r4.c (.../branches/gcc-4_8-branch)
13563
retarray->offset = 0;
13564
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13566
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13567
- * extent[rank-1];
13568
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13570
- retarray->base_addr = xmalloc (alloc_size);
13571
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13572
if (alloc_size == 0)
13574
/* Make sure we have a zero-sized array. */
13575
@@ -294,8 +293,7 @@
13579
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13580
- * extent[rank-1];
13581
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13583
retarray->offset = 0;
13584
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13585
@@ -307,7 +305,7 @@
13589
- retarray->base_addr = xmalloc (alloc_size);
13590
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13594
@@ -485,8 +483,7 @@
13595
retarray->offset = 0;
13596
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13598
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13599
- * extent[rank-1];
13600
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13602
if (alloc_size == 0)
13604
@@ -495,7 +492,7 @@
13608
- retarray->base_addr = xmalloc (alloc_size);
13609
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13613
Index: libgfortran/generated/maxval_r8.c
13614
===================================================================
13615
--- a/src/libgfortran/generated/maxval_r8.c (.../tags/gcc_4_8_3_release)
13616
+++ b/src/libgfortran/generated/maxval_r8.c (.../branches/gcc-4_8-branch)
13618
retarray->offset = 0;
13619
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13621
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13622
- * extent[rank-1];
13623
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13625
- retarray->base_addr = xmalloc (alloc_size);
13626
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
13627
if (alloc_size == 0)
13629
/* Make sure we have a zero-sized array. */
13630
@@ -286,8 +285,7 @@
13634
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13635
- * extent[rank-1];
13636
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13638
retarray->offset = 0;
13639
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13640
@@ -299,7 +297,7 @@
13644
- retarray->base_addr = xmalloc (alloc_size);
13645
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
13649
@@ -472,8 +470,7 @@
13650
retarray->offset = 0;
13651
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13653
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13654
- * extent[rank-1];
13655
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13657
if (alloc_size == 0)
13659
@@ -482,7 +479,7 @@
13663
- retarray->base_addr = xmalloc (alloc_size);
13664
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
13668
Index: libgfortran/generated/transpose_c4.c
13669
===================================================================
13670
--- a/src/libgfortran/generated/transpose_c4.c (.../tags/gcc_4_8_3_release)
13671
+++ b/src/libgfortran/generated/transpose_c4.c (.../branches/gcc-4_8-branch)
13673
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
13674
GFC_DESCRIPTOR_EXTENT(source, 1));
13676
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
13677
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
13678
+ sizeof (GFC_COMPLEX_4));
13680
} else if (unlikely (compile_options.bounds_check))
13682
Index: libgfortran/generated/eoshift1_4.c
13683
===================================================================
13684
--- a/src/libgfortran/generated/eoshift1_4.c (.../tags/gcc_4_8_3_release)
13685
+++ b/src/libgfortran/generated/eoshift1_4.c (.../branches/gcc-4_8-branch)
13686
@@ -105,8 +105,8 @@
13687
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
13690
- /* xmalloc allocates a single byte for zero size. */
13691
- ret->base_addr = xmalloc (size * arraysize);
13692
+ /* xmallocarray allocates a single byte for zero size. */
13693
+ ret->base_addr = xmallocarray (arraysize, size);
13696
else if (unlikely (compile_options.bounds_check))
13697
Index: libgfortran/generated/minval_r16.c
13698
===================================================================
13699
--- a/src/libgfortran/generated/minval_r16.c (.../tags/gcc_4_8_3_release)
13700
+++ b/src/libgfortran/generated/minval_r16.c (.../branches/gcc-4_8-branch)
13702
retarray->offset = 0;
13703
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13705
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13706
- * extent[rank-1];
13707
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13709
- retarray->base_addr = xmalloc (alloc_size);
13710
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
13711
if (alloc_size == 0)
13713
/* Make sure we have a zero-sized array. */
13714
@@ -286,8 +285,7 @@
13718
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13719
- * extent[rank-1];
13720
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13722
retarray->offset = 0;
13723
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13724
@@ -299,7 +297,7 @@
13728
- retarray->base_addr = xmalloc (alloc_size);
13729
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
13733
@@ -472,8 +470,7 @@
13734
retarray->offset = 0;
13735
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13737
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13738
- * extent[rank-1];
13739
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13741
if (alloc_size == 0)
13743
@@ -482,7 +479,7 @@
13747
- retarray->base_addr = xmalloc (alloc_size);
13748
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
13752
Index: libgfortran/generated/iany_i16.c
13753
===================================================================
13754
--- a/src/libgfortran/generated/iany_i16.c (.../tags/gcc_4_8_3_release)
13755
+++ b/src/libgfortran/generated/iany_i16.c (.../branches/gcc-4_8-branch)
13757
retarray->offset = 0;
13758
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13760
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13761
- * extent[rank-1];
13762
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13764
- retarray->base_addr = xmalloc (alloc_size);
13765
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13766
if (alloc_size == 0)
13768
/* Make sure we have a zero-sized array. */
13769
@@ -272,8 +271,7 @@
13773
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13774
- * extent[rank-1];
13775
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13777
retarray->offset = 0;
13778
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13779
@@ -285,7 +283,7 @@
13783
- retarray->base_addr = xmalloc (alloc_size);
13784
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13788
@@ -430,8 +428,7 @@
13789
retarray->offset = 0;
13790
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13792
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13793
- * extent[rank-1];
13794
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13796
if (alloc_size == 0)
13798
@@ -440,7 +437,7 @@
13802
- retarray->base_addr = xmalloc (alloc_size);
13803
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13807
Index: libgfortran/generated/maxloc1_4_i2.c
13808
===================================================================
13809
--- a/src/libgfortran/generated/maxloc1_4_i2.c (.../tags/gcc_4_8_3_release)
13810
+++ b/src/libgfortran/generated/maxloc1_4_i2.c (.../branches/gcc-4_8-branch)
13812
retarray->offset = 0;
13813
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13815
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13816
- * extent[rank-1];
13817
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13819
- retarray->base_addr = xmalloc (alloc_size);
13820
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13821
if (alloc_size == 0)
13823
/* Make sure we have a zero-sized array. */
13824
@@ -294,8 +293,7 @@
13828
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13829
- * extent[rank-1];
13830
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13832
retarray->offset = 0;
13833
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13834
@@ -307,7 +305,7 @@
13838
- retarray->base_addr = xmalloc (alloc_size);
13839
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13843
@@ -485,8 +483,7 @@
13844
retarray->offset = 0;
13845
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13847
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13848
- * extent[rank-1];
13849
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13851
if (alloc_size == 0)
13853
@@ -495,7 +492,7 @@
13857
- retarray->base_addr = xmalloc (alloc_size);
13858
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13862
Index: libgfortran/generated/maxloc1_8_i8.c
13863
===================================================================
13864
--- a/src/libgfortran/generated/maxloc1_8_i8.c (.../tags/gcc_4_8_3_release)
13865
+++ b/src/libgfortran/generated/maxloc1_8_i8.c (.../branches/gcc-4_8-branch)
13867
retarray->offset = 0;
13868
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13870
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13871
- * extent[rank-1];
13872
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13874
- retarray->base_addr = xmalloc (alloc_size);
13875
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13876
if (alloc_size == 0)
13878
/* Make sure we have a zero-sized array. */
13879
@@ -294,8 +293,7 @@
13883
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13884
- * extent[rank-1];
13885
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13887
retarray->offset = 0;
13888
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13889
@@ -307,7 +305,7 @@
13893
- retarray->base_addr = xmalloc (alloc_size);
13894
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13898
@@ -485,8 +483,7 @@
13899
retarray->offset = 0;
13900
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13902
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13903
- * extent[rank-1];
13904
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13906
if (alloc_size == 0)
13908
@@ -495,7 +492,7 @@
13912
- retarray->base_addr = xmalloc (alloc_size);
13913
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13917
Index: libgfortran/generated/maxloc0_4_r8.c
13918
===================================================================
13919
--- a/src/libgfortran/generated/maxloc0_4_r8.c (.../tags/gcc_4_8_3_release)
13920
+++ b/src/libgfortran/generated/maxloc0_4_r8.c (.../branches/gcc-4_8-branch)
13922
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13923
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13924
retarray->offset = 0;
13925
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13926
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13930
@@ -199,7 +199,7 @@
13931
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13932
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13933
retarray->offset = 0;
13934
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13935
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13939
@@ -367,7 +367,7 @@
13940
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13941
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13942
retarray->offset = 0;
13943
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13944
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13946
else if (unlikely (compile_options.bounds_check))
13948
Index: libgfortran/generated/maxloc0_16_r16.c
13949
===================================================================
13950
--- a/src/libgfortran/generated/maxloc0_16_r16.c (.../tags/gcc_4_8_3_release)
13951
+++ b/src/libgfortran/generated/maxloc0_16_r16.c (.../branches/gcc-4_8-branch)
13953
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13954
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13955
retarray->offset = 0;
13956
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13957
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13961
@@ -199,7 +199,7 @@
13962
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13963
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13964
retarray->offset = 0;
13965
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13966
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13970
@@ -367,7 +367,7 @@
13971
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13972
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13973
retarray->offset = 0;
13974
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13975
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13977
else if (unlikely (compile_options.bounds_check))
13979
Index: libgfortran/generated/sum_c10.c
13980
===================================================================
13981
--- a/src/libgfortran/generated/sum_c10.c (.../tags/gcc_4_8_3_release)
13982
+++ b/src/libgfortran/generated/sum_c10.c (.../branches/gcc-4_8-branch)
13984
retarray->offset = 0;
13985
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13987
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13988
- * extent[rank-1];
13989
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13991
- retarray->base_addr = xmalloc (alloc_size);
13992
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
13993
if (alloc_size == 0)
13995
/* Make sure we have a zero-sized array. */
13996
@@ -272,8 +271,7 @@
14000
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14001
- * extent[rank-1];
14002
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14004
retarray->offset = 0;
14005
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14006
@@ -285,7 +283,7 @@
14010
- retarray->base_addr = xmalloc (alloc_size);
14011
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
14015
@@ -430,8 +428,7 @@
14016
retarray->offset = 0;
14017
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14019
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14020
- * extent[rank-1];
14021
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14023
if (alloc_size == 0)
14025
@@ -440,7 +437,7 @@
14029
- retarray->base_addr = xmalloc (alloc_size);
14030
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
14034
Index: libgfortran/generated/iall_i4.c
14035
===================================================================
14036
--- a/src/libgfortran/generated/iall_i4.c (.../tags/gcc_4_8_3_release)
14037
+++ b/src/libgfortran/generated/iall_i4.c (.../branches/gcc-4_8-branch)
14039
retarray->offset = 0;
14040
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14042
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14043
- * extent[rank-1];
14044
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14046
- retarray->base_addr = xmalloc (alloc_size);
14047
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14048
if (alloc_size == 0)
14050
/* Make sure we have a zero-sized array. */
14051
@@ -272,8 +271,7 @@
14055
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14056
- * extent[rank-1];
14057
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14059
retarray->offset = 0;
14060
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14061
@@ -285,7 +283,7 @@
14065
- retarray->base_addr = xmalloc (alloc_size);
14066
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14070
@@ -430,8 +428,7 @@
14071
retarray->offset = 0;
14072
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14074
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14075
- * extent[rank-1];
14076
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14078
if (alloc_size == 0)
14080
@@ -440,7 +437,7 @@
14084
- retarray->base_addr = xmalloc (alloc_size);
14085
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14089
Index: libgfortran/generated/minloc1_4_r16.c
14090
===================================================================
14091
--- a/src/libgfortran/generated/minloc1_4_r16.c (.../tags/gcc_4_8_3_release)
14092
+++ b/src/libgfortran/generated/minloc1_4_r16.c (.../branches/gcc-4_8-branch)
14094
retarray->offset = 0;
14095
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14097
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14098
- * extent[rank-1];
14099
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14101
- retarray->base_addr = xmalloc (alloc_size);
14102
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14103
if (alloc_size == 0)
14105
/* Make sure we have a zero-sized array. */
14106
@@ -294,8 +293,7 @@
14110
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14111
- * extent[rank-1];
14112
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14114
retarray->offset = 0;
14115
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14116
@@ -307,7 +305,7 @@
14120
- retarray->base_addr = xmalloc (alloc_size);
14121
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14125
@@ -485,8 +483,7 @@
14126
retarray->offset = 0;
14127
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14129
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14130
- * extent[rank-1];
14131
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14133
if (alloc_size == 0)
14135
@@ -495,7 +492,7 @@
14139
- retarray->base_addr = xmalloc (alloc_size);
14140
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14144
Index: libgfortran/generated/maxloc0_8_r16.c
14145
===================================================================
14146
--- a/src/libgfortran/generated/maxloc0_8_r16.c (.../tags/gcc_4_8_3_release)
14147
+++ b/src/libgfortran/generated/maxloc0_8_r16.c (.../branches/gcc-4_8-branch)
14149
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14150
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14151
retarray->offset = 0;
14152
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14153
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14157
@@ -199,7 +199,7 @@
14158
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14159
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14160
retarray->offset = 0;
14161
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14162
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14166
@@ -367,7 +367,7 @@
14167
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14168
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14169
retarray->offset = 0;
14170
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14171
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14173
else if (unlikely (compile_options.bounds_check))
14175
Index: libgfortran/generated/pack_r8.c
14176
===================================================================
14177
--- a/src/libgfortran/generated/pack_r8.c (.../tags/gcc_4_8_3_release)
14178
+++ b/src/libgfortran/generated/pack_r8.c (.../branches/gcc-4_8-branch)
14179
@@ -167,8 +167,8 @@
14183
- /* xmalloc allocates a single byte for zero size. */
14184
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * total);
14185
+ /* xmallocarray allocates a single byte for zero size. */
14186
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_8));
14190
Index: libgfortran/generated/matmul_c10.c
14191
===================================================================
14192
--- a/src/libgfortran/generated/matmul_c10.c (.../tags/gcc_4_8_3_release)
14193
+++ b/src/libgfortran/generated/matmul_c10.c (.../branches/gcc-4_8-branch)
14194
@@ -124,7 +124,7 @@
14197
retarray->base_addr
14198
- = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
14199
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_10));
14200
retarray->offset = 0;
14202
else if (unlikely (compile_options.bounds_check))
14203
Index: libgfortran/generated/maxloc0_16_i4.c
14204
===================================================================
14205
--- a/src/libgfortran/generated/maxloc0_16_i4.c (.../tags/gcc_4_8_3_release)
14206
+++ b/src/libgfortran/generated/maxloc0_16_i4.c (.../branches/gcc-4_8-branch)
14208
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14209
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14210
retarray->offset = 0;
14211
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14212
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14216
@@ -199,7 +199,7 @@
14217
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14218
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14219
retarray->offset = 0;
14220
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14221
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14225
@@ -367,7 +367,7 @@
14226
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14227
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14228
retarray->offset = 0;
14229
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14230
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14232
else if (unlikely (compile_options.bounds_check))
14234
Index: libgfortran/generated/pack_r16.c
14235
===================================================================
14236
--- a/src/libgfortran/generated/pack_r16.c (.../tags/gcc_4_8_3_release)
14237
+++ b/src/libgfortran/generated/pack_r16.c (.../branches/gcc-4_8-branch)
14238
@@ -167,8 +167,8 @@
14242
- /* xmalloc allocates a single byte for zero size. */
14243
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * total);
14244
+ /* xmallocarray allocates a single byte for zero size. */
14245
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_16));
14249
Index: libgfortran/generated/minloc1_16_i8.c
14250
===================================================================
14251
--- a/src/libgfortran/generated/minloc1_16_i8.c (.../tags/gcc_4_8_3_release)
14252
+++ b/src/libgfortran/generated/minloc1_16_i8.c (.../branches/gcc-4_8-branch)
14254
retarray->offset = 0;
14255
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14257
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14258
- * extent[rank-1];
14259
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14261
- retarray->base_addr = xmalloc (alloc_size);
14262
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14263
if (alloc_size == 0)
14265
/* Make sure we have a zero-sized array. */
14266
@@ -294,8 +293,7 @@
14270
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14271
- * extent[rank-1];
14272
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14274
retarray->offset = 0;
14275
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14276
@@ -307,7 +305,7 @@
14280
- retarray->base_addr = xmalloc (alloc_size);
14281
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14285
@@ -485,8 +483,7 @@
14286
retarray->offset = 0;
14287
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14289
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14290
- * extent[rank-1];
14291
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14293
if (alloc_size == 0)
14295
@@ -495,7 +492,7 @@
14299
- retarray->base_addr = xmalloc (alloc_size);
14300
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14304
Index: libgfortran/generated/minloc0_16_r10.c
14305
===================================================================
14306
--- a/src/libgfortran/generated/minloc0_16_r10.c (.../tags/gcc_4_8_3_release)
14307
+++ b/src/libgfortran/generated/minloc0_16_r10.c (.../branches/gcc-4_8-branch)
14309
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14310
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14311
retarray->offset = 0;
14312
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14313
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14317
@@ -199,7 +199,7 @@
14318
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14319
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14320
retarray->offset = 0;
14321
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14322
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14326
@@ -367,7 +367,7 @@
14327
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14328
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14329
retarray->offset = 0;
14330
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14331
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14333
else if (unlikely (compile_options.bounds_check))
14335
Index: libgfortran/generated/unpack_c4.c
14336
===================================================================
14337
--- a/src/libgfortran/generated/unpack_c4.c (.../tags/gcc_4_8_3_release)
14338
+++ b/src/libgfortran/generated/unpack_c4.c (.../branches/gcc-4_8-branch)
14343
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
14344
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
14348
@@ -244,7 +244,7 @@
14352
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
14353
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
14357
Index: libgfortran/generated/iparity_i1.c
14358
===================================================================
14359
--- a/src/libgfortran/generated/iparity_i1.c (.../tags/gcc_4_8_3_release)
14360
+++ b/src/libgfortran/generated/iparity_i1.c (.../branches/gcc-4_8-branch)
14362
retarray->offset = 0;
14363
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14365
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14366
- * extent[rank-1];
14367
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14369
- retarray->base_addr = xmalloc (alloc_size);
14370
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14371
if (alloc_size == 0)
14373
/* Make sure we have a zero-sized array. */
14374
@@ -272,8 +271,7 @@
14378
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14379
- * extent[rank-1];
14380
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14382
retarray->offset = 0;
14383
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14384
@@ -285,7 +283,7 @@
14388
- retarray->base_addr = xmalloc (alloc_size);
14389
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14393
@@ -430,8 +428,7 @@
14394
retarray->offset = 0;
14395
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14397
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14398
- * extent[rank-1];
14399
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14401
if (alloc_size == 0)
14403
@@ -440,7 +437,7 @@
14407
- retarray->base_addr = xmalloc (alloc_size);
14408
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14412
Index: libgfortran/generated/product_c8.c
14413
===================================================================
14414
--- a/src/libgfortran/generated/product_c8.c (.../tags/gcc_4_8_3_release)
14415
+++ b/src/libgfortran/generated/product_c8.c (.../branches/gcc-4_8-branch)
14417
retarray->offset = 0;
14418
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14420
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14421
- * extent[rank-1];
14422
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14424
- retarray->base_addr = xmalloc (alloc_size);
14425
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
14426
if (alloc_size == 0)
14428
/* Make sure we have a zero-sized array. */
14429
@@ -272,8 +271,7 @@
14433
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14434
- * extent[rank-1];
14435
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14437
retarray->offset = 0;
14438
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14439
@@ -285,7 +283,7 @@
14443
- retarray->base_addr = xmalloc (alloc_size);
14444
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
14448
@@ -430,8 +428,7 @@
14449
retarray->offset = 0;
14450
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14452
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14453
- * extent[rank-1];
14454
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14456
if (alloc_size == 0)
14458
@@ -440,7 +437,7 @@
14462
- retarray->base_addr = xmalloc (alloc_size);
14463
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
14467
Index: libgfortran/generated/in_pack_i16.c
14468
===================================================================
14469
--- a/src/libgfortran/generated/in_pack_i16.c (.../tags/gcc_4_8_3_release)
14470
+++ b/src/libgfortran/generated/in_pack_i16.c (.../branches/gcc-4_8-branch)
14472
return source->base_addr;
14474
/* Allocate storage for the destination. */
14475
- destptr = (GFC_INTEGER_16 *)xmalloc (ssize * sizeof (GFC_INTEGER_16));
14476
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_16));
14478
src = source->base_addr;
14479
stride0 = stride[0];
14480
Index: libgfortran/generated/minloc0_8_i4.c
14481
===================================================================
14482
--- a/src/libgfortran/generated/minloc0_8_i4.c (.../tags/gcc_4_8_3_release)
14483
+++ b/src/libgfortran/generated/minloc0_8_i4.c (.../branches/gcc-4_8-branch)
14485
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14486
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14487
retarray->offset = 0;
14488
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14489
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14493
@@ -199,7 +199,7 @@
14494
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14495
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14496
retarray->offset = 0;
14497
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14498
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14502
@@ -367,7 +367,7 @@
14503
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14504
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14505
retarray->offset = 0;
14506
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14507
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14509
else if (unlikely (compile_options.bounds_check))
14511
Index: libgfortran/generated/matmul_c4.c
14512
===================================================================
14513
--- a/src/libgfortran/generated/matmul_c4.c (.../tags/gcc_4_8_3_release)
14514
+++ b/src/libgfortran/generated/matmul_c4.c (.../branches/gcc-4_8-branch)
14515
@@ -124,7 +124,7 @@
14518
retarray->base_addr
14519
- = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
14520
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_4));
14521
retarray->offset = 0;
14523
else if (unlikely (compile_options.bounds_check))
14524
Index: libgfortran/generated/reshape_i8.c
14525
===================================================================
14526
--- a/src/libgfortran/generated/reshape_i8.c (.../tags/gcc_4_8_3_release)
14527
+++ b/src/libgfortran/generated/reshape_i8.c (.../branches/gcc-4_8-branch)
14528
@@ -111,11 +111,11 @@
14531
if (unlikely (rs < 1))
14535
- alloc_size = rs * sizeof (GFC_INTEGER_8);
14538
- ret->base_addr = xmalloc (alloc_size);
14539
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14540
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
14543
Index: libgfortran/generated/in_pack_c8.c
14544
===================================================================
14545
--- a/src/libgfortran/generated/in_pack_c8.c (.../tags/gcc_4_8_3_release)
14546
+++ b/src/libgfortran/generated/in_pack_c8.c (.../branches/gcc-4_8-branch)
14548
return source->base_addr;
14550
/* Allocate storage for the destination. */
14551
- destptr = (GFC_COMPLEX_8 *)xmalloc (ssize * sizeof (GFC_COMPLEX_8));
14552
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_8));
14554
src = source->base_addr;
14555
stride0 = stride[0];
14556
Index: libgfortran/generated/bessel_r10.c
14557
===================================================================
14558
--- a/src/libgfortran/generated/bessel_r10.c (.../tags/gcc_4_8_3_release)
14559
+++ b/src/libgfortran/generated/bessel_r10.c (.../branches/gcc-4_8-branch)
14562
size_t size = n2 < n1 ? 0 : n2-n1+1;
14563
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
14564
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
14565
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
14569
@@ -122,7 +122,7 @@
14571
size_t size = n2 < n1 ? 0 : n2-n1+1;
14572
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
14573
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
14574
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
14578
Index: libgfortran/generated/iall_i16.c
14579
===================================================================
14580
--- a/src/libgfortran/generated/iall_i16.c (.../tags/gcc_4_8_3_release)
14581
+++ b/src/libgfortran/generated/iall_i16.c (.../branches/gcc-4_8-branch)
14583
retarray->offset = 0;
14584
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14586
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14587
- * extent[rank-1];
14588
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14590
- retarray->base_addr = xmalloc (alloc_size);
14591
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14592
if (alloc_size == 0)
14594
/* Make sure we have a zero-sized array. */
14595
@@ -272,8 +271,7 @@
14599
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14600
- * extent[rank-1];
14601
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14603
retarray->offset = 0;
14604
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14605
@@ -285,7 +283,7 @@
14609
- retarray->base_addr = xmalloc (alloc_size);
14610
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14614
@@ -430,8 +428,7 @@
14615
retarray->offset = 0;
14616
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14618
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14619
- * extent[rank-1];
14620
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14622
if (alloc_size == 0)
14624
@@ -440,7 +437,7 @@
14628
- retarray->base_addr = xmalloc (alloc_size);
14629
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14633
Index: libgfortran/generated/maxloc1_16_i1.c
14634
===================================================================
14635
--- a/src/libgfortran/generated/maxloc1_16_i1.c (.../tags/gcc_4_8_3_release)
14636
+++ b/src/libgfortran/generated/maxloc1_16_i1.c (.../branches/gcc-4_8-branch)
14638
retarray->offset = 0;
14639
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14641
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14642
- * extent[rank-1];
14643
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14645
- retarray->base_addr = xmalloc (alloc_size);
14646
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14647
if (alloc_size == 0)
14649
/* Make sure we have a zero-sized array. */
14650
@@ -294,8 +293,7 @@
14654
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14655
- * extent[rank-1];
14656
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14658
retarray->offset = 0;
14659
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14660
@@ -307,7 +305,7 @@
14664
- retarray->base_addr = xmalloc (alloc_size);
14665
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14669
@@ -485,8 +483,7 @@
14670
retarray->offset = 0;
14671
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14673
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14674
- * extent[rank-1];
14675
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14677
if (alloc_size == 0)
14679
@@ -495,7 +492,7 @@
14683
- retarray->base_addr = xmalloc (alloc_size);
14684
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14688
Index: libgfortran/generated/reshape_i16.c
14689
===================================================================
14690
--- a/src/libgfortran/generated/reshape_i16.c (.../tags/gcc_4_8_3_release)
14691
+++ b/src/libgfortran/generated/reshape_i16.c (.../branches/gcc-4_8-branch)
14692
@@ -111,11 +111,11 @@
14695
if (unlikely (rs < 1))
14699
- alloc_size = rs * sizeof (GFC_INTEGER_16);
14702
- ret->base_addr = xmalloc (alloc_size);
14703
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14704
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
14707
Index: libgfortran/generated/count_16_l.c
14708
===================================================================
14709
--- a/src/libgfortran/generated/count_16_l.c (.../tags/gcc_4_8_3_release)
14710
+++ b/src/libgfortran/generated/count_16_l.c (.../branches/gcc-4_8-branch)
14711
@@ -101,8 +101,7 @@
14712
retarray->offset = 0;
14713
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14715
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14716
- * extent[rank-1];
14717
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14719
if (alloc_size == 0)
14721
@@ -111,7 +110,7 @@
14725
- retarray->base_addr = xmalloc (alloc_size);
14726
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14730
Index: libgfortran/generated/minloc1_8_i1.c
14731
===================================================================
14732
--- a/src/libgfortran/generated/minloc1_8_i1.c (.../tags/gcc_4_8_3_release)
14733
+++ b/src/libgfortran/generated/minloc1_8_i1.c (.../branches/gcc-4_8-branch)
14735
retarray->offset = 0;
14736
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14738
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14739
- * extent[rank-1];
14740
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14742
- retarray->base_addr = xmalloc (alloc_size);
14743
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14744
if (alloc_size == 0)
14746
/* Make sure we have a zero-sized array. */
14747
@@ -294,8 +293,7 @@
14751
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14752
- * extent[rank-1];
14753
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14755
retarray->offset = 0;
14756
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14757
@@ -307,7 +305,7 @@
14761
- retarray->base_addr = xmalloc (alloc_size);
14762
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14766
@@ -485,8 +483,7 @@
14767
retarray->offset = 0;
14768
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14770
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14771
- * extent[rank-1];
14772
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14774
if (alloc_size == 0)
14776
@@ -495,7 +492,7 @@
14780
- retarray->base_addr = xmalloc (alloc_size);
14781
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14785
Index: libgfortran/generated/maxloc1_4_i4.c
14786
===================================================================
14787
--- a/src/libgfortran/generated/maxloc1_4_i4.c (.../tags/gcc_4_8_3_release)
14788
+++ b/src/libgfortran/generated/maxloc1_4_i4.c (.../branches/gcc-4_8-branch)
14790
retarray->offset = 0;
14791
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14793
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14794
- * extent[rank-1];
14795
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14797
- retarray->base_addr = xmalloc (alloc_size);
14798
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14799
if (alloc_size == 0)
14801
/* Make sure we have a zero-sized array. */
14802
@@ -294,8 +293,7 @@
14806
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14807
- * extent[rank-1];
14808
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14810
retarray->offset = 0;
14811
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14812
@@ -307,7 +305,7 @@
14816
- retarray->base_addr = xmalloc (alloc_size);
14817
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14821
@@ -485,8 +483,7 @@
14822
retarray->offset = 0;
14823
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14825
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14826
- * extent[rank-1];
14827
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14829
if (alloc_size == 0)
14831
@@ -495,7 +492,7 @@
14835
- retarray->base_addr = xmalloc (alloc_size);
14836
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14840
Index: libgfortran/generated/maxval_i8.c
14841
===================================================================
14842
--- a/src/libgfortran/generated/maxval_i8.c (.../tags/gcc_4_8_3_release)
14843
+++ b/src/libgfortran/generated/maxval_i8.c (.../branches/gcc-4_8-branch)
14845
retarray->offset = 0;
14846
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14848
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14849
- * extent[rank-1];
14850
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14852
- retarray->base_addr = xmalloc (alloc_size);
14853
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14854
if (alloc_size == 0)
14856
/* Make sure we have a zero-sized array. */
14857
@@ -286,8 +285,7 @@
14861
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14862
- * extent[rank-1];
14863
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14865
retarray->offset = 0;
14866
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14867
@@ -299,7 +297,7 @@
14871
- retarray->base_addr = xmalloc (alloc_size);
14872
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14876
@@ -472,8 +470,7 @@
14877
retarray->offset = 0;
14878
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14880
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14881
- * extent[rank-1];
14882
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14884
if (alloc_size == 0)
14886
@@ -482,7 +479,7 @@
14890
- retarray->base_addr = xmalloc (alloc_size);
14891
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14895
Index: libgfortran/generated/eoshift3_16.c
14896
===================================================================
14897
--- a/src/libgfortran/generated/eoshift3_16.c (.../tags/gcc_4_8_3_release)
14898
+++ b/src/libgfortran/generated/eoshift3_16.c (.../branches/gcc-4_8-branch)
14903
- ret->base_addr = xmalloc (size * arraysize);
14904
+ ret->base_addr = xmallocarray (arraysize, size);
14906
ret->dtype = array->dtype;
14907
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
14908
@@ -107,8 +107,8 @@
14909
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
14912
- /* xmalloc allocates a single byte for zero size. */
14913
- ret->base_addr = xmalloc (size * arraysize);
14914
+ /* xmallocarray allocates a single byte for zero size. */
14915
+ ret->base_addr = xmallocarray (arraysize, size);
14918
else if (unlikely (compile_options.bounds_check))
14919
Index: libgfortran/generated/shape_i8.c
14920
===================================================================
14921
--- a/src/libgfortran/generated/shape_i8.c (.../tags/gcc_4_8_3_release)
14922
+++ b/src/libgfortran/generated/shape_i8.c (.../branches/gcc-4_8-branch)
14925
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
14927
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14928
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14931
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
14932
Index: libgfortran/generated/maxloc0_4_i16.c
14933
===================================================================
14934
--- a/src/libgfortran/generated/maxloc0_4_i16.c (.../tags/gcc_4_8_3_release)
14935
+++ b/src/libgfortran/generated/maxloc0_4_i16.c (.../branches/gcc-4_8-branch)
14937
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14938
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14939
retarray->offset = 0;
14940
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14941
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14945
@@ -199,7 +199,7 @@
14946
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14947
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14948
retarray->offset = 0;
14949
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14950
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14954
@@ -367,7 +367,7 @@
14955
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14956
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14957
retarray->offset = 0;
14958
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14959
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14961
else if (unlikely (compile_options.bounds_check))
14963
Index: libgfortran/generated/maxloc1_4_r10.c
14964
===================================================================
14965
--- a/src/libgfortran/generated/maxloc1_4_r10.c (.../tags/gcc_4_8_3_release)
14966
+++ b/src/libgfortran/generated/maxloc1_4_r10.c (.../branches/gcc-4_8-branch)
14968
retarray->offset = 0;
14969
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14971
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14972
- * extent[rank-1];
14973
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14975
- retarray->base_addr = xmalloc (alloc_size);
14976
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14977
if (alloc_size == 0)
14979
/* Make sure we have a zero-sized array. */
14980
@@ -294,8 +293,7 @@
14984
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14985
- * extent[rank-1];
14986
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14988
retarray->offset = 0;
14989
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14990
@@ -307,7 +305,7 @@
14994
- retarray->base_addr = xmalloc (alloc_size);
14995
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14999
@@ -485,8 +483,7 @@
15000
retarray->offset = 0;
15001
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15003
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15004
- * extent[rank-1];
15005
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15007
if (alloc_size == 0)
15009
@@ -495,7 +492,7 @@
15013
- retarray->base_addr = xmalloc (alloc_size);
15014
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15018
Index: libgfortran/generated/maxloc1_8_i16.c
15019
===================================================================
15020
--- a/src/libgfortran/generated/maxloc1_8_i16.c (.../tags/gcc_4_8_3_release)
15021
+++ b/src/libgfortran/generated/maxloc1_8_i16.c (.../branches/gcc-4_8-branch)
15023
retarray->offset = 0;
15024
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15026
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15027
- * extent[rank-1];
15028
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15030
- retarray->base_addr = xmalloc (alloc_size);
15031
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15032
if (alloc_size == 0)
15034
/* Make sure we have a zero-sized array. */
15035
@@ -294,8 +293,7 @@
15039
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15040
- * extent[rank-1];
15041
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15043
retarray->offset = 0;
15044
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15045
@@ -307,7 +305,7 @@
15049
- retarray->base_addr = xmalloc (alloc_size);
15050
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15054
@@ -485,8 +483,7 @@
15055
retarray->offset = 0;
15056
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15058
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15059
- * extent[rank-1];
15060
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15062
if (alloc_size == 0)
15064
@@ -495,7 +492,7 @@
15068
- retarray->base_addr = xmalloc (alloc_size);
15069
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15073
Index: libgfortran/generated/minloc0_8_r10.c
15074
===================================================================
15075
--- a/src/libgfortran/generated/minloc0_8_r10.c (.../tags/gcc_4_8_3_release)
15076
+++ b/src/libgfortran/generated/minloc0_8_r10.c (.../branches/gcc-4_8-branch)
15078
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15079
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15080
retarray->offset = 0;
15081
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15082
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15086
@@ -199,7 +199,7 @@
15087
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15088
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15089
retarray->offset = 0;
15090
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15091
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15095
@@ -367,7 +367,7 @@
15096
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15097
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15098
retarray->offset = 0;
15099
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15100
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15102
else if (unlikely (compile_options.bounds_check))
15104
Index: libgfortran/generated/iparity_i2.c
15105
===================================================================
15106
--- a/src/libgfortran/generated/iparity_i2.c (.../tags/gcc_4_8_3_release)
15107
+++ b/src/libgfortran/generated/iparity_i2.c (.../branches/gcc-4_8-branch)
15109
retarray->offset = 0;
15110
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15112
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15113
- * extent[rank-1];
15114
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15116
- retarray->base_addr = xmalloc (alloc_size);
15117
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15118
if (alloc_size == 0)
15120
/* Make sure we have a zero-sized array. */
15121
@@ -272,8 +271,7 @@
15125
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15126
- * extent[rank-1];
15127
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15129
retarray->offset = 0;
15130
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15131
@@ -285,7 +283,7 @@
15135
- retarray->base_addr = xmalloc (alloc_size);
15136
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15140
@@ -430,8 +428,7 @@
15141
retarray->offset = 0;
15142
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15144
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15145
- * extent[rank-1];
15146
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15148
if (alloc_size == 0)
15150
@@ -440,7 +437,7 @@
15154
- retarray->base_addr = xmalloc (alloc_size);
15155
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15159
Index: libgfortran/generated/maxloc1_16_r4.c
15160
===================================================================
15161
--- a/src/libgfortran/generated/maxloc1_16_r4.c (.../tags/gcc_4_8_3_release)
15162
+++ b/src/libgfortran/generated/maxloc1_16_r4.c (.../branches/gcc-4_8-branch)
15164
retarray->offset = 0;
15165
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15167
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15168
- * extent[rank-1];
15169
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15171
- retarray->base_addr = xmalloc (alloc_size);
15172
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15173
if (alloc_size == 0)
15175
/* Make sure we have a zero-sized array. */
15176
@@ -294,8 +293,7 @@
15180
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15181
- * extent[rank-1];
15182
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15184
retarray->offset = 0;
15185
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15186
@@ -307,7 +305,7 @@
15190
- retarray->base_addr = xmalloc (alloc_size);
15191
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15195
@@ -485,8 +483,7 @@
15196
retarray->offset = 0;
15197
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15199
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15200
- * extent[rank-1];
15201
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15203
if (alloc_size == 0)
15205
@@ -495,7 +492,7 @@
15209
- retarray->base_addr = xmalloc (alloc_size);
15210
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15214
Index: libgfortran/generated/maxloc0_16_r8.c
15215
===================================================================
15216
--- a/src/libgfortran/generated/maxloc0_16_r8.c (.../tags/gcc_4_8_3_release)
15217
+++ b/src/libgfortran/generated/maxloc0_16_r8.c (.../branches/gcc-4_8-branch)
15219
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15220
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15221
retarray->offset = 0;
15222
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15223
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15227
@@ -199,7 +199,7 @@
15228
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15229
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15230
retarray->offset = 0;
15231
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15232
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15236
@@ -367,7 +367,7 @@
15237
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15238
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15239
retarray->offset = 0;
15240
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15241
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15243
else if (unlikely (compile_options.bounds_check))
15245
Index: libgfortran/generated/sum_i16.c
15246
===================================================================
15247
--- a/src/libgfortran/generated/sum_i16.c (.../tags/gcc_4_8_3_release)
15248
+++ b/src/libgfortran/generated/sum_i16.c (.../branches/gcc-4_8-branch)
15250
retarray->offset = 0;
15251
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15253
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15254
- * extent[rank-1];
15255
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15257
- retarray->base_addr = xmalloc (alloc_size);
15258
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15259
if (alloc_size == 0)
15261
/* Make sure we have a zero-sized array. */
15262
@@ -272,8 +271,7 @@
15266
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15267
- * extent[rank-1];
15268
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15270
retarray->offset = 0;
15271
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15272
@@ -285,7 +283,7 @@
15276
- retarray->base_addr = xmalloc (alloc_size);
15277
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15281
@@ -430,8 +428,7 @@
15282
retarray->offset = 0;
15283
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15285
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15286
- * extent[rank-1];
15287
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15289
if (alloc_size == 0)
15291
@@ -440,7 +437,7 @@
15295
- retarray->base_addr = xmalloc (alloc_size);
15296
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15300
Index: libgfortran/generated/maxloc0_4_i8.c
15301
===================================================================
15302
--- a/src/libgfortran/generated/maxloc0_4_i8.c (.../tags/gcc_4_8_3_release)
15303
+++ b/src/libgfortran/generated/maxloc0_4_i8.c (.../branches/gcc-4_8-branch)
15305
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15306
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15307
retarray->offset = 0;
15308
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15309
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15313
@@ -199,7 +199,7 @@
15314
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15315
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15316
retarray->offset = 0;
15317
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15318
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15322
@@ -367,7 +367,7 @@
15323
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15324
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15325
retarray->offset = 0;
15326
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15327
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15329
else if (unlikely (compile_options.bounds_check))
15331
Index: libgfortran/generated/pack_c16.c
15332
===================================================================
15333
--- a/src/libgfortran/generated/pack_c16.c (.../tags/gcc_4_8_3_release)
15334
+++ b/src/libgfortran/generated/pack_c16.c (.../branches/gcc-4_8-branch)
15335
@@ -167,8 +167,8 @@
15339
- /* xmalloc allocates a single byte for zero size. */
15340
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * total);
15341
+ /* xmallocarray allocates a single byte for zero size. */
15342
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_16));
15346
Index: libgfortran/generated/maxloc1_16_i16.c
15347
===================================================================
15348
--- a/src/libgfortran/generated/maxloc1_16_i16.c (.../tags/gcc_4_8_3_release)
15349
+++ b/src/libgfortran/generated/maxloc1_16_i16.c (.../branches/gcc-4_8-branch)
15351
retarray->offset = 0;
15352
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15354
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15355
- * extent[rank-1];
15356
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15358
- retarray->base_addr = xmalloc (alloc_size);
15359
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15360
if (alloc_size == 0)
15362
/* Make sure we have a zero-sized array. */
15363
@@ -294,8 +293,7 @@
15367
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15368
- * extent[rank-1];
15369
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15371
retarray->offset = 0;
15372
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15373
@@ -307,7 +305,7 @@
15377
- retarray->base_addr = xmalloc (alloc_size);
15378
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15382
@@ -485,8 +483,7 @@
15383
retarray->offset = 0;
15384
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15386
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15387
- * extent[rank-1];
15388
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15390
if (alloc_size == 0)
15392
@@ -495,7 +492,7 @@
15396
- retarray->base_addr = xmalloc (alloc_size);
15397
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15401
Index: libgfortran/generated/minloc1_8_r4.c
15402
===================================================================
15403
--- a/src/libgfortran/generated/minloc1_8_r4.c (.../tags/gcc_4_8_3_release)
15404
+++ b/src/libgfortran/generated/minloc1_8_r4.c (.../branches/gcc-4_8-branch)
15406
retarray->offset = 0;
15407
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15409
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15410
- * extent[rank-1];
15411
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15413
- retarray->base_addr = xmalloc (alloc_size);
15414
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15415
if (alloc_size == 0)
15417
/* Make sure we have a zero-sized array. */
15418
@@ -294,8 +293,7 @@
15422
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15423
- * extent[rank-1];
15424
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15426
retarray->offset = 0;
15427
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15428
@@ -307,7 +305,7 @@
15432
- retarray->base_addr = xmalloc (alloc_size);
15433
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15437
@@ -485,8 +483,7 @@
15438
retarray->offset = 0;
15439
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15441
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15442
- * extent[rank-1];
15443
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15445
if (alloc_size == 0)
15447
@@ -495,7 +492,7 @@
15451
- retarray->base_addr = xmalloc (alloc_size);
15452
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15456
Index: libgfortran/generated/sum_c8.c
15457
===================================================================
15458
--- a/src/libgfortran/generated/sum_c8.c (.../tags/gcc_4_8_3_release)
15459
+++ b/src/libgfortran/generated/sum_c8.c (.../branches/gcc-4_8-branch)
15461
retarray->offset = 0;
15462
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15464
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15465
- * extent[rank-1];
15466
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15468
- retarray->base_addr = xmalloc (alloc_size);
15469
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
15470
if (alloc_size == 0)
15472
/* Make sure we have a zero-sized array. */
15473
@@ -272,8 +271,7 @@
15477
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15478
- * extent[rank-1];
15479
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15481
retarray->offset = 0;
15482
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15483
@@ -285,7 +283,7 @@
15487
- retarray->base_addr = xmalloc (alloc_size);
15488
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
15492
@@ -430,8 +428,7 @@
15493
retarray->offset = 0;
15494
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15496
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15497
- * extent[rank-1];
15498
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15500
if (alloc_size == 0)
15502
@@ -440,7 +437,7 @@
15506
- retarray->base_addr = xmalloc (alloc_size);
15507
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
15511
Index: libgfortran/generated/maxloc1_16_i2.c
15512
===================================================================
15513
--- a/src/libgfortran/generated/maxloc1_16_i2.c (.../tags/gcc_4_8_3_release)
15514
+++ b/src/libgfortran/generated/maxloc1_16_i2.c (.../branches/gcc-4_8-branch)
15516
retarray->offset = 0;
15517
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15519
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15520
- * extent[rank-1];
15521
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15523
- retarray->base_addr = xmalloc (alloc_size);
15524
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15525
if (alloc_size == 0)
15527
/* Make sure we have a zero-sized array. */
15528
@@ -294,8 +293,7 @@
15532
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15533
- * extent[rank-1];
15534
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15536
retarray->offset = 0;
15537
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15538
@@ -307,7 +305,7 @@
15542
- retarray->base_addr = xmalloc (alloc_size);
15543
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15547
@@ -485,8 +483,7 @@
15548
retarray->offset = 0;
15549
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15551
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15552
- * extent[rank-1];
15553
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15555
if (alloc_size == 0)
15557
@@ -495,7 +492,7 @@
15561
- retarray->base_addr = xmalloc (alloc_size);
15562
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15566
Index: libgfortran/generated/parity_l1.c
15567
===================================================================
15568
--- a/src/libgfortran/generated/parity_l1.c (.../tags/gcc_4_8_3_release)
15569
+++ b/src/libgfortran/generated/parity_l1.c (.../branches/gcc-4_8-branch)
15571
retarray->offset = 0;
15572
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15574
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15575
- * extent[rank-1];
15576
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15578
- retarray->base_addr = xmalloc (alloc_size);
15579
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
15580
if (alloc_size == 0)
15582
/* Make sure we have a zero-sized array. */
15583
Index: libgfortran/generated/maxval_i16.c
15584
===================================================================
15585
--- a/src/libgfortran/generated/maxval_i16.c (.../tags/gcc_4_8_3_release)
15586
+++ b/src/libgfortran/generated/maxval_i16.c (.../branches/gcc-4_8-branch)
15588
retarray->offset = 0;
15589
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15591
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15592
- * extent[rank-1];
15593
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15595
- retarray->base_addr = xmalloc (alloc_size);
15596
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15597
if (alloc_size == 0)
15599
/* Make sure we have a zero-sized array. */
15600
@@ -286,8 +285,7 @@
15604
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15605
- * extent[rank-1];
15606
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15608
retarray->offset = 0;
15609
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15610
@@ -299,7 +297,7 @@
15614
- retarray->base_addr = xmalloc (alloc_size);
15615
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15619
@@ -472,8 +470,7 @@
15620
retarray->offset = 0;
15621
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15623
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15624
- * extent[rank-1];
15625
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15627
if (alloc_size == 0)
15629
@@ -482,7 +479,7 @@
15633
- retarray->base_addr = xmalloc (alloc_size);
15634
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15638
Index: libgfortran/generated/spread_c8.c
15639
===================================================================
15640
--- a/src/libgfortran/generated/spread_c8.c (.../tags/gcc_4_8_3_release)
15641
+++ b/src/libgfortran/generated/spread_c8.c (.../branches/gcc-4_8-branch)
15642
@@ -101,8 +101,8 @@
15646
- /* xmalloc allocates a single byte for zero size. */
15647
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_8));
15648
+ /* xmallocarray allocates a single byte for zero size. */
15649
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_8));
15653
@@ -244,7 +244,7 @@
15655
if (ret->base_addr == NULL)
15657
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_8));
15658
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_8));
15660
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
15662
Index: libgfortran/generated/matmul_i16.c
15663
===================================================================
15664
--- a/src/libgfortran/generated/matmul_i16.c (.../tags/gcc_4_8_3_release)
15665
+++ b/src/libgfortran/generated/matmul_i16.c (.../branches/gcc-4_8-branch)
15666
@@ -124,7 +124,7 @@
15669
retarray->base_addr
15670
- = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
15671
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_16));
15672
retarray->offset = 0;
15674
else if (unlikely (compile_options.bounds_check))
15675
Index: libgfortran/generated/pack_i8.c
15676
===================================================================
15677
--- a/src/libgfortran/generated/pack_i8.c (.../tags/gcc_4_8_3_release)
15678
+++ b/src/libgfortran/generated/pack_i8.c (.../branches/gcc-4_8-branch)
15679
@@ -167,8 +167,8 @@
15683
- /* xmalloc allocates a single byte for zero size. */
15684
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * total);
15685
+ /* xmallocarray allocates a single byte for zero size. */
15686
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_8));
15690
Index: libgfortran/generated/any_l1.c
15691
===================================================================
15692
--- a/src/libgfortran/generated/any_l1.c (.../tags/gcc_4_8_3_release)
15693
+++ b/src/libgfortran/generated/any_l1.c (.../branches/gcc-4_8-branch)
15694
@@ -101,8 +101,7 @@
15695
retarray->offset = 0;
15696
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15698
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15699
- * extent[rank-1];
15700
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15702
if (alloc_size == 0)
15704
@@ -111,7 +110,7 @@
15708
- retarray->base_addr = xmalloc (alloc_size);
15709
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
15713
Index: libgfortran/generated/minloc1_8_i2.c
15714
===================================================================
15715
--- a/src/libgfortran/generated/minloc1_8_i2.c (.../tags/gcc_4_8_3_release)
15716
+++ b/src/libgfortran/generated/minloc1_8_i2.c (.../branches/gcc-4_8-branch)
15718
retarray->offset = 0;
15719
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15721
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15722
- * extent[rank-1];
15723
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15725
- retarray->base_addr = xmalloc (alloc_size);
15726
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15727
if (alloc_size == 0)
15729
/* Make sure we have a zero-sized array. */
15730
@@ -294,8 +293,7 @@
15734
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15735
- * extent[rank-1];
15736
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15738
retarray->offset = 0;
15739
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15740
@@ -307,7 +305,7 @@
15744
- retarray->base_addr = xmalloc (alloc_size);
15745
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15749
@@ -485,8 +483,7 @@
15750
retarray->offset = 0;
15751
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15753
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15754
- * extent[rank-1];
15755
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15757
if (alloc_size == 0)
15759
@@ -495,7 +492,7 @@
15763
- retarray->base_addr = xmalloc (alloc_size);
15764
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15768
Index: libgfortran/generated/minloc0_8_r8.c
15769
===================================================================
15770
--- a/src/libgfortran/generated/minloc0_8_r8.c (.../tags/gcc_4_8_3_release)
15771
+++ b/src/libgfortran/generated/minloc0_8_r8.c (.../branches/gcc-4_8-branch)
15773
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15774
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15775
retarray->offset = 0;
15776
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15777
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15781
@@ -199,7 +199,7 @@
15782
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15783
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15784
retarray->offset = 0;
15785
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15786
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15790
@@ -367,7 +367,7 @@
15791
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15792
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15793
retarray->offset = 0;
15794
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15795
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15797
else if (unlikely (compile_options.bounds_check))
15799
Index: libgfortran/generated/matmul_l8.c
15800
===================================================================
15801
--- a/src/libgfortran/generated/matmul_l8.c (.../tags/gcc_4_8_3_release)
15802
+++ b/src/libgfortran/generated/matmul_l8.c (.../branches/gcc-4_8-branch)
15806
retarray->base_addr
15807
- = xmalloc (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
15808
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_8));
15809
retarray->offset = 0;
15811
else if (unlikely (compile_options.bounds_check))
15812
Index: libgfortran/generated/product_r10.c
15813
===================================================================
15814
--- a/src/libgfortran/generated/product_r10.c (.../tags/gcc_4_8_3_release)
15815
+++ b/src/libgfortran/generated/product_r10.c (.../branches/gcc-4_8-branch)
15817
retarray->offset = 0;
15818
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15820
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15821
- * extent[rank-1];
15822
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15824
- retarray->base_addr = xmalloc (alloc_size);
15825
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
15826
if (alloc_size == 0)
15828
/* Make sure we have a zero-sized array. */
15829
@@ -272,8 +271,7 @@
15833
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15834
- * extent[rank-1];
15835
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15837
retarray->offset = 0;
15838
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15839
@@ -285,7 +283,7 @@
15843
- retarray->base_addr = xmalloc (alloc_size);
15844
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
15848
@@ -430,8 +428,7 @@
15849
retarray->offset = 0;
15850
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15852
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15853
- * extent[rank-1];
15854
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15856
if (alloc_size == 0)
15858
@@ -440,7 +437,7 @@
15862
- retarray->base_addr = xmalloc (alloc_size);
15863
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
15867
Index: libgfortran/generated/product_i1.c
15868
===================================================================
15869
--- a/src/libgfortran/generated/product_i1.c (.../tags/gcc_4_8_3_release)
15870
+++ b/src/libgfortran/generated/product_i1.c (.../branches/gcc-4_8-branch)
15872
retarray->offset = 0;
15873
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15875
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15876
- * extent[rank-1];
15877
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15879
- retarray->base_addr = xmalloc (alloc_size);
15880
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15881
if (alloc_size == 0)
15883
/* Make sure we have a zero-sized array. */
15884
@@ -272,8 +271,7 @@
15888
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15889
- * extent[rank-1];
15890
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15892
retarray->offset = 0;
15893
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15894
@@ -285,7 +283,7 @@
15898
- retarray->base_addr = xmalloc (alloc_size);
15899
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15903
@@ -430,8 +428,7 @@
15904
retarray->offset = 0;
15905
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15907
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15908
- * extent[rank-1];
15909
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15911
if (alloc_size == 0)
15913
@@ -440,7 +437,7 @@
15917
- retarray->base_addr = xmalloc (alloc_size);
15918
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15922
Index: libgfortran/generated/all_l8.c
15923
===================================================================
15924
--- a/src/libgfortran/generated/all_l8.c (.../tags/gcc_4_8_3_release)
15925
+++ b/src/libgfortran/generated/all_l8.c (.../branches/gcc-4_8-branch)
15926
@@ -101,8 +101,7 @@
15927
retarray->offset = 0;
15928
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15930
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15931
- * extent[rank-1];
15932
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15934
if (alloc_size == 0)
15936
@@ -111,7 +110,7 @@
15940
- retarray->base_addr = xmalloc (alloc_size);
15941
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
15945
Index: libgfortran/generated/in_pack_r16.c
15946
===================================================================
15947
--- a/src/libgfortran/generated/in_pack_r16.c (.../tags/gcc_4_8_3_release)
15948
+++ b/src/libgfortran/generated/in_pack_r16.c (.../branches/gcc-4_8-branch)
15950
return source->base_addr;
15952
/* Allocate storage for the destination. */
15953
- destptr = (GFC_REAL_16 *)xmalloc (ssize * sizeof (GFC_REAL_16));
15954
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_16));
15956
src = source->base_addr;
15957
stride0 = stride[0];
15958
Index: libgfortran/generated/in_pack_i1.c
15959
===================================================================
15960
--- a/src/libgfortran/generated/in_pack_i1.c (.../tags/gcc_4_8_3_release)
15961
+++ b/src/libgfortran/generated/in_pack_i1.c (.../branches/gcc-4_8-branch)
15963
return source->base_addr;
15965
/* Allocate storage for the destination. */
15966
- destptr = (GFC_INTEGER_1 *)xmalloc (ssize * sizeof (GFC_INTEGER_1));
15967
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_1));
15969
src = source->base_addr;
15970
stride0 = stride[0];
15971
Index: libgfortran/libgfortran.h
15972
===================================================================
15973
--- a/src/libgfortran/libgfortran.h (.../tags/gcc_4_8_3_release)
15974
+++ b/src/libgfortran/libgfortran.h (.../branches/gcc-4_8-branch)
15975
@@ -751,6 +751,9 @@
15976
extern void *xmalloc (size_t) __attribute__ ((malloc));
15977
internal_proto(xmalloc);
15979
+extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc));
15980
+internal_proto(xmallocarray);
15982
extern void *xcalloc (size_t, size_t) __attribute__ ((malloc));
15983
internal_proto(xcalloc);
15985
Index: libgfortran/io/list_read.c
15986
===================================================================
15987
--- a/src/libgfortran/io/list_read.c (.../tags/gcc_4_8_3_release)
15988
+++ b/src/libgfortran/io/list_read.c (.../branches/gcc-4_8-branch)
15989
@@ -2354,7 +2354,7 @@
15991
index_type len = strlen (nl->var_name) + 1;
15993
- char * ext_name = (char*)xmalloc (len + 1);
15994
+ char * ext_name = xmalloc (len + 1);
15995
memcpy (ext_name, nl->var_name, len-1);
15996
memcpy (ext_name + len - 1, "%", 2);
15997
for (nl = nl->next; nl; nl = nl->next)
15998
Index: libgfortran/io/unit.c
15999
===================================================================
16000
--- a/src/libgfortran/io/unit.c (.../tags/gcc_4_8_3_release)
16001
+++ b/src/libgfortran/io/unit.c (.../branches/gcc-4_8-branch)
16002
@@ -455,7 +455,7 @@
16004
iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
16005
iunit->ls = (array_loop_spec *)
16006
- xmalloc (iunit->rank * sizeof (array_loop_spec));
16007
+ xmallocarray (iunit->rank, sizeof (array_loop_spec));
16008
dtp->internal_unit_len *=
16009
init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
16011
Index: libgfortran/io/unix.c
16012
===================================================================
16013
--- a/src/libgfortran/io/unix.c (.../tags/gcc_4_8_3_release)
16014
+++ b/src/libgfortran/io/unix.c (.../branches/gcc-4_8-branch)
16015
@@ -407,7 +407,9 @@
16019
- if (s->fd != STDOUT_FILENO
16022
+ else if (s->fd != STDOUT_FILENO
16023
&& s->fd != STDERR_FILENO
16024
&& s->fd != STDIN_FILENO)
16025
retval = close (s->fd);
16026
@@ -983,7 +985,15 @@
16028
/* Get the current length of the file. */
16030
- fstat (fd, &statbuf);
16031
+ if (fstat (fd, &statbuf) == -1)
16033
+ s->st_dev = s->st_ino = -1;
16034
+ s->file_length = 0;
16035
+ if (errno == EBADF)
16038
+ return (stream *) s;
16041
s->st_dev = statbuf.st_dev;
16042
s->st_ino = statbuf.st_ino;
16043
Index: libgfortran/io/transfer.c
16044
===================================================================
16045
--- a/src/libgfortran/io/transfer.c (.../tags/gcc_4_8_3_release)
16046
+++ b/src/libgfortran/io/transfer.c (.../branches/gcc-4_8-branch)
16047
@@ -3776,9 +3776,9 @@
16048
if (nml->var_rank > 0)
16050
nml->dim = (descriptor_dimension*)
16051
- xmalloc (nml->var_rank * sizeof (descriptor_dimension));
16052
+ xmallocarray (nml->var_rank, sizeof (descriptor_dimension));
16053
nml->ls = (array_loop_spec*)
16054
- xmalloc (nml->var_rank * sizeof (array_loop_spec));
16055
+ xmallocarray (nml->var_rank, sizeof (array_loop_spec));
16059
Index: libgfortran/io/write.c
16060
===================================================================
16061
--- a/src/libgfortran/io/write.c (.../tags/gcc_4_8_3_release)
16062
+++ b/src/libgfortran/io/write.c (.../branches/gcc-4_8-branch)
16063
@@ -1863,7 +1863,7 @@
16064
base_var_name_len = base ? strlen (base->var_name) : 0;
16065
ext_name_len = base_name_len + base_var_name_len
16066
+ strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1;
16067
- ext_name = (char*)xmalloc (ext_name_len);
16068
+ ext_name = xmalloc (ext_name_len);
16070
memcpy (ext_name, base_name, base_name_len);
16071
clen = strlen (obj->var_name + base_var_name_len);
16072
@@ -1892,7 +1892,7 @@
16073
/* Now obj_name. */
16075
obj_name_len = strlen (obj->var_name) + 1;
16076
- obj_name = xmalloc (obj_name_len+1);
16077
+ obj_name = xmalloc (obj_name_len + 1);
16078
memcpy (obj_name, obj->var_name, obj_name_len-1);
16079
memcpy (obj_name + obj_name_len-1, "%", 2);
16082
===================================================================
16083
--- a/src/. (.../tags/gcc_4_8_3_release)
16084
+++ b/src/. (.../branches/gcc-4_8-branch)
16086
Property changes on: .
16087
___________________________________________________________________
16088
Modified: svn:mergeinfo
16089
Merged /trunk:r211733