aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9')
-rw-r--r--gcc-4.9/ChangeLog15
-rw-r--r--gcc-4.9/boehm-gc/ChangeLog4
-rw-r--r--gcc-4.9/config/ChangeLog9
-rwxr-xr-xgcc-4.9/configure3
-rw-r--r--gcc-4.9/configure.ac3
-rw-r--r--gcc-4.9/contrib/ChangeLog4
-rw-r--r--gcc-4.9/contrib/reghunt/ChangeLog4
-rw-r--r--gcc-4.9/contrib/regression/ChangeLog4
-rw-r--r--gcc-4.9/contrib/testsuite-management/aarch64-grtev4-linux-gnu.xfail3
-rw-r--r--gcc-4.9/contrib/testsuite-management/powerpc64le-grtev4-linux-gnu.xfail3
-rw-r--r--gcc-4.9/fixincludes/ChangeLog4
-rw-r--r--gcc-4.9/gcc/ChangeLog242
-rw-r--r--gcc-4.9/gcc/DATESTAMP2
-rw-r--r--gcc-4.9/gcc/ada/ChangeLog4
-rw-r--r--gcc-4.9/gcc/c-family/ChangeLog14
-rw-r--r--gcc-4.9/gcc/c-family/c-gimplify.c4
-rw-r--r--gcc-4.9/gcc/c/ChangeLog4
-rw-r--r--gcc-4.9/gcc/cgraph.c6
-rw-r--r--gcc-4.9/gcc/common.opt4
-rw-r--r--gcc-4.9/gcc/config.gcc11
-rw-r--r--gcc-4.9/gcc/config/aarch64/aarch64-linux.h2
-rw-r--r--gcc-4.9/gcc/config/aarch64/aarch64.c14
-rw-r--r--gcc-4.9/gcc/config/alpha/elf.h4
-rw-r--r--gcc-4.9/gcc/config/arm/t-rtems-eabi124
-rw-r--r--gcc-4.9/gcc/config/cris/constraints.md4
-rw-r--r--gcc-4.9/gcc/config/cris/cris-protos.h5
-rw-r--r--gcc-4.9/gcc/config/cris/cris.c120
-rw-r--r--gcc-4.9/gcc/config/cris/cris.h11
-rw-r--r--gcc-4.9/gcc/config/cris/cris.md60
-rw-r--r--gcc-4.9/gcc/config/cris/predicates.md14
-rw-r--r--gcc-4.9/gcc/config/i386/avx512fintrin.h32
-rw-r--r--gcc-4.9/gcc/config/i386/i386.c2
-rw-r--r--gcc-4.9/gcc/config/i386/ia32intrin.h14
-rw-r--r--gcc-4.9/gcc/config/i386/sse.md14
-rw-r--r--gcc-4.9/gcc/config/rs6000/freebsd64.h2
-rw-r--r--gcc-4.9/gcc/config/rs6000/linux64.h2
-rw-r--r--gcc-4.9/gcc/config/rs6000/rs6000-protos.h1
-rw-r--r--gcc-4.9/gcc/config/rs6000/rs6000.c111
-rw-r--r--gcc-4.9/gcc/config/rs6000/sysv4.h18
-rw-r--r--gcc-4.9/gcc/config/sh/predicates.md8
-rw-r--r--gcc-4.9/gcc/config/sh/sh.c26
-rw-r--r--gcc-4.9/gcc/config/sparc/sync.md10
-rw-r--r--gcc-4.9/gcc/coverage.c46
-rw-r--r--gcc-4.9/gcc/coverage.h2
-rw-r--r--gcc-4.9/gcc/cp/ChangeLog9
-rw-r--r--gcc-4.9/gcc/cp/call.c6
-rw-r--r--gcc-4.9/gcc/cp/except.c4
-rw-r--r--gcc-4.9/gcc/expr.c2
-rw-r--r--gcc-4.9/gcc/fortran/ChangeLog12
-rw-r--r--gcc-4.9/gcc/fortran/dependency.c31
-rw-r--r--gcc-4.9/gcc/gcc.c3
-rw-r--r--gcc-4.9/gcc/gcov-tool.c27
-rw-r--r--gcc-4.9/gcc/go/ChangeLog4
-rw-r--r--gcc-4.9/gcc/ipa-inline-transform.c10
-rw-r--r--gcc-4.9/gcc/java/ChangeLog4
-rw-r--r--gcc-4.9/gcc/l-ipo.c6
-rw-r--r--gcc-4.9/gcc/lto/ChangeLog4
-rw-r--r--gcc-4.9/gcc/objc/ChangeLog4
-rw-r--r--gcc-4.9/gcc/objcp/ChangeLog4
-rw-r--r--gcc-4.9/gcc/omp-low.c1
-rw-r--r--gcc-4.9/gcc/opts.c105
-rw-r--r--gcc-4.9/gcc/opts.h2
-rw-r--r--gcc-4.9/gcc/params.c15
-rw-r--r--gcc-4.9/gcc/params.def11
-rw-r--r--gcc-4.9/gcc/params.h2
-rw-r--r--gcc-4.9/gcc/po/ChangeLog4
-rw-r--r--gcc-4.9/gcc/sched-deps.c3
-rw-r--r--gcc-4.9/gcc/testsuite/ChangeLog112
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/compat/struct-layout-1.exp3
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C3
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C3
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-1.x1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050604-1.x1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c17
-rw-r--r--gcc-4.9/gcc/toplev.c13
-rw-r--r--gcc-4.9/gcc/tree-profile.c13
-rw-r--r--gcc-4.9/gcc/tree-ssa-copy.c46
-rw-r--r--gcc-4.9/gcc/value-prof.c15
-rw-r--r--gcc-4.9/gnattools/ChangeLog4
-rw-r--r--gcc-4.9/include/ChangeLog4
-rw-r--r--gcc-4.9/intl/ChangeLog4
-rw-r--r--gcc-4.9/libada/ChangeLog4
-rw-r--r--gcc-4.9/libatomic/ChangeLog4
-rw-r--r--gcc-4.9/libbacktrace/ChangeLog4
-rw-r--r--gcc-4.9/libcilkrts/ChangeLog4
-rw-r--r--gcc-4.9/libcpp/ChangeLog4
-rw-r--r--gcc-4.9/libcpp/po/ChangeLog4
-rw-r--r--gcc-4.9/libdecnumber/ChangeLog4
-rw-r--r--gcc-4.9/libffi/ChangeLog4
-rw-r--r--gcc-4.9/libgcc/ChangeLog4
-rw-r--r--gcc-4.9/libgcc/config/libbid/ChangeLog4
-rw-r--r--gcc-4.9/libgcc/dyn-ipa.c803
-rw-r--r--gcc-4.9/libgcc/libgcov-driver.c151
-rw-r--r--gcc-4.9/libgcc/libgcov-interface.c94
-rw-r--r--gcc-4.9/libgcc/libgcov-util.c10
-rw-r--r--gcc-4.9/libgcc/libgcov.h11
-rw-r--r--gcc-4.9/libgfortran/ChangeLog58
-rw-r--r--gcc-4.9/libgfortran/generated/all_l1.c5
-rw-r--r--gcc-4.9/libgfortran/generated/all_l16.c5
-rw-r--r--gcc-4.9/libgfortran/generated/all_l2.c5
-rw-r--r--gcc-4.9/libgfortran/generated/all_l4.c5
-rw-r--r--gcc-4.9/libgfortran/generated/all_l8.c5
-rw-r--r--gcc-4.9/libgfortran/generated/any_l1.c5
-rw-r--r--gcc-4.9/libgfortran/generated/any_l16.c5
-rw-r--r--gcc-4.9/libgfortran/generated/any_l2.c5
-rw-r--r--gcc-4.9/libgfortran/generated/any_l4.c5
-rw-r--r--gcc-4.9/libgfortran/generated/any_l8.c5
-rw-r--r--gcc-4.9/libgfortran/generated/bessel_r10.c4
-rw-r--r--gcc-4.9/libgfortran/generated/bessel_r16.c4
-rw-r--r--gcc-4.9/libgfortran/generated/bessel_r4.c4
-rw-r--r--gcc-4.9/libgfortran/generated/bessel_r8.c4
-rw-r--r--gcc-4.9/libgfortran/generated/count_16_l.c5
-rw-r--r--gcc-4.9/libgfortran/generated/count_1_l.c5
-rw-r--r--gcc-4.9/libgfortran/generated/count_2_l.c5
-rw-r--r--gcc-4.9/libgfortran/generated/count_4_l.c5
-rw-r--r--gcc-4.9/libgfortran/generated/count_8_l.c5
-rw-r--r--gcc-4.9/libgfortran/generated/cshift1_16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/cshift1_4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/cshift1_8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/eoshift1_16.c4
-rw-r--r--gcc-4.9/libgfortran/generated/eoshift1_4.c4
-rw-r--r--gcc-4.9/libgfortran/generated/eoshift1_8.c4
-rw-r--r--gcc-4.9/libgfortran/generated/eoshift3_16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/eoshift3_4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/eoshift3_8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/iall_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iall_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iall_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iall_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iall_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iany_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iany_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iany_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iany_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iany_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_c10.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_c16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_c4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_c8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_i1.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_i16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_i2.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_i4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_i8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_r10.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_r16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_r4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/in_pack_r8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/iparity_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iparity_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iparity_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iparity_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/iparity_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_c10.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_c16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_c4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_c8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_i1.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_i16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_i2.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_i4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_i8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_l16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_l4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_l8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_r10.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_r16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_r4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/matmul_r8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_i1.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_i16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_i2.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_i4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_i8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_r10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_r16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_r4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_16_r8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_i1.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_i16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_i2.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_i4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_i8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_r10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_r16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_r4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_4_r8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_i1.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_i16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_i2.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_i4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_i8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_r10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_r16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_r4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc0_8_r8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_16_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_4_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxloc1_8_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/maxval_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_i1.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_i16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_i2.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_i4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_i8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_r10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_r16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_r4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_16_r8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_i1.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_i16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_i2.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_i4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_i8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_r10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_r16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_r4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_4_r8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_i1.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_i16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_i2.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_i4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_i8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_r10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_r16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_r4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc0_8_r8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_16_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_4_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minloc1_8_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/minval_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/norm2_r10.c5
-rw-r--r--gcc-4.9/libgfortran/generated/norm2_r16.c5
-rw-r--r--gcc-4.9/libgfortran/generated/norm2_r4.c5
-rw-r--r--gcc-4.9/libgfortran/generated/norm2_r8.c5
-rw-r--r--gcc-4.9/libgfortran/generated/pack_c10.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_c16.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_c4.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_c8.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_i1.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_i16.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_i2.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_i4.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_i8.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_r10.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_r16.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_r4.c4
-rw-r--r--gcc-4.9/libgfortran/generated/pack_r8.c4
-rw-r--r--gcc-4.9/libgfortran/generated/parity_l1.c5
-rw-r--r--gcc-4.9/libgfortran/generated/parity_l16.c5
-rw-r--r--gcc-4.9/libgfortran/generated/parity_l2.c5
-rw-r--r--gcc-4.9/libgfortran/generated/parity_l4.c5
-rw-r--r--gcc-4.9/libgfortran/generated/parity_l8.c5
-rw-r--r--gcc-4.9/libgfortran/generated/product_c10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_c16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_c4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_c8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/product_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_c10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_c16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_c4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_c8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_i16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_i4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_i8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_r10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_r16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_r4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/reshape_r8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/shape_i16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/shape_i4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/shape_i8.c2
-rw-r--r--gcc-4.9/libgfortran/generated/spread_c10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_c16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_c4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_c8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_i1.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_i16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_i2.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_i4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_i8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_r10.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_r16.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_r4.c6
-rw-r--r--gcc-4.9/libgfortran/generated/spread_r8.c6
-rw-r--r--gcc-4.9/libgfortran/generated/sum_c10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_c16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_c4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_c8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_i1.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_i16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_i2.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_i4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_i8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_r10.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_r16.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_r4.c15
-rw-r--r--gcc-4.9/libgfortran/generated/sum_r8.c15
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_c10.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_c16.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_c4.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_c8.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_i16.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_i4.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_i8.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_r10.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_r16.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_r4.c3
-rw-r--r--gcc-4.9/libgfortran/generated/transpose_r8.c3
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_c10.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_c16.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_c4.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_c8.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_i1.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_i16.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_i2.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_i4.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_i8.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_r10.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_r16.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_r4.c4
-rw-r--r--gcc-4.9/libgfortran/generated/unpack_r8.c4
-rw-r--r--gcc-4.9/libgfortran/intrinsics/cshift0.c4
-rw-r--r--gcc-4.9/libgfortran/intrinsics/eoshift0.c4
-rw-r--r--gcc-4.9/libgfortran/intrinsics/eoshift2.c4
-rw-r--r--gcc-4.9/libgfortran/intrinsics/pack_generic.c6
-rw-r--r--gcc-4.9/libgfortran/intrinsics/reshape_generic.c6
-rw-r--r--gcc-4.9/libgfortran/intrinsics/spread_generic.c4
-rw-r--r--gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c4
-rw-r--r--gcc-4.9/libgfortran/intrinsics/transpose_generic.c2
-rw-r--r--gcc-4.9/libgfortran/intrinsics/unpack_generic.c2
-rw-r--r--gcc-4.9/libgfortran/io/list_read.c2
-rw-r--r--gcc-4.9/libgfortran/io/transfer.c4
-rw-r--r--gcc-4.9/libgfortran/io/unit.c2
-rw-r--r--gcc-4.9/libgfortran/io/write.c4
-rw-r--r--gcc-4.9/libgfortran/libgfortran.h3
-rw-r--r--gcc-4.9/libgfortran/m4/bessel.m44
-rw-r--r--gcc-4.9/libgfortran/m4/cshift1.m42
-rw-r--r--gcc-4.9/libgfortran/m4/eoshift1.m44
-rw-r--r--gcc-4.9/libgfortran/m4/eoshift3.m46
-rw-r--r--gcc-4.9/libgfortran/m4/iforeach.m46
-rw-r--r--gcc-4.9/libgfortran/m4/ifunction.m415
-rw-r--r--gcc-4.9/libgfortran/m4/ifunction_logical.m45
-rw-r--r--gcc-4.9/libgfortran/m4/in_pack.m42
-rw-r--r--gcc-4.9/libgfortran/m4/matmul.m42
-rw-r--r--gcc-4.9/libgfortran/m4/matmull.m42
-rw-r--r--gcc-4.9/libgfortran/m4/pack.m44
-rw-r--r--gcc-4.9/libgfortran/m4/reshape.m46
-rw-r--r--gcc-4.9/libgfortran/m4/shape.m42
-rw-r--r--gcc-4.9/libgfortran/m4/spread.m46
-rw-r--r--gcc-4.9/libgfortran/m4/transpose.m43
-rw-r--r--gcc-4.9/libgfortran/m4/unpack.m44
-rw-r--r--gcc-4.9/libgfortran/runtime/convert_char.c4
-rw-r--r--gcc-4.9/libgfortran/runtime/environ.c2
-rw-r--r--gcc-4.9/libgfortran/runtime/in_pack_generic.c2
-rw-r--r--gcc-4.9/libgfortran/runtime/memory.c29
-rw-r--r--gcc-4.9/libgomp/ChangeLog4
-rw-r--r--gcc-4.9/libiberty/ChangeLog4
-rw-r--r--gcc-4.9/libitm/ChangeLog10
-rw-r--r--gcc-4.9/libitm/configure.tgt1
-rw-r--r--gcc-4.9/libjava/ChangeLog4
-rw-r--r--gcc-4.9/libjava/classpath/ChangeLog4
-rw-r--r--gcc-4.9/libjava/libltdl/ChangeLog4
-rw-r--r--gcc-4.9/libobjc/ChangeLog17
-rw-r--r--gcc-4.9/libobjc/encoding.c2
-rw-r--r--gcc-4.9/libquadmath/ChangeLog4
-rw-r--r--gcc-4.9/libsanitizer/ChangeLog4
-rw-r--r--gcc-4.9/libssp/ChangeLog4
-rw-r--r--gcc-4.9/libstdc++-v3/ChangeLog15
-rw-r--r--gcc-4.9/libstdc++-v3/include/bits/random.h2
-rw-r--r--gcc-4.9/libstdc++-v3/include/bits/random.tcc3
-rw-r--r--gcc-4.9/libstdc++-v3/include/ext/random.tcc2
-rw-r--r--gcc-4.9/libvtv/ChangeLog4
-rw-r--r--gcc-4.9/lto-plugin/ChangeLog4
-rw-r--r--gcc-4.9/maintainer-scripts/ChangeLog4
-rw-r--r--gcc-4.9/zlib/ChangeLog4
451 files changed, 3651 insertions, 1829 deletions
diff --git a/gcc-4.9/ChangeLog b/gcc-4.9/ChangeLog
index 95931df23..b52689522 100644
--- a/gcc-4.9/ChangeLog
+++ b/gcc-4.9/ChangeLog
@@ -1,3 +1,13 @@
+2014-07-26 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/47230
+ * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
+ * configure: Regenerate.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
@@ -5,7 +15,7 @@
2014-04-04 Eric Botcazou <ebotcazou@adacore.com>
PR bootstrap/60620
- * Makefile.def (dependencies): Make gnattools depend on libstdc++-v3.
+ * Makefile.def (dependencies): Make gnattools depend on libstdc++-v3.
* Makefile.in: Regenerate.
2014-03-28 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
@@ -43,7 +53,8 @@
2014-03-07 Denis Chertykov <chertykov@gmail.com>
- * MAINTAINERS: Remove avr maintainers: Anatoly Sokolov and Eric Weddington
+ * MAINTAINERS: Remove avr maintainers: Anatoly Sokolov
+ and Eric Weddington
2014-03-07 Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc-4.9/boehm-gc/ChangeLog b/gcc-4.9/boehm-gc/ChangeLog
index b6ef629be..2dbc61fa9 100644
--- a/gcc-4.9/boehm-gc/ChangeLog
+++ b/gcc-4.9/boehm-gc/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/config/ChangeLog b/gcc-4.9/config/ChangeLog
index a8877a18f..cb6dcaafc 100644
--- a/gcc-4.9/config/ChangeLog
+++ b/gcc-4.9/config/ChangeLog
@@ -1,3 +1,12 @@
+2014-07-26 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/47230
+ * mh-alpha-linux: New file.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/configure b/gcc-4.9/configure
index 795bc793b..a91394234 100755
--- a/gcc-4.9/configure
+++ b/gcc-4.9/configure
@@ -3871,6 +3871,9 @@ fi
*-mingw*)
host_makefile_frag="config/mh-mingw"
;;
+ alpha*-*-linux*)
+ host_makefile_frag="config/mh-alpha-linux"
+ ;;
hppa*-hp-hpux10*)
host_makefile_frag="config/mh-pa-hpux10"
;;
diff --git a/gcc-4.9/configure.ac b/gcc-4.9/configure.ac
index fce98f110..aa41d3c70 100644
--- a/gcc-4.9/configure.ac
+++ b/gcc-4.9/configure.ac
@@ -1180,6 +1180,9 @@ case "${host}" in
*-mingw*)
host_makefile_frag="config/mh-mingw"
;;
+ alpha*-*-linux*)
+ host_makefile_frag="config/mh-alpha-linux"
+ ;;
hppa*-hp-hpux10*)
host_makefile_frag="config/mh-pa-hpux10"
;;
diff --git a/gcc-4.9/contrib/ChangeLog b/gcc-4.9/contrib/ChangeLog
index a3fad3892..985389828 100644
--- a/gcc-4.9/contrib/ChangeLog
+++ b/gcc-4.9/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-06-29 Richard Biener <rguenther@suse.de>
* gennews: Use gcc-3.0/index.html.
diff --git a/gcc-4.9/contrib/reghunt/ChangeLog b/gcc-4.9/contrib/reghunt/ChangeLog
index 8e36f5467..ccb88eb1d 100644
--- a/gcc-4.9/contrib/reghunt/ChangeLog
+++ b/gcc-4.9/contrib/reghunt/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/contrib/regression/ChangeLog b/gcc-4.9/contrib/regression/ChangeLog
index 15281935e..de91385ff 100644
--- a/gcc-4.9/contrib/regression/ChangeLog
+++ b/gcc-4.9/contrib/regression/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/contrib/testsuite-management/aarch64-grtev4-linux-gnu.xfail b/gcc-4.9/contrib/testsuite-management/aarch64-grtev4-linux-gnu.xfail
index 48d392d6b..d77ebeedf 100644
--- a/gcc-4.9/contrib/testsuite-management/aarch64-grtev4-linux-gnu.xfail
+++ b/gcc-4.9/contrib/testsuite-management/aarch64-grtev4-linux-gnu.xfail
@@ -65,6 +65,9 @@ FAIL: gcc.target/aarch64/fcvt_float_long.c scan-assembler-times fcvtas\tx[0-9]+,
FAIL: gcc.target/aarch64/vect-abs-compile.c scan-assembler abs\\tv[0-9]+.16b
FAIL: gcc.target/aarch64/vect-abs-compile.c scan-assembler abs\\tv[0-9]+.8h
+# AArch64 and PowerPC64LE failure (new 2014-07-31)
+FAIL: gcc.dg/tree-prof/crossmodule-indircall-1.c execution, -fprofile-use -D_PROFILE_USE
+
# *** g++:
diff --git a/gcc-4.9/contrib/testsuite-management/powerpc64le-grtev4-linux-gnu.xfail b/gcc-4.9/contrib/testsuite-management/powerpc64le-grtev4-linux-gnu.xfail
index 0b0c4ce83..d3717ac74 100644
--- a/gcc-4.9/contrib/testsuite-management/powerpc64le-grtev4-linux-gnu.xfail
+++ b/gcc-4.9/contrib/testsuite-management/powerpc64le-grtev4-linux-gnu.xfail
@@ -134,6 +134,9 @@ flaky | FAIL: g++.dg/init/placement2.C -std=c++1y execution test
flaky | FAIL: g++.dg/init/ref9.C -std=c++98 execution test
flaky | FAIL: g++.dg/init/ref9.C -std=c++11 execution test
+# AArch64 and PowerPC64LE failure (new 2014-07-31)
+FAIL: gcc.dg/tree-prof/crossmodule-indircall-1.c execution, -fprofile-use -D_PROFILE_USE
+
# *** g++:
diff --git a/gcc-4.9/fixincludes/ChangeLog b/gcc-4.9/fixincludes/ChangeLog
index d4738d034..cef5385de 100644
--- a/gcc-4.9/fixincludes/ChangeLog
+++ b/gcc-4.9/fixincludes/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/gcc/ChangeLog b/gcc-4.9/gcc/ChangeLog
index dd6e9ad47..df98072de 100644
--- a/gcc-4.9/gcc/ChangeLog
+++ b/gcc-4.9/gcc/ChangeLog
@@ -1,3 +1,198 @@
+2014-07-31 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2014-07-31 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/61844
+ * config/sh/sh.c (sh_legitimate_address_p,
+ sh_legitimize_reload_address): Handle reg+reg address modes when
+ ALLOW_INDEXED_ADDRESS is false.
+ * config/sh/predicates.md (general_movsrc_operand,
+ general_movdst_operand): Likewise.
+
+2014-07-25 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2014-07-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/61656
+ * config/i386/i386.c (classify_argument): Don't merge classes above
+ number of words.
+
+2014-07-25 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/alpha/elf.h: Define TARGET_UNWIND_TABLES_DEFAULT.
+
+2014-07-24 Kyle McMartin <kyle@redhat.com>
+
+ * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define.
+
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
+ Add prototype.
+ * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
+ function. Issue -Wpsabi warning if future GCC releases will use
+ different field alignment rules for this type.
+ * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
+ * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
+ * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
+
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/rs6000/rs6000.c (rs6000_function_arg_boundary): Issue
+ -Wpsabi note when encountering a type where future GCC releases
+ will apply different alignment requirements.
+
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/rs6000/rs6000.c (rs6000_function_arg): If a float argument
+ does not fit fully into floating-point registers, and there is still
+ space in the register parameter area, issue -Wpsabi note that the ABI
+ will change in a future GCC release.
+
+2014-07-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config/arm/t-rtems-eabi: Add
+ mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard,
+ mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard,
+ mbig-endian/mthumb/march=armv7-r, and
+ mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
+ multilibs.
+
+2014-07-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
+ Chris Johns <chrisj@rtems.org>
+ Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * config.gcc: Add nios2-*-rtems*.
+ * config/nios2/rtems.h: New file.
+ * gcc/config/nios2/t-rtems: New file.
+
+2014-07-21 Peter Bergner <bergner@vnet.ibm.com>
+
+ * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define.
+ (LIBTSAN_EARLY_SPEC): Likewise.
+
+2014-07-21 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2014-07-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/61855
+ * config/i386/avx512fintrin.h: Move constants for mantissa extraction
+ out of #ifdef __OPTIMIZE__.
+
+2014-07-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expr.c (store_field): Handle VOIDmode for calls that return values
+ in multiple locations.
+
+2014-07-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * toplev.c (output_stack_usage): Adjust the location of the warning.
+
+2014-07-19 Daniel Cederman <cederman@gaisler.com>
+
+ * config/sparc/sync.md (*membar_storeload_leon3): New insn.
+ (*membar_storeload): Disable for LEON3.
+
+2014-07-18 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2014-07-16 David Wohlferd <dw@LimeGreenSocks.com>
+
+ PR target/61662
+ * config/i386/ia32intrin.h: Use __LP64__ to determine size of long.
+
+2014-07-18 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2014-07-18 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/61794
+ * config/i386/sse.md (avx512f_vextract<shuffletype>32x4_1_maskm):
+ Fix instruction constraint.
+ (<mask_codefor>avx512f_vextract<shuffletype>32x4_1<mask_name>): Ditto.
+
+2014-07-17 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-07-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/61779
+ * tree-ssa-copy.c (copy_prop_visit_cond_stmt): Always try
+ simplifying a condition.
+
+2014-07-17 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/61801
+ * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and ASM_INPUT
+ don't set reg_pending_barrier if it appears in a debug-insn.
+
+2014-07-17 Hans-Peter Nilsson <hp@axis.com>
+
+ Backport from trunk.
+ PR target/61737.
+ * config/cris/cris.c (TARGET_LEGITIMATE_CONSTANT_P)
+ (TARGET_CANNOT_FORCE_CONST_MEM): Define.
+ (cris_cannot_force_const_mem, cris_legitimate_constant_p): New
+ functions.
+ (cris_print_index, cris_print_operand, cris_constant_index_p)
+ (cris_side_effect_mode_ok): Replace CONSTANT_P with CRIS_CONSTANT_P.
+ (cris_address_cost): Ditto last CONSTANT_P.
+ (cris_symbol_type_of): Rename from cris_pic_symbol_type_of. All
+ callers changed. Yield cris_offsettable_symbol for non-PIC
+ constant symbolic expressions including labels. Yield cris_unspec
+ for all unspecs.
+ (cris_expand_pic_call_address): New parameter MARKERP. Set its
+ target to pic_offset_table_rtx for calls that will likely go
+ through PLT, const0_rtx when they can't. All callers changed.
+ Assert flag_pic. Use CONSTANT_P, not CONSTANT_ADDRESS_P, for
+ symbolic expressions to be PICified. Remove second, redundant,
+ assert on can_create_pseudo_p returning non-zero. Use
+ replace_equiv_address_nv, not replace_equiv_address, for final
+ operand update.
+ * config/cris/cris.md ("movsi"): Move variable t to pattern
+ toplevel. Adjust assert for new cris_symbol_type member. Use
+ CONSTANT_P instead of CONSTANT_ADDRESS_P.
+ ("*movsi_internal") <case 9>: Make check for valid unspec operands
+ for lapc stricter.
+ <case CRIS_UNSPEC_PCREL, CRIS_UNSPEC_PLT_PCREL>: Clear condition codes.
+ ("call", "call_value"): Use second incoming operand as a marker
+ for pic-offset-table-register being used.
+ ("*expanded_call_non_v32", "*expanded_call_v32")
+ ("*expanded_call_value_non_v32", "*expanded_call_value_v32"): For
+ second incoming operand to CALL, match cris_call_type_marker.
+ ("*expanded_call_value_side"): Ditto. Disable before reload_completed.
+ ("*expanded_call_side"): Ditto. Fix typo in comment.
+ (moverside, movemside peepholes): Check for CRIS_CONSTANT_P, not
+ CONSTANT_P.
+ * config/cris/predicates.md ("cris_call_type_marker"): New predicate.
+ * config/cris/cris.h (CRIS_CONSTANT_P): New macro.
+ (enum cris_symbol_type): Rename from cris_pic_symbol_type. All
+ users changed. Add members cris_offsettable_symbol and cris_unspec.
+ (cris_symbol_type): Rename from cris_pic_symbol_type.
+ * config/cris/constraints.md ("T"): Use CRIS_CONSTANT_P, not
+ just CONSTANT_P.
+ * config/cris/cris-protos.h (cris_symbol_type_of,
+ cris_expand_pic_call_address): Adjust prototypes.
+ (cris_legitimate_constant_p): New prototype.
+
+ * config.gcc (crisv32-*-linux* | cris-*-linux*): Do not override
+ an existing tmake_file. Don't add t-slibgcc and t-linux.
+
+2014-07-16 Jakub Jelinek <jakub@redhat.com>
+
+ * omp-low.c (create_omp_child_function): Don't set DECL_NAMELESS
+ on the FUNCTION_DECL.
+
+ * BASE-VER: Set to 4.9.1.
+ * DEV-PHASE: Set to prerelease.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-07-11 Rong Xu <xur@google.com>
Backport r212462 trunk.
@@ -41,14 +236,14 @@
2014-07-10 Cary Coutant <ccoutant@google.com>
- Backport from trunk at r212211.
+ Backport from trunk at r212211.
* dwarf2out.c (remove_addr_table_entry): Remove unnecessary hash table
- lookup.
+ lookup.
(resolve_addr_in_expr): When replacing the rtx in a location list
- entry, get a new address table entry.
+ entry, get a new address table entry.
(dwarf2out_finish): Call index_location_lists even if there are no
- addr_index_table entries yet.
+ addr_index_table entries yet.
2014-07-10 Tom G. Christensen <tgc@jupiterrise.com>
@@ -70,13 +265,13 @@
PR target/61062
* config/arm/arm_neon.h (vtrn_s8, vtrn_s16, vtrn_u8, vtrn_u16, vtrn_p8,
vtrn_p16, vtrn_s32, vtrn_f32, vtrn_u32, vtrnq_s8, vtrnq_s16, vtrnq_s32,
- vtrnq_f32, vtrnq_u8, vtrnq_u16, vtrnq_u32, vtrnq_p8, vtrnq_p16, vzip_s8,
- vzip_s16, vzip_u8, vzip_u16, vzip_p8, vzip_p16, vzip_s32, vzip_f32,
- vzip_u32, vzipq_s8, vzipq_s16, vzipq_s32, vzipq_f32, vzipq_u8,
- vzipq_u16, vzipq_u32, vzipq_p8, vzipq_p16, vuzp_s8, vuzp_s16, vuzp_s32,
- vuzp_f32, vuzp_u8, vuzp_u16, vuzp_u32, vuzp_p8, vuzp_p16, vuzpq_s8,
- vuzpq_s16, vuzpq_s32, vuzpq_f32, vuzpq_u8, vuzpq_u16, vuzpq_u32,
- vuzpq_p8, vuzpq_p16): Correct mask for bigendian.
+ vtrnq_f32, vtrnq_u8, vtrnq_u16, vtrnq_u32, vtrnq_p8, vtrnq_p16,
+ vzip_s8, vzip_s16, vzip_u8, vzip_u16, vzip_p8, vzip_p16, vzip_s32,
+ vzip_f32, vzip_u32, vzipq_s8, vzipq_s16, vzipq_s32, vzipq_f32,
+ vzipq_u8, vzipq_u16, vzipq_u32, vzipq_p8, vzipq_p16, vuzp_s8, vuzp_s16,
+ vuzp_s32, vuzp_f32, vuzp_u8, vuzp_u16, vuzp_u32, vuzp_p8, vuzp_p16,
+ vuzpq_s8, vuzpq_s16, vuzpq_s32, vuzpq_f32, vuzpq_u8, vuzpq_u16,
+ vuzpq_u32, vuzpq_p8, vuzpq_p16): Correct mask for bigendian.
2014-07-09 Alan Lawrence <alan.lawrence@arm.com>
@@ -194,11 +389,9 @@
2014-06-24 Jakub Jelinek <jakub@redhat.com>
* gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_MAP,
- OMP_CLAUSE_TO, OMP_CLAUSE_FROM): Make sure OMP_CLAUSE_SIZE is
- non-NULL.
+ OMP_CLAUSE_TO, OMP_CLAUSE_FROM): Make sure OMP_CLAUSE_SIZE is non-NULL.
<case OMP_CLAUSE_ALIGNED>: Gimplify OMP_CLAUSE_ALIGNED_ALIGNMENT.
- (gimplify_adjust_omp_clauses_1): Make sure OMP_CLAUSE_SIZE is
- non-NULL.
+ (gimplify_adjust_omp_clauses_1): Make sure OMP_CLAUSE_SIZE is non-NULL.
(gimplify_adjust_omp_clauses): Likewise.
* omp-low.c (lower_rec_simd_input_clauses,
lower_rec_input_clauses, expand_omp_simd): Handle non-constant
@@ -213,9 +406,8 @@
2014-06-18 Jakub Jelinek <jakub@redhat.com>
- * gimplify.c (omp_notice_variable): If n is non-NULL
- and no flags change in ORT_TARGET region, don't jump to
- do_outer.
+ * gimplify.c (omp_notice_variable): If n is non-NULL and no flags
+ change in ORT_TARGET region, don't jump to do_outer.
(struct gimplify_adjust_omp_clauses_data): New type.
(gimplify_adjust_omp_clauses_1): Adjust for data being
a struct gimplify_adjust_omp_clauses_data pointer instead
@@ -233,14 +425,12 @@
gimple_seq * argument to omp_finish_clause hook.
* omp-low.c (scan_sharing_clauses): Call scan_omp_op on
non-DECL_P OMP_CLAUSE_DECL if ctx->outer.
- (scan_omp_parallel, lower_omp_for): When adding
- _LOOPTEMP_ clause var, add it to outer ctx's decl_map
- as identity.
+ (scan_omp_parallel, lower_omp_for): When adding _LOOPTEMP_ clause var,
+ add it to outer ctx's decl_map as identity.
* tree-core.h (OMP_CLAUSE_MAP_TO_PSET): New map kind.
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Handle various OpenMP 4.0 clauses.
- * tree-pretty-print.c (dump_omp_clause): Handle
- OMP_CLAUSE_MAP_TO_PSET.
+ * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_MAP_TO_PSET.
2014-06-10 Jakub Jelinek <jakub@redhat.com>
@@ -264,8 +454,7 @@
OMP_CLAUSE_LINEAR_STMT.
* omp-low.c (lower_rec_input_clauses): Fix typo.
(maybe_add_implicit_barrier_cancel, lower_omp_1): Add
- cast between Fortran boolean_type_node and C _Bool if
- needed.
+ cast between Fortran boolean_type_node and C _Bool if needed.
2014-06-30 Jason Merrill <jason@redhat.com>
@@ -316,8 +505,7 @@
(aarch64_sqdmlsl_lane<mode>): Likewise.
(aarch64_sqdmull_lane<mode>): Likewise.
(aarch64_sqdmull2_lane<mode>): Likewise.
- (aarch64_sqdmlal_laneq<mode>):
- Replace VCON usage with VCONQ.
+ (aarch64_sqdmlal_laneq<mode>): Replace VCON usage with VCONQ.
Emit aarch64_sqdmlal_laneq<mode>_internal insn.
(aarch64_sqdmlal2_laneq<mode>): Emit
aarch64_sqdmlal2_laneq<mode>_internal insn.
diff --git a/gcc-4.9/gcc/DATESTAMP b/gcc-4.9/gcc/DATESTAMP
index e48f0e7c4..06fdc7792 100644
--- a/gcc-4.9/gcc/DATESTAMP
+++ b/gcc-4.9/gcc/DATESTAMP
@@ -1 +1 @@
-20140711
+20140801
diff --git a/gcc-4.9/gcc/ada/ChangeLog b/gcc-4.9/gcc/ada/ChangeLog
index f979c34d4..27d4ad7cb 100644
--- a/gcc-4.9/gcc/ada/ChangeLog
+++ b/gcc-4.9/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-05-19 Eric Botcazou <ebotcazou@adacore.com>
Backport from mainline
diff --git a/gcc-4.9/gcc/c-family/ChangeLog b/gcc-4.9/gcc/c-family/ChangeLog
index 1fa0dd088..cbe8b06cf 100644
--- a/gcc-4.9/gcc/c-family/ChangeLog
+++ b/gcc-4.9/gcc/c-family/ChangeLog
@@ -1,3 +1,17 @@
+2014-07-17 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-07-09 Richard Biener <rguenther@suse.de>
+
+ PR c-family/61741
+ * c-gimplify.c (c_gimplify_expr): Gimplify self-modify expressions
+ using unsigned arithmetic if overflow does not wrap instead of
+ if overflow is undefined.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-06-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
diff --git a/gcc-4.9/gcc/c-family/c-gimplify.c b/gcc-4.9/gcc/c-family/c-gimplify.c
index d385f3a40..0bf93fcd7 100644
--- a/gcc-4.9/gcc/c-family/c-gimplify.c
+++ b/gcc-4.9/gcc/c-family/c-gimplify.c
@@ -197,9 +197,7 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
tree type = TREE_TYPE (TREE_OPERAND (*expr_p, 0));
if (INTEGRAL_TYPE_P (type) && c_promoting_integer_type_p (type))
{
- if (TYPE_OVERFLOW_UNDEFINED (type)
- || ((flag_sanitize & SANITIZE_SI_OVERFLOW)
- && !TYPE_OVERFLOW_WRAPS (type)))
+ if (!TYPE_OVERFLOW_WRAPS (type))
type = unsigned_type_for (type);
return gimplify_self_mod_expr (expr_p, pre_p, post_p, 1, type);
}
diff --git a/gcc-4.9/gcc/c/ChangeLog b/gcc-4.9/gcc/c/ChangeLog
index e31d4a8a3..4816d5c67 100644
--- a/gcc-4.9/gcc/c/ChangeLog
+++ b/gcc-4.9/gcc/c/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-06-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
diff --git a/gcc-4.9/gcc/cgraph.c b/gcc-4.9/gcc/cgraph.c
index 180a63656..63b7b4d60 100644
--- a/gcc-4.9/gcc/cgraph.c
+++ b/gcc-4.9/gcc/cgraph.c
@@ -677,7 +677,11 @@ cgraph_node_for_asm (tree asmname)
{
cgraph_node *cn = dyn_cast <cgraph_node> (node);
if (cn && !cn->global.inlined_to)
- return cn;
+ {
+ if (L_IPO_COMP_MODE && cgraph_pre_profiling_inlining_done)
+ return cgraph_lipo_get_resolved_node (cn->decl);
+ return cn;
+ }
}
return NULL;
}
diff --git a/gcc-4.9/gcc/common.opt b/gcc-4.9/gcc/common.opt
index 6614228b8..40607738a 100644
--- a/gcc-4.9/gcc/common.opt
+++ b/gcc-4.9/gcc/common.opt
@@ -1259,6 +1259,10 @@ fexceptions
Common Report Var(flag_exceptions) Optimization
Enable exception handling
+fdefault-noexcept
+Common Report Var(flag_default_noexcept) Optimization Init(0)
+Make functions no-throw/noexcept by default
+
fexpensive-optimizations
Common Report Var(flag_expensive_optimizations) Optimization
Perform a number of minor, expensive optimizations
diff --git a/gcc-4.9/gcc/config.gcc b/gcc-4.9/gcc/config.gcc
index c4851d37f..0250fd181 100644
--- a/gcc-4.9/gcc/config.gcc
+++ b/gcc-4.9/gcc/config.gcc
@@ -432,7 +432,7 @@ nds32*)
nios2-*-*)
cpu_type=nios2
extra_options="${extra_options} g.opt"
- ;;
+ ;;
picochip-*-*)
cpu_type=picochip
;;
@@ -1156,8 +1156,7 @@ cris-*-elf | cris-*-none)
;;
crisv32-*-linux* | cris-*-linux*)
tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h cris/linux.h"
- # We need to avoid using t-linux, so override default tmake_file
- tmake_file="cris/t-cris cris/t-linux t-slibgcc t-linux"
+ tmake_file="${tmake_file} cris/t-cris cris/t-linux"
extra_options="${extra_options} cris/linux.opt"
case $target in
cris-*-*)
@@ -2245,6 +2244,10 @@ nios2-*-*)
tm_file="${tm_file} newlib-stdint.h nios2/elf.h"
extra_options="${extra_options} nios2/elf.opt"
;;
+ nios2-*-rtems*)
+ tm_file="${tm_file} newlib-stdint.h nios2/rtems.h rtems.h"
+ tmake_file="${tmake_file} t-rtems nios2/t-rtems"
+ ;;
esac
;;
pdp11-*-*)
@@ -2351,7 +2354,7 @@ powerpc-*-rtems*)
tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
;;
powerpc*-*-linux*)
- tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h linux-android.h"
extra_options="${extra_options} rs6000/sysv4.opt"
extra_options="${extra_options} linux-android.opt"
tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
diff --git a/gcc-4.9/gcc/config/aarch64/aarch64-linux.h b/gcc-4.9/gcc/config/aarch64/aarch64-linux.h
index f8a97c899..3a180bb89 100644
--- a/gcc-4.9/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc-4.9/gcc/config/aarch64/aarch64-linux.h
@@ -47,4 +47,6 @@
} \
while (0)
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
#endif /* GCC_AARCH64_LINUX_H */
diff --git a/gcc-4.9/gcc/config/aarch64/aarch64.c b/gcc-4.9/gcc/config/aarch64/aarch64.c
index bf35031ec..07430a48d 100644
--- a/gcc-4.9/gcc/config/aarch64/aarch64.c
+++ b/gcc-4.9/gcc/config/aarch64/aarch64.c
@@ -5257,6 +5257,20 @@ aarch64_override_options (void)
aarch64_tune_params = selected_tune->tune;
aarch64_override_options_after_change ();
+
+ if (TARGET_ANDROID)
+ {
+ /* Lower the complete unroll code size limits.
+ Loop unroll needs some tuning in arm and aarch64. */
+ maybe_set_param_value (PARAM_MAX_DEFAULT_COMPLETELY_PEELED_INSNS, 50,
+ global_options.x_param_values,
+ global_options_set.x_param_values);
+
+ /* Disable array_bound warning. Work around isses
+ introduced in complete unroll. */
+ global_options.x_warn_array_bounds = 0;
+ }
+
}
/* Implement targetm.override_options_after_change. */
diff --git a/gcc-4.9/gcc/config/alpha/elf.h b/gcc-4.9/gcc/config/alpha/elf.h
index 6ae4065bc..e334fc4ec 100644
--- a/gcc-4.9/gcc/config/alpha/elf.h
+++ b/gcc-4.9/gcc/config/alpha/elf.h
@@ -126,6 +126,10 @@ do { \
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+/* This variable should be set to 'true' if the target ABI requires
+ unwinding tables even when exceptions are not used. */
+#define TARGET_UNWIND_TABLES_DEFAULT true
+
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations.
diff --git a/gcc-4.9/gcc/config/arm/t-rtems-eabi b/gcc-4.9/gcc/config/arm/t-rtems-eabi
index d81fbf7ec..92c4dcb12 100644
--- a/gcc-4.9/gcc/config/arm/t-rtems-eabi
+++ b/gcc-4.9/gcc/config/arm/t-rtems-eabi
@@ -1,47 +1,167 @@
# Custom RTEMS EABI multilibs
-MULTILIB_OPTIONS = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard
-MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard
+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
+MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard
# Enumeration of multilibs
MULTILIB_EXCEPTIONS =
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16
+MULTILIB_EXCEPTIONS += mbig-endian/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mbig-endian
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfloat-abi=hard
# MULTILIB_EXCEPTIONS += mthumb/march=armv6-m
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfloat-abi=hard
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-a
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfloat-abi=hard
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfloat-abi=hard
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m
MULTILIB_EXCEPTIONS += mthumb/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard
# MULTILIB_EXCEPTIONS += mthumb
MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += march=armv6-m/mfloat-abi=hard
MULTILIB_EXCEPTIONS += march=armv6-m
MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += march=armv7-a/mfloat-abi=hard
MULTILIB_EXCEPTIONS += march=armv7-a
MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += march=armv7-r/mfloat-abi=hard
MULTILIB_EXCEPTIONS += march=armv7-r
MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += march=armv7-m/mfloat-abi=hard
MULTILIB_EXCEPTIONS += march=armv7-m
MULTILIB_EXCEPTIONS += mfpu=neon/mfloat-abi=hard
MULTILIB_EXCEPTIONS += mfpu=neon
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16
MULTILIB_EXCEPTIONS += mfloat-abi=hard
diff --git a/gcc-4.9/gcc/config/cris/constraints.md b/gcc-4.9/gcc/config/cris/constraints.md
index 651fbedb0..f927ccaaa 100644
--- a/gcc-4.9/gcc/config/cris/constraints.md
+++ b/gcc-4.9/gcc/config/cris/constraints.md
@@ -118,7 +118,7 @@
reload_in_progress
|| reload_completed)"))
;; Just an explicit indirect reference: [const]?
- (match_test "CONSTANT_P (XEXP (op, 0))")
+ (match_test "CRIS_CONSTANT_P (XEXP (op, 0))")
;; Something that is indexed; [...+...]?
(and (match_code "plus" "0")
;; A BDAP constant: [reg+(8|16|32)bit offset]?
@@ -159,6 +159,8 @@
(define_constraint "U"
"@internal"
(and (match_test "flag_pic")
+ ;; We're just interested in the ..._or_callable_symbol part.
+ ;; (Using CRIS_CONSTANT_P would exclude that too.)
(match_test "CONSTANT_P (op)")
(match_operand 0 "cris_nonmemory_operand_or_callable_symbol")))
diff --git a/gcc-4.9/gcc/config/cris/cris-protos.h b/gcc-4.9/gcc/config/cris/cris-protos.h
index 0fdcafe52..b09babd69 100644
--- a/gcc-4.9/gcc/config/cris/cris-protos.h
+++ b/gcc-4.9/gcc/config/cris/cris-protos.h
@@ -31,8 +31,9 @@ extern bool cris_cc0_user_requires_cmp (rtx);
extern rtx cris_return_addr_rtx (int, rtx);
extern rtx cris_split_movdx (rtx *);
extern int cris_legitimate_pic_operand (rtx);
-extern enum cris_pic_symbol_type cris_pic_symbol_type_of (const_rtx);
+extern enum cris_symbol_type cris_symbol_type_of (const_rtx);
extern bool cris_valid_pic_const (const_rtx, bool);
+extern bool cris_legitimate_constant_p (enum machine_mode, rtx);
extern bool cris_constant_index_p (const_rtx);
extern bool cris_base_p (const_rtx, bool);
extern bool cris_base_or_autoincr_p (const_rtx, bool);
@@ -46,7 +47,7 @@ extern int cris_cfun_uses_pic_table (void);
extern void cris_asm_output_case_end (FILE *, int, rtx);
extern rtx cris_gen_movem_load (rtx, rtx, int);
extern rtx cris_emit_movem_store (rtx, rtx, int, bool);
-extern void cris_expand_pic_call_address (rtx *);
+extern void cris_expand_pic_call_address (rtx *, rtx *);
extern void cris_order_for_addsi3 (rtx *, int);
extern void cris_emit_trap_for_misalignment (rtx);
#endif /* RTX_CODE */
diff --git a/gcc-4.9/gcc/config/cris/cris.c b/gcc-4.9/gcc/config/cris/cris.c
index 209f127a6..c15139f51 100644
--- a/gcc-4.9/gcc/config/cris/cris.c
+++ b/gcc-4.9/gcc/config/cris/cris.c
@@ -147,6 +147,7 @@ static rtx cris_function_incoming_arg (cumulative_args_t,
static void cris_function_arg_advance (cumulative_args_t, enum machine_mode,
const_tree, bool);
static tree cris_md_asm_clobbers (tree, tree, tree);
+static bool cris_cannot_force_const_mem (enum machine_mode, rtx);
static void cris_option_override (void);
@@ -214,6 +215,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P cris_legitimate_address_p
+#undef TARGET_LEGITIMATE_CONSTANT_P
+#define TARGET_LEGITIMATE_CONSTANT_P cris_legitimate_constant_p
+
#undef TARGET_PREFERRED_RELOAD_CLASS
#define TARGET_PREFERRED_RELOAD_CLASS cris_preferred_reload_class
@@ -248,6 +252,10 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#define TARGET_FUNCTION_ARG_ADVANCE cris_function_arg_advance
#undef TARGET_MD_ASM_CLOBBERS
#define TARGET_MD_ASM_CLOBBERS cris_md_asm_clobbers
+
+#undef TARGET_CANNOT_FORCE_CONST_MEM
+#define TARGET_CANNOT_FORCE_CONST_MEM cris_cannot_force_const_mem
+
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED cris_frame_pointer_required
@@ -506,6 +514,21 @@ cris_cfun_uses_pic_table (void)
return crtl->uses_pic_offset_table;
}
+/* Worker function for TARGET_CANNOT_FORCE_CONST_MEM.
+ We can't put PIC addresses in the constant pool, not even the ones that
+ can be reached as pc-relative as we can't tell when or how to do that. */
+
+static bool
+cris_cannot_force_const_mem (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
+{
+ enum cris_symbol_type t = cris_symbol_type_of (x);
+
+ return
+ t == cris_unspec
+ || t == cris_got_symbol
+ || t == cris_rel_symbol;
+}
+
/* Given an rtx, return the text string corresponding to the CODE of X.
Intended for use in the assembly language output section of a
define_insn. */
@@ -601,7 +624,7 @@ cris_print_index (rtx index, FILE *file)
if (REG_P (index))
fprintf (file, "$%s.b", reg_names[REGNO (index)]);
- else if (CONSTANT_P (index))
+ else if (CRIS_CONSTANT_P (index))
cris_output_addr_const (file, index);
else if (GET_CODE (index) == MULT)
{
@@ -1041,7 +1064,7 @@ cris_print_operand (FILE *file, rtx x, int code)
/* If this is a GOT symbol, force it to be emitted as :GOT and
:GOTPLT regardless of -fpic (i.e. not as :GOT16, :GOTPLT16).
Avoid making this too much of a special case. */
- if (flag_pic == 1 && CONSTANT_P (operand))
+ if (flag_pic == 1 && CRIS_CONSTANT_P (operand))
{
int flag_pic_save = flag_pic;
@@ -1161,7 +1184,7 @@ cris_print_operand (FILE *file, rtx x, int code)
default:
/* No need to handle all strange variants, let output_addr_const
do it for us. */
- if (CONSTANT_P (operand))
+ if (CRIS_CONSTANT_P (operand))
{
cris_output_addr_const (file, operand);
return;
@@ -1358,7 +1381,7 @@ reg_ok_for_index_p (const_rtx x, bool strict)
bool
cris_constant_index_p (const_rtx x)
{
- return (CONSTANT_P (x) && (!flag_pic || cris_valid_pic_const (x, true)));
+ return (CRIS_CONSTANT_P (x) && (!flag_pic || cris_valid_pic_const (x, true)));
}
/* True if X is a valid base register. */
@@ -1467,6 +1490,29 @@ cris_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
return false;
}
+/* Worker function for TARGET_LEGITIMATE_CONSTANT_P. We have to handle
+ PIC constants that aren't legitimized. FIXME: there used to be a
+ guarantee that the target LEGITIMATE_CONSTANT_P didn't have to handle
+ PIC constants, but no more (4.7 era); testcase: glibc init-first.c.
+ While that may be seen as a bug, that guarantee seems a wart by design,
+ so don't bother; fix the documentation instead. */
+
+bool
+cris_legitimate_constant_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
+{
+ enum cris_symbol_type t;
+
+ if (flag_pic)
+ return LEGITIMATE_PIC_OPERAND_P (x);
+
+ t = cris_symbol_type_of (x);
+
+ return
+ t == cris_no_symbol
+ || t == cris_offsettable_symbol
+ || t == cris_unspec;
+}
+
/* Worker function for LEGITIMIZE_RELOAD_ADDRESS. */
bool
@@ -2214,7 +2260,7 @@ cris_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
return (2 + 2) / 2;
/* A BDAP with some other constant is 2 bytes extra. */
- if (CONSTANT_P (tem2))
+ if (CRIS_CONSTANT_P (tem2))
return (2 + 2 + 2) / 2;
/* BDAP with something indirect should have a higher cost than
@@ -2312,7 +2358,7 @@ cris_side_effect_mode_ok (enum rtx_code code, rtx *ops,
return 0;
/* Check allowed cases, like [r(+)?].[bwd] and const. */
- if (CONSTANT_P (val_rtx))
+ if (CRIS_CONSTANT_P (val_rtx))
return 1;
if (MEM_P (val_rtx)
@@ -2464,32 +2510,34 @@ cris_valid_pic_const (const_rtx x, bool any_operand)
gcc_unreachable ();
}
- return cris_pic_symbol_type_of (x) == cris_no_symbol;
+ return cris_symbol_type_of (x) == cris_no_symbol;
}
-/* Helper function to find the right PIC-type symbol to generate,
+/* Helper function to find the right symbol-type to generate,
given the original (non-PIC) representation. */
-enum cris_pic_symbol_type
-cris_pic_symbol_type_of (const_rtx x)
+enum cris_symbol_type
+cris_symbol_type_of (const_rtx x)
{
switch (GET_CODE (x))
{
case SYMBOL_REF:
- return SYMBOL_REF_LOCAL_P (x)
- ? cris_rel_symbol : cris_got_symbol;
+ return flag_pic
+ ? (SYMBOL_REF_LOCAL_P (x)
+ ? cris_rel_symbol : cris_got_symbol)
+ : cris_offsettable_symbol;
case LABEL_REF:
- return cris_rel_symbol;
+ return flag_pic ? cris_rel_symbol : cris_offsettable_symbol;
case CONST:
- return cris_pic_symbol_type_of (XEXP (x, 0));
+ return cris_symbol_type_of (XEXP (x, 0));
case PLUS:
case MINUS:
{
- enum cris_pic_symbol_type t1 = cris_pic_symbol_type_of (XEXP (x, 0));
- enum cris_pic_symbol_type t2 = cris_pic_symbol_type_of (XEXP (x, 1));
+ enum cris_symbol_type t1 = cris_symbol_type_of (XEXP (x, 0));
+ enum cris_symbol_type t2 = cris_symbol_type_of (XEXP (x, 1));
gcc_assert (t1 == cris_no_symbol || t2 == cris_no_symbol);
@@ -2504,9 +2552,7 @@ cris_pic_symbol_type_of (const_rtx x)
return cris_no_symbol;
case UNSPEC:
- /* Likely an offsettability-test attempting to add a constant to
- a GOTREAD symbol, which can't be handled. */
- return cris_invalid_pic_symbol;
+ return cris_unspec;
default:
fatal_insn ("unrecognized supposed constant", x);
@@ -3714,19 +3760,19 @@ cris_emit_movem_store (rtx dest, rtx nregs_rtx, int increment,
/* Worker function for expanding the address for PIC function calls. */
void
-cris_expand_pic_call_address (rtx *opp)
+cris_expand_pic_call_address (rtx *opp, rtx *markerp)
{
rtx op = *opp;
- gcc_assert (MEM_P (op));
+ gcc_assert (flag_pic && MEM_P (op));
op = XEXP (op, 0);
/* It might be that code can be generated that jumps to 0 (or to a
specific address). Don't die on that. (There is a
testcase.) */
- if (CONSTANT_ADDRESS_P (op) && !CONST_INT_P (op))
+ if (CONSTANT_P (op) && !CONST_INT_P (op))
{
- enum cris_pic_symbol_type t = cris_pic_symbol_type_of (op);
+ enum cris_symbol_type t = cris_symbol_type_of (op);
CRIS_ASSERT (can_create_pseudo_p ());
@@ -3752,18 +3798,21 @@ cris_expand_pic_call_address (rtx *opp)
}
else
op = force_reg (Pmode, op);
+
+ /* A local call. */
+ *markerp = const0_rtx;
}
else if (t == cris_got_symbol)
{
if (TARGET_AVOID_GOTPLT)
{
/* Change a "jsr sym" into (allocate register rM, rO)
- "move.d (const (unspec [sym rPIC] CRIS_UNSPEC_PLT_GOTREL)),rM"
+ "move.d (const (unspec [sym] CRIS_UNSPEC_PLT_GOTREL)),rM"
"add.d rPIC,rM,rO", "jsr rO" for pre-v32 and
- "jsr (const (unspec [sym rPIC] CRIS_UNSPEC_PLT_PCREL))"
+ "jsr (const (unspec [sym] CRIS_UNSPEC_PLT_PCREL))"
for v32. */
rtx tem, rm, ro;
- gcc_assert (can_create_pseudo_p ());
+
crtl->uses_pic_offset_table = 1;
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op),
TARGET_V32
@@ -3817,14 +3866,27 @@ cris_expand_pic_call_address (rtx *opp)
MEM_NOTRAP_P (mem) = 1;
op = mem;
}
+
+ /* We need to prepare this call to go through the PLT; we
+ need to make GOT available. */
+ *markerp = pic_offset_table_rtx;
}
else
- /* Can't possibly get a GOT-needing-fixup for a function-call,
- right? */
+ /* Can't possibly get anything else for a function-call, right? */
fatal_insn ("unidentifiable call op", op);
- *opp = replace_equiv_address (*opp, op);
+ /* If the validizing variant is called, it will try to validize
+ the address as a valid any-operand constant, but as it's only
+ valid for calls and moves, it will fail and always be forced
+ into a register. */
+ *opp = replace_equiv_address_nv (*opp, op);
}
+ else
+ /* Can't tell what locality a call to a non-constant address has;
+ better make the GOT register alive at it.
+ FIXME: Can we see whether the register has known constant
+ contents? */
+ *markerp = pic_offset_table_rtx;
}
/* Make sure operands are in the right order for an addsi3 insn as
diff --git a/gcc-4.9/gcc/config/cris/cris.h b/gcc-4.9/gcc/config/cris/cris.h
index 37b562e5d..c5aa83edb 100644
--- a/gcc-4.9/gcc/config/cris/cris.h
+++ b/gcc-4.9/gcc/config/cris/cris.h
@@ -794,6 +794,12 @@ struct cum_args {int regs;};
} \
while (0)
+/* The mode argument to cris_legitimate_constant_p isn't used, so just
+ pass a cheap dummy. N.B. we have to cast away const from the
+ parameter rather than adjust the parameter, as it's type is mandated
+ by the TARGET_LEGITIMATE_CONSTANT_P target hook interface. */
+#define CRIS_CONSTANT_P(X) \
+ (CONSTANT_P (X) && cris_legitimate_constant_p (VOIDmode, CONST_CAST_RTX (X)))
/* Node: Condition Code */
@@ -833,13 +839,14 @@ struct cum_args {int regs;};
/* Helper type. */
-enum cris_pic_symbol_type
+enum cris_symbol_type
{
cris_no_symbol = 0,
cris_got_symbol = 1,
cris_rel_symbol = 2,
cris_got_symbol_needing_fixup = 3,
- cris_invalid_pic_symbol = 4
+ cris_unspec = 7,
+ cris_offsettable_symbol = 8
};
#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? CRIS_GOT_REGNUM : INVALID_REGNUM)
diff --git a/gcc-4.9/gcc/config/cris/cris.md b/gcc-4.9/gcc/config/cris/cris.md
index 47f64512a..18b978786 100644
--- a/gcc-4.9/gcc/config/cris/cris.md
+++ b/gcc-4.9/gcc/config/cris/cris.md
@@ -919,6 +919,8 @@
(match_operand:SI 1 "cris_general_operand_or_symbol" ""))]
""
{
+ enum cris_symbol_type t;
+
/* If the output goes to a MEM, make sure we have zero or a register as
input. */
if (MEM_P (operands[0])
@@ -934,12 +936,12 @@
valid symbol? Can we exclude global PIC addresses with an added
offset? */
if (flag_pic
- && CONSTANT_ADDRESS_P (operands[1])
+ && CONSTANT_P (operands[1])
&& !cris_valid_pic_const (operands[1], false))
{
- enum cris_pic_symbol_type t = cris_pic_symbol_type_of (operands[1]);
+ t = cris_symbol_type_of (operands[1]);
- gcc_assert (t != cris_no_symbol);
+ gcc_assert (t != cris_no_symbol && t != cris_offsettable_symbol);
if (! REG_S_P (operands[0]))
{
@@ -1086,7 +1088,12 @@
if (!flag_pic
&& (GET_CODE (operands[1]) == SYMBOL_REF
|| GET_CODE (operands[1]) == LABEL_REF
- || GET_CODE (operands[1]) == CONST))
+ || (GET_CODE (operands[1]) == CONST
+ && (GET_CODE (XEXP (operands[1], 0)) != UNSPEC
+ || (XINT (XEXP (operands[1], 0), 1)
+ == CRIS_UNSPEC_PLT_PCREL)
+ || (XINT (XEXP (operands[1], 0), 1)
+ == CRIS_UNSPEC_PCREL)))))
{
/* FIXME: Express this through (set_attr cc none) instead,
since we can't express the ``none'' at this point. FIXME:
@@ -1169,6 +1176,12 @@
case CRIS_UNSPEC_PCREL:
case CRIS_UNSPEC_PLT_PCREL:
gcc_assert (TARGET_V32);
+ /* LAPC doesn't set condition codes; clear them to make the
+ (equivalence-marked) result of this insn not presumed
+ present. This instruction can be a PIC symbol load (for
+ a hidden symbol) which for weak symbols will be followed
+ by a test for NULL. */
+ CC_STATUS_INIT;
return "lapc %1,%0";
default:
@@ -3710,15 +3723,16 @@
{
gcc_assert (MEM_P (operands[0]));
if (flag_pic)
- cris_expand_pic_call_address (&operands[0]);
+ cris_expand_pic_call_address (&operands[0], &operands[1]);
+ else
+ operands[1] = const0_rtx;
})
-;; Accept *anything* as operand 1. Accept operands for operand 0 in
-;; order of preference.
+;; Accept operands for operand 0 in order of preference.
(define_insn "*expanded_call_non_v32"
[(call (mem:QI (match_operand:SI 0 "general_operand" "r,Q>,g"))
- (match_operand 1 "" ""))
+ (match_operand:SI 1 "cris_call_type_marker" "rM,rM,rM"))
(clobber (reg:SI CRIS_SRP_REGNUM))]
"!TARGET_V32"
"jsr %0")
@@ -3727,7 +3741,7 @@
[(call
(mem:QI
(match_operand:SI 0 "cris_nonmemory_operand_or_callable_symbol" "n,r,U,i"))
- (match_operand 1 "" ""))
+ (match_operand:SI 1 "cris_call_type_marker" "rM,rM,rM,rM"))
(clobber (reg:SI CRIS_SRP_REGNUM))]
"TARGET_V32"
"@
@@ -3740,19 +3754,21 @@
;; Parallel when calculating and reusing address of indirect pointer
;; with simple offset. (Makes most sense with PIC.) It looks a bit
;; wrong not to have the clobber last, but that's the way combine
-;; generates it (except it doesn' look into the *inner* mem, so this
+;; generates it (except it doesn't look into the *inner* mem, so this
;; just matches a peephole2). FIXME: investigate that.
(define_insn "*expanded_call_side"
[(call (mem:QI
(mem:SI
(plus:SI (match_operand:SI 0 "cris_bdap_operand" "%r, r,r")
(match_operand:SI 1 "cris_bdap_operand" "r>Rn,r,>Rn"))))
- (match_operand 2 "" ""))
+ (match_operand:SI 2 "cris_call_type_marker" "rM,rM,rM"))
(clobber (reg:SI CRIS_SRP_REGNUM))
(set (match_operand:SI 3 "register_operand" "=*0,r,r")
(plus:SI (match_dup 0)
(match_dup 1)))]
- "!TARGET_AVOID_GOTPLT && !TARGET_V32"
+ ;; Disabled until after reload until we can avoid an output reload for
+ ;; operand 3 (being forbidden for call insns).
+ "reload_completed && !TARGET_AVOID_GOTPLT && !TARGET_V32"
"jsr [%3=%0%S1]")
(define_expand "call_value"
@@ -3764,10 +3780,12 @@
{
gcc_assert (MEM_P (operands[1]));
if (flag_pic)
- cris_expand_pic_call_address (&operands[1]);
+ cris_expand_pic_call_address (&operands[1], &operands[2]);
+ else
+ operands[2] = const0_rtx;
})
-;; Accept *anything* as operand 2. The validity other than "general" of
+;; The validity other than "general" of
;; operand 0 will be checked elsewhere. Accept operands for operand 1 in
;; order of preference (Q includes r, but r is shorter, faster).
;; We also accept a PLT symbol. We output it as [rPIC+sym:GOTPLT] rather
@@ -3776,7 +3794,7 @@
(define_insn "*expanded_call_value_non_v32"
[(set (match_operand 0 "nonimmediate_operand" "=g,g,g")
(call (mem:QI (match_operand:SI 1 "general_operand" "r,Q>,g"))
- (match_operand 2 "" "")))
+ (match_operand:SI 2 "cris_call_type_marker" "rM,rM,rM")))
(clobber (reg:SI CRIS_SRP_REGNUM))]
"!TARGET_V32"
"Jsr %1"
@@ -3790,12 +3808,14 @@
(mem:SI
(plus:SI (match_operand:SI 1 "cris_bdap_operand" "%r, r,r")
(match_operand:SI 2 "cris_bdap_operand" "r>Rn,r,>Rn"))))
- (match_operand 3 "" "")))
+ (match_operand:SI 3 "cris_call_type_marker" "rM,rM,rM")))
(clobber (reg:SI CRIS_SRP_REGNUM))
(set (match_operand:SI 4 "register_operand" "=*1,r,r")
(plus:SI (match_dup 1)
(match_dup 2)))]
- "!TARGET_AVOID_GOTPLT && !TARGET_V32"
+ ;; Disabled until after reload until we can avoid an output reload for
+ ;; operand 4 (being forbidden for call insns).
+ "reload_completed && !TARGET_AVOID_GOTPLT && !TARGET_V32"
"Jsr [%4=%1%S2]"
[(set_attr "cc" "clobber")])
@@ -3805,7 +3825,7 @@
(call
(mem:QI
(match_operand:SI 1 "cris_nonmemory_operand_or_callable_symbol" "n,r,U,i"))
- (match_operand 2 "" "")))
+ (match_operand:SI 2 "cris_call_type_marker" "rM,rM,rM,rM")))
(clobber (reg:SI 16))]
"TARGET_V32"
"@
@@ -4827,7 +4847,7 @@
/* Make sure we have canonical RTX so we match the insn pattern -
not a constant in the first operand. We also require the order
(plus reg mem) to match the final pattern. */
- if (CONSTANT_P (otherop) || MEM_P (otherop))
+ if (CRIS_CONSTANT_P (otherop) || MEM_P (otherop))
{
operands[7] = operands[1];
operands[8] = otherop;
@@ -4878,7 +4898,7 @@
/* Make sure we have canonical RTX so we match the insn pattern -
not a constant in the first operand. We also require the order
(plus reg mem) to match the final pattern. */
- if (CONSTANT_P (otherop) || MEM_P (otherop))
+ if (CRIS_CONSTANT_P (otherop) || MEM_P (otherop))
{
operands[7] = operands[1];
operands[8] = otherop;
diff --git a/gcc-4.9/gcc/config/cris/predicates.md b/gcc-4.9/gcc/config/cris/predicates.md
index 0169b0b71..ddb090eab 100644
--- a/gcc-4.9/gcc/config/cris/predicates.md
+++ b/gcc-4.9/gcc/config/cris/predicates.md
@@ -142,7 +142,7 @@
(ior (match_operand 0 "general_operand")
(and (match_code "const, symbol_ref, label_ref")
; The following test is actually just an assertion.
- (match_test "cris_pic_symbol_type_of (op) != cris_no_symbol"))))
+ (match_test "cris_symbol_type_of (op) != cris_no_symbol"))))
;; A predicate for the anon movsi expansion, one that fits a PCREL
;; operand as well as general_operand.
@@ -176,3 +176,15 @@
(ior (match_operand 0 "memory_operand")
(match_test "cris_general_operand_or_symbol (XEXP (op, 0),
Pmode)"))))
+
+;; A marker for the call-insn: (const_int 0) for a call to a
+;; hidden or static function and non-pic and
+;; pic_offset_table_rtx for a call that *might* go through the
+;; PLT.
+
+(define_predicate "cris_call_type_marker"
+ (ior (and (match_operand 0 "const_int_operand")
+ (match_test "op == const0_rtx"))
+ (and (and (match_operand 0 "register_operand")
+ (match_test "op == pic_offset_table_rtx"))
+ (match_test "flag_pic != 0"))))
diff --git a/gcc-4.9/gcc/config/i386/avx512fintrin.h b/gcc-4.9/gcc/config/i386/avx512fintrin.h
index 314895ad7..c4caa5ae6 100644
--- a/gcc-4.9/gcc/config/i386/avx512fintrin.h
+++ b/gcc-4.9/gcc/config/i386/avx512fintrin.h
@@ -8103,6 +8103,22 @@ _mm512_stream_load_si512 (void *__P)
return __builtin_ia32_movntdqa512 ((__v8di *)__P);
}
+/* Constants for mantissa extraction */
+typedef enum
+{
+ _MM_MANT_NORM_1_2, /* interval [1, 2) */
+ _MM_MANT_NORM_p5_2, /* interval [0.5, 2) */
+ _MM_MANT_NORM_p5_1, /* interval [0.5, 1) */
+ _MM_MANT_NORM_p75_1p5 /* interval [0.75, 1.5) */
+} _MM_MANTISSA_NORM_ENUM;
+
+typedef enum
+{
+ _MM_MANT_SIGN_src, /* sign = sign(SRC) */
+ _MM_MANT_SIGN_zero, /* sign = 0 */
+ _MM_MANT_SIGN_nan /* DEST = NaN if sign(SRC) = 1 */
+} _MM_MANTISSA_SIGN_ENUM;
+
#ifdef __OPTIMIZE__
extern __inline __m128
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
@@ -8182,22 +8198,6 @@ _mm512_maskz_getexp_round_pd (__mmask8 __U, __m512d __A, const int __R)
(__mmask8) __U, __R);
}
-/* Constants for mantissa extraction */
-typedef enum
-{
- _MM_MANT_NORM_1_2, /* interval [1, 2) */
- _MM_MANT_NORM_p5_2, /* interval [0.5, 2) */
- _MM_MANT_NORM_p5_1, /* interval [0.5, 1) */
- _MM_MANT_NORM_p75_1p5 /* interval [0.75, 1.5) */
-} _MM_MANTISSA_NORM_ENUM;
-
-typedef enum
-{
- _MM_MANT_SIGN_src, /* sign = sign(SRC) */
- _MM_MANT_SIGN_zero, /* sign = 0 */
- _MM_MANT_SIGN_nan /* DEST = NaN if sign(SRC) = 1 */
-} _MM_MANTISSA_SIGN_ENUM;
-
extern __inline __m512d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_getmant_round_pd (__m512d __A, _MM_MANTISSA_NORM_ENUM __B,
diff --git a/gcc-4.9/gcc/config/i386/i386.c b/gcc-4.9/gcc/config/i386/i386.c
index df504335e..70f18ad7b 100644
--- a/gcc-4.9/gcc/config/i386/i386.c
+++ b/gcc-4.9/gcc/config/i386/i386.c
@@ -6556,7 +6556,7 @@ classify_argument (enum machine_mode mode, const_tree type,
bit_offset);
if (!num)
return 0;
- for (i = 0; i < num; i++)
+ for (i = 0; i < num && i < words; i++)
classes[i] = merge_classes (subclasses[i], classes[i]);
}
}
diff --git a/gcc-4.9/gcc/config/i386/ia32intrin.h b/gcc-4.9/gcc/config/i386/ia32intrin.h
index 5e7c893fe..614b0fab2 100644
--- a/gcc-4.9/gcc/config/i386/ia32intrin.h
+++ b/gcc-4.9/gcc/config/i386/ia32intrin.h
@@ -256,11 +256,7 @@ __writeeflags (unsigned long long X)
#define _bswap64(a) __bswapq(a)
#define _popcnt64(a) __popcntq(a)
-#define _lrotl(a,b) __rolq((a), (b))
-#define _lrotr(a,b) __rorq((a), (b))
#else
-#define _lrotl(a,b) __rold((a), (b))
-#define _lrotr(a,b) __rord((a), (b))
/* Read flags register */
extern __inline unsigned int
@@ -280,6 +276,16 @@ __writeeflags (unsigned int X)
#endif
+/* On LP64 systems, longs are 64-bit. Use the appropriate rotate
+ * function. */
+#ifdef __LP64__
+#define _lrotl(a,b) __rolq((a), (b))
+#define _lrotr(a,b) __rorq((a), (b))
+#else
+#define _lrotl(a,b) __rold((a), (b))
+#define _lrotr(a,b) __rord((a), (b))
+#endif
+
#define _bit_scan_forward(a) __bsfd(a)
#define _bit_scan_reverse(a) __bsrd(a)
#define _bswap(a) __bswapd(a)
diff --git a/gcc-4.9/gcc/config/i386/sse.md b/gcc-4.9/gcc/config/i386/sse.md
index 27ade1964..b60a8226d 100644
--- a/gcc-4.9/gcc/config/i386/sse.md
+++ b/gcc-4.9/gcc/config/i386/sse.md
@@ -5887,9 +5887,10 @@
(match_operand 5 "const_0_to_15_operand")]))
(match_operand:<ssequartermode> 6 "memory_operand" "0")
(match_operand:QI 7 "register_operand" "Yk")))]
- "TARGET_AVX512F && (INTVAL (operands[2]) = INTVAL (operands[3]) - 1)
- && (INTVAL (operands[3]) = INTVAL (operands[4]) - 1)
- && (INTVAL (operands[4]) = INTVAL (operands[5]) - 1)"
+ "TARGET_AVX512F
+ && (INTVAL (operands[2]) == (INTVAL (operands[3]) - 1)
+ && INTVAL (operands[3]) == (INTVAL (operands[4]) - 1)
+ && INTVAL (operands[4]) == (INTVAL (operands[5]) - 1))"
{
operands[2] = GEN_INT ((INTVAL (operands[2])) >> 2);
return "vextract<shuffletype>32x4\t{%2, %1, %0%{%7%}|%0%{%7%}, %1, %2}";
@@ -5909,9 +5910,10 @@
(match_operand 3 "const_0_to_15_operand")
(match_operand 4 "const_0_to_15_operand")
(match_operand 5 "const_0_to_15_operand")])))]
- "TARGET_AVX512F && (INTVAL (operands[2]) = INTVAL (operands[3]) - 1)
- && (INTVAL (operands[3]) = INTVAL (operands[4]) - 1)
- && (INTVAL (operands[4]) = INTVAL (operands[5]) - 1)"
+ "TARGET_AVX512F
+ && (INTVAL (operands[2]) == (INTVAL (operands[3]) - 1)
+ && INTVAL (operands[3]) == (INTVAL (operands[4]) - 1)
+ && INTVAL (operands[4]) == (INTVAL (operands[5]) - 1))"
{
operands[2] = GEN_INT ((INTVAL (operands[2])) >> 2);
return "vextract<shuffletype>32x4\t{%2, %1, %0<mask_operand6>|%0<mask_operand6>, %1, %2}";
diff --git a/gcc-4.9/gcc/config/rs6000/freebsd64.h b/gcc-4.9/gcc/config/rs6000/freebsd64.h
index 4f678f6f4..1f3ef199e 100644
--- a/gcc-4.9/gcc/config/rs6000/freebsd64.h
+++ b/gcc-4.9/gcc/config/rs6000/freebsd64.h
@@ -367,7 +367,7 @@ extern int dot_symbols;
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
#undef ADJUST_FIELD_ALIGN
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
? 128 \
: (TARGET_64BIT \
&& TARGET_ALIGN_NATURAL == 0 \
diff --git a/gcc-4.9/gcc/config/rs6000/linux64.h b/gcc-4.9/gcc/config/rs6000/linux64.h
index 52c233b7d..a198af186 100644
--- a/gcc-4.9/gcc/config/rs6000/linux64.h
+++ b/gcc-4.9/gcc/config/rs6000/linux64.h
@@ -246,7 +246,7 @@ extern int dot_symbols;
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
#undef ADJUST_FIELD_ALIGN
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
? 128 \
: (TARGET_64BIT \
&& TARGET_ALIGN_NATURAL == 0 \
diff --git a/gcc-4.9/gcc/config/rs6000/rs6000-protos.h b/gcc-4.9/gcc/config/rs6000/rs6000-protos.h
index 785f6ce1b..067a74aa6 100644
--- a/gcc-4.9/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc-4.9/gcc/config/rs6000/rs6000-protos.h
@@ -155,6 +155,7 @@ extern void rs6000_split_logical (rtx [], enum rtx_code, bool, bool, bool, rtx);
#ifdef TREE_CODE
extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
+extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
unsigned int);
extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
diff --git a/gcc-4.9/gcc/config/rs6000/rs6000.c b/gcc-4.9/gcc/config/rs6000/rs6000.c
index bf67e7298..d7cbc6cde 100644
--- a/gcc-4.9/gcc/config/rs6000/rs6000.c
+++ b/gcc-4.9/gcc/config/rs6000/rs6000.c
@@ -5871,6 +5871,34 @@ rs6000_data_alignment (tree type, unsigned int align, enum data_align how)
return align;
}
+/* Previous GCC releases forced all vector types to have 16-byte alignment. */
+
+bool
+rs6000_special_adjust_field_align_p (tree field, unsigned int computed)
+{
+ if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE)
+ {
+ if (computed != 128)
+ {
+ static bool warned;
+ if (!warned && warn_psabi)
+ {
+ warned = true;
+ inform (input_location,
+ "the layout of aggregates containing vectors with"
+ " %d-byte alignment will change in a future GCC release",
+ computed / BITS_PER_UNIT);
+ }
+ }
+ /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
+ keep the special treatment of vector types, but warn if there will
+ be differences in future GCC releases. */
+ return true;
+ }
+
+ return false;
+}
+
/* AIX increases natural record alignment to doubleword if the first
field is an FP double while the FP fields remain word aligned. */
@@ -9180,14 +9208,51 @@ rs6000_function_arg_boundary (enum machine_mode mode, const_tree type)
|| (type && TREE_CODE (type) == VECTOR_TYPE
&& int_size_in_bytes (type) >= 16))
return 128;
- else if (((TARGET_MACHO && rs6000_darwin64_abi)
- || DEFAULT_ABI == ABI_ELFv2
- || (DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm))
- && mode == BLKmode
- && type && TYPE_ALIGN (type) > 64)
+
+ /* Aggregate types that need > 8 byte alignment are quadword-aligned
+ in the parameter area in the ELFv2 ABI, and in the AIX ABI unless
+ -mcompat-align-parm is used. */
+ if (((DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm)
+ || DEFAULT_ABI == ABI_ELFv2)
+ && type && TYPE_ALIGN (type) > 64)
+ {
+ /* "Aggregate" means any AGGREGATE_TYPE except for single-element
+ or homogeneous float/vector aggregates here. We already handled
+ vector aggregates above, but still need to check for float here. */
+ bool aggregate_p = (AGGREGATE_TYPE_P (type)
+ && !SCALAR_FLOAT_MODE_P (elt_mode));
+
+ /* We used to check for BLKmode instead of the above aggregate type
+ check. Warn when this results in any difference to the ABI. */
+ if (aggregate_p != (mode == BLKmode))
+ {
+ static bool warned;
+ if (!warned && warn_psabi)
+ {
+ warned = true;
+ inform (input_location,
+ "the ABI of passing aggregates with %d-byte alignment"
+ " will change in a future GCC release",
+ (int) TYPE_ALIGN (type) / BITS_PER_UNIT);
+ }
+ }
+
+ /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
+ keep using the BLKmode check, but warn if there will be differences
+ in future GCC releases. */
+ if (mode == BLKmode)
+ return 128;
+ }
+
+ /* Similar for the Darwin64 ABI. Note that for historical reasons we
+ implement the "aggregate type" check as a BLKmode check here; this
+ means certain aggregate types are in fact not aligned. */
+ if (TARGET_MACHO && rs6000_darwin64_abi
+ && mode == BLKmode
+ && type && TYPE_ALIGN (type) > 64)
return 128;
- else
- return PARM_BOUNDARY;
+
+ return PARM_BOUNDARY;
}
/* The offset in words to the start of the parameter save area. */
@@ -10225,6 +10290,7 @@ rs6000_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
rtx r, off;
int i, k = 0;
unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
+ int fpr_words;
/* Do we also need to pass this argument in the parameter
save area? */
@@ -10253,6 +10319,37 @@ rs6000_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off);
}
+ /* If there were not enough FPRs to hold the argument, the rest
+ usually goes into memory. However, if the current position
+ is still within the register parameter area, a portion may
+ actually have to go into GPRs.
+
+ Note that it may happen that the portion of the argument
+ passed in the first "half" of the first GPR was already
+ passed in the last FPR as well.
+
+ For unnamed arguments, we already set up GPRs to cover the
+ whole argument in rs6000_psave_function_arg, so there is
+ nothing further to do at this point.
+
+ GCC 4.8/4.9 Note: This was implemented incorrectly in earlier
+ GCC releases. To avoid any ABI change on the release branch,
+ we retain that original implementation here, but warn if we
+ encounter a case where the ABI will change in the future. */
+ fpr_words = (i * GET_MODE_SIZE (elt_mode)) / (TARGET_32BIT ? 4 : 8);
+ if (i < n_elts && align_words + fpr_words < GP_ARG_NUM_REG
+ && cum->nargs_prototype > 0)
+ {
+ static bool warned;
+ if (!warned && warn_psabi)
+ {
+ warned = true;
+ inform (input_location,
+ "the ABI of passing homogeneous float aggregates"
+ " will change in a future GCC release");
+ }
+ }
+
return rs6000_finish_function_arg (mode, rvec, k);
}
else if (align_words < GP_ARG_NUM_REG)
diff --git a/gcc-4.9/gcc/config/rs6000/sysv4.h b/gcc-4.9/gcc/config/rs6000/sysv4.h
index afbd2892e..7cc543319 100644
--- a/gcc-4.9/gcc/config/rs6000/sysv4.h
+++ b/gcc-4.9/gcc/config/rs6000/sysv4.h
@@ -292,7 +292,7 @@ do { \
/* An expression for the alignment of a structure field FIELD if the
alignment computed in the usual way is COMPUTED. */
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
? 128 : COMPUTED)
#undef BIGGEST_FIELD_ALIGNMENT
@@ -962,3 +962,19 @@ ncrtn.o%s"
#define TARGET_USES_SYSV4_OPT 1
#undef DBX_REGISTER_NUMBER
+
+/* Link -lasan early on the command line. For -static-libasan, don't link
+ it for -shared link, the executable should be compiled with -static-libasan
+ in that case, and for executable link link with --{,no-}whole-archive around
+ it to force everything into the executable. And similarly for -ltsan. */
+#if defined(HAVE_LD_STATIC_DYNAMIC)
+#undef LIBASAN_EARLY_SPEC
+#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
+ "%{static-libasan:%{!shared:" \
+ LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
+#undef LIBTSAN_EARLY_SPEC
+#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
+ LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
+#endif
diff --git a/gcc-4.9/gcc/config/sh/predicates.md b/gcc-4.9/gcc/config/sh/predicates.md
index 31f2e1f5a..73bb880d6 100644
--- a/gcc-4.9/gcc/config/sh/predicates.md
+++ b/gcc-4.9/gcc/config/sh/predicates.md
@@ -489,6 +489,10 @@
rtx mem_rtx = MEM_P (op) ? op : SUBREG_REG (op);
rtx x = XEXP (mem_rtx, 0);
+ if (! ALLOW_INDEXED_ADDRESS
+ && GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 1)))
+ return false;
+
if ((mode == QImode || mode == HImode)
&& GET_CODE (x) == PLUS
&& REG_P (XEXP (x, 0))
@@ -567,6 +571,10 @@
rtx mem_rtx = MEM_P (op) ? op : SUBREG_REG (op);
rtx x = XEXP (mem_rtx, 0);
+ if (! ALLOW_INDEXED_ADDRESS
+ && GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 1)))
+ return false;
+
if ((mode == QImode || mode == HImode)
&& GET_CODE (x) == PLUS
&& REG_P (XEXP (x, 0))
diff --git a/gcc-4.9/gcc/config/sh/sh.c b/gcc-4.9/gcc/config/sh/sh.c
index 12724a20d..62dcf0cb3 100644
--- a/gcc-4.9/gcc/config/sh/sh.c
+++ b/gcc-4.9/gcc/config/sh/sh.c
@@ -10207,6 +10207,10 @@ sh_legitimate_index_p (enum machine_mode mode, rtx op, bool consider_sh2a,
static bool
sh_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
{
+ if (! ALLOW_INDEXED_ADDRESS
+ && GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 1)))
+ return false;
+
if (REG_P (x) && REGNO (x) == GBR_REG)
return true;
@@ -10436,6 +10440,28 @@ sh_legitimize_reload_address (rtx *p, enum machine_mode mode, int opnum,
enum reload_type type = (enum reload_type) itype;
const int mode_sz = GET_MODE_SIZE (mode);
+ if (! ALLOW_INDEXED_ADDRESS
+ && GET_CODE (*p) == PLUS
+ && REG_P (XEXP (*p, 0)) && REG_P (XEXP (*p, 1)))
+ {
+ *p = copy_rtx (*p);
+ push_reload (*p, NULL_RTX, p, NULL,
+ BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, type);
+ return true;
+ }
+
+ if (! ALLOW_INDEXED_ADDRESS
+ && GET_CODE (*p) == PLUS
+ && GET_CODE (XEXP (*p, 0)) == PLUS)
+ {
+ rtx sum = gen_rtx_PLUS (Pmode, XEXP (XEXP (*p, 0), 0),
+ XEXP (XEXP (*p, 0), 1));
+ *p = gen_rtx_PLUS (Pmode, sum, XEXP (*p, 1));
+ push_reload (sum, NULL_RTX, &XEXP (*p, 0), NULL,
+ BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, type);
+ return true;
+ }
+
if (TARGET_SHMEDIA)
return false;
diff --git a/gcc-4.9/gcc/config/sparc/sync.md b/gcc-4.9/gcc/config/sparc/sync.md
index e6e237f25..98ac0d3d6 100644
--- a/gcc-4.9/gcc/config/sparc/sync.md
+++ b/gcc-4.9/gcc/config/sparc/sync.md
@@ -64,11 +64,19 @@
"stbar"
[(set_attr "type" "multi")])
+;; For LEON3, STB has the effect of membar #StoreLoad.
+(define_insn "*membar_storeload_leon3"
+ [(set (match_operand:BLK 0 "" "")
+ (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
+ "TARGET_LEON3"
+ "stb\t%%g0, [%%sp-1]"
+ [(set_attr "type" "store")])
+
;; For V8, LDSTUB has the effect of membar #StoreLoad.
(define_insn "*membar_storeload"
[(set (match_operand:BLK 0 "" "")
(unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
- "TARGET_V8"
+ "TARGET_V8 && !TARGET_LEON3"
"ldstub\t[%%sp-1], %%g0"
[(set_attr "type" "multi")])
diff --git a/gcc-4.9/gcc/coverage.c b/gcc-4.9/gcc/coverage.c
index a7f183d0c..6b1d0d6cd 100644
--- a/gcc-4.9/gcc/coverage.c
+++ b/gcc-4.9/gcc/coverage.c
@@ -720,7 +720,18 @@ read_counts_file (const char *da_file_name, unsigned module_id)
return;
}
else
- return;
+ {
+ inform (input_location, "file %s not found, disabling profile use",
+ da_file_name);
+ set_profile_use_options (&global_options, &global_options_set,
+ false, true);
+ /* RESET is invoked during covrerage_init when process_options is done.
+ Need to reset optimization_default_node and optimization_current_node. */
+ /* Save the current optimization options. */
+ optimization_default_node = build_optimization_node (&global_options);
+ optimization_current_node = optimization_default_node;
+ return;
+ }
}
if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC))
@@ -1023,7 +1034,10 @@ get_coverage_counts_entry (struct function *func, unsigned counter)
if (PARAM_VALUE (PARAM_PROFILE_FUNC_INTERNAL_ID))
elt.ident = FUNC_DECL_GLOBAL_ID (func);
else
- elt.ident = coverage_compute_profile_id (cgraph_get_node (func->decl));
+ {
+ gcc_assert (coverage_node_map_initialized_p ());
+ elt.ident = cgraph_get_node (func->decl)->profile_id;
+ }
elt.ctr = counter;
entry = counts_hash.find (&elt);
@@ -1131,7 +1145,10 @@ get_coverage_counts_no_warn (struct function *f, unsigned counter, unsigned *n_c
if (PARAM_VALUE (PARAM_PROFILE_FUNC_INTERNAL_ID))
elt.ident = FUNC_DECL_GLOBAL_ID (f);
else
- elt.ident = coverage_compute_profile_id (cgraph_get_node (f->decl));
+ {
+ gcc_assert (coverage_node_map_initialized_p ());
+ elt.ident = cgraph_get_node (f->decl)->profile_id;
+ }
elt.ctr = counter;
entry = counts_hash.find (&elt);
if (!entry)
@@ -1325,8 +1342,15 @@ coverage_compute_lineno_checksum (void)
/* Note: it is a bad design that C++ FE associate the convertion function type
with the name of the decl. This leads to cross contamination between different
conversion operators in different modules (If conv_type_names map is cleared
- at the end of parsing of each module). */
- if (flag_dyn_ipa && lang_hooks.user_conv_function_p (current_function_decl))
+ at the end of parsing of each module).
+
+ For LIPO always use the full mangled name to help disambiguate different
+ template instantiations. This is important for LIPO because we use the
+ checksums to identify matching copies of the same COMDAT to handle
+ missing profiles in the copies not selected by the linker, and to update
+ indirect call profiles when the target COMDAT is a copy that is not
+ in the module group. */
+ if (flag_dyn_ipa)
name = DECL_ASSEMBLER_NAME (current_function_decl);
else
name = DECL_NAME (current_function_decl);
@@ -1411,8 +1435,11 @@ coverage_begin_function (unsigned lineno_checksum, unsigned cfg_checksum)
if (PARAM_VALUE (PARAM_PROFILE_FUNC_INTERNAL_ID))
gcov_write_unsigned (FUNC_DECL_FUNC_ID (cfun));
else
- gcov_write_unsigned (coverage_compute_profile_id (
- cgraph_get_node (cfun->decl)));
+ {
+ gcc_assert (coverage_node_map_initialized_p ());
+ gcov_write_unsigned (
+ cgraph_get_node (current_function_decl)->profile_id);
+ }
gcov_write_unsigned (lineno_checksum);
gcov_write_unsigned (cfg_checksum);
@@ -1458,8 +1485,9 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum)
if (flag_dyn_ipa)
error ("param=profile-func-internal-id=0 is not"
" supported in LIPO mode. ");
- item->ident = coverage_compute_profile_id (
- cgraph_get_node (cfun->decl));
+ gcc_assert (coverage_node_map_initialized_p ());
+ item->ident = cgraph_get_node (cfun->decl)->profile_id;
+
}
item->lineno_checksum = lineno_checksum;
item->cfg_checksum = cfg_checksum;
diff --git a/gcc-4.9/gcc/coverage.h b/gcc-4.9/gcc/coverage.h
index 408cd66e6..0049d1318 100644
--- a/gcc-4.9/gcc/coverage.h
+++ b/gcc-4.9/gcc/coverage.h
@@ -75,6 +75,8 @@ extern void coverage_dc_end_function (void);
is present in the coverage internal data structures. */
extern bool coverage_function_present (unsigned fn_ident);
+extern bool coverage_node_map_initialized_p (void);
+
extern void emit_function_name (void);
extern tree get_gcov_type (void);
diff --git a/gcc-4.9/gcc/cp/ChangeLog b/gcc-4.9/gcc/cp/ChangeLog
index f406b27b7..b0a474daf 100644
--- a/gcc-4.9/gcc/cp/ChangeLog
+++ b/gcc-4.9/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
+2014-07-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/58636
+ * call.c (build_list_conv): Don't try to build a list of references.
+
2014-07-10 Jason Merrill <jason@redhat.com>
PR c++/61661
diff --git a/gcc-4.9/gcc/cp/call.c b/gcc-4.9/gcc/cp/call.c
index 2f24fd49b..2c67c03e4 100644
--- a/gcc-4.9/gcc/cp/call.c
+++ b/gcc-4.9/gcc/cp/call.c
@@ -805,6 +805,12 @@ build_list_conv (tree type, tree ctor, int flags, tsubst_flags_t complain)
/* But no narrowing conversions. */
flags |= LOOKUP_NO_NARROWING;
+ /* Can't make an array of these types. */
+ if (TREE_CODE (elttype) == REFERENCE_TYPE
+ || TREE_CODE (elttype) == FUNCTION_TYPE
+ || VOID_TYPE_P (elttype))
+ return NULL;
+
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (ctor), i, val)
{
conversion *sub
diff --git a/gcc-4.9/gcc/cp/except.c b/gcc-4.9/gcc/cp/except.c
index 221971ac9..3a66c678b 100644
--- a/gcc-4.9/gcc/cp/except.c
+++ b/gcc-4.9/gcc/cp/except.c
@@ -1269,6 +1269,8 @@ bool
nothrow_spec_p (const_tree spec)
{
gcc_assert (!DEFERRED_NOEXCEPT_SPEC_P (spec));
+ if (spec == NULL_TREE && flag_default_noexcept)
+ return true;
if (spec == NULL_TREE
|| TREE_VALUE (spec) != NULL_TREE
|| spec == noexcept_false_spec)
@@ -1290,7 +1292,7 @@ type_noexcept_p (const_tree type)
{
tree spec = TYPE_RAISES_EXCEPTIONS (type);
gcc_assert (!DEFERRED_NOEXCEPT_SPEC_P (spec));
- if (flag_nothrow_opt)
+ if (flag_nothrow_opt || flag_default_noexcept)
return nothrow_spec_p (spec);
else
return spec == noexcept_true_spec;
diff --git a/gcc-4.9/gcc/expr.c b/gcc-4.9/gcc/expr.c
index 94e90172e..ad8c05a90 100644
--- a/gcc-4.9/gcc/expr.c
+++ b/gcc-4.9/gcc/expr.c
@@ -6605,7 +6605,7 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos,
{
HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
rtx temp_target;
- if (mode == BLKmode)
+ if (mode == BLKmode || mode == VOIDmode)
mode = smallest_mode_for_size (size * BITS_PER_UNIT, MODE_INT);
temp_target = gen_reg_rtx (mode);
emit_group_store (temp_target, temp, TREE_TYPE (exp), size);
diff --git a/gcc-4.9/gcc/fortran/ChangeLog b/gcc-4.9/gcc/fortran/ChangeLog
index b96c61224..d2e070b78 100644
--- a/gcc-4.9/gcc/fortran/ChangeLog
+++ b/gcc-4.9/gcc/fortran/ChangeLog
@@ -1,3 +1,15 @@
+2014-07-19 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/61780
+ * dependency.c (gfc_dep_resolver): Index the 'reverse' array so
+ that elements are skipped. This then correctly aligns 'reverse'
+ with the scalarizer loops.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-07-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/61459
diff --git a/gcc-4.9/gcc/fortran/dependency.c b/gcc-4.9/gcc/fortran/dependency.c
index a24a4709e..f9b975ad9 100644
--- a/gcc-4.9/gcc/fortran/dependency.c
+++ b/gcc-4.9/gcc/fortran/dependency.c
@@ -2023,6 +2023,7 @@ int
gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
{
int n;
+ int m;
gfc_dependency fin_dep;
gfc_dependency this_dep;
@@ -2072,6 +2073,8 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
break;
}
+ /* Index for the reverse array. */
+ m = -1;
for (n=0; n < lref->u.ar.dimen; n++)
{
/* Handle dependency when either of array reference is vector
@@ -2118,38 +2121,44 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
The ability to reverse or not is set by previous conditions
in this dimension. If reversal is not activated, the
value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP. */
+
+ /* Get the indexing right for the scalarizing loop. If this
+ is an element, there is no corresponding loop. */
+ if (lref->u.ar.dimen_type[n] != DIMEN_ELEMENT)
+ m++;
+
if (rref->u.ar.dimen_type[n] == DIMEN_RANGE
&& lref->u.ar.dimen_type[n] == DIMEN_RANGE)
{
/* Set reverse if backward dependence and not inhibited. */
- if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
- reverse[n] = (this_dep == GFC_DEP_BACKWARD) ?
- GFC_REVERSE_SET : reverse[n];
+ if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
+ reverse[m] = (this_dep == GFC_DEP_BACKWARD) ?
+ GFC_REVERSE_SET : reverse[m];
/* Set forward if forward dependence and not inhibited. */
- if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
- reverse[n] = (this_dep == GFC_DEP_FORWARD) ?
- GFC_FORWARD_SET : reverse[n];
+ if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
+ reverse[m] = (this_dep == GFC_DEP_FORWARD) ?
+ GFC_FORWARD_SET : reverse[m];
/* Flag up overlap if dependence not compatible with
the overall state of the expression. */
- if (reverse && reverse[n] == GFC_REVERSE_SET
+ if (reverse && reverse[m] == GFC_REVERSE_SET
&& this_dep == GFC_DEP_FORWARD)
{
- reverse[n] = GFC_INHIBIT_REVERSE;
+ reverse[m] = GFC_INHIBIT_REVERSE;
this_dep = GFC_DEP_OVERLAP;
}
- else if (reverse && reverse[n] == GFC_FORWARD_SET
+ else if (reverse && reverse[m] == GFC_FORWARD_SET
&& this_dep == GFC_DEP_BACKWARD)
{
- reverse[n] = GFC_INHIBIT_REVERSE;
+ reverse[m] = GFC_INHIBIT_REVERSE;
this_dep = GFC_DEP_OVERLAP;
}
/* If no intention of reversing or reversing is explicitly
inhibited, convert backward dependence to overlap. */
if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
- || (reverse != NULL && reverse[n] == GFC_INHIBIT_REVERSE))
+ || (reverse != NULL && reverse[m] == GFC_INHIBIT_REVERSE))
this_dep = GFC_DEP_OVERLAP;
}
diff --git a/gcc-4.9/gcc/gcc.c b/gcc-4.9/gcc/gcc.c
index efca49bfb..297d985f4 100644
--- a/gcc-4.9/gcc/gcc.c
+++ b/gcc-4.9/gcc/gcc.c
@@ -772,7 +772,8 @@ proper position among the other output files. */
%{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
%(mflib) " STACK_SPLIT_SPEC "\
- %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
+ %{fprofile-arcs|fprofile-generate*|coverage:-lgcov " \
+ LINUX_OR_ANDROID_LD("", "-lgcc") "}" SANITIZER_SPEC " \
%{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
%{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
#endif
diff --git a/gcc-4.9/gcc/gcov-tool.c b/gcc-4.9/gcc/gcov-tool.c
index f15e6f33f..e7b551e3b 100644
--- a/gcc-4.9/gcc/gcov-tool.c
+++ b/gcc-4.9/gcc/gcov-tool.c
@@ -61,17 +61,22 @@ extern void lipo_set_substitute_string (const char *);
-- otherwise we get duplicated defintions.
Make the defines weak to link with other objects/libraries
that potentially compiled with -fprofile-generate. */
+#if !defined(_WIN32)
+#define WEAK_ATTR __attribute__ ((weak))
+#else
+#define WEAK_ATTR
+#endif
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_grouping_algorithm;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_merge_modu_edges;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_weak_inclusion;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_max_mem;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_comdat_algorithm;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_random_group_size;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_cutoff;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_random_seed;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_dump_cgraph;
-__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_propagate_scale;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_grouping_algorithm;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_merge_modu_edges;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_weak_inclusion;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_max_mem;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_comdat_algorithm;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_random_group_size;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_cutoff;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_random_seed;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_dump_cgraph;
+WEAK_ATTR gcov_unsigned_t __gcov_lipo_propagate_scale;
#else
gcov_unsigned_t __gcov_lipo_grouping_algorithm;
gcov_unsigned_t __gcov_lipo_merge_modu_edges;
@@ -85,6 +90,8 @@ gcov_unsigned_t __gcov_lipo_dump_cgraph;
gcov_unsigned_t __gcov_lipo_propagate_scale;
#endif
+#undef WEAK_ATTR
+
/* Set to verbose output mode. */
static bool verbose;
diff --git a/gcc-4.9/gcc/go/ChangeLog b/gcc-4.9/gcc/go/ChangeLog
index 1c1505a38..1af11e486 100644
--- a/gcc-4.9/gcc/go/ChangeLog
+++ b/gcc-4.9/gcc/go/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/gcc/ipa-inline-transform.c b/gcc-4.9/gcc/ipa-inline-transform.c
index aaf427d12..69598b3c8 100644
--- a/gcc-4.9/gcc/ipa-inline-transform.c
+++ b/gcc-4.9/gcc/ipa-inline-transform.c
@@ -186,8 +186,14 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
else
{
struct cgraph_node *n;
- if (flag_auto_profile && L_IPO_COMP_MODE
- && cgraph_pre_profiling_inlining_done)
+ /* Disable updating of callee count if caller is not the resolved node
+ to avoid multiple updates of the callee's profile when inlining
+ into COMDAT copies. Both AutoFDO and regular FDO will have the
+ same edge counts for all unresolved nodes. In AutoFDO this is due
+ to profile correlation by function name and source position. In
+ regular FDO this is due to COMDAT profile merging performed on the
+ dynamic callgraph at the end of LIPO profiling. */
+ if (L_IPO_COMP_MODE && cgraph_pre_profiling_inlining_done)
{
struct cgraph_node *caller = e->caller;
if (caller->global.inlined_to)
diff --git a/gcc-4.9/gcc/java/ChangeLog b/gcc-4.9/gcc/java/ChangeLog
index c806f6255..b9185f119 100644
--- a/gcc-4.9/gcc/java/ChangeLog
+++ b/gcc-4.9/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/gcc/l-ipo.c b/gcc-4.9/gcc/l-ipo.c
index 843ad557d..59a9636d2 100644
--- a/gcc-4.9/gcc/l-ipo.c
+++ b/gcc-4.9/gcc/l-ipo.c
@@ -1566,7 +1566,11 @@ resolve_cgraph_node (struct cgraph_sym **slot, struct cgraph_node *node)
}
has_prof1 = has_profile_info (decl1);
- if (has_prof1)
+ bool is_aux1 = cgraph_is_auxiliary (decl1);
+ bool is_aux2 = cgraph_is_auxiliary (decl2);
+ /* Pick the copy from the primary module if multiple copies
+ have profile. */
+ if (has_prof1 && (!is_aux1 || is_aux2))
return;
has_prof2 = has_profile_info (decl2);
if (has_prof2)
diff --git a/gcc-4.9/gcc/lto/ChangeLog b/gcc-4.9/gcc/lto/ChangeLog
index 47a5924c1..c029da671 100644
--- a/gcc-4.9/gcc/lto/ChangeLog
+++ b/gcc-4.9/gcc/lto/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Jan Hubicka <hubicka@ucw.cz>
PR lto/61012
diff --git a/gcc-4.9/gcc/objc/ChangeLog b/gcc-4.9/gcc/objc/ChangeLog
index de619aeea..2443c6197 100644
--- a/gcc-4.9/gcc/objc/ChangeLog
+++ b/gcc-4.9/gcc/objc/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/gcc/objcp/ChangeLog b/gcc-4.9/gcc/objcp/ChangeLog
index 19f43bc88..cba09a4be 100644
--- a/gcc-4.9/gcc/objcp/ChangeLog
+++ b/gcc-4.9/gcc/objcp/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/gcc/omp-low.c b/gcc-4.9/gcc/omp-low.c
index a605c45f0..1753cad45 100644
--- a/gcc-4.9/gcc/omp-low.c
+++ b/gcc-4.9/gcc/omp-low.c
@@ -1872,7 +1872,6 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
TREE_STATIC (decl) = 1;
TREE_USED (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
- DECL_NAMELESS (decl) = 1;
DECL_IGNORED_P (decl) = 0;
TREE_PUBLIC (decl) = 0;
DECL_UNINLINABLE (decl) = 1;
diff --git a/gcc-4.9/gcc/opts.c b/gcc-4.9/gcc/opts.c
index 3ed603a53..a588d2ec8 100644
--- a/gcc-4.9/gcc/opts.c
+++ b/gcc-4.9/gcc/opts.c
@@ -1288,6 +1288,75 @@ print_specific_help (unsigned int include_flags,
opts->x_help_columns, opts, lang_mask);
}
+/* Set options implied by -f[no-]profile-use[=...]. If RESET is
+ true, it means the profile data is not available, so it is better
+ to turn off the options unless explicitly set. The default
+ values are not checked. */
+
+void
+set_profile_use_options (struct gcc_options *opts,
+ struct gcc_options *opts_set,
+ bool value, bool reset)
+{
+ if (reset)
+ {
+ opts->x_flag_profile_use = false;
+ maybe_set_param_value
+ (PARAM_MAX_INLINE_INSNS_SINGLE,
+ default_param_value (PARAM_MAX_INLINE_INSNS_SINGLE),
+ opts->x_param_values, opts_set->x_param_values);
+ maybe_set_param_value
+ (PARAM_MAX_INLINE_INSNS_AUTO,
+ default_param_value (PARAM_MAX_INLINE_INSNS_AUTO),
+ opts->x_param_values, opts_set->x_param_values);
+ }
+
+ if (!opts_set->x_flag_branch_probabilities || reset)
+ opts->x_flag_branch_probabilities = value;
+ if (!opts_set->x_flag_profile_values || reset)
+ opts->x_flag_profile_values = value;
+ if (!opts_set->x_flag_unroll_loops)
+ opts->x_flag_unroll_loops = value;
+ if (!opts_set->x_flag_peel_loops)
+ opts->x_flag_peel_loops = value;
+ if (!opts_set->x_flag_value_profile_transformations || reset)
+ opts->x_flag_value_profile_transformations = value;
+ if (!opts_set->x_flag_inline_functions)
+ opts->x_flag_inline_functions = value;
+ if (!opts_set->x_flag_ipa_cp)
+ opts->x_flag_ipa_cp = value;
+ if (!opts_set->x_flag_ipa_cp_clone
+ && value && opts->x_flag_ipa_cp || reset)
+ opts->x_flag_ipa_cp_clone = value;
+ if (!opts_set->x_flag_predictive_commoning)
+ opts->x_flag_predictive_commoning = value;
+ if (!opts_set->x_flag_unswitch_loops)
+ opts->x_flag_unswitch_loops = value;
+ if (!opts_set->x_flag_gcse_after_reload)
+ opts->x_flag_gcse_after_reload = value;
+ if (!opts_set->x_flag_tree_loop_vectorize
+ && !opts_set->x_flag_tree_vectorize)
+ opts->x_flag_tree_loop_vectorize = value;
+ if (!opts_set->x_flag_tree_loop_distribute_patterns)
+ opts->x_flag_tree_loop_distribute_patterns = value;
+ if (!opts_set->x_flag_profile_reorder_functions || reset)
+ opts->x_flag_profile_reorder_functions = value;
+ /* Indirect call profiling should do all useful transformations
+ speculative devirtualization does. */
+ if (!opts_set->x_flag_devirtualize_speculatively
+ && opts->x_flag_value_profile_transformations)
+ opts->x_flag_devirtualize_speculatively = false;
+
+ /* See how AUTODECT flag_web is set in toplev.c. */
+ if (reset && !opts->x_flag_unroll_loops
+ && !opts->x_flag_peel_loops)
+ {
+ if(!opts_set->x_flag_web)
+ opts->x_flag_web = false;
+ if (!opts_set->x_flag_rename_registers)
+ opts->x_flag_rename_registers = false;
+ }
+}
/* Handle target- and language-independent options. Return zero to
generate an "unknown option" message. Only options that need
@@ -1735,41 +1804,7 @@ common_handle_option (struct gcc_options *opts,
value = true;
/* No break here - do -fprofile-use processing. */
case OPT_fprofile_use:
- if (!opts_set->x_flag_branch_probabilities)
- opts->x_flag_branch_probabilities = value;
- if (!opts_set->x_flag_profile_values)
- opts->x_flag_profile_values = value;
- if (!opts_set->x_flag_unroll_loops)
- opts->x_flag_unroll_loops = value;
- if (!opts_set->x_flag_peel_loops)
- opts->x_flag_peel_loops = value;
- if (!opts_set->x_flag_value_profile_transformations)
- opts->x_flag_value_profile_transformations = value;
- if (!opts_set->x_flag_inline_functions)
- opts->x_flag_inline_functions = value;
- if (!opts_set->x_flag_ipa_cp)
- opts->x_flag_ipa_cp = value;
- if (!opts_set->x_flag_ipa_cp_clone
- && value && opts->x_flag_ipa_cp)
- opts->x_flag_ipa_cp_clone = value;
- if (!opts_set->x_flag_predictive_commoning)
- opts->x_flag_predictive_commoning = value;
- if (!opts_set->x_flag_unswitch_loops)
- opts->x_flag_unswitch_loops = value;
- if (!opts_set->x_flag_gcse_after_reload)
- opts->x_flag_gcse_after_reload = value;
- if (!opts_set->x_flag_tree_loop_vectorize
- && !opts_set->x_flag_tree_vectorize)
- opts->x_flag_tree_loop_vectorize = value;
- if (!opts_set->x_flag_tree_loop_distribute_patterns)
- opts->x_flag_tree_loop_distribute_patterns = value;
- if (!opts_set->x_flag_profile_reorder_functions)
- opts->x_flag_profile_reorder_functions = value;
- /* Indirect call profiling should do all useful transformations
- speculative devirtualization does. */
- if (!opts_set->x_flag_devirtualize_speculatively
- && opts->x_flag_value_profile_transformations)
- opts->x_flag_devirtualize_speculatively = false;
+ set_profile_use_options (opts, opts_set, value, false);
break;
case OPT_fauto_profile_:
diff --git a/gcc-4.9/gcc/opts.h b/gcc-4.9/gcc/opts.h
index 3f07ec203..74e7622db 100644
--- a/gcc-4.9/gcc/opts.h
+++ b/gcc-4.9/gcc/opts.h
@@ -417,4 +417,6 @@ extern bool opt_enum_arg_to_value (size_t opt_index, const char *arg,
int *value, unsigned int lang_mask);
extern void write_compilation_info_to_asm (void);
extern void write_compilation_flags_to_asm (void);
+extern void set_profile_use_options (struct gcc_options *,
+ struct gcc_options *, bool, bool);
#endif
diff --git a/gcc-4.9/gcc/params.c b/gcc-4.9/gcc/params.c
index ab3c7c761..03b769cfd 100644
--- a/gcc-4.9/gcc/params.c
+++ b/gcc-4.9/gcc/params.c
@@ -190,3 +190,18 @@ get_num_compiler_params (void)
{
return num_compiler_params;
}
+
+/* Dump values of parameters. */
+
+void
+dump_params (int *params, int *params_set)
+{
+ size_t i;
+
+ /* Scan the parameter table to find a matching entry. */
+ for (i = 0; i < num_compiler_params; ++i)
+ {
+ fprintf (stderr, "%s\t%d (%s)\n", compiler_params[i].option,
+ params[i], params_set[i] ? "explicit" : "implicit");
+ }
+}
diff --git a/gcc-4.9/gcc/params.def b/gcc-4.9/gcc/params.def
index fd38e8fed..f59656933 100644
--- a/gcc-4.9/gcc/params.def
+++ b/gcc-4.9/gcc/params.def
@@ -1071,6 +1071,17 @@ DEFPARAM (PARAM_LIPO_WEAK_INCLUSION,
"Default is 0.",
0, 0, 1)
+/* Choose different COMDAT profile fixup algorithm. This only affects
+ LIPO profile-gen. */
+DEFPARAM (PARAM_LIPO_COMDAT_ALGORITHM,
+ "lipo-comdat-algorithm",
+ "Algorithm 0 performs no fixup."
+ "Algorithm 1 fixes up only indirect call profile targets."
+ "Algorithm 2 fixes up only missing counters."
+ "Algorithm 3 (1|2) fixes up both."
+ "The default algorithm is 3.",
+ 3, 0, 3)
+
/* In LIPO profile-use, use this parameter to enable the dumping of module id
in inline message. */
DEFPARAM (PARAM_INLINE_DUMP_MODULE_ID,
diff --git a/gcc-4.9/gcc/params.h b/gcc-4.9/gcc/params.h
index 0d6daa205..b1bac4067 100644
--- a/gcc-4.9/gcc/params.h
+++ b/gcc-4.9/gcc/params.h
@@ -92,6 +92,8 @@ enum compiler_param
#define PARAM_VALUE(ENUM) \
((int) global_options.x_param_values[(int) ENUM])
+extern void dump_params (int *params, int *params_set);
+
/* Set the value of the parameter given by NUM to VALUE, implicitly,
if it has not been set explicitly by the user, in the table PARAMS
using PARAMS_SET to indicate which have been explicitly set. */
diff --git a/gcc-4.9/gcc/po/ChangeLog b/gcc-4.9/gcc/po/ChangeLog
index 631f64ad1..399d6b5fa 100644
--- a/gcc-4.9/gcc/po/ChangeLog
+++ b/gcc-4.9/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-05-14 Joseph Myers <joseph@codesourcery.com>
* zh_CN.po: Update.
diff --git a/gcc-4.9/gcc/sched-deps.c b/gcc-4.9/gcc/sched-deps.c
index efc422308..df29bd30b 100644
--- a/gcc-4.9/gcc/sched-deps.c
+++ b/gcc-4.9/gcc/sched-deps.c
@@ -2750,7 +2750,8 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn)
Consider for instance a volatile asm that changes the fpu rounding
mode. An insn should not be moved across this even if it only uses
pseudo-regs because it might give an incorrectly rounded result. */
- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
+ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
+ && !DEBUG_INSN_P (insn))
reg_pending_barrier = TRUE_BARRIER;
/* For all ASM_OPERANDS, we must traverse the vector of input operands.
diff --git a/gcc-4.9/gcc/testsuite/ChangeLog b/gcc-4.9/gcc/testsuite/ChangeLog
index 20212cd73..790319955 100644
--- a/gcc-4.9/gcc/testsuite/ChangeLog
+++ b/gcc-4.9/gcc/testsuite/ChangeLog
@@ -1,3 +1,108 @@
+2014-07-28 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/61801
+ * gcc.target/i386/pr61801.c: Fix testcase.
+
+2014-07-28 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/61801
+ * gcc.target/i386/pr61801.c: New testcase.
+
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ Backport from mainline
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gcc.target/powerpc/ppc64-abi-warn-3.c: New test.
+
+ * gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
+ * gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
+ * gcc.c-torture/execute/20050316-3.x: New file. Add -Wno-psabi.
+ * gcc.c-torture/execute/pr23135.x: Likewise.
+
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ Backport from mainline
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gcc.target/powerpc/ppc64-abi-warn-2.c: New test.
+
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ Backport from mainline
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gcc.target/powerpc/ppc64-abi-warn-1.c: New test.
+
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ Backport from mainline
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * g++.dg/compat/struct-layout-1.exp: Load g++-dg.exp.
+
+2014-07-24 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/61160
+ * g++.dg/ipa/pr61160-2.C (main): Return zero.
+ * g++.dg/ipa/pr61160-3.C (main): Likewise.
+
+2014-07-21 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2014-07-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/61855
+ * gcc.target/i386/pr61855.c: New test.
+
+2014-07-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/pack20.ad[sb]: New test.
+ * gnat.dg/pack20_pkg.ads: New helper.
+
+2014-07-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/stack-usage-2.c: Adjust.
+
+2014-07-19 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/61780
+ * gfortran.dg/dependency_44.f90 : New test
+
+2014-07-18 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2014-07-18 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/61794
+ * gcc.target/i386/pr61794.c: New test.
+
+2014-07-17 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-07-10 Richard Biener <rguenther@suse.de>
+
+ PR c-family/61741
+ * c-c++-common/torture/pr61741.c: Use signed char.
+
+ 2014-07-09 Richard Biener <rguenther@suse.de>
+
+ PR c-family/61741
+ * c-c++-common/torture/pr61741.c: New testcase.
+
+2014-07-17 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-07-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/61779
+ * gcc.dg/tree-ssa/ssa-copyprop-2.c: New testcase.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-07-10 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt39.adb: New test.
@@ -13,7 +118,8 @@
2014-06-09 Alan Lawrence <alan.lawrence@arm.com>
PR target/61062
- * gcc.target/arm/pr48252.c (main): Expect same result as endian-neutral.
+ * gcc.target/arm/pr48252.c (main): Expect same result as
+ endian-neutral.
2014-07-08 Jakub Jelinek <jakub@redhat.com>
@@ -30,8 +136,8 @@
2014-07-08 Alan Lawrence <alan.lawrence@arm.com>
- Backport r211502 from mainline.
- 2014-06-10 Alan Lawrence <alan.lawrence@arm.com>
+ Backport r211502 from mainline.
+ 2014-06-10 Alan Lawrence <alan.lawrence@arm.com>
PR target/59843
* gcc.dg/vect/vect-singleton_1.c: New file.
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/compat/struct-layout-1.exp b/gcc-4.9/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
index 13211c2fa..4c7d4c43f 100644
--- a/gcc-4.9/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
+++ b/gcc-4.9/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
@@ -89,6 +89,9 @@ proc compat-use-tst-compiler { } {
# This must be done after the compat-use-*-compiler definitions.
load_lib compat.exp
+# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
+load_lib g++-dg.exp
+
g++_init
# Save variables for the C++ compiler under test, which each test will
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C
index a0fbb5f42..69bd6a61d 100644
--- a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C
+++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C
@@ -27,5 +27,6 @@ void *test (MMixin & anExample)
int main ()
{
CExample c;
- return (test (c) != &c);
+ test (c);
+ return 0;
}
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C
index 1011bd1ef..dd925d25c 100644
--- a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C
+++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C
@@ -39,5 +39,6 @@ void *test (MMixin & anExample)
int main ()
{
CExample c;
- return (test (c) != &c);
+ test (c);
+ return 0;
}
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C
index 91f43ae8c..68fc48c2c 100644
--- a/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C
+++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C
@@ -1,7 +1,8 @@
+// { dg-message "note: file" "" }
// PR tree-optimization/39557
// invalid post-dom info leads to infinite loop
// { dg-do run }
-// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fopt-info -fno-rtti" }
+// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fno-rtti -fno-diagnostics-show-caret" }
struct C
{
@@ -49,4 +50,4 @@ main ()
{
E e;
e.bar ();
-} // { dg-message "note: file" "" }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-1.x b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
index 121fcfecc..cb2d28fd9 100644
--- a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
@@ -4,4 +4,5 @@ if { [check_effective_target_int16] } {
return 1
}
+set additional_flags "-Wno-psabi"
return 0;
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050604-1.x b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
index f5b4aaae3..756242d23 100644
--- a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
@@ -6,4 +6,5 @@ if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
set additional_flags "-mno-mmx"
}
+set additional_flags "-Wno-psabi"
return 0
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c
index 71c16f207..b1222578a 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c
@@ -1,7 +1,8 @@
+/* { dg-message "note: file" "" } */
/* { dg-do compile } */
/* { dg-options "-O2 -fprofile-generate -fprofile-use -fopt-info" } */
unsigned test (unsigned a, unsigned b)
{
return a / b;
-} /* { dg-message "note: \[^\n\]*execution counts estimated" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c
index 19a90195a..c9bcb4392 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c
@@ -1,3 +1,4 @@
+/* { dg-message "note: file" "" } */
/* { dg-do compile } */
/* { dg-options "-O -fprofile-use -fopt-info" } */
/* { dg-options "-O -m4 -fprofile-use -fopt-info" { target sh-*-* } } */
@@ -6,4 +7,4 @@ void foo (int *p)
{
if (p)
*p = 0;
-} /* { dg-message "note: \[^\n\]*execution counts estimated" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c
index d3c17a84d..df7e55f05 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c
@@ -1,33 +1,32 @@
/* { dg-do compile } */
/* { dg-options "-Wstack-usage=512" } */
-int foo1 (void)
+int foo1 (void) /* { dg-bogus "stack usage" } */
{
char arr[16];
arr[0] = 1;
return 0;
-} /* { dg-bogus "stack usage" } */
+}
-int foo2 (void)
+int foo2 (void) /* { dg-warning "stack usage is \[0-9\]* bytes" } */
{
char arr[1024];
arr[0] = 1;
return 0;
-} /* { dg-warning "stack usage is \[0-9\]* bytes" } */
+}
-int foo3 (void)
+int foo3 (void) /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
{
char arr[1024] __attribute__((aligned (512)));
arr[0] = 1;
/* Force dynamic realignment of argument pointer. */
__builtin_apply ((void (*)()) foo2, 0, 0);
return 0;
+}
-} /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
-
-int foo4 (int n)
+int foo4 (int n) /* { dg-warning "stack usage might be unbounded" } */
{
char arr[n];
arr[0] = 1;
return 0;
-} /* { dg-warning "stack usage might be unbounded" } */
+}
diff --git a/gcc-4.9/gcc/toplev.c b/gcc-4.9/gcc/toplev.c
index 528087302..9b8d31342 100644
--- a/gcc-4.9/gcc/toplev.c
+++ b/gcc-4.9/gcc/toplev.c
@@ -1073,16 +1073,19 @@ output_stack_usage (void)
if (warn_stack_usage >= 0)
{
+ const location_t loc = DECL_SOURCE_LOCATION (current_function_decl);
+
if (stack_usage_kind == DYNAMIC)
- warning (OPT_Wstack_usage_, "stack usage might be unbounded");
+ warning_at (loc, OPT_Wstack_usage_, "stack usage might be unbounded");
else if (stack_usage > warn_stack_usage)
{
if (stack_usage_kind == DYNAMIC_BOUNDED)
- warning (OPT_Wstack_usage_, "stack usage might be %wd bytes",
- stack_usage);
+ warning_at (loc,
+ OPT_Wstack_usage_, "stack usage might be %wd bytes",
+ stack_usage);
else
- warning (OPT_Wstack_usage_, "stack usage is %wd bytes",
- stack_usage);
+ warning_at (loc, OPT_Wstack_usage_, "stack usage is %wd bytes",
+ stack_usage);
}
}
}
diff --git a/gcc-4.9/gcc/tree-profile.c b/gcc-4.9/gcc/tree-profile.c
index 4e2e8741e..b16525181 100644
--- a/gcc-4.9/gcc/tree-profile.c
+++ b/gcc-4.9/gcc/tree-profile.c
@@ -256,6 +256,9 @@ static tree GTY(()) gcov_lipo_merge_modu_edges = NULL_TREE;
/* extern gcov_unsigned_t __gcov_lipo_strict_inclusion */
static tree GTY(()) gcov_lipo_strict_inclusion = NULL_TREE;
+/* extern gcov_unsigned_t __gcov_lipo_comdat_algorithm */
+static tree GTY(()) gcov_lipo_comdat_algorithm = NULL_TREE;
+
/* Insert STMT_IF around given sequence of consecutive statements in the
same basic block starting with STMT_START, ending with STMT_END.
PROB is the probability of the taken branch. */
@@ -493,6 +496,13 @@ tree_init_dyn_ipa_parameters (void)
get_gcov_unsigned_t ());
init_comdat_decl (gcov_lipo_strict_inclusion,
PARAM_LIPO_WEAK_INCLUSION);
+ gcov_lipo_comdat_algorithm = build_decl (
+ UNKNOWN_LOCATION,
+ VAR_DECL,
+ get_identifier ("__gcov_lipo_comdat_algorithm"),
+ get_gcov_unsigned_t ());
+ init_comdat_decl (gcov_lipo_comdat_algorithm,
+ PARAM_LIPO_COMDAT_ALGORITHM);
}
}
@@ -1264,7 +1274,8 @@ tree_profiling (void)
function body from being deleted) won't be needed. */
if (L_IPO_COMP_MODE)
lipo_link_and_fixup ();
- init_node_map (true);
+ else
+ init_node_map (true);
FOR_EACH_DEFINED_FUNCTION (node)
diff --git a/gcc-4.9/gcc/tree-ssa-copy.c b/gcc-4.9/gcc/tree-ssa-copy.c
index 02f474355..a3d83921d 100644
--- a/gcc-4.9/gcc/tree-ssa-copy.c
+++ b/gcc-4.9/gcc/tree-ssa-copy.c
@@ -235,38 +235,26 @@ copy_prop_visit_cond_stmt (gimple stmt, edge *taken_edge_p)
enum ssa_prop_result retval = SSA_PROP_VARYING;
location_t loc = gimple_location (stmt);
- tree op0 = gimple_cond_lhs (stmt);
- tree op1 = gimple_cond_rhs (stmt);
+ tree op0 = valueize_val (gimple_cond_lhs (stmt));
+ tree op1 = valueize_val (gimple_cond_rhs (stmt));
- /* The only conditionals that we may be able to compute statically
- are predicates involving two SSA_NAMEs. */
- if (TREE_CODE (op0) == SSA_NAME && TREE_CODE (op1) == SSA_NAME)
+ /* See if we can determine the predicate's value. */
+ if (dump_file && (dump_flags & TDF_DETAILS))
{
- op0 = valueize_val (op0);
- op1 = valueize_val (op1);
-
- /* See if we can determine the predicate's value. */
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "Trying to determine truth value of ");
- fprintf (dump_file, "predicate ");
- print_gimple_stmt (dump_file, stmt, 0, 0);
- }
+ fprintf (dump_file, "Trying to determine truth value of ");
+ fprintf (dump_file, "predicate ");
+ print_gimple_stmt (dump_file, stmt, 0, 0);
+ }
- /* We can fold COND and get a useful result only when we have
- the same SSA_NAME on both sides of a comparison operator. */
- if (op0 == op1)
- {
- tree folded_cond = fold_binary_loc (loc, gimple_cond_code (stmt),
- boolean_type_node, op0, op1);
- if (folded_cond)
- {
- basic_block bb = gimple_bb (stmt);
- *taken_edge_p = find_taken_edge (bb, folded_cond);
- if (*taken_edge_p)
- retval = SSA_PROP_INTERESTING;
- }
- }
+ /* Fold COND and see whether we get a useful result. */
+ tree folded_cond = fold_binary_loc (loc, gimple_cond_code (stmt),
+ boolean_type_node, op0, op1);
+ if (folded_cond)
+ {
+ basic_block bb = gimple_bb (stmt);
+ *taken_edge_p = find_taken_edge (bb, folded_cond);
+ if (*taken_edge_p)
+ retval = SSA_PROP_INTERESTING;
}
if (dump_file && (dump_flags & TDF_DETAILS) && *taken_edge_p)
diff --git a/gcc-4.9/gcc/value-prof.c b/gcc-4.9/gcc/value-prof.c
index c0bd06538..62046de03 100644
--- a/gcc-4.9/gcc/value-prof.c
+++ b/gcc-4.9/gcc/value-prof.c
@@ -1276,7 +1276,17 @@ gimple_mod_subtract_transform (gimple_stmt_iterator *si)
return true;
}
-static pointer_map_t *cgraph_node_map;
+static pointer_map_t *cgraph_node_map = 0;
+
+/* Returns true if node graph is initialized. This
+ * is used to test if profile_id has been created
+ * for cgraph_nodes. */
+
+bool
+coverage_node_map_initialized_p (void)
+{
+ return cgraph_node_map != 0;
+}
/* Initialize map from PROFILE_ID to CGRAPH_NODE.
When LOCAL is true, the PROFILE_IDs are computed. when it is false we assume
@@ -1292,8 +1302,7 @@ init_node_map (bool local)
return;
FOR_EACH_DEFINED_FUNCTION (n)
- if (cgraph_function_with_gimple_body_p (n)
- && !cgraph_only_called_directly_p (n))
+ if (cgraph_function_with_gimple_body_p (n))
{
void **val;
if (local)
diff --git a/gcc-4.9/gnattools/ChangeLog b/gcc-4.9/gnattools/ChangeLog
index 8da446568..ca1c728af 100644
--- a/gcc-4.9/gnattools/ChangeLog
+++ b/gcc-4.9/gnattools/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/include/ChangeLog b/gcc-4.9/include/ChangeLog
index c69467b30..5023227dd 100644
--- a/gcc-4.9/include/ChangeLog
+++ b/gcc-4.9/include/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/intl/ChangeLog b/gcc-4.9/intl/ChangeLog
index 83ceb0a81..4a30e7b0f 100644
--- a/gcc-4.9/intl/ChangeLog
+++ b/gcc-4.9/intl/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libada/ChangeLog b/gcc-4.9/libada/ChangeLog
index dcabfa932..94ea2e00a 100644
--- a/gcc-4.9/libada/ChangeLog
+++ b/gcc-4.9/libada/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libatomic/ChangeLog b/gcc-4.9/libatomic/ChangeLog
index 9a546c115..f78862ff9 100644
--- a/gcc-4.9/libatomic/ChangeLog
+++ b/gcc-4.9/libatomic/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libbacktrace/ChangeLog b/gcc-4.9/libbacktrace/ChangeLog
index 8bcc677fd..8acd47243 100644
--- a/gcc-4.9/libbacktrace/ChangeLog
+++ b/gcc-4.9/libbacktrace/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-05-08 Ian Lance Taylor <iant@google.com>
Backport from mainline:
diff --git a/gcc-4.9/libcilkrts/ChangeLog b/gcc-4.9/libcilkrts/ChangeLog
index bb750773b..5f369830d 100644
--- a/gcc-4.9/libcilkrts/ChangeLog
+++ b/gcc-4.9/libcilkrts/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libcpp/ChangeLog b/gcc-4.9/libcpp/ChangeLog
index e0e39e37f..32bb84f94 100644
--- a/gcc-4.9/libcpp/ChangeLog
+++ b/gcc-4.9/libcpp/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
diff --git a/gcc-4.9/libcpp/po/ChangeLog b/gcc-4.9/libcpp/po/ChangeLog
index 49879ab13..b9f60389e 100644
--- a/gcc-4.9/libcpp/po/ChangeLog
+++ b/gcc-4.9/libcpp/po/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libdecnumber/ChangeLog b/gcc-4.9/libdecnumber/ChangeLog
index 367babbe9..c3215a6e8 100644
--- a/gcc-4.9/libdecnumber/ChangeLog
+++ b/gcc-4.9/libdecnumber/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libffi/ChangeLog b/gcc-4.9/libffi/ChangeLog
index bc2ab9c6c..6b22f6930 100644
--- a/gcc-4.9/libffi/ChangeLog
+++ b/gcc-4.9/libffi/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libgcc/ChangeLog b/gcc-4.9/libgcc/ChangeLog
index 9f17a7d14..1edf552db 100644
--- a/gcc-4.9/libgcc/ChangeLog
+++ b/gcc-4.9/libgcc/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-07-14 Richard Biener <rguenther@suse.de>
Backport r212520 from trunk.
* libgcov.h (struct gcov_fn_info): Make ctrs size 1.
diff --git a/gcc-4.9/libgcc/config/libbid/ChangeLog b/gcc-4.9/libgcc/config/libbid/ChangeLog
index 60132c466..c3f83862a 100644
--- a/gcc-4.9/libgcc/config/libbid/ChangeLog
+++ b/gcc-4.9/libgcc/config/libbid/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libgcc/dyn-ipa.c b/gcc-4.9/libgcc/dyn-ipa.c
index eb5ae9cc9..e66b02bbc 100644
--- a/gcc-4.9/libgcc/dyn-ipa.c
+++ b/gcc-4.9/libgcc/dyn-ipa.c
@@ -54,6 +54,7 @@ struct dyn_cgraph_edge
struct dyn_cgraph_edge *next_caller;
struct dyn_cgraph_edge *next_callee;
gcov_type count;
+ int indirect;
};
struct dyn_module_info
@@ -78,6 +79,36 @@ struct dyn_cgraph
unsigned num_nodes_executed;
/* used by new algorithm */
struct modu_node *modu_nodes;
+ /* Set indexed by lineno_checksum, returns a linked list of
+ checksum_alias_info structs. */
+ struct dyn_pointer_set *lineno_pointer_sets;
+};
+
+/* Struct holding information for functions with the same lineno_checksum. */
+struct lineno_checksum_alias
+{
+ struct checksum_alias_info *cfg_checksum_list;
+ unsigned lineno_checksum;
+};
+
+/* Struct holding information about functions with the same lineno and cfg
+ checksums. */
+struct checksum_alias_info
+{
+ struct checksum_alias_info *next_cfg_checksum;
+ struct checksum_alias *alias_list;
+ unsigned cfg_checksum;
+};
+
+/* Implements list of guid and corresponding fi_ptr for functions with matching
+ checksums. */
+struct checksum_alias
+{
+ struct checksum_alias *next_alias;
+ gcov_type guid;
+ const struct gcov_fn_info *fi_ptr;
+ /* Does this function have all-zero arc counts? */
+ int zero_counts;
};
/* Module info is stored in dyn_caph->sup_modules
@@ -141,6 +172,7 @@ extern gcov_unsigned_t __gcov_lipo_random_group_size;
extern gcov_unsigned_t __gcov_lipo_propagate_scale;
extern gcov_unsigned_t __gcov_lipo_dump_cgraph;
extern gcov_unsigned_t __gcov_lipo_max_mem;
+extern gcov_unsigned_t __gcov_lipo_comdat_algorithm;
extern gcov_unsigned_t __gcov_lipo_grouping_algorithm;
extern gcov_unsigned_t __gcov_lipo_merge_modu_edges;
extern gcov_unsigned_t __gcov_lipo_weak_inclusion;
@@ -149,7 +181,7 @@ extern gcov_unsigned_t __gcov_lipo_weak_inclusion;
void __gcov_build_callgraph (void) {}
#else
-void __gcov_compute_module_groups (void) ATTRIBUTE_HIDDEN;
+int __gcov_compute_module_groups (void) ATTRIBUTE_HIDDEN;
void __gcov_finalize_dyn_callgraph (void) ATTRIBUTE_HIDDEN;
static void gcov_dump_callgraph (gcov_type);
static void gcov_dump_cgraph_node_short (struct dyn_cgraph_node *node);
@@ -173,6 +205,7 @@ pointer_set_create (unsigned (*get_key) (const void *));
static struct dyn_cgraph the_dyn_call_graph;
static int total_zero_count = 0;
static int total_insane_count = 0;
+static int fixup_type = 0;
enum GROUPING_ALGORITHM
{
@@ -185,6 +218,24 @@ static int flag_weak_inclusion;
static int flag_use_existing_grouping;
static gcov_unsigned_t mem_threshold;
+gcov_type
+gcov_find_new_ic_target (gcov_type caller_guid, gcov_type callee_guid);
+void
+__gcov_dyn_ipa_merge_add (gcov_type *dest, gcov_type *src, unsigned n_counters);
+void
+__gcov_dyn_ipa_merge_ior (gcov_type *dest, gcov_type *src, unsigned n_counters);
+void
+__gcov_dyn_ipa_merge_dc (gcov_type *dest, gcov_type *src, unsigned n_counters);
+void
+__gcov_dyn_ipa_merge_icall_topn (gcov_type *dest, gcov_type *src,
+ unsigned n_counters);
+void
+__gcov_dyn_ipa_merge_single (gcov_type *dest, gcov_type *src,
+ unsigned n_counters);
+void
+__gcov_dyn_ipa_merge_delta (gcov_type *dest, gcov_type *src,
+ unsigned n_counters);
+
/* Returns 0 if no dump is enabled. Returns 1 if text form graph
dump is enabled. Returns 2 if .dot form dump is enabled. */
@@ -318,6 +369,102 @@ gcov_info_get_key (const void *p)
return get_module_ident ((const struct gcov_info *)p);
}
+/* The lineno_checksum value in P is the key for lineno_pointer_sets. */
+
+static inline unsigned
+lineno_checksum_get_key (const void *p)
+{
+ return ((const struct lineno_checksum_alias *) p)->lineno_checksum;
+}
+
+/* Create a new checksum_alias struct for function with GUID, FI_PTR,
+ and ZERO_COUNTS flag. Prepends to list NEXT and returns new struct. */
+
+static struct checksum_alias *
+new_checksum_alias (gcov_type guid, const struct gcov_fn_info *fi_ptr,
+ int zero_counts,
+ struct checksum_alias *next)
+{
+ struct checksum_alias *alias = XNEW (struct checksum_alias);
+ alias->next_alias = next;
+ alias->fi_ptr = fi_ptr;
+ alias->guid = guid;
+ alias->zero_counts = zero_counts;
+ return alias;
+}
+
+/* Locate the checksum_alias_info in LIST that matches CFG_CHECKSUM. */
+
+static struct checksum_alias_info *
+find_cfg_checksum (struct checksum_alias_info *list, unsigned cfg_checksum)
+{
+ for (; list; list = list->next_cfg_checksum)
+ {
+ if (list->cfg_checksum == cfg_checksum)
+ return list;
+ }
+ return NULL;
+}
+
+/* Insert a new checksum_alias struct into LIST for function with
+ CFG_CHECKSUM and associated GUID, FI_PTR, and ZERO_COUNTS flag. */
+
+static struct checksum_alias_info *
+cfg_checksum_insert (unsigned cfg_checksum, gcov_type guid,
+ const struct gcov_fn_info *fi_ptr, int zero_counts,
+ struct checksum_alias_info *list)
+{
+ struct checksum_alias_info *alias_info;
+ alias_info = find_cfg_checksum (list, cfg_checksum);
+ if (alias_info)
+ {
+ gcc_assert (alias_info->alias_list);
+ alias_info->alias_list = new_checksum_alias (guid, fi_ptr, zero_counts,
+ alias_info->alias_list);
+ return list;
+ }
+ else
+ {
+ alias_info = XNEW (struct checksum_alias_info);
+ alias_info->next_cfg_checksum = list;
+ alias_info->cfg_checksum = cfg_checksum;
+ alias_info->alias_list = new_checksum_alias (guid, fi_ptr, zero_counts,
+ NULL);
+ return alias_info;
+ }
+}
+
+/* Insert a new checksum_alias struct into lineno_pointer_sets for function with
+ LINENO_CHECKSUM and CFG_CHECKSUM with associated GUID, FI_PTR, and
+ ZERO_COUNTS flag. */
+
+static void
+checksum_set_insert (unsigned lineno_checksum, unsigned cfg_checksum,
+ gcov_type guid, const struct gcov_fn_info *fi_ptr,
+ int zero_counts)
+{
+ struct dyn_pointer_set *p = the_dyn_call_graph.lineno_pointer_sets;
+ if (!p)
+ the_dyn_call_graph.lineno_pointer_sets = p =
+ pointer_set_create (lineno_checksum_get_key);
+ struct lineno_checksum_alias **m = (struct lineno_checksum_alias **)
+ pointer_set_find_or_insert (p, lineno_checksum);
+ if (*m)
+ {
+ (*m)->cfg_checksum_list = cfg_checksum_insert (cfg_checksum, guid,
+ fi_ptr, zero_counts,
+ (*m)->cfg_checksum_list);
+ }
+ else
+ {
+ *m = XNEW (struct lineno_checksum_alias);
+ (*m)->lineno_checksum = lineno_checksum;
+ (*m)->cfg_checksum_list = cfg_checksum_insert (cfg_checksum, guid,
+ fi_ptr, zero_counts, NULL);
+ p->n_elements++;
+ }
+}
+
static struct dyn_pointer_set *
get_exported_to (unsigned module_ident)
{
@@ -428,6 +575,10 @@ init_dyn_call_graph (void)
fprintf (stderr, "Group mem limit: %u KB \n",
__gcov_lipo_max_mem);
+ if (do_dump)
+ fprintf (stderr, "COMDAT fixup algorithm: %u\n",
+ __gcov_lipo_comdat_algorithm);
+
for (; gi_ptr; gi_ptr = gi_ptr->next)
{
/* mod_idx is module_ident - 1. */
@@ -563,12 +714,13 @@ gcov_add_in_edge (struct dyn_cgraph_node *callee,
}
/* Add a call graph edge between caller CALLER and callee CALLEE.
- The edge count is COUNT. */
+ The edge count is COUNT and INDIRECT flags whether the call was
+ direct or indirect. */
static void
gcov_add_cgraph_edge (struct dyn_cgraph_node *caller,
struct dyn_cgraph_node *callee,
- gcov_type count)
+ gcov_type count, int indirect)
{
struct dyn_cgraph_edge *new_edge = XNEW (struct dyn_cgraph_edge);
new_edge->caller = caller;
@@ -576,6 +728,7 @@ gcov_add_cgraph_edge (struct dyn_cgraph_node *caller,
new_edge->count = count;
new_edge->next_caller = 0;
new_edge->next_callee = 0;
+ new_edge->indirect = indirect;
gcov_add_out_edge (caller, new_edge);
gcov_add_in_edge (callee, new_edge);
@@ -609,7 +762,7 @@ gcov_build_callgraph_dc_fn (struct dyn_cgraph_node *caller,
total_insane_count++;
continue;
}
- gcov_add_cgraph_edge (caller, callee, count);
+ gcov_add_cgraph_edge (caller, callee, count, 0);
}
}
@@ -643,7 +796,7 @@ gcov_build_callgraph_ic_fn (struct dyn_cgraph_node *caller,
total_insane_count++;
continue;
}
- gcov_add_cgraph_edge (caller, callee, count);
+ gcov_add_cgraph_edge (caller, callee, count, 1);
}
}
}
@@ -690,7 +843,7 @@ gcov_build_callgraph (void)
if (i == GCOV_COUNTER_ICALL_TOPNV)
gcov_build_callgraph_ic_fn (caller, ci_ptr->values, ci_ptr->num);
- if (i == GCOV_COUNTER_ARCS && 0)
+ if (i == GCOV_COUNTER_ARCS)
{
gcov_type total_arc_count = 0;
unsigned arc;
@@ -698,6 +851,10 @@ gcov_build_callgraph (void)
total_arc_count += ci_ptr->values[arc];
if (total_arc_count != 0)
the_dyn_call_graph.num_nodes_executed++;
+ if (fixup_type)
+ checksum_set_insert (fi_ptr->lineno_checksum,
+ fi_ptr->cfg_checksum, caller->guid,
+ fi_ptr, total_arc_count == 0);
}
ci_ptr++;
}
@@ -2290,9 +2447,622 @@ read_modu_groups_from_imports_files (void)
#endif /* IN_GCOV_TOOL */
}
-/* Compute module groups needed for L-IPO compilation. */
+/* Scan functions in MOD_INFO and return gcov_fn_info for matching
+ FUNC_ID. */
+
+static const struct gcov_fn_info *
+find_fn_info_from_func_id (struct gcov_info *mod_info, unsigned func_id)
+{
+ unsigned j;
+ for (j = 0; j < mod_info->n_functions; j++)
+ {
+ const struct gcov_fn_info *fi_ptr = mod_info->functions[j];
+ if (fi_ptr->ident == func_id)
+ return fi_ptr;
+ }
+ gcc_assert (0);
+ return NULL;
+}
+
+/* Look for a function in the same module as CALLER_GUID that has
+ the same lineno and cfg checksums as CALLEE_GUID. Return the
+ guid of the matching function if exactly one is found, 0 otherwise. */
+
+gcov_type
+gcov_find_new_ic_target (gcov_type caller_guid, gcov_type callee_guid)
+{
+ /* Obtain the callee's function info. */
+ unsigned callee_mod_id = get_module_ident_from_func_glob_uid (callee_guid);
+ struct gcov_info *callee_mod_info = get_module_info (callee_mod_id);
+ unsigned callee_func_id = get_intra_module_func_id (callee_guid);
+ const struct gcov_fn_info *callee_fi_ptr
+ = find_fn_info_from_func_id (callee_mod_info, callee_func_id);
+
+ /* Obtain the list of checksum_alias structures for functions with
+ the same lineno and cfg checksum as callee. */
+ struct dyn_pointer_set *p = the_dyn_call_graph.lineno_pointer_sets;
+ gcc_assert (p);
+ struct lineno_checksum_alias **line_alias = (struct lineno_checksum_alias **)
+ pointer_set_find_or_insert (p, callee_fi_ptr->lineno_checksum);
+ gcc_assert (*line_alias);
+ struct checksum_alias_info *cfg_alias
+ = find_cfg_checksum ((*line_alias)->cfg_checksum_list,
+ callee_fi_ptr->cfg_checksum);
+ gcc_assert (cfg_alias);
+
+
+ /* Scan the list of checksum aliases for one that is located in caller's
+ module. */
+ gcov_type new_guid = 0;
+ unsigned caller_mod_id = get_module_ident_from_func_glob_uid (caller_guid);
+ struct checksum_alias *alias;
+ for (alias = cfg_alias->alias_list; alias;
+ alias = alias->next_alias)
+ {
+ if (get_module_ident_from_func_glob_uid (alias->guid)
+ == caller_mod_id)
+ {
+ /* Give up if we found multiple matches. */
+ if (new_guid)
+ return 0;
+ new_guid = alias->guid;
+ }
+ }
+
+ /* We found exactly one match, return it. */
+ return new_guid;
+}
+
+/* If any of CALLER's indirect call counters in CI_PTR has a target that is
+ not in CALLER's module group, see if we can find a copy of the function in
+ CALLER's module. If so, replace the target to point to that copy. See
+ comments for gcov_fixup_icall_profile on why we would want to do this.
+ Return 1 if any icall profiles were updated, 0 otherwise. */
+
+static int
+gcov_fixup_ic_fn (struct dyn_cgraph_node *caller,
+ const struct gcov_ctr_info *ci_ptr)
+{
+ unsigned i, j;
+ int changed = 0;
+ gcov_type *icall_counters = ci_ptr->values;
+ unsigned n_counts = ci_ptr->num;
+ int do_dump = (do_cgraph_dump () != 0);
+
+ unsigned caller_mod_id = get_module_ident_from_func_glob_uid (caller->guid);
+ struct dyn_pointer_set *imported_mods = get_imported_modus (caller_mod_id);
+ for (i = 0; i < n_counts; i += GCOV_ICALL_TOPN_NCOUNTS)
+ {
+ gcov_type *value_array = &icall_counters[i + 1];
+ for (j = 0; j < GCOV_ICALL_TOPN_NCOUNTS - 1; j += 2)
+ {
+ struct dyn_cgraph_node *callee;
+ gcov_type count;
+ gcov_type callee_guid = value_array[j];
+
+ count = value_array[j + 1];
+ if (count == 0)
+ continue;
+
+ callee = get_cgraph_node (callee_guid);
+ if (!callee)
+ continue;
+
+ /* Now check if callee is in the module group of caller. If so,
+ no need for any fixup. */
+ unsigned callee_mod_id
+ = get_module_ident_from_func_glob_uid (callee_guid);
+ if (pointer_set_contains (imported_mods, callee_mod_id))
+ continue;
+
+ /* Attempt to find a copy of callee in caller's module. */
+ gcov_type new_callee_guid
+ = gcov_find_new_ic_target (caller->guid, callee_guid);
+
+ if (do_dump == 1)
+ {
+ struct gcov_info *caller_mod_info
+ = the_dyn_call_graph.modules[caller_mod_id - 1];
+ struct gcov_info *callee_mod_info
+ = the_dyn_call_graph.modules[callee_mod_id - 1];
+ fprintf (stderr,
+ "Fixup icall %u:%u -> %u:%u with count %lld "
+ "(%s -> %s): ",
+ caller_mod_id, get_intra_module_func_id (caller->guid),
+ callee_mod_id, get_intra_module_func_id (callee_guid),
+ (long long) count,
+ caller_mod_info->mod_info->source_filename,
+ callee_mod_info->mod_info->source_filename);
+ if (!new_callee_guid)
+ fprintf (stderr,"No target found\n");
+ else
+ fprintf (stderr,"Found new target %u:%u (%llx)\n",
+ get_module_ident_from_func_glob_uid (new_callee_guid),
+ get_intra_module_func_id (new_callee_guid),
+ (long long) new_callee_guid);
+ }
+
+ if (new_callee_guid)
+ {
+ /* Update the profile info and note the need for a profile
+ counter rewrite. */
+ value_array[j] = new_callee_guid;
+ changed = 1;
+ }
+ }
+ }
+ return changed;
+}
+
+/* Look for indirect call profiles that target callee's outside of the caller's
+ module group, and see if we can find a copy of the function in caller's own
+ module. If so, replace the profile target to point to that copy. This is
+ useful when the callee is a COMDAT, in which case there should be a copy
+ within CALLER's module. The linker would have selected a single copy of
+ COMDAT and all indirect call profiles would target that copy of the callee,
+ which might not end up in the module group of CALLER.
+ Return 1 if any icall profiles were updated, 0 otherwise. */
+
+static int
+gcov_fixup_icall_profile (void)
+{
+ struct gcov_info *gi_ptr;
+ unsigned m_ix;
+ int changed = 0;
+
+ for (m_ix = 0; m_ix < the_dyn_call_graph.num_modules; m_ix++)
+ {
+ const struct gcov_fn_info *fi_ptr;
+ unsigned f_ix, i;
+
+ gi_ptr = the_dyn_call_graph.modules[m_ix];
+ if (gi_ptr == NULL)
+ continue;
+
+ for (f_ix = 0; f_ix < gi_ptr->n_functions; f_ix++)
+ {
+ struct dyn_cgraph_node *caller;
+ const struct gcov_ctr_info *ci_ptr = 0;
+
+ fi_ptr = gi_ptr->functions[f_ix];
+ ci_ptr = fi_ptr->ctrs;
+
+ caller = (struct dyn_cgraph_node *) *(pointer_set_find_or_insert
+ (the_dyn_call_graph.call_graph_nodes[m_ix],
+ fi_ptr->ident));
+ gcc_assert (caller);
+
+ for (i = 0; i < GCOV_COUNTERS; i++)
+ {
+ if (!gi_ptr->merge[i])
+ continue;
+
+ if (i == GCOV_COUNTER_ICALL_TOPNV)
+ changed |= gcov_fixup_ic_fn (caller, ci_ptr);
+
+ ci_ptr++;
+ }
+ }
+ }
+ return changed;
+}
+
+/* Create, zero-initialize and return an array to hold merged counter
+ values. */
+
+static struct gcov_ctr_info *
+init_merged_ctrs (void)
+{
+ struct gcov_ctr_info *merged_ctrs = XNEWVEC (struct gcov_ctr_info,
+ GCOV_COUNTERS);
+ int i;
+ for (i = 0; i < GCOV_COUNTERS; i++)
+ {
+ merged_ctrs[i].num = 0;
+ merged_ctrs[i].values = NULL;
+ }
+ return merged_ctrs;
+}
+
+/* The profile merging function that just adds N_COUNTERS counters from array
+ SRC to those in DEST. Adapted from __gcov_merge_add. */
+
+void
+__gcov_dyn_ipa_merge_add (gcov_type *dest, gcov_type *src, unsigned n_counters)
+{
+ for (; n_counters; dest++, src++, n_counters--)
+ *dest += *src;
+}
+
+/* The profile merging function that just ors N_COUNTERS counters from array
+ SRC to those in DEST. Adapted from __gcov_merge_ior. */
+
+void
+__gcov_dyn_ipa_merge_ior (gcov_type *dest, gcov_type *src, unsigned n_counters)
+{
+ for (; n_counters; dest++, src++, n_counters--)
+ *dest |= *src;
+}
+
+
+/* The profile merging function that just merges N_COUNTERS direct call counters
+ from array SRC to those in DEST. Adapted from __gcov_merge_dc. */
+
+void
+__gcov_dyn_ipa_merge_dc (gcov_type *dest, gcov_type *src, unsigned n_counters)
+{
+ unsigned i;
+
+ gcc_assert (!(n_counters % 2));
+ for (i = 0; i < n_counters; i += 2)
+ {
+ gcov_type global_id = src[i];
+ if (!global_id)
+ continue;
+
+ /* Simply skip non-matching call targets. */
+ if (dest[i] && dest[i] != global_id)
+ {
+ continue;
+ }
+ dest[i] = global_id;
+
+ dest[i + 1] += src[i + 1];
+ }
+}
+
+/* The profile merging function that just merges N_COUNTERS indirect call
+ counters from array SRC to those in DEST. Adapted from
+ __gcov_merge_icall_topn. */
+
+void
+__gcov_dyn_ipa_merge_icall_topn (gcov_type *dest, gcov_type *src,
+ unsigned n_counters)
+{
+ unsigned i, j, k, m;
+
+ gcc_assert (!(n_counters % GCOV_ICALL_TOPN_NCOUNTS));
+ for (i = 0; i < n_counters; i += GCOV_ICALL_TOPN_NCOUNTS)
+ {
+ /* Skip the number_of_eviction entry (in dest[i]). */
+ gcov_type *value_array = &dest[i + 1];
+ unsigned tmp_size = 2 * (GCOV_ICALL_TOPN_NCOUNTS - 1);
+ gcov_type *tmp_array
+ = (gcov_type *) alloca (tmp_size * sizeof (gcov_type));
+
+ for (j = 0; j < tmp_size; j++)
+ tmp_array[j] = 0;
+
+ for (j = 0; j < GCOV_ICALL_TOPN_NCOUNTS - 1; j += 2)
+ {
+ tmp_array[j] = value_array[j];
+ tmp_array[j + 1] = value_array [j + 1];
+ }
+
+ /* Skip the number_of_eviction entry (in src[i]). */
+ gcov_type *src_value_array = &src[i + 1];
+ for (k = 0; k < GCOV_ICALL_TOPN_NCOUNTS - 1; k += 2)
+ {
+ int found = 0;
+ gcov_type global_id = src_value_array[k];
+ gcov_type call_count = src_value_array[k + 1];
+ for (m = 0; m < j; m += 2)
+ {
+ if (tmp_array[m] == global_id)
+ {
+ found = 1;
+ tmp_array[m + 1] += call_count;
+ break;
+ }
+ }
+ if (!found)
+ {
+ tmp_array[j] = global_id;
+ tmp_array[j + 1] = call_count;
+ j += 2;
+ }
+ }
+ /* Now sort the temp array. */
+ gcov_sort_n_vals (tmp_array, j);
+
+ /* Now copy back the top half of the temp array. */
+ for (k = 0; k < GCOV_ICALL_TOPN_NCOUNTS - 1; k += 2)
+ {
+ value_array[k] = tmp_array[k];
+ value_array[k + 1] = tmp_array[k + 1];
+ }
+ }
+}
+
+
+/* Time profiles are merged so that minimum from all valid (greater than zero)
+ is stored. There could be a fork that creates new counters. To have
+ the profile stable, we chosen to pick the smallest function visit time. */
+
void
+__gcov_dyn_ipa_merge_time_profile (gcov_type *dest, gcov_type *src,
+ unsigned n_counters)
+{
+ unsigned i;
+ gcov_type value;
+
+ for (i = 0; i < n_counters; i++)
+ {
+ value = src[i];
+
+ if (value && (!dest[i] || value < dest[i]))
+ dest[i] = value;
+ }
+}
+
+
+/* The profile merging function that just merges N_COUNTERS most common value
+ counters from array SRC to those in DEST. Adapted from
+ __gcov_merge_single. */
+
+void
+__gcov_dyn_ipa_merge_single (gcov_type *dest, gcov_type *src,
+ unsigned n_counters)
+{
+ unsigned i, n_measures;
+ gcov_type value, counter, all;
+
+ gcc_assert (!(n_counters % 3));
+ n_measures = n_counters / 3;
+ for (i = 0; i < n_measures; i++, dest += 3, src += 3)
+ {
+ value = src[0];
+ counter = src[1];
+ all = src[2];
+
+ if (dest[0] == value)
+ dest[1] += counter;
+ else if (counter > dest[1])
+ {
+ dest[0] = value;
+ dest[1] = counter - dest[1];
+ }
+ else
+ dest[1] -= counter;
+ dest[2] += all;
+ }
+}
+
+/* The profile merging function that just merges N_COUNTERS most common
+ difference counters from array SRC to those in DEST. Adapted from
+ __gcov_merge_delta. */
+
+void
+__gcov_dyn_ipa_merge_delta (gcov_type *dest, gcov_type *src,
+ unsigned n_counters)
+{
+ unsigned i, n_measures;
+ gcov_type value, counter, all;
+
+ gcc_assert (!(n_counters % 4));
+ n_measures = n_counters / 4;
+ for (i = 0; i < n_measures; i++, dest += 4, src += 4)
+ {
+ value = src[1];
+ counter = src[2];
+ all = src[3];
+
+ if (dest[1] == value)
+ dest[2] += counter;
+ else if (counter > dest[2])
+ {
+ dest[1] = value;
+ dest[2] = counter - dest[2];
+ }
+ else
+ dest[2] -= counter;
+ dest[3] += all;
+ }
+}
+
+/* Type of function used to merge counters. */
+typedef void (*gcov_dyn_ipa_merge_fn) (gcov_type *, gcov_type *,
+ gcov_unsigned_t);
+
+/* Merge functions for counters. */
+#define DEF_GCOV_COUNTER(COUNTER, NAME, FN_TYPE) __gcov_dyn_ipa_merge ## FN_TYPE,
+static gcov_dyn_ipa_merge_fn ctr_merge_functions[GCOV_COUNTERS] = {
+#include "gcov-counter.def"
+};
+#undef DEF_GCOV_COUNTER
+
+#if 0
+static gcov_dyn_ipa_merge_fn ctr_merge_functions[GCOV_COUNTERS] = {
+ __gcov_dyn_ipa_merge_add,
+ __gcov_dyn_ipa_merge_add,
+ __gcov_dyn_ipa_merge_add,
+ __gcov_dyn_ipa_merge_single,
+ __gcov_dyn_ipa_merge_delta,
+ __gcov_dyn_ipa_merge_single,
+ __gcov_dyn_ipa_merge_add,
+ __gcov_dyn_ipa_merge_ior,
+ __gcov_dyn_ipa_merge_icall_topn,
+ __gcov_dyn_ipa_merge_dc,
+};
+#endif
+
+/* Copy counters from SRC_CTRS array to DEST_CTRS array, where SRC_CTRS is
+ indexed by the GCOV_COUNTER type, and DEST_CTRS is an array holding only
+ the mergable counters to emit to the gcda file for DEST_GUID. */
+
+static void
+copy_ctrs (const struct gcov_ctr_info *dest_ctrs, gcov_type dest_guid,
+ const struct gcov_ctr_info *src_ctrs)
+{
+ unsigned dest_mod_id
+ = get_module_ident_from_func_glob_uid (dest_guid);
+ struct gcov_info *dest_mod_info = the_dyn_call_graph.modules[dest_mod_id - 1];
+ int i;
+ for (i = 0; i < GCOV_COUNTERS; i++)
+ {
+ if (!dest_mod_info->merge[i])
+ continue;
+
+ gcov_unsigned_t num = dest_ctrs->num;
+ // This could be different if code was optimized differently
+ // (e.g. early-inlined in some modules but not others).
+ // If they are different then just punt on merge of this counter
+ // (what about other counters?).
+ //gcc_assert (dest_ctrs[i].num == num);
+ if (num && src_ctrs[i].num == num)
+ (*ctr_merge_functions[i]) (dest_ctrs->values,
+ src_ctrs[i].values, num);
+ dest_ctrs++;
+ }
+}
+
+/* Merge counters from SRC_CTRS array to DEST_CTRS array, where DEST_CTRS is
+ indexed by the GCOV_COUNTER type, and SRC_CTRS is an array holding only
+ the mergable counters from the gcda file for SRC_GUID. */
+
+static void
+merge_ctrs (struct gcov_ctr_info *dest_ctrs,
+ const struct gcov_ctr_info *src_ctrs, gcov_type src_guid)
+{
+ unsigned src_mod_id
+ = get_module_ident_from_func_glob_uid (src_guid);
+ struct gcov_info *src_mod_info = the_dyn_call_graph.modules[src_mod_id - 1];
+ unsigned i, j;
+
+ for (i = 0; i < GCOV_COUNTERS; i++)
+ {
+ if (!src_mod_info->merge[i])
+ continue;
+
+ gcov_unsigned_t num = src_ctrs->num;
+ // This could be different if code was optimized differently
+ // (e.g. call counters when ipa-inlined in some modules but not others?).
+ // If they are different then just punt on merge of this counter
+ // (what about other counters?).
+ //gcc_assert (dest_ctrs[i].num == num);
+ if (num)
+ {
+ /* If this is the first source counter array containing counters for
+ this counter type, allocate the associated number of counter values
+ in the dest counter array. */
+ if (!dest_ctrs[i].num)
+ {
+ dest_ctrs[i].values = XNEWVEC (gcov_type, num);
+ for (j = 0; j < num; j++)
+ dest_ctrs[i].values[j] = 0;
+ dest_ctrs[i].num = num;
+ }
+ if (dest_ctrs[i].num == num)
+ (*ctr_merge_functions[i]) (dest_ctrs[i].values,
+ src_ctrs->values, num);
+ }
+ src_ctrs++;
+ }
+}
+
+/* Walks the set of functions that have the same lineno and cfg checksum, and
+ performs counter merging. INFO contains the checksum_alias_info structure
+ for a given lineno and cfg checksum combination. CHANGED points
+ to a flag that should be set to 1 if any fixups were applied. */
+
+static int
+gcov_fixup_counters_checksum (const struct checksum_alias_info *info,
+ int *changed)
+{
+ /* See if there are any zero count functions to fix. */
+ int found = 0;
+ struct checksum_alias *alias;
+ for (alias = info->alias_list; alias;
+ alias = alias->next_alias)
+ {
+ if (alias->zero_counts)
+ {
+ found = 1;
+ break;
+ }
+ }
+ if (!found)
+ return 1;
+
+ /* Walk the aliases and merge the non-zero counters into a dummy copy. */
+ struct gcov_ctr_info *merged_ctrs = init_merged_ctrs ();
+ found = 0;
+ for (alias = info->alias_list; alias;
+ alias = alias->next_alias)
+ {
+ if (alias->zero_counts)
+ continue;
+ merge_ctrs (merged_ctrs, alias->fi_ptr->ctrs, alias->guid);
+ found = 1;
+ }
+
+ /* Check if we found a non-zero count function to fix up from. */
+ if (!found)
+ return 1;
+
+ /* At this point we know we have a zero count function to fixup, and data
+ from which to fix it up. */
+ *changed = 1;
+
+ /* Walk them again and copy the merged counters into 0-count copies. */
+ for (alias = info->alias_list; alias;
+ alias = alias->next_alias)
+ {
+ if (!alias->zero_counts)
+ continue;
+ copy_ctrs (alias->fi_ptr->ctrs, alias->guid, merged_ctrs);
+ }
+
+ return 1;
+}
+
+/* Walks the set of functions that have the same lineno_checksum, and
+ performs counter merging for functions that have the same cfg_checksum
+ as well. VALUE contains the lineno_checksum_alias structure for a
+ given lineno_checksum, and DATA1 contains a pointer to a flag that
+ should be set to 1 if any fixups were applied. */
+
+static int
+gcov_fixup_counters_lineno (const void *value,
+ void *data1,
+ void *data2 ATTRIBUTE_UNUSED,
+ void *data3 ATTRIBUTE_UNUSED)
+{
+ const struct lineno_checksum_alias *a
+ = (const struct lineno_checksum_alias*) value;
+ int *changed = (int *) data1;
+ struct checksum_alias_info *cfg_alias_list = a->cfg_checksum_list;
+ for (; cfg_alias_list; cfg_alias_list = cfg_alias_list->next_cfg_checksum)
+ {
+ gcov_fixup_counters_checksum (cfg_alias_list, changed);
+ }
+ return 1;
+}
+
+/* Routine to perform counter fixup for COMDAT functions with missing counters.
+ Returns 1 if any updates were performed, 0 otherwise. Walks the sets of
+ functions having the same lineno and cfg checksums and merges all non-zero
+ counters, copying the merged counters into any copies with all-zero counts.
+ This is done because the linker will chose one out-of-line copy of a COMDAT,
+ and only that copy will get non-zero counters. Other copies that were IPA
+ inlined may have non-zero counts, which we don't overwrite as they contain
+ more context-sensitive data. */
+
+static int
+gcov_fixup_zero_counters (void)
+{
+ int changed = 0;
+ pointer_set_traverse (the_dyn_call_graph.lineno_pointer_sets,
+ gcov_fixup_counters_lineno,
+ &changed, 0, 0);
+ return changed;
+}
+
+/* Compute module groups needed for L-IPO compilation. Returns 1 if any
+ counter fixups were applied, requiring a profile rewrite, 0 otherwise. */
+
+int
__gcov_compute_module_groups (void)
{
gcov_type cut_off_count;
@@ -2310,7 +3080,7 @@ __gcov_compute_module_groups (void)
fprintf (stderr, " Creating random grouping with %u:%u\n",
__gcov_lipo_random_seed, __gcov_lipo_random_group_size);
}
- return;
+ return 0;
}
else if (seed && max_group_size)
{
@@ -2324,15 +3094,21 @@ __gcov_compute_module_groups (void)
fprintf (stderr, " Creating random grouping with %s:%s\n",
seed, max_group_size);
}
- return;
+ return 0;
}
if (flag_use_existing_grouping)
{
read_modu_groups_from_imports_files ();
- return;
+ return 0;
}
+ const char *do_fixup = 0;
+ fixup_type = __gcov_lipo_comdat_algorithm;
+ do_fixup = getenv ("GCOV_DYN_DO_FIXUP");
+ if (do_fixup)
+ fixup_type = atoi (do_fixup);
+
/* First compute dynamic call graph. */
gcov_build_callgraph ();
@@ -2342,6 +3118,13 @@ __gcov_compute_module_groups (void)
gcov_dump_callgraph (cut_off_count);
+ int changed = 0;
+ if (fixup_type & 0x2)
+ changed |= gcov_fixup_zero_counters ();
+ if (fixup_type & 0x1)
+ changed |= gcov_fixup_icall_profile ();
+
+ return changed;
}
/* Dumper function for NODE. */
diff --git a/gcc-4.9/libgcc/libgcov-driver.c b/gcc-4.9/libgcc/libgcov-driver.c
index e829fe588..dc8cf362b 100644
--- a/gcc-4.9/libgcc/libgcov-driver.c
+++ b/gcc-4.9/libgcc/libgcov-driver.c
@@ -55,7 +55,7 @@ static gcov_unsigned_t gcov_cur_module_id = 0;
/* Dynamic call graph build and form module groups. */
-void __gcov_compute_module_groups (void) ATTRIBUTE_HIDDEN;
+int __gcov_compute_module_groups (void) ATTRIBUTE_HIDDEN;
void __gcov_finalize_dyn_callgraph (void) ATTRIBUTE_HIDDEN;
/* The following functions can be called from outside of this file. */
@@ -453,6 +453,49 @@ struct gcov_filename_aux{
/* Including system dependent components. */
#include "libgcov-driver-system.c"
+/* Scan through the current open gcda file corresponding to GI_PTR
+ to locate the end position of the last summary, returned in
+ SUMMARY_END_POS_P. Return 0 on success, -1 on error. */
+static int
+gcov_scan_summary_end (struct gcov_info *gi_ptr,
+ gcov_position_t *summary_end_pos_p)
+{
+ gcov_unsigned_t tag, version, stamp;
+ tag = gcov_read_unsigned ();
+ if (tag != GCOV_DATA_MAGIC)
+ {
+ gcov_error ("profiling:%s:Not a gcov data file\n", gi_filename);
+ return -1;
+ }
+
+ version = gcov_read_unsigned ();
+ if (!gcov_version (gi_ptr, version, gi_filename))
+ return -1;
+
+ stamp = gcov_read_unsigned ();
+ if (stamp != gi_ptr->stamp)
+ /* Read from a different compilation. Overwrite the file. */
+ return -1;
+
+ /* Look for program summary. */
+ while (1)
+ {
+ struct gcov_summary tmp;
+
+ *summary_end_pos_p = gcov_position ();
+ tag = gcov_read_unsigned ();
+ if (tag != GCOV_TAG_PROGRAM_SUMMARY)
+ break;
+
+ gcov_read_unsigned ();
+ gcov_read_summary (&tmp);
+ if (gcov_is_error ())
+ return -1;
+ }
+
+ return 0;
+}
+
/* This function merges counters in GI_PTR to an existing gcda file.
Return 0 on success.
Return -1 on error. In this case, caller will goto read_fatal. */
@@ -603,44 +646,13 @@ read_error:
return -1;
}
-/* Write counters in GI_PTR and the summary in PRG to a gcda file. In
- the case of appending to an existing file, SUMMARY_POS will be non-zero.
- We will write the file starting from SUMMAY_POS. */
+/* Write counters in GI_PTR to a gcda file starting from its current
+ location. */
static void
-gcov_exit_write_gcda (struct gcov_info *gi_ptr,
- const struct gcov_summary *prg_p,
- const gcov_position_t eof_pos,
- const gcov_position_t summary_pos)
+gcov_write_func_counters (struct gcov_info *gi_ptr)
{
unsigned f_ix;
- struct gcov_summary_buffer *next_sum_buffer;
-
- /* Write out the data. */
- if (!eof_pos)
- {
- gcov_write_tag_length (GCOV_DATA_MAGIC, GCOV_VERSION);
- gcov_write_unsigned (gi_ptr->stamp);
- }
-
- if (summary_pos)
- gcov_seek (summary_pos);
-
- /* Generate whole program statistics. */
- gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, prg_p);
-
- /* Rewrite all the summaries that were after the summary we merged
- into. This is necessary as the merged summary may have a different
- size due to the number of non-zero histogram entries changing after
- merging. */
-
- while (sum_buffer)
- {
- gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, &sum_buffer->summary);
- next_sum_buffer = sum_buffer->next;
- free (sum_buffer);
- sum_buffer = next_sum_buffer;
- }
/* Write execution counts for each function. */
for (f_ix = 0; f_ix != gi_ptr->n_functions; f_ix++)
@@ -700,6 +712,50 @@ gcov_exit_write_gcda (struct gcov_info *gi_ptr,
gcov_write_unsigned (0);
}
+/* Write counters in GI_PTR and the summary in PRG to a gcda file. In
+ the case of appending to an existing file, SUMMARY_POS will be non-zero.
+ We will write the file starting from SUMMAY_POS. */
+
+static void
+gcov_exit_write_gcda (struct gcov_info *gi_ptr,
+ const struct gcov_summary *prg_p,
+ const gcov_position_t eof_pos,
+ const gcov_position_t summary_pos)
+
+{
+ struct gcov_summary_buffer *next_sum_buffer;
+
+ /* Write out the data. */
+ if (!eof_pos)
+ {
+ gcov_write_tag_length (GCOV_DATA_MAGIC, GCOV_VERSION);
+ gcov_write_unsigned (gi_ptr->stamp);
+ }
+
+ if (summary_pos)
+ gcov_seek (summary_pos);
+ gcc_assert (!summary_pos || summary_pos == gcov_position ());
+
+ /* Generate whole program statistics. */
+ gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, prg_p);
+
+ /* Rewrite all the summaries that were after the summary we merged
+ into. This is necessary as the merged summary may have a different
+ size due to the number of non-zero histogram entries changing after
+ merging. */
+
+ while (sum_buffer)
+ {
+ gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, &sum_buffer->summary);
+ next_sum_buffer = sum_buffer->next;
+ free (sum_buffer);
+ sum_buffer = next_sum_buffer;
+ }
+
+ /* Write the counters. */
+ gcov_write_func_counters (gi_ptr);
+}
+
/* Helper function for merging summary.
Return -1 on error. Return 0 on success. */
@@ -964,7 +1020,9 @@ gcov_dump_module_info (struct gcov_filename_aux *gf)
{
struct gcov_info *gi_ptr;
- __gcov_compute_module_groups ();
+ /* Compute the module groups and record whether there were any
+ counter fixups applied that require rewriting the counters. */
+ int changed = __gcov_compute_module_groups ();
/* Now write out module group info. */
for (gi_ptr = __gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
@@ -974,8 +1032,27 @@ gcov_dump_module_info (struct gcov_filename_aux *gf)
if (gcov_exit_open_gcda_file (gi_ptr, gf) == -1)
continue;
+ if (changed)
+ {
+ /* Scan file to find the end of the summary section, which is
+ where we will start re-writing the counters. */
+ gcov_position_t summary_end_pos;
+ if (gcov_scan_summary_end (gi_ptr, &summary_end_pos) == -1)
+ gcov_error ("profiling:%s:Error scanning summaries\n",
+ gi_filename);
+ else
+ {
+ gcov_position_t eof_pos = gi_ptr->eof_pos;
+ gcov_rewrite ();
+ gcov_seek (summary_end_pos);
+ gcov_write_func_counters (gi_ptr);
+ gcc_assert (eof_pos == gi_ptr->eof_pos);
+ }
+ }
+ else
+ gcov_rewrite ();
+
/* Overwrite the zero word at the of the file. */
- gcov_rewrite ();
gcov_seek (gi_ptr->eof_pos);
gcov_write_module_infos (gi_ptr);
diff --git a/gcc-4.9/libgcc/libgcov-interface.c b/gcc-4.9/libgcc/libgcov-interface.c
index 77d839512..a3effa411 100644
--- a/gcc-4.9/libgcc/libgcov-interface.c
+++ b/gcc-4.9/libgcc/libgcov-interface.c
@@ -129,6 +129,100 @@ unsigned int __gcov_profiling_for_test_coverage (void)
return __gcov_test_coverage;
}
+typedef void (*gcov_dumper_type) (void);
+struct dumper_entry
+{
+ gcov_dumper_type dumper;
+ struct dumper_entry *next_dumper;
+};
+
+static struct dumper_entry this_dumper = {&__gcov_dump, 0};
+
+/* global dumper list with default visibilty. */
+struct dumper_entry *__gcov_dumper_list;
+
+#ifdef __GTHREAD_MUTEX_INIT
+__gthread_mutex_t __gcov_dump_mx = __GTHREAD_MUTEX_INIT;
+#define init_mx_once()
+#else
+__gthread_mutex_t __gcov_dump_mx;
+
+static void
+init_mx (void)
+{
+ __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_dump_mx);
+}
+static void
+init_mx_once (void)
+{
+ static __gthread_once_t once = __GTHREAD_ONCE_INIT;
+ __gthread_once (&once, init_mx);
+}
+#endif
+
+/* Register the library private __gcov_dump method
+ to the global list. */
+
+__attribute__((constructor))
+static void
+register_dumper (void)
+{
+ init_mx_once ();
+ __gthread_mutex_lock (&__gcov_dump_mx);
+ this_dumper.next_dumper = __gcov_dumper_list;
+ __gcov_dumper_list = &this_dumper;
+ __gthread_mutex_unlock (&__gcov_dump_mx);
+}
+
+__attribute__((destructor))
+static void
+unregister_dumper (void)
+{
+ struct dumper_entry *dumper;
+ struct dumper_entry *prev_dumper = 0;
+
+ init_mx_once ();
+ __gthread_mutex_lock (&__gcov_dump_mx);
+ dumper = __gcov_dumper_list;
+
+ while (dumper)
+ {
+ if (dumper->dumper == &__gcov_dump)
+ {
+ if (prev_dumper)
+ prev_dumper->next_dumper = dumper->next_dumper;
+ else
+ __gcov_dumper_list = dumper->next_dumper;
+ break;
+ }
+ prev_dumper = dumper;
+ dumper = dumper->next_dumper;
+ }
+ __gthread_mutex_unlock (&__gcov_dump_mx);
+}
+
+/* Public interface to dump profile data for all shared libraries
+ via registered dumpers from the libraries. This interface
+ has default visibility (unlike gcov_dump which has hidden
+ visbility. */
+
+void
+__gcov_dump_all (void)
+{
+ struct dumper_entry *dumper;
+
+ init_mx_once ();
+ __gthread_mutex_lock (&__gcov_dump_mx);
+
+ dumper = __gcov_dumper_list;
+ while (dumper)
+ {
+ dumper->dumper ();
+ dumper = dumper->next_dumper;
+ }
+ __gthread_mutex_unlock (&__gcov_dump_mx);
+}
+
#endif /* L_gcov_dump */
#ifdef L_gcov_sampling
diff --git a/gcc-4.9/libgcc/libgcov-util.c b/gcc-4.9/libgcc/libgcov-util.c
index d1401b54d..09d588675 100644
--- a/gcc-4.9/libgcc/libgcov-util.c
+++ b/gcc-4.9/libgcc/libgcov-util.c
@@ -88,7 +88,9 @@ static int k_ctrs_types;
/* The longest length of all the filenames. */
static int max_filename_len;
-/* Merge functions for counters. */
+/* Merge functions for counters. Similar to __gcov_dyn_ipa_merge_*
+ functions in dyn-ipa.c, which were derived from these, except
+ the versions in dyn-ipa are used when merging from another array. */
#define DEF_GCOV_COUNTER(COUNTER, NAME, FN_TYPE) __gcov_merge ## FN_TYPE,
static gcov_merge_fn ctr_merge_functions[GCOV_COUNTERS] = {
#include "gcov-counter.def"
@@ -430,11 +432,7 @@ read_gcda_file (const char *filename)
/* Read version. */
version = gcov_read_unsigned ();
if (version != GCOV_VERSION)
- {
- fnotice (stderr, "%s:incorrect gcov version %d vs %d \n", filename, version, GCOV_VERSION);
- gcov_close ();
- return NULL;
- }
+ warning (0, "%s:incorrect gcov version %d vs %d \n", filename, version, GCOV_VERSION);
/* Instantiate a gcov_info object. */
curr_gcov_info = obj_info = (struct gcov_info *) xcalloc (sizeof (struct gcov_info) +
diff --git a/gcc-4.9/libgcc/libgcov.h b/gcc-4.9/libgcc/libgcov.h
index 25534acd5..fdfb6502e 100644
--- a/gcc-4.9/libgcc/libgcov.h
+++ b/gcc-4.9/libgcc/libgcov.h
@@ -272,8 +272,15 @@ extern void __gcov_flush (void) ATTRIBUTE_HIDDEN;
/* Function to reset all counters to 0. */
extern void __gcov_reset (void);
-/* Function to enable early write of profile information so far. */
-extern void __gcov_dump (void);
+/* Function to enable early write of profile information so far.
+ __gcov_dump is also used by __gcov_dump_all. The latter
+ depends on __GCOV_DUMP to have hidden or protected visibility
+ so that each library has its own copy of the registered dumper. */
+extern void __gcov_dump (void) ATTRIBUTE_HIDDEN;
+
+/* Call __gcov_dump registered from each shared library.
+ This function must have default visibility. */
+void __gcov_dump_all (void);
/* The merge function that just sums the counters. */
extern void __gcov_merge_add (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
diff --git a/gcc-4.9/libgfortran/ChangeLog b/gcc-4.9/libgfortran/ChangeLog
index 2d19304d5..89f2c8a10 100644
--- a/gcc-4.9/libgfortran/ChangeLog
+++ b/gcc-4.9/libgfortran/ChangeLog
@@ -1,3 +1,61 @@
+2014-07-31 Janne Blomqvist <jb@gcc.gnu.org>
+
+ Backport from mainline
+ CVE-2014-5044
+ * libgfortran.h (xmallocarray): New prototype.
+ * runtime/memory.c (xmallocarray): New function.
+ (xcalloc): Check for nonzero separately instead of multiplying.
+ * generated/*.c: Regenerated.
+ * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of
+ xmalloc.
+ * intrinsics/eoshift0.c (eoshift0): Likewise.
+ * intrinsics/eoshift2.c (eoshift2): Likewise.
+ * intrinsics/pack_generic.c (pack_internal): Likewise.
+ (pack_s_internal): Likewise.
+ * intrinsics/reshape_generic.c (reshape_internal): Likewise.
+ * intrinsics/spread_generic.c (spread_internal): Likewise.
+ (spread_internal_scalar): Likewise.
+ * intrinsics/string_intrinsics_inc.c (string_trim): Likewise.
+ (string_minmax): Likewise.
+ * intrinsics/transpose_generic.c (transpose_internal): Likewise.
+ * intrinsics/unpack_generic.c (unpack_internal): Likewise.
+ * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value.
+ * io/transfer.c (st_set_nml_var): Call xmallocarray instead of
+ xmalloc.
+ * io/unit.c (get_internal_unit): Likewise.
+ (filename_from_unit): Don't cast xmalloc return value.
+ * io/write.c (nml_write_obj): Likewise, formatting.
+ * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray
+ instead of xmalloc.
+ (besse_yn_r'rtype_kind`): Likewise.
+ * m4/cshift1.m4 (cshift1): Likewise.
+ * m4/eoshift1.m4 (eoshift1): Likewise.
+ * m4/eoshift3.m4 (eoshift3): Likewise.
+ * m4/iforeach.m4: Likewise.
+ * m4/ifunction.m4: Likewise.
+ * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
+ Likewise.
+ * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise.
+ * m4/matmul.m4 (matmul_'rtype_code`): Likewise.
+ * m4/matmull.m4 (matmul_'rtype_code`): Likewise.
+ * m4/pack.m4 (pack_'rtype_code`): Likewise.
+ * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise.
+ * m4/shape.m4 (shape_'rtype_kind`): Likewise.
+ * m4/spread.m4 (spread_'rtype_code`): Likewise.
+ (spread_scalar_'rtype_code`): Likewise.
+ * m4/transpose.m4 (transpose_'rtype_code`): Likewise.
+ * m4/unpack.m4 (unpack0_'rtype_code`): Likewise.
+ (unpack1_'rtype_code`): Likewise.
+ * runtime/convert_char.c (convert_char1_to_char4): Likewise.
+ (convert_char4_to_char1): Simplify.
+ * runtime/environ.c (init_unformatted): Call xmallocarray instead
+ of xmalloc.
+ * runtime/in_pack_generic.c (internal_pack): Likewise.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-07-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Backport from trunk.
diff --git a/gcc-4.9/libgfortran/generated/all_l1.c b/gcc-4.9/libgfortran/generated/all_l1.c
index ed956227c..0f008b97d 100644
--- a/gcc-4.9/libgfortran/generated/all_l1.c
+++ b/gcc-4.9/libgfortran/generated/all_l1.c
@@ -101,8 +101,7 @@ all_l1 (gfc_array_l1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l1 (gfc_array_l1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/all_l16.c b/gcc-4.9/libgfortran/generated/all_l16.c
index a23001b56..a9f85b4bf 100644
--- a/gcc-4.9/libgfortran/generated/all_l16.c
+++ b/gcc-4.9/libgfortran/generated/all_l16.c
@@ -101,8 +101,7 @@ all_l16 (gfc_array_l16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l16 (gfc_array_l16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/all_l2.c b/gcc-4.9/libgfortran/generated/all_l2.c
index 28235d6db..3ef4a1dc2 100644
--- a/gcc-4.9/libgfortran/generated/all_l2.c
+++ b/gcc-4.9/libgfortran/generated/all_l2.c
@@ -101,8 +101,7 @@ all_l2 (gfc_array_l2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l2 (gfc_array_l2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/all_l4.c b/gcc-4.9/libgfortran/generated/all_l4.c
index 601b7c397..58dab4f12 100644
--- a/gcc-4.9/libgfortran/generated/all_l4.c
+++ b/gcc-4.9/libgfortran/generated/all_l4.c
@@ -101,8 +101,7 @@ all_l4 (gfc_array_l4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l4 (gfc_array_l4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/all_l8.c b/gcc-4.9/libgfortran/generated/all_l8.c
index f0041dcdd..4293aaa06 100644
--- a/gcc-4.9/libgfortran/generated/all_l8.c
+++ b/gcc-4.9/libgfortran/generated/all_l8.c
@@ -101,8 +101,7 @@ all_l8 (gfc_array_l8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ all_l8 (gfc_array_l8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/any_l1.c b/gcc-4.9/libgfortran/generated/any_l1.c
index b94c84735..46387fdd2 100644
--- a/gcc-4.9/libgfortran/generated/any_l1.c
+++ b/gcc-4.9/libgfortran/generated/any_l1.c
@@ -101,8 +101,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/any_l16.c b/gcc-4.9/libgfortran/generated/any_l16.c
index a82135267..b29fdd923 100644
--- a/gcc-4.9/libgfortran/generated/any_l16.c
+++ b/gcc-4.9/libgfortran/generated/any_l16.c
@@ -101,8 +101,7 @@ any_l16 (gfc_array_l16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l16 (gfc_array_l16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/any_l2.c b/gcc-4.9/libgfortran/generated/any_l2.c
index 7f4eabc36..a63c593d4 100644
--- a/gcc-4.9/libgfortran/generated/any_l2.c
+++ b/gcc-4.9/libgfortran/generated/any_l2.c
@@ -101,8 +101,7 @@ any_l2 (gfc_array_l2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l2 (gfc_array_l2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/any_l4.c b/gcc-4.9/libgfortran/generated/any_l4.c
index 8ec451a8f..ccd35d789 100644
--- a/gcc-4.9/libgfortran/generated/any_l4.c
+++ b/gcc-4.9/libgfortran/generated/any_l4.c
@@ -101,8 +101,7 @@ any_l4 (gfc_array_l4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l4 (gfc_array_l4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/any_l8.c b/gcc-4.9/libgfortran/generated/any_l8.c
index 47957a77d..e089ea8be 100644
--- a/gcc-4.9/libgfortran/generated/any_l8.c
+++ b/gcc-4.9/libgfortran/generated/any_l8.c
@@ -101,8 +101,7 @@ any_l8 (gfc_array_l8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ any_l8 (gfc_array_l8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/bessel_r10.c b/gcc-4.9/libgfortran/generated/bessel_r10.c
index 980bf8426..14b93e910 100644
--- a/gcc-4.9/libgfortran/generated/bessel_r10.c
+++ b/gcc-4.9/libgfortran/generated/bessel_r10.c
@@ -55,7 +55,7 @@ bessel_jn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, GFC_REAL_10 x
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
ret->offset = 0;
}
@@ -122,7 +122,7 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
ret->offset = 0;
}
diff --git a/gcc-4.9/libgfortran/generated/bessel_r16.c b/gcc-4.9/libgfortran/generated/bessel_r16.c
index d5757c9a6..d64fa9c13 100644
--- a/gcc-4.9/libgfortran/generated/bessel_r16.c
+++ b/gcc-4.9/libgfortran/generated/bessel_r16.c
@@ -59,7 +59,7 @@ bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
ret->offset = 0;
}
@@ -126,7 +126,7 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
ret->offset = 0;
}
diff --git a/gcc-4.9/libgfortran/generated/bessel_r4.c b/gcc-4.9/libgfortran/generated/bessel_r4.c
index 6b6129f01..a86bb5fa9 100644
--- a/gcc-4.9/libgfortran/generated/bessel_r4.c
+++ b/gcc-4.9/libgfortran/generated/bessel_r4.c
@@ -55,7 +55,7 @@ bessel_jn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, GFC_REAL_4 x)
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
ret->offset = 0;
}
@@ -122,7 +122,7 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
ret->offset = 0;
}
diff --git a/gcc-4.9/libgfortran/generated/bessel_r8.c b/gcc-4.9/libgfortran/generated/bessel_r8.c
index a80a7662f..84018872e 100644
--- a/gcc-4.9/libgfortran/generated/bessel_r8.c
+++ b/gcc-4.9/libgfortran/generated/bessel_r8.c
@@ -55,7 +55,7 @@ bessel_jn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, GFC_REAL_8 x)
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
ret->offset = 0;
}
@@ -122,7 +122,7 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
ret->offset = 0;
}
diff --git a/gcc-4.9/libgfortran/generated/count_16_l.c b/gcc-4.9/libgfortran/generated/count_16_l.c
index f690236bc..c6c0b5b9c 100644
--- a/gcc-4.9/libgfortran/generated/count_16_l.c
+++ b/gcc-4.9/libgfortran/generated/count_16_l.c
@@ -101,8 +101,7 @@ count_16_l (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_16_l (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/count_1_l.c b/gcc-4.9/libgfortran/generated/count_1_l.c
index 359a2f9ef..15d270d04 100644
--- a/gcc-4.9/libgfortran/generated/count_1_l.c
+++ b/gcc-4.9/libgfortran/generated/count_1_l.c
@@ -101,8 +101,7 @@ count_1_l (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_1_l (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/count_2_l.c b/gcc-4.9/libgfortran/generated/count_2_l.c
index 0dd51a178..fd9b3d37a 100644
--- a/gcc-4.9/libgfortran/generated/count_2_l.c
+++ b/gcc-4.9/libgfortran/generated/count_2_l.c
@@ -101,8 +101,7 @@ count_2_l (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_2_l (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/count_4_l.c b/gcc-4.9/libgfortran/generated/count_4_l.c
index 7879ce849..1e15256ca 100644
--- a/gcc-4.9/libgfortran/generated/count_4_l.c
+++ b/gcc-4.9/libgfortran/generated/count_4_l.c
@@ -101,8 +101,7 @@ count_4_l (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_4_l (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/count_8_l.c b/gcc-4.9/libgfortran/generated/count_8_l.c
index 21516f5ff..97962a4fe 100644
--- a/gcc-4.9/libgfortran/generated/count_8_l.c
+++ b/gcc-4.9/libgfortran/generated/count_8_l.c
@@ -101,8 +101,7 @@ count_8_l (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -111,7 +110,7 @@ count_8_l (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/cshift1_16.c b/gcc-4.9/libgfortran/generated/cshift1_16.c
index 77fc3bf36..b0cc767ae 100644
--- a/gcc-4.9/libgfortran/generated/cshift1_16.c
+++ b/gcc-4.9/libgfortran/generated/cshift1_16.c
@@ -80,7 +80,7 @@ cshift1 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
diff --git a/gcc-4.9/libgfortran/generated/cshift1_4.c b/gcc-4.9/libgfortran/generated/cshift1_4.c
index 8accb4c82..5ea8a6ace 100644
--- a/gcc-4.9/libgfortran/generated/cshift1_4.c
+++ b/gcc-4.9/libgfortran/generated/cshift1_4.c
@@ -80,7 +80,7 @@ cshift1 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
diff --git a/gcc-4.9/libgfortran/generated/cshift1_8.c b/gcc-4.9/libgfortran/generated/cshift1_8.c
index 6c809a995..5c4dbc360 100644
--- a/gcc-4.9/libgfortran/generated/cshift1_8.c
+++ b/gcc-4.9/libgfortran/generated/cshift1_8.c
@@ -80,7 +80,7 @@ cshift1 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
diff --git a/gcc-4.9/libgfortran/generated/eoshift1_16.c b/gcc-4.9/libgfortran/generated/eoshift1_16.c
index 188589ff7..566d807b3 100644
--- a/gcc-4.9/libgfortran/generated/eoshift1_16.c
+++ b/gcc-4.9/libgfortran/generated/eoshift1_16.c
@@ -105,8 +105,8 @@ eoshift1 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/eoshift1_4.c b/gcc-4.9/libgfortran/generated/eoshift1_4.c
index 81e855098..bd5fabad3 100644
--- a/gcc-4.9/libgfortran/generated/eoshift1_4.c
+++ b/gcc-4.9/libgfortran/generated/eoshift1_4.c
@@ -105,8 +105,8 @@ eoshift1 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/eoshift1_8.c b/gcc-4.9/libgfortran/generated/eoshift1_8.c
index eff6f7666..814f81a81 100644
--- a/gcc-4.9/libgfortran/generated/eoshift1_8.c
+++ b/gcc-4.9/libgfortran/generated/eoshift1_8.c
@@ -105,8 +105,8 @@ eoshift1 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/eoshift3_16.c b/gcc-4.9/libgfortran/generated/eoshift3_16.c
index fc5203d6e..5e09df22e 100644
--- a/gcc-4.9/libgfortran/generated/eoshift3_16.c
+++ b/gcc-4.9/libgfortran/generated/eoshift3_16.c
@@ -89,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -107,8 +107,8 @@ eoshift3 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/eoshift3_4.c b/gcc-4.9/libgfortran/generated/eoshift3_4.c
index ee2b568a4..970402c63 100644
--- a/gcc-4.9/libgfortran/generated/eoshift3_4.c
+++ b/gcc-4.9/libgfortran/generated/eoshift3_4.c
@@ -89,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -107,8 +107,8 @@ eoshift3 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/eoshift3_8.c b/gcc-4.9/libgfortran/generated/eoshift3_8.c
index b2e6d26cc..991eb9151 100644
--- a/gcc-4.9/libgfortran/generated/eoshift3_8.c
+++ b/gcc-4.9/libgfortran/generated/eoshift3_8.c
@@ -89,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -107,8 +107,8 @@ eoshift3 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/iall_i1.c b/gcc-4.9/libgfortran/generated/iall_i1.c
index ac36bac13..da0ce4d22 100644
--- a/gcc-4.9/libgfortran/generated/iall_i1.c
+++ b/gcc-4.9/libgfortran/generated/iall_i1.c
@@ -97,10 +97,9 @@ iall_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -430,8 +428,7 @@ siall_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siall_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iall_i16.c b/gcc-4.9/libgfortran/generated/iall_i16.c
index de333617a..a3f39d3c9 100644
--- a/gcc-4.9/libgfortran/generated/iall_i16.c
+++ b/gcc-4.9/libgfortran/generated/iall_i16.c
@@ -97,10 +97,9 @@ iall_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -430,8 +428,7 @@ siall_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siall_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iall_i2.c b/gcc-4.9/libgfortran/generated/iall_i2.c
index a34703686..4ca06a8a0 100644
--- a/gcc-4.9/libgfortran/generated/iall_i2.c
+++ b/gcc-4.9/libgfortran/generated/iall_i2.c
@@ -97,10 +97,9 @@ iall_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -430,8 +428,7 @@ siall_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siall_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iall_i4.c b/gcc-4.9/libgfortran/generated/iall_i4.c
index 55e09b876..8ff15f4ed 100644
--- a/gcc-4.9/libgfortran/generated/iall_i4.c
+++ b/gcc-4.9/libgfortran/generated/iall_i4.c
@@ -97,10 +97,9 @@ iall_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -430,8 +428,7 @@ siall_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siall_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iall_i8.c b/gcc-4.9/libgfortran/generated/iall_i8.c
index 9c7f88d21..08932d486 100644
--- a/gcc-4.9/libgfortran/generated/iall_i8.c
+++ b/gcc-4.9/libgfortran/generated/iall_i8.c
@@ -97,10 +97,9 @@ iall_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -430,8 +428,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iany_i1.c b/gcc-4.9/libgfortran/generated/iany_i1.c
index 2ce620b69..999230a11 100644
--- a/gcc-4.9/libgfortran/generated/iany_i1.c
+++ b/gcc-4.9/libgfortran/generated/iany_i1.c
@@ -97,10 +97,9 @@ iany_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -430,8 +428,7 @@ siany_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siany_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iany_i16.c b/gcc-4.9/libgfortran/generated/iany_i16.c
index 38e28d1b8..9410db45c 100644
--- a/gcc-4.9/libgfortran/generated/iany_i16.c
+++ b/gcc-4.9/libgfortran/generated/iany_i16.c
@@ -97,10 +97,9 @@ iany_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -430,8 +428,7 @@ siany_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siany_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iany_i2.c b/gcc-4.9/libgfortran/generated/iany_i2.c
index 7a4b79c93..7068bb192 100644
--- a/gcc-4.9/libgfortran/generated/iany_i2.c
+++ b/gcc-4.9/libgfortran/generated/iany_i2.c
@@ -97,10 +97,9 @@ iany_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -430,8 +428,7 @@ siany_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siany_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iany_i4.c b/gcc-4.9/libgfortran/generated/iany_i4.c
index 126c2fa62..62034cfd8 100644
--- a/gcc-4.9/libgfortran/generated/iany_i4.c
+++ b/gcc-4.9/libgfortran/generated/iany_i4.c
@@ -97,10 +97,9 @@ iany_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -430,8 +428,7 @@ siany_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siany_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iany_i8.c b/gcc-4.9/libgfortran/generated/iany_i8.c
index ee2a07f9c..f347d69f1 100644
--- a/gcc-4.9/libgfortran/generated/iany_i8.c
+++ b/gcc-4.9/libgfortran/generated/iany_i8.c
@@ -97,10 +97,9 @@ iany_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -430,8 +428,7 @@ siany_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siany_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/in_pack_c10.c b/gcc-4.9/libgfortran/generated/in_pack_c10.c
index ff3bb332e..9148af577 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_c10.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_c10.c
@@ -76,7 +76,7 @@ internal_pack_c10 (gfc_array_c10 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_COMPLEX_10 *)xmalloc (ssize * sizeof (GFC_COMPLEX_10));
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_10));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_c16.c b/gcc-4.9/libgfortran/generated/in_pack_c16.c
index a3e961247..e109efc1d 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_c16.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_c16.c
@@ -76,7 +76,7 @@ internal_pack_c16 (gfc_array_c16 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_COMPLEX_16 *)xmalloc (ssize * sizeof (GFC_COMPLEX_16));
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_16));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_c4.c b/gcc-4.9/libgfortran/generated/in_pack_c4.c
index 2959354a8..3afdaf3a4 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_c4.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_c4.c
@@ -76,7 +76,7 @@ internal_pack_c4 (gfc_array_c4 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_COMPLEX_4 *)xmalloc (ssize * sizeof (GFC_COMPLEX_4));
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_4));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_c8.c b/gcc-4.9/libgfortran/generated/in_pack_c8.c
index e63ea9d29..995a3676d 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_c8.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_c8.c
@@ -76,7 +76,7 @@ internal_pack_c8 (gfc_array_c8 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_COMPLEX_8 *)xmalloc (ssize * sizeof (GFC_COMPLEX_8));
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_8));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_i1.c b/gcc-4.9/libgfortran/generated/in_pack_i1.c
index 2356102e3..2ee5e2837 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_i1.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_i1.c
@@ -76,7 +76,7 @@ internal_pack_1 (gfc_array_i1 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_1 *)xmalloc (ssize * sizeof (GFC_INTEGER_1));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_1));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_i16.c b/gcc-4.9/libgfortran/generated/in_pack_i16.c
index e271a896a..ac6bb4f8a 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_i16.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_i16.c
@@ -76,7 +76,7 @@ internal_pack_16 (gfc_array_i16 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_16 *)xmalloc (ssize * sizeof (GFC_INTEGER_16));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_16));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_i2.c b/gcc-4.9/libgfortran/generated/in_pack_i2.c
index 391e27d24..f42a89254 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_i2.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_i2.c
@@ -76,7 +76,7 @@ internal_pack_2 (gfc_array_i2 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_2 *)xmalloc (ssize * sizeof (GFC_INTEGER_2));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_2));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_i4.c b/gcc-4.9/libgfortran/generated/in_pack_i4.c
index 6ba027743..acde25aa9 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_i4.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_i4.c
@@ -76,7 +76,7 @@ internal_pack_4 (gfc_array_i4 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_4 *)xmalloc (ssize * sizeof (GFC_INTEGER_4));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_4));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_i8.c b/gcc-4.9/libgfortran/generated/in_pack_i8.c
index 4c05043b7..5be35445c 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_i8.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_i8.c
@@ -76,7 +76,7 @@ internal_pack_8 (gfc_array_i8 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_INTEGER_8 *)xmalloc (ssize * sizeof (GFC_INTEGER_8));
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_8));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_r10.c b/gcc-4.9/libgfortran/generated/in_pack_r10.c
index 75dec30ed..c4680d8cc 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_r10.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_r10.c
@@ -76,7 +76,7 @@ internal_pack_r10 (gfc_array_r10 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_REAL_10 *)xmalloc (ssize * sizeof (GFC_REAL_10));
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_10));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_r16.c b/gcc-4.9/libgfortran/generated/in_pack_r16.c
index a37623a3b..ff09d1462 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_r16.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_r16.c
@@ -76,7 +76,7 @@ internal_pack_r16 (gfc_array_r16 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_REAL_16 *)xmalloc (ssize * sizeof (GFC_REAL_16));
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_16));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_r4.c b/gcc-4.9/libgfortran/generated/in_pack_r4.c
index 5a28ff07c..34fe5829a 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_r4.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_r4.c
@@ -76,7 +76,7 @@ internal_pack_r4 (gfc_array_r4 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_REAL_4 *)xmalloc (ssize * sizeof (GFC_REAL_4));
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_4));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/in_pack_r8.c b/gcc-4.9/libgfortran/generated/in_pack_r8.c
index 7c4fa428b..b0728c9b6 100644
--- a/gcc-4.9/libgfortran/generated/in_pack_r8.c
+++ b/gcc-4.9/libgfortran/generated/in_pack_r8.c
@@ -76,7 +76,7 @@ internal_pack_r8 (gfc_array_r8 * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = (GFC_REAL_8 *)xmalloc (ssize * sizeof (GFC_REAL_8));
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_8));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/generated/iparity_i1.c b/gcc-4.9/libgfortran/generated/iparity_i1.c
index 9ccbd55de..fdccc3d44 100644
--- a/gcc-4.9/libgfortran/generated/iparity_i1.c
+++ b/gcc-4.9/libgfortran/generated/iparity_i1.c
@@ -97,10 +97,9 @@ iparity_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -430,8 +428,7 @@ siparity_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siparity_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iparity_i16.c b/gcc-4.9/libgfortran/generated/iparity_i16.c
index 6a4d03277..7a572ba71 100644
--- a/gcc-4.9/libgfortran/generated/iparity_i16.c
+++ b/gcc-4.9/libgfortran/generated/iparity_i16.c
@@ -97,10 +97,9 @@ iparity_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -430,8 +428,7 @@ siparity_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siparity_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iparity_i2.c b/gcc-4.9/libgfortran/generated/iparity_i2.c
index cb0d8a91b..49233fbc5 100644
--- a/gcc-4.9/libgfortran/generated/iparity_i2.c
+++ b/gcc-4.9/libgfortran/generated/iparity_i2.c
@@ -97,10 +97,9 @@ iparity_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -430,8 +428,7 @@ siparity_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siparity_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iparity_i4.c b/gcc-4.9/libgfortran/generated/iparity_i4.c
index 689f0c125..1551e51fe 100644
--- a/gcc-4.9/libgfortran/generated/iparity_i4.c
+++ b/gcc-4.9/libgfortran/generated/iparity_i4.c
@@ -97,10 +97,9 @@ iparity_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -430,8 +428,7 @@ siparity_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siparity_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/iparity_i8.c b/gcc-4.9/libgfortran/generated/iparity_i8.c
index de84f561a..a745bb6be 100644
--- a/gcc-4.9/libgfortran/generated/iparity_i8.c
+++ b/gcc-4.9/libgfortran/generated/iparity_i8.c
@@ -97,10 +97,9 @@ iparity_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -430,8 +428,7 @@ siparity_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ siparity_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/matmul_c10.c b/gcc-4.9/libgfortran/generated/matmul_c10.c
index 53a8c6a9f..0ff7d58b9 100644
--- a/gcc-4.9/libgfortran/generated/matmul_c10.c
+++ b/gcc-4.9/libgfortran/generated/matmul_c10.c
@@ -124,7 +124,7 @@ matmul_c10 (gfc_array_c10 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_10));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_c16.c b/gcc-4.9/libgfortran/generated/matmul_c16.c
index 00ddc1347..a5fea00c8 100644
--- a/gcc-4.9/libgfortran/generated/matmul_c16.c
+++ b/gcc-4.9/libgfortran/generated/matmul_c16.c
@@ -124,7 +124,7 @@ matmul_c16 (gfc_array_c16 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_16));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_c4.c b/gcc-4.9/libgfortran/generated/matmul_c4.c
index cdb92c43d..b5b0ecb83 100644
--- a/gcc-4.9/libgfortran/generated/matmul_c4.c
+++ b/gcc-4.9/libgfortran/generated/matmul_c4.c
@@ -124,7 +124,7 @@ matmul_c4 (gfc_array_c4 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_4));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_c8.c b/gcc-4.9/libgfortran/generated/matmul_c8.c
index 6a223d04f..077b709df 100644
--- a/gcc-4.9/libgfortran/generated/matmul_c8.c
+++ b/gcc-4.9/libgfortran/generated/matmul_c8.c
@@ -124,7 +124,7 @@ matmul_c8 (gfc_array_c8 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_8));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_i1.c b/gcc-4.9/libgfortran/generated/matmul_i1.c
index bc24f1179..72c998a1b 100644
--- a/gcc-4.9/libgfortran/generated/matmul_i1.c
+++ b/gcc-4.9/libgfortran/generated/matmul_i1.c
@@ -124,7 +124,7 @@ matmul_i1 (gfc_array_i1 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_1));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_i16.c b/gcc-4.9/libgfortran/generated/matmul_i16.c
index 74fe26221..59cd80ba8 100644
--- a/gcc-4.9/libgfortran/generated/matmul_i16.c
+++ b/gcc-4.9/libgfortran/generated/matmul_i16.c
@@ -124,7 +124,7 @@ matmul_i16 (gfc_array_i16 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_16));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_i2.c b/gcc-4.9/libgfortran/generated/matmul_i2.c
index 8627361ba..6fddc4f18 100644
--- a/gcc-4.9/libgfortran/generated/matmul_i2.c
+++ b/gcc-4.9/libgfortran/generated/matmul_i2.c
@@ -124,7 +124,7 @@ matmul_i2 (gfc_array_i2 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_2));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_i4.c b/gcc-4.9/libgfortran/generated/matmul_i4.c
index 37e5d5b1d..f62cb56aa 100644
--- a/gcc-4.9/libgfortran/generated/matmul_i4.c
+++ b/gcc-4.9/libgfortran/generated/matmul_i4.c
@@ -124,7 +124,7 @@ matmul_i4 (gfc_array_i4 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_4));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_i8.c b/gcc-4.9/libgfortran/generated/matmul_i8.c
index 892822ae1..6d524905e 100644
--- a/gcc-4.9/libgfortran/generated/matmul_i8.c
+++ b/gcc-4.9/libgfortran/generated/matmul_i8.c
@@ -124,7 +124,7 @@ matmul_i8 (gfc_array_i8 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_8));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_l16.c b/gcc-4.9/libgfortran/generated/matmul_l16.c
index bc6003009..370db0731 100644
--- a/gcc-4.9/libgfortran/generated/matmul_l16.c
+++ b/gcc-4.9/libgfortran/generated/matmul_l16.c
@@ -88,7 +88,7 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_16));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_l4.c b/gcc-4.9/libgfortran/generated/matmul_l4.c
index d464e6206..d901e3cd7 100644
--- a/gcc-4.9/libgfortran/generated/matmul_l4.c
+++ b/gcc-4.9/libgfortran/generated/matmul_l4.c
@@ -88,7 +88,7 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_4));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_l8.c b/gcc-4.9/libgfortran/generated/matmul_l8.c
index 0fd6bad01..5862c8d87 100644
--- a/gcc-4.9/libgfortran/generated/matmul_l8.c
+++ b/gcc-4.9/libgfortran/generated/matmul_l8.c
@@ -88,7 +88,7 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_8));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_r10.c b/gcc-4.9/libgfortran/generated/matmul_r10.c
index e22204470..6c9656adf 100644
--- a/gcc-4.9/libgfortran/generated/matmul_r10.c
+++ b/gcc-4.9/libgfortran/generated/matmul_r10.c
@@ -124,7 +124,7 @@ matmul_r10 (gfc_array_r10 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_10));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_r16.c b/gcc-4.9/libgfortran/generated/matmul_r16.c
index 335feb074..fbe8e0928 100644
--- a/gcc-4.9/libgfortran/generated/matmul_r16.c
+++ b/gcc-4.9/libgfortran/generated/matmul_r16.c
@@ -124,7 +124,7 @@ matmul_r16 (gfc_array_r16 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_16));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_r4.c b/gcc-4.9/libgfortran/generated/matmul_r4.c
index bb07efa0c..f80c8bfcd 100644
--- a/gcc-4.9/libgfortran/generated/matmul_r4.c
+++ b/gcc-4.9/libgfortran/generated/matmul_r4.c
@@ -124,7 +124,7 @@ matmul_r4 (gfc_array_r4 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_4));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/matmul_r8.c b/gcc-4.9/libgfortran/generated/matmul_r8.c
index a3bc842a7..7aec3b3c2 100644
--- a/gcc-4.9/libgfortran/generated/matmul_r8.c
+++ b/gcc-4.9/libgfortran/generated/matmul_r8.c
@@ -124,7 +124,7 @@ matmul_r8 (gfc_array_r8 * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_8));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_i1.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i1.c
index 01d6e77cc..d205d2466 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_i1.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i1.c
@@ -58,7 +58,7 @@ maxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_i16.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i16.c
index c24b4be04..3d8e3dc0f 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_i16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i16.c
@@ -58,7 +58,7 @@ maxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_i2.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i2.c
index 1a0f2b64b..93f5cc477 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_i2.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i2.c
@@ -58,7 +58,7 @@ maxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_i4.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i4.c
index 005a96336..6858c8ff7 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_i4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i4.c
@@ -58,7 +58,7 @@ maxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_i8.c b/gcc-4.9/libgfortran/generated/maxloc0_16_i8.c
index 2643b82dd..f324b02fc 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_i8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_i8.c
@@ -58,7 +58,7 @@ maxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_r10.c b/gcc-4.9/libgfortran/generated/maxloc0_16_r10.c
index 714a52343..03560f711 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_r10.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_r10.c
@@ -58,7 +58,7 @@ maxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_r16.c b/gcc-4.9/libgfortran/generated/maxloc0_16_r16.c
index 5a2ecb304..aeb2e81d2 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_r16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_r16.c
@@ -58,7 +58,7 @@ maxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_r4.c b/gcc-4.9/libgfortran/generated/maxloc0_16_r4.c
index 5556429fb..a88774e95 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_r4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_r4.c
@@ -58,7 +58,7 @@ maxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_16_r8.c b/gcc-4.9/libgfortran/generated/maxloc0_16_r8.c
index 2ae92c9fc..8704cad65 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_16_r8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_16_r8.c
@@ -58,7 +58,7 @@ maxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_i1.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i1.c
index 2470b4907..8e75ec977 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_i1.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i1.c
@@ -58,7 +58,7 @@ maxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_i16.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i16.c
index 850a26cfa..67383b6c5 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_i16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i16.c
@@ -58,7 +58,7 @@ maxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_i2.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i2.c
index 89715197f..3991bd6b2 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_i2.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i2.c
@@ -58,7 +58,7 @@ maxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_i4.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i4.c
index 9ad21d745..0a714c3c1 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_i4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i4.c
@@ -58,7 +58,7 @@ maxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_i8.c b/gcc-4.9/libgfortran/generated/maxloc0_4_i8.c
index 7e1e3a46b..c32c6fb4f 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_i8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_i8.c
@@ -58,7 +58,7 @@ maxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_r10.c b/gcc-4.9/libgfortran/generated/maxloc0_4_r10.c
index 4d1d980ff..d2d7f2ef7 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_r10.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_r10.c
@@ -58,7 +58,7 @@ maxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_r16.c b/gcc-4.9/libgfortran/generated/maxloc0_4_r16.c
index 0d37cdada..e9d8620f0 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_r16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_r16.c
@@ -58,7 +58,7 @@ maxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_r4.c b/gcc-4.9/libgfortran/generated/maxloc0_4_r4.c
index 6db50f803..c402868de 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_r4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_r4.c
@@ -58,7 +58,7 @@ maxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_4_r8.c b/gcc-4.9/libgfortran/generated/maxloc0_4_r8.c
index 610f757f4..5057e9c34 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_4_r8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_4_r8.c
@@ -58,7 +58,7 @@ maxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_i1.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i1.c
index 6e1d04959..95d027dbd 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_i1.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i1.c
@@ -58,7 +58,7 @@ maxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_i16.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i16.c
index aa2d6e39d..1fa391b11 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_i16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i16.c
@@ -58,7 +58,7 @@ maxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_i2.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i2.c
index b9fd82b4c..d98a1a25a 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_i2.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i2.c
@@ -58,7 +58,7 @@ maxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_i4.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i4.c
index 36bba3e5f..56a77487f 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_i4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i4.c
@@ -58,7 +58,7 @@ maxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_i8.c b/gcc-4.9/libgfortran/generated/maxloc0_8_i8.c
index e8089283c..dd1fe2c56 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_i8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_i8.c
@@ -58,7 +58,7 @@ maxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_r10.c b/gcc-4.9/libgfortran/generated/maxloc0_8_r10.c
index fba75b987..2c8394cef 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_r10.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_r10.c
@@ -58,7 +58,7 @@ maxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_r16.c b/gcc-4.9/libgfortran/generated/maxloc0_8_r16.c
index 24e317ea2..4ebf6f473 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_r16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_r16.c
@@ -58,7 +58,7 @@ maxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_r4.c b/gcc-4.9/libgfortran/generated/maxloc0_8_r4.c
index 88dc2b230..893adadd7 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_r4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_r4.c
@@ -58,7 +58,7 @@ maxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc0_8_r8.c b/gcc-4.9/libgfortran/generated/maxloc0_8_r8.c
index 23c1115bf..e2343430a 100644
--- a/gcc-4.9/libgfortran/generated/maxloc0_8_r8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc0_8_r8.c
@@ -58,7 +58,7 @@ maxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ smaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_i1.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i1.c
index 0602fc9ef..4d1bea09c 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_i1.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i1.c
@@ -98,10 +98,9 @@ maxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_i16.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i16.c
index 3f8c51724..eb9b2a0cd 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_i16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i16.c
@@ -98,10 +98,9 @@ maxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_i2.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i2.c
index f28421065..91a0800a7 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_i2.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i2.c
@@ -98,10 +98,9 @@ maxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_i4.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i4.c
index 35fcc2a25..c68035167 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_i4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i4.c
@@ -98,10 +98,9 @@ maxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_i8.c b/gcc-4.9/libgfortran/generated/maxloc1_16_i8.c
index b2c945c0b..ea164dc6b 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_i8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_i8.c
@@ -98,10 +98,9 @@ maxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_r10.c b/gcc-4.9/libgfortran/generated/maxloc1_16_r10.c
index d898dde14..4d5ed45a5 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_r10.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_r10.c
@@ -98,10 +98,9 @@ maxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_r16.c b/gcc-4.9/libgfortran/generated/maxloc1_16_r16.c
index 28e2db48f..572d91617 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_r16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_r16.c
@@ -98,10 +98,9 @@ maxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_r4.c b/gcc-4.9/libgfortran/generated/maxloc1_16_r4.c
index f7f85a7d9..d9aef3e63 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_r4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_r4.c
@@ -98,10 +98,9 @@ maxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_16_r8.c b/gcc-4.9/libgfortran/generated/maxloc1_16_r8.c
index 69c82d373..d1014cdb0 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_16_r8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_16_r8.c
@@ -98,10 +98,9 @@ maxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_i1.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i1.c
index fde194756..1ab44ab6b 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_i1.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i1.c
@@ -98,10 +98,9 @@ maxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_i16.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i16.c
index c7b32b3e4..59bb2a31e 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_i16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i16.c
@@ -98,10 +98,9 @@ maxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_i2.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i2.c
index 2a16a0b79..794fde04d 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_i2.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i2.c
@@ -98,10 +98,9 @@ maxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_i4.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i4.c
index 7c693e114..d10e93736 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_i4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i4.c
@@ -98,10 +98,9 @@ maxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_i8.c b/gcc-4.9/libgfortran/generated/maxloc1_4_i8.c
index 45188e1d0..b761b8264 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_i8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_i8.c
@@ -98,10 +98,9 @@ maxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_r10.c b/gcc-4.9/libgfortran/generated/maxloc1_4_r10.c
index bd0e0f862..f1d522df5 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_r10.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_r10.c
@@ -98,10 +98,9 @@ maxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_r16.c b/gcc-4.9/libgfortran/generated/maxloc1_4_r16.c
index 37428b295..deaf571ba 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_r16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_r16.c
@@ -98,10 +98,9 @@ maxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_r4.c b/gcc-4.9/libgfortran/generated/maxloc1_4_r4.c
index a42c7b447..bc6449599 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_r4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_r4.c
@@ -98,10 +98,9 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_4_r8.c b/gcc-4.9/libgfortran/generated/maxloc1_4_r8.c
index 85b796539..af09cb3ec 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_4_r8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_4_r8.c
@@ -98,10 +98,9 @@ maxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_i1.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i1.c
index 4c5d55ef1..caaabe72d 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_i1.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i1.c
@@ -98,10 +98,9 @@ maxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_i16.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i16.c
index 6779d6a7b..384635c99 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_i16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i16.c
@@ -98,10 +98,9 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_i2.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i2.c
index 2fe569637..731c7237e 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_i2.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i2.c
@@ -98,10 +98,9 @@ maxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_i4.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i4.c
index ae06e9e6e..26fdf834b 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_i4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i4.c
@@ -98,10 +98,9 @@ maxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_i8.c b/gcc-4.9/libgfortran/generated/maxloc1_8_i8.c
index d8d7b6836..a7f43d15f 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_i8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_i8.c
@@ -98,10 +98,9 @@ maxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_r10.c b/gcc-4.9/libgfortran/generated/maxloc1_8_r10.c
index 2b44cbb7b..f996db495 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_r10.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_r10.c
@@ -98,10 +98,9 @@ maxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_r16.c b/gcc-4.9/libgfortran/generated/maxloc1_8_r16.c
index bcee80168..d3ae5cb36 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_r16.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_r16.c
@@ -98,10 +98,9 @@ maxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_r4.c b/gcc-4.9/libgfortran/generated/maxloc1_8_r4.c
index 57a039d36..c282cf703 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_r4.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_r4.c
@@ -98,10 +98,9 @@ maxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxloc1_8_r8.c b/gcc-4.9/libgfortran/generated/maxloc1_8_r8.c
index c11368098..13446e070 100644
--- a/gcc-4.9/libgfortran/generated/maxloc1_8_r8.c
+++ b/gcc-4.9/libgfortran/generated/maxloc1_8_r8.c
@@ -98,10 +98,9 @@ maxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_i1.c b/gcc-4.9/libgfortran/generated/maxval_i1.c
index 18d4eff3e..eadec5ce9 100644
--- a/gcc-4.9/libgfortran/generated/maxval_i1.c
+++ b/gcc-4.9/libgfortran/generated/maxval_i1.c
@@ -97,10 +97,9 @@ maxval_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -472,8 +470,7 @@ smaxval_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_i16.c b/gcc-4.9/libgfortran/generated/maxval_i16.c
index 6815eb2a7..b83dd181e 100644
--- a/gcc-4.9/libgfortran/generated/maxval_i16.c
+++ b/gcc-4.9/libgfortran/generated/maxval_i16.c
@@ -97,10 +97,9 @@ maxval_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -472,8 +470,7 @@ smaxval_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_i2.c b/gcc-4.9/libgfortran/generated/maxval_i2.c
index 5b99b3422..72bb3b4dd 100644
--- a/gcc-4.9/libgfortran/generated/maxval_i2.c
+++ b/gcc-4.9/libgfortran/generated/maxval_i2.c
@@ -97,10 +97,9 @@ maxval_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -472,8 +470,7 @@ smaxval_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_i4.c b/gcc-4.9/libgfortran/generated/maxval_i4.c
index ff19f9cd3..c939a0acd 100644
--- a/gcc-4.9/libgfortran/generated/maxval_i4.c
+++ b/gcc-4.9/libgfortran/generated/maxval_i4.c
@@ -97,10 +97,9 @@ maxval_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -472,8 +470,7 @@ smaxval_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_i8.c b/gcc-4.9/libgfortran/generated/maxval_i8.c
index d708c3478..50ee398d2 100644
--- a/gcc-4.9/libgfortran/generated/maxval_i8.c
+++ b/gcc-4.9/libgfortran/generated/maxval_i8.c
@@ -97,10 +97,9 @@ maxval_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -472,8 +470,7 @@ smaxval_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_r10.c b/gcc-4.9/libgfortran/generated/maxval_r10.c
index 759198ba7..b16d26341 100644
--- a/gcc-4.9/libgfortran/generated/maxval_r10.c
+++ b/gcc-4.9/libgfortran/generated/maxval_r10.c
@@ -97,10 +97,9 @@ maxval_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
@@ -472,8 +470,7 @@ smaxval_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_r16.c b/gcc-4.9/libgfortran/generated/maxval_r16.c
index b16c4cb3b..df6f2b088 100644
--- a/gcc-4.9/libgfortran/generated/maxval_r16.c
+++ b/gcc-4.9/libgfortran/generated/maxval_r16.c
@@ -97,10 +97,9 @@ maxval_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
@@ -472,8 +470,7 @@ smaxval_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_r4.c b/gcc-4.9/libgfortran/generated/maxval_r4.c
index db688855b..edccaeb65 100644
--- a/gcc-4.9/libgfortran/generated/maxval_r4.c
+++ b/gcc-4.9/libgfortran/generated/maxval_r4.c
@@ -97,10 +97,9 @@ maxval_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
@@ -472,8 +470,7 @@ smaxval_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/maxval_r8.c b/gcc-4.9/libgfortran/generated/maxval_r8.c
index ea0c8d849..bfbfa981d 100644
--- a/gcc-4.9/libgfortran/generated/maxval_r8.c
+++ b/gcc-4.9/libgfortran/generated/maxval_r8.c
@@ -97,10 +97,9 @@ maxval_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
@@ -472,8 +470,7 @@ smaxval_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ smaxval_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_i1.c b/gcc-4.9/libgfortran/generated/minloc0_16_i1.c
index f70d9fff4..ccd89f043 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_i1.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_i1.c
@@ -58,7 +58,7 @@ minloc0_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_i16.c b/gcc-4.9/libgfortran/generated/minloc0_16_i16.c
index 796241592..65050b984 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_i16.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_i16.c
@@ -58,7 +58,7 @@ minloc0_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_i2.c b/gcc-4.9/libgfortran/generated/minloc0_16_i2.c
index e06f9f9c6..9fb63255e 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_i2.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_i2.c
@@ -58,7 +58,7 @@ minloc0_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_i4.c b/gcc-4.9/libgfortran/generated/minloc0_16_i4.c
index 099ac7e05..999ac4b50 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_i4.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_i4.c
@@ -58,7 +58,7 @@ minloc0_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_i8.c b/gcc-4.9/libgfortran/generated/minloc0_16_i8.c
index 2361c8596..3c2e3c3a9 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_i8.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_i8.c
@@ -58,7 +58,7 @@ minloc0_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_r10.c b/gcc-4.9/libgfortran/generated/minloc0_16_r10.c
index 9777ed15c..c661cdc0f 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_r10.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_r10.c
@@ -58,7 +58,7 @@ minloc0_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_r16.c b/gcc-4.9/libgfortran/generated/minloc0_16_r16.c
index 6d3a34982..c455e92de 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_r16.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_r16.c
@@ -58,7 +58,7 @@ minloc0_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_r4.c b/gcc-4.9/libgfortran/generated/minloc0_16_r4.c
index 6db57e841..779935e4f 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_r4.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_r4.c
@@ -58,7 +58,7 @@ minloc0_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_16_r8.c b/gcc-4.9/libgfortran/generated/minloc0_16_r8.c
index 41e94b427..d90237677 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_16_r8.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_16_r8.c
@@ -58,7 +58,7 @@ minloc0_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_i1.c b/gcc-4.9/libgfortran/generated/minloc0_4_i1.c
index a2acfa9a5..a9e902dd3 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_i1.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_i1.c
@@ -58,7 +58,7 @@ minloc0_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_i16.c b/gcc-4.9/libgfortran/generated/minloc0_4_i16.c
index 920525419..7981c28ba 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_i16.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_i16.c
@@ -58,7 +58,7 @@ minloc0_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_i2.c b/gcc-4.9/libgfortran/generated/minloc0_4_i2.c
index 087e9245e..59439faa0 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_i2.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_i2.c
@@ -58,7 +58,7 @@ minloc0_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_i4.c b/gcc-4.9/libgfortran/generated/minloc0_4_i4.c
index e8d43a818..5731a43ea 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_i4.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_i4.c
@@ -58,7 +58,7 @@ minloc0_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_i8.c b/gcc-4.9/libgfortran/generated/minloc0_4_i8.c
index d2c81e761..50b8e1612 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_i8.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_i8.c
@@ -58,7 +58,7 @@ minloc0_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_r10.c b/gcc-4.9/libgfortran/generated/minloc0_4_r10.c
index 25c7c5a75..2701a859f 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_r10.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_r10.c
@@ -58,7 +58,7 @@ minloc0_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_r16.c b/gcc-4.9/libgfortran/generated/minloc0_4_r16.c
index c41a9f39c..fca50b39e 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_r16.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_r16.c
@@ -58,7 +58,7 @@ minloc0_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_r4.c b/gcc-4.9/libgfortran/generated/minloc0_4_r4.c
index 08f733fa3..0469a5280 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_r4.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_r4.c
@@ -58,7 +58,7 @@ minloc0_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_4_r8.c b/gcc-4.9/libgfortran/generated/minloc0_4_r8.c
index 590138f1b..7be43c4af 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_4_r8.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_4_r8.c
@@ -58,7 +58,7 @@ minloc0_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_i1.c b/gcc-4.9/libgfortran/generated/minloc0_8_i1.c
index 2bce39453..60bfe811c 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_i1.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_i1.c
@@ -58,7 +58,7 @@ minloc0_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_i16.c b/gcc-4.9/libgfortran/generated/minloc0_8_i16.c
index 32a2b5a3d..27ddd4f99 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_i16.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_i16.c
@@ -58,7 +58,7 @@ minloc0_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_i2.c b/gcc-4.9/libgfortran/generated/minloc0_8_i2.c
index a0061d28e..38a4aa64e 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_i2.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_i2.c
@@ -58,7 +58,7 @@ minloc0_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_i4.c b/gcc-4.9/libgfortran/generated/minloc0_8_i4.c
index 3ea2487dc..5586ea9fa 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_i4.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_i4.c
@@ -58,7 +58,7 @@ minloc0_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_i8.c b/gcc-4.9/libgfortran/generated/minloc0_8_i8.c
index afc6d44e4..1f21d2657 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_i8.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_i8.c
@@ -58,7 +58,7 @@ minloc0_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_r10.c b/gcc-4.9/libgfortran/generated/minloc0_8_r10.c
index 6abc03d01..df34ca333 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_r10.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_r10.c
@@ -58,7 +58,7 @@ minloc0_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_r16.c b/gcc-4.9/libgfortran/generated/minloc0_8_r16.c
index 322951e48..d8769ec95 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_r16.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_r16.c
@@ -58,7 +58,7 @@ minloc0_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_r4.c b/gcc-4.9/libgfortran/generated/minloc0_8_r4.c
index c9896d744..b8ab0c990 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_r4.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_r4.c
@@ -58,7 +58,7 @@ minloc0_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc0_8_r8.c b/gcc-4.9/libgfortran/generated/minloc0_8_r8.c
index edada9004..ff67f1ed5 100644
--- a/gcc-4.9/libgfortran/generated/minloc0_8_r8.c
+++ b/gcc-4.9/libgfortran/generated/minloc0_8_r8.c
@@ -58,7 +58,7 @@ minloc0_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -199,7 +199,7 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else
{
@@ -367,7 +367,7 @@ sminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_i1.c b/gcc-4.9/libgfortran/generated/minloc1_16_i1.c
index d47e946f0..a9b2d96b1 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_i1.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_i1.c
@@ -98,10 +98,9 @@ minloc1_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_i16.c b/gcc-4.9/libgfortran/generated/minloc1_16_i16.c
index aca08c0c1..1e52c2220 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_i16.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_i16.c
@@ -98,10 +98,9 @@ minloc1_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_i2.c b/gcc-4.9/libgfortran/generated/minloc1_16_i2.c
index 27eb379e7..7617b9e32 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_i2.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_i2.c
@@ -98,10 +98,9 @@ minloc1_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_i4.c b/gcc-4.9/libgfortran/generated/minloc1_16_i4.c
index 4a30ac1fa..9729d11bc 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_i4.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_i4.c
@@ -98,10 +98,9 @@ minloc1_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_i8.c b/gcc-4.9/libgfortran/generated/minloc1_16_i8.c
index 4021ac228..00421b235 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_i8.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_i8.c
@@ -98,10 +98,9 @@ minloc1_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_r10.c b/gcc-4.9/libgfortran/generated/minloc1_16_r10.c
index c8eadc34c..fb1401b95 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_r10.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_r10.c
@@ -98,10 +98,9 @@ minloc1_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_r16.c b/gcc-4.9/libgfortran/generated/minloc1_16_r16.c
index 6aa1de836..031286809 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_r16.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_r16.c
@@ -98,10 +98,9 @@ minloc1_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_r4.c b/gcc-4.9/libgfortran/generated/minloc1_16_r4.c
index 67e5564da..af5b67d90 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_r4.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_r4.c
@@ -98,10 +98,9 @@ minloc1_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_16_r8.c b/gcc-4.9/libgfortran/generated/minloc1_16_r8.c
index 1fcef6c5a..dd2be3bb4 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_16_r8.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_16_r8.c
@@ -98,10 +98,9 @@ minloc1_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -485,8 +483,7 @@ sminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_i1.c b/gcc-4.9/libgfortran/generated/minloc1_4_i1.c
index 863f873f7..b0bf6efba 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_i1.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_i1.c
@@ -98,10 +98,9 @@ minloc1_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_i16.c b/gcc-4.9/libgfortran/generated/minloc1_4_i16.c
index 9a81558f4..882b4b417 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_i16.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_i16.c
@@ -98,10 +98,9 @@ minloc1_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_i2.c b/gcc-4.9/libgfortran/generated/minloc1_4_i2.c
index 6657c9f1d..877af7a5a 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_i2.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_i2.c
@@ -98,10 +98,9 @@ minloc1_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_i4.c b/gcc-4.9/libgfortran/generated/minloc1_4_i4.c
index 36e9552c4..3a872706d 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_i4.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_i4.c
@@ -98,10 +98,9 @@ minloc1_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_i8.c b/gcc-4.9/libgfortran/generated/minloc1_4_i8.c
index c5d782831..22e43bf6c 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_i8.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_i8.c
@@ -98,10 +98,9 @@ minloc1_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_r10.c b/gcc-4.9/libgfortran/generated/minloc1_4_r10.c
index f55791c01..624006cd6 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_r10.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_r10.c
@@ -98,10 +98,9 @@ minloc1_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_r16.c b/gcc-4.9/libgfortran/generated/minloc1_4_r16.c
index 99163f439..f32b60825 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_r16.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_r16.c
@@ -98,10 +98,9 @@ minloc1_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_r4.c b/gcc-4.9/libgfortran/generated/minloc1_4_r4.c
index 9e8574504..0ed5fe96e 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_r4.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_r4.c
@@ -98,10 +98,9 @@ minloc1_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_4_r8.c b/gcc-4.9/libgfortran/generated/minloc1_4_r8.c
index 75f2a5ff1..c780a42aa 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_4_r8.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_4_r8.c
@@ -98,10 +98,9 @@ minloc1_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -485,8 +483,7 @@ sminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_i1.c b/gcc-4.9/libgfortran/generated/minloc1_8_i1.c
index 8c065ec47..6f8c7d944 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_i1.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_i1.c
@@ -98,10 +98,9 @@ minloc1_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_i16.c b/gcc-4.9/libgfortran/generated/minloc1_8_i16.c
index 68c961773..07cb01171 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_i16.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_i16.c
@@ -98,10 +98,9 @@ minloc1_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_i2.c b/gcc-4.9/libgfortran/generated/minloc1_8_i2.c
index 3e4f4f05b..9ea0bf4c3 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_i2.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_i2.c
@@ -98,10 +98,9 @@ minloc1_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_i4.c b/gcc-4.9/libgfortran/generated/minloc1_8_i4.c
index b0e753af2..5e433cc1d 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_i4.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_i4.c
@@ -98,10 +98,9 @@ minloc1_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_i8.c b/gcc-4.9/libgfortran/generated/minloc1_8_i8.c
index a7fec9070..364cf3249 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_i8.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_i8.c
@@ -98,10 +98,9 @@ minloc1_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_r10.c b/gcc-4.9/libgfortran/generated/minloc1_8_r10.c
index 6b3e80f0a..901cf91a3 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_r10.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_r10.c
@@ -98,10 +98,9 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_r16.c b/gcc-4.9/libgfortran/generated/minloc1_8_r16.c
index 7b69876e2..7bf17ea37 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_r16.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_r16.c
@@ -98,10 +98,9 @@ minloc1_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_r4.c b/gcc-4.9/libgfortran/generated/minloc1_8_r4.c
index 13d40ea9a..5edb92f99 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_r4.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_r4.c
@@ -98,10 +98,9 @@ minloc1_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minloc1_8_r8.c b/gcc-4.9/libgfortran/generated/minloc1_8_r8.c
index 51151f236..405b9e183 100644
--- a/gcc-4.9/libgfortran/generated/minloc1_8_r8.c
+++ b/gcc-4.9/libgfortran/generated/minloc1_8_r8.c
@@ -98,10 +98,9 @@ minloc1_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -294,8 +293,7 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -485,8 +483,7 @@ sminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -495,7 +492,7 @@ sminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_i1.c b/gcc-4.9/libgfortran/generated/minval_i1.c
index 261dac8e4..da7405b28 100644
--- a/gcc-4.9/libgfortran/generated/minval_i1.c
+++ b/gcc-4.9/libgfortran/generated/minval_i1.c
@@ -97,10 +97,9 @@ minval_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -472,8 +470,7 @@ sminval_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_i16.c b/gcc-4.9/libgfortran/generated/minval_i16.c
index c75db9682..11cbeac5f 100644
--- a/gcc-4.9/libgfortran/generated/minval_i16.c
+++ b/gcc-4.9/libgfortran/generated/minval_i16.c
@@ -97,10 +97,9 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -472,8 +470,7 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_i2.c b/gcc-4.9/libgfortran/generated/minval_i2.c
index 5e7a3642e..e208b57e2 100644
--- a/gcc-4.9/libgfortran/generated/minval_i2.c
+++ b/gcc-4.9/libgfortran/generated/minval_i2.c
@@ -97,10 +97,9 @@ minval_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -472,8 +470,7 @@ sminval_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_i4.c b/gcc-4.9/libgfortran/generated/minval_i4.c
index a8aed7dc0..68ba76e8d 100644
--- a/gcc-4.9/libgfortran/generated/minval_i4.c
+++ b/gcc-4.9/libgfortran/generated/minval_i4.c
@@ -97,10 +97,9 @@ minval_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -472,8 +470,7 @@ sminval_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_i8.c b/gcc-4.9/libgfortran/generated/minval_i8.c
index 1d489bc55..b089358d0 100644
--- a/gcc-4.9/libgfortran/generated/minval_i8.c
+++ b/gcc-4.9/libgfortran/generated/minval_i8.c
@@ -97,10 +97,9 @@ minval_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -472,8 +470,7 @@ sminval_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_r10.c b/gcc-4.9/libgfortran/generated/minval_r10.c
index 9181e21d7..e9e6afee6 100644
--- a/gcc-4.9/libgfortran/generated/minval_r10.c
+++ b/gcc-4.9/libgfortran/generated/minval_r10.c
@@ -97,10 +97,9 @@ minval_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
@@ -472,8 +470,7 @@ sminval_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_r16.c b/gcc-4.9/libgfortran/generated/minval_r16.c
index 85aaa5dbe..e4e38275d 100644
--- a/gcc-4.9/libgfortran/generated/minval_r16.c
+++ b/gcc-4.9/libgfortran/generated/minval_r16.c
@@ -97,10 +97,9 @@ minval_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
@@ -472,8 +470,7 @@ sminval_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_r4.c b/gcc-4.9/libgfortran/generated/minval_r4.c
index 19a258c81..515b2db49 100644
--- a/gcc-4.9/libgfortran/generated/minval_r4.c
+++ b/gcc-4.9/libgfortran/generated/minval_r4.c
@@ -97,10 +97,9 @@ minval_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
@@ -472,8 +470,7 @@ sminval_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/minval_r8.c b/gcc-4.9/libgfortran/generated/minval_r8.c
index d2f963976..c61656f87 100644
--- a/gcc-4.9/libgfortran/generated/minval_r8.c
+++ b/gcc-4.9/libgfortran/generated/minval_r8.c
@@ -97,10 +97,9 @@ minval_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -286,8 +285,7 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -299,7 +297,7 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
@@ -472,8 +470,7 @@ sminval_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -482,7 +479,7 @@ sminval_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/norm2_r10.c b/gcc-4.9/libgfortran/generated/norm2_r10.c
index 44028ccb2..0145c99b6 100644
--- a/gcc-4.9/libgfortran/generated/norm2_r10.c
+++ b/gcc-4.9/libgfortran/generated/norm2_r10.c
@@ -101,10 +101,9 @@ norm2_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/norm2_r16.c b/gcc-4.9/libgfortran/generated/norm2_r16.c
index c036edce8..46329d523 100644
--- a/gcc-4.9/libgfortran/generated/norm2_r16.c
+++ b/gcc-4.9/libgfortran/generated/norm2_r16.c
@@ -105,10 +105,9 @@ norm2_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/norm2_r4.c b/gcc-4.9/libgfortran/generated/norm2_r4.c
index dcf78daf9..067dbee62 100644
--- a/gcc-4.9/libgfortran/generated/norm2_r4.c
+++ b/gcc-4.9/libgfortran/generated/norm2_r4.c
@@ -101,10 +101,9 @@ norm2_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/norm2_r8.c b/gcc-4.9/libgfortran/generated/norm2_r8.c
index 1bda1c5e0..51c89427a 100644
--- a/gcc-4.9/libgfortran/generated/norm2_r8.c
+++ b/gcc-4.9/libgfortran/generated/norm2_r8.c
@@ -101,10 +101,9 @@ norm2_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/pack_c10.c b/gcc-4.9/libgfortran/generated/pack_c10.c
index 9fcacf12e..90866a840 100644
--- a/gcc-4.9/libgfortran/generated/pack_c10.c
+++ b/gcc-4.9/libgfortran/generated/pack_c10.c
@@ -167,8 +167,8 @@ pack_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_c16.c b/gcc-4.9/libgfortran/generated/pack_c16.c
index 0e3db3452..60f60d1e4 100644
--- a/gcc-4.9/libgfortran/generated/pack_c16.c
+++ b/gcc-4.9/libgfortran/generated/pack_c16.c
@@ -167,8 +167,8 @@ pack_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_16));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_c4.c b/gcc-4.9/libgfortran/generated/pack_c4.c
index f17d35abf..36a9f941c 100644
--- a/gcc-4.9/libgfortran/generated/pack_c4.c
+++ b/gcc-4.9/libgfortran/generated/pack_c4.c
@@ -167,8 +167,8 @@ pack_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_4));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_c8.c b/gcc-4.9/libgfortran/generated/pack_c8.c
index f291b4676..38880c183 100644
--- a/gcc-4.9/libgfortran/generated/pack_c8.c
+++ b/gcc-4.9/libgfortran/generated/pack_c8.c
@@ -167,8 +167,8 @@ pack_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_8));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_i1.c b/gcc-4.9/libgfortran/generated/pack_i1.c
index b70127d5b..933cf9ab7 100644
--- a/gcc-4.9/libgfortran/generated/pack_i1.c
+++ b/gcc-4.9/libgfortran/generated/pack_i1.c
@@ -167,8 +167,8 @@ pack_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_1) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_1));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_i16.c b/gcc-4.9/libgfortran/generated/pack_i16.c
index da1faefd4..01d32ad0f 100644
--- a/gcc-4.9/libgfortran/generated/pack_i16.c
+++ b/gcc-4.9/libgfortran/generated/pack_i16.c
@@ -167,8 +167,8 @@ pack_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_i2.c b/gcc-4.9/libgfortran/generated/pack_i2.c
index 0481720d4..de329abf1 100644
--- a/gcc-4.9/libgfortran/generated/pack_i2.c
+++ b/gcc-4.9/libgfortran/generated/pack_i2.c
@@ -167,8 +167,8 @@ pack_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_2) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_2));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_i4.c b/gcc-4.9/libgfortran/generated/pack_i4.c
index 0a0b4ba38..93ac356f8 100644
--- a/gcc-4.9/libgfortran/generated/pack_i4.c
+++ b/gcc-4.9/libgfortran/generated/pack_i4.c
@@ -167,8 +167,8 @@ pack_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_4));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_i8.c b/gcc-4.9/libgfortran/generated/pack_i8.c
index 183a0fef7..ec7b4275c 100644
--- a/gcc-4.9/libgfortran/generated/pack_i8.c
+++ b/gcc-4.9/libgfortran/generated/pack_i8.c
@@ -167,8 +167,8 @@ pack_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_8));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_r10.c b/gcc-4.9/libgfortran/generated/pack_r10.c
index d1c22973d..8b3e81693 100644
--- a/gcc-4.9/libgfortran/generated/pack_r10.c
+++ b/gcc-4.9/libgfortran/generated/pack_r10.c
@@ -167,8 +167,8 @@ pack_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_10));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_r16.c b/gcc-4.9/libgfortran/generated/pack_r16.c
index 59a6f5872..598ef8e57 100644
--- a/gcc-4.9/libgfortran/generated/pack_r16.c
+++ b/gcc-4.9/libgfortran/generated/pack_r16.c
@@ -167,8 +167,8 @@ pack_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_16));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_r4.c b/gcc-4.9/libgfortran/generated/pack_r4.c
index 86ec8ffef..955a812d2 100644
--- a/gcc-4.9/libgfortran/generated/pack_r4.c
+++ b/gcc-4.9/libgfortran/generated/pack_r4.c
@@ -167,8 +167,8 @@ pack_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_4));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/pack_r8.c b/gcc-4.9/libgfortran/generated/pack_r8.c
index 6d7c15510..d0bb227e1 100644
--- a/gcc-4.9/libgfortran/generated/pack_r8.c
+++ b/gcc-4.9/libgfortran/generated/pack_r8.c
@@ -167,8 +167,8 @@ pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_8));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/generated/parity_l1.c b/gcc-4.9/libgfortran/generated/parity_l1.c
index f71e9ad48..ff81d1ac5 100644
--- a/gcc-4.9/libgfortran/generated/parity_l1.c
+++ b/gcc-4.9/libgfortran/generated/parity_l1.c
@@ -98,10 +98,9 @@ parity_l1 (gfc_array_l1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/parity_l16.c b/gcc-4.9/libgfortran/generated/parity_l16.c
index ba50d9640..66970d00f 100644
--- a/gcc-4.9/libgfortran/generated/parity_l16.c
+++ b/gcc-4.9/libgfortran/generated/parity_l16.c
@@ -98,10 +98,9 @@ parity_l16 (gfc_array_l16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/parity_l2.c b/gcc-4.9/libgfortran/generated/parity_l2.c
index b719eb882..5942257e3 100644
--- a/gcc-4.9/libgfortran/generated/parity_l2.c
+++ b/gcc-4.9/libgfortran/generated/parity_l2.c
@@ -98,10 +98,9 @@ parity_l2 (gfc_array_l2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/parity_l4.c b/gcc-4.9/libgfortran/generated/parity_l4.c
index 7274d72c2..4f8a9f917 100644
--- a/gcc-4.9/libgfortran/generated/parity_l4.c
+++ b/gcc-4.9/libgfortran/generated/parity_l4.c
@@ -98,10 +98,9 @@ parity_l4 (gfc_array_l4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/parity_l8.c b/gcc-4.9/libgfortran/generated/parity_l8.c
index 9c4e57177..73b1d9fba 100644
--- a/gcc-4.9/libgfortran/generated/parity_l8.c
+++ b/gcc-4.9/libgfortran/generated/parity_l8.c
@@ -98,10 +98,9 @@ parity_l8 (gfc_array_l8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
diff --git a/gcc-4.9/libgfortran/generated/product_c10.c b/gcc-4.9/libgfortran/generated/product_c10.c
index 6b2ea5fb0..7b325837a 100644
--- a/gcc-4.9/libgfortran/generated/product_c10.c
+++ b/gcc-4.9/libgfortran/generated/product_c10.c
@@ -97,10 +97,9 @@ product_c10 (gfc_array_c10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
}
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
}
else
@@ -430,8 +428,7 @@ sproduct_c10 (gfc_array_c10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_c10 (gfc_array_c10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_c16.c b/gcc-4.9/libgfortran/generated/product_c16.c
index 42d5dcdb6..4f31e1b63 100644
--- a/gcc-4.9/libgfortran/generated/product_c16.c
+++ b/gcc-4.9/libgfortran/generated/product_c16.c
@@ -97,10 +97,9 @@ product_c16 (gfc_array_c16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
}
else
@@ -430,8 +428,7 @@ sproduct_c16 (gfc_array_c16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_c16 (gfc_array_c16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_c4.c b/gcc-4.9/libgfortran/generated/product_c4.c
index 04d3cf9c4..038c502d4 100644
--- a/gcc-4.9/libgfortran/generated/product_c4.c
+++ b/gcc-4.9/libgfortran/generated/product_c4.c
@@ -97,10 +97,9 @@ product_c4 (gfc_array_c4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
}
else
@@ -430,8 +428,7 @@ sproduct_c4 (gfc_array_c4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_c4 (gfc_array_c4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_c8.c b/gcc-4.9/libgfortran/generated/product_c8.c
index 184e1bc50..a941a6c62 100644
--- a/gcc-4.9/libgfortran/generated/product_c8.c
+++ b/gcc-4.9/libgfortran/generated/product_c8.c
@@ -97,10 +97,9 @@ product_c8 (gfc_array_c8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
}
else
@@ -430,8 +428,7 @@ sproduct_c8 (gfc_array_c8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_c8 (gfc_array_c8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_i1.c b/gcc-4.9/libgfortran/generated/product_i1.c
index 0a8bc2689..39d94fc81 100644
--- a/gcc-4.9/libgfortran/generated/product_i1.c
+++ b/gcc-4.9/libgfortran/generated/product_i1.c
@@ -97,10 +97,9 @@ product_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -430,8 +428,7 @@ sproduct_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_i16.c b/gcc-4.9/libgfortran/generated/product_i16.c
index 97c774afe..a89070a44 100644
--- a/gcc-4.9/libgfortran/generated/product_i16.c
+++ b/gcc-4.9/libgfortran/generated/product_i16.c
@@ -97,10 +97,9 @@ product_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -430,8 +428,7 @@ sproduct_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_i2.c b/gcc-4.9/libgfortran/generated/product_i2.c
index 86d85eedd..c8e04ef85 100644
--- a/gcc-4.9/libgfortran/generated/product_i2.c
+++ b/gcc-4.9/libgfortran/generated/product_i2.c
@@ -97,10 +97,9 @@ product_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -430,8 +428,7 @@ sproduct_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_i4.c b/gcc-4.9/libgfortran/generated/product_i4.c
index 6e7374032..1d3b9cf6a 100644
--- a/gcc-4.9/libgfortran/generated/product_i4.c
+++ b/gcc-4.9/libgfortran/generated/product_i4.c
@@ -97,10 +97,9 @@ product_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -430,8 +428,7 @@ sproduct_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_i8.c b/gcc-4.9/libgfortran/generated/product_i8.c
index c49f57219..7d61b9ba2 100644
--- a/gcc-4.9/libgfortran/generated/product_i8.c
+++ b/gcc-4.9/libgfortran/generated/product_i8.c
@@ -97,10 +97,9 @@ product_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -430,8 +428,7 @@ sproduct_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_r10.c b/gcc-4.9/libgfortran/generated/product_r10.c
index 5aa856349..16aa3059e 100644
--- a/gcc-4.9/libgfortran/generated/product_r10.c
+++ b/gcc-4.9/libgfortran/generated/product_r10.c
@@ -97,10 +97,9 @@ product_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
@@ -430,8 +428,7 @@ sproduct_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_r16.c b/gcc-4.9/libgfortran/generated/product_r16.c
index 63bf37263..3bb085ff1 100644
--- a/gcc-4.9/libgfortran/generated/product_r16.c
+++ b/gcc-4.9/libgfortran/generated/product_r16.c
@@ -97,10 +97,9 @@ product_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
@@ -430,8 +428,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_r4.c b/gcc-4.9/libgfortran/generated/product_r4.c
index 2d852130a..18dfdde96 100644
--- a/gcc-4.9/libgfortran/generated/product_r4.c
+++ b/gcc-4.9/libgfortran/generated/product_r4.c
@@ -97,10 +97,9 @@ product_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
@@ -430,8 +428,7 @@ sproduct_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/product_r8.c b/gcc-4.9/libgfortran/generated/product_r8.c
index 9cb1a177e..7ac062aa9 100644
--- a/gcc-4.9/libgfortran/generated/product_r8.c
+++ b/gcc-4.9/libgfortran/generated/product_r8.c
@@ -97,10 +97,9 @@ product_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
@@ -430,8 +428,7 @@ sproduct_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ sproduct_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/reshape_c10.c b/gcc-4.9/libgfortran/generated/reshape_c10.c
index e516e074c..a7fb560d6 100644
--- a/gcc-4.9/libgfortran/generated/reshape_c10.c
+++ b/gcc-4.9/libgfortran/generated/reshape_c10.c
@@ -111,11 +111,11 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_COMPLEX_10);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_c16.c b/gcc-4.9/libgfortran/generated/reshape_c16.c
index c374af888..a8186f98d 100644
--- a/gcc-4.9/libgfortran/generated/reshape_c16.c
+++ b/gcc-4.9/libgfortran/generated/reshape_c16.c
@@ -111,11 +111,11 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_COMPLEX_16);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_c4.c b/gcc-4.9/libgfortran/generated/reshape_c4.c
index b0043028b..1aa1934ce 100644
--- a/gcc-4.9/libgfortran/generated/reshape_c4.c
+++ b/gcc-4.9/libgfortran/generated/reshape_c4.c
@@ -111,11 +111,11 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_COMPLEX_4);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_c8.c b/gcc-4.9/libgfortran/generated/reshape_c8.c
index 345dcccb2..5b7f79623 100644
--- a/gcc-4.9/libgfortran/generated/reshape_c8.c
+++ b/gcc-4.9/libgfortran/generated/reshape_c8.c
@@ -111,11 +111,11 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_COMPLEX_8);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_i16.c b/gcc-4.9/libgfortran/generated/reshape_i16.c
index f05a93727..b766e1a9a 100644
--- a/gcc-4.9/libgfortran/generated/reshape_i16.c
+++ b/gcc-4.9/libgfortran/generated/reshape_i16.c
@@ -111,11 +111,11 @@ reshape_16 (gfc_array_i16 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_INTEGER_16);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_i4.c b/gcc-4.9/libgfortran/generated/reshape_i4.c
index 174b4ca94..4831857b8 100644
--- a/gcc-4.9/libgfortran/generated/reshape_i4.c
+++ b/gcc-4.9/libgfortran/generated/reshape_i4.c
@@ -111,11 +111,11 @@ reshape_4 (gfc_array_i4 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_INTEGER_4);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_i8.c b/gcc-4.9/libgfortran/generated/reshape_i8.c
index c37775248..1729d488b 100644
--- a/gcc-4.9/libgfortran/generated/reshape_i8.c
+++ b/gcc-4.9/libgfortran/generated/reshape_i8.c
@@ -111,11 +111,11 @@ reshape_8 (gfc_array_i8 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_INTEGER_8);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_r10.c b/gcc-4.9/libgfortran/generated/reshape_r10.c
index ee2c47f21..f1dd44a43 100644
--- a/gcc-4.9/libgfortran/generated/reshape_r10.c
+++ b/gcc-4.9/libgfortran/generated/reshape_r10.c
@@ -111,11 +111,11 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_REAL_10);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_r16.c b/gcc-4.9/libgfortran/generated/reshape_r16.c
index 61c8de4d6..360b18ffd 100644
--- a/gcc-4.9/libgfortran/generated/reshape_r16.c
+++ b/gcc-4.9/libgfortran/generated/reshape_r16.c
@@ -111,11 +111,11 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_REAL_16);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_r4.c b/gcc-4.9/libgfortran/generated/reshape_r4.c
index d7ca64f5e..e06cb5417 100644
--- a/gcc-4.9/libgfortran/generated/reshape_r4.c
+++ b/gcc-4.9/libgfortran/generated/reshape_r4.c
@@ -111,11 +111,11 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_REAL_4);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/reshape_r8.c b/gcc-4.9/libgfortran/generated/reshape_r8.c
index 9700a5861..08888a8ad 100644
--- a/gcc-4.9/libgfortran/generated/reshape_r8.c
+++ b/gcc-4.9/libgfortran/generated/reshape_r8.c
@@ -111,11 +111,11 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof (GFC_REAL_8);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/generated/shape_i16.c b/gcc-4.9/libgfortran/generated/shape_i16.c
index c23f6d4f1..c5047562d 100644
--- a/gcc-4.9/libgfortran/generated/shape_i16.c
+++ b/gcc-4.9/libgfortran/generated/shape_i16.c
@@ -49,7 +49,7 @@ shape_16 (gfc_array_i16 * const restrict ret,
{
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
ret->offset = 0;
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
}
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
diff --git a/gcc-4.9/libgfortran/generated/shape_i4.c b/gcc-4.9/libgfortran/generated/shape_i4.c
index 1abac162d..0a56fe9fe 100644
--- a/gcc-4.9/libgfortran/generated/shape_i4.c
+++ b/gcc-4.9/libgfortran/generated/shape_i4.c
@@ -49,7 +49,7 @@ shape_4 (gfc_array_i4 * const restrict ret,
{
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
ret->offset = 0;
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
}
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
diff --git a/gcc-4.9/libgfortran/generated/shape_i8.c b/gcc-4.9/libgfortran/generated/shape_i8.c
index 707d26c0b..6e9dc2258 100644
--- a/gcc-4.9/libgfortran/generated/shape_i8.c
+++ b/gcc-4.9/libgfortran/generated/shape_i8.c
@@ -49,7 +49,7 @@ shape_8 (gfc_array_i8 * const restrict ret,
{
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
ret->offset = 0;
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
}
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
diff --git a/gcc-4.9/libgfortran/generated/spread_c10.c b/gcc-4.9/libgfortran/generated/spread_c10.c
index ad58e34bc..592443e71 100644
--- a/gcc-4.9/libgfortran/generated/spread_c10.c
+++ b/gcc-4.9/libgfortran/generated/spread_c10.c
@@ -101,8 +101,8 @@ spread_c10 (gfc_array_c10 *ret, const gfc_array_c10 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_10));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_10));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_c10 (gfc_array_c10 *ret, const GFC_COMPLEX_10 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_10));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_10));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_c16.c b/gcc-4.9/libgfortran/generated/spread_c16.c
index 31e82ac58..0fce566d7 100644
--- a/gcc-4.9/libgfortran/generated/spread_c16.c
+++ b/gcc-4.9/libgfortran/generated/spread_c16.c
@@ -101,8 +101,8 @@ spread_c16 (gfc_array_c16 *ret, const gfc_array_c16 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_16));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_16));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_c16 (gfc_array_c16 *ret, const GFC_COMPLEX_16 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_16));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_16));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_c4.c b/gcc-4.9/libgfortran/generated/spread_c4.c
index f17c6ba9f..5d1e86b37 100644
--- a/gcc-4.9/libgfortran/generated/spread_c4.c
+++ b/gcc-4.9/libgfortran/generated/spread_c4.c
@@ -101,8 +101,8 @@ spread_c4 (gfc_array_c4 *ret, const gfc_array_c4 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_4));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_4));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_c4 (gfc_array_c4 *ret, const GFC_COMPLEX_4 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_4));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_4));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_c8.c b/gcc-4.9/libgfortran/generated/spread_c8.c
index 07347a28b..f8b0da8bc 100644
--- a/gcc-4.9/libgfortran/generated/spread_c8.c
+++ b/gcc-4.9/libgfortran/generated/spread_c8.c
@@ -101,8 +101,8 @@ spread_c8 (gfc_array_c8 *ret, const gfc_array_c8 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_8));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_8));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_c8 (gfc_array_c8 *ret, const GFC_COMPLEX_8 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_8));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_8));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_i1.c b/gcc-4.9/libgfortran/generated/spread_i1.c
index 083d26e41..44aef16d3 100644
--- a/gcc-4.9/libgfortran/generated/spread_i1.c
+++ b/gcc-4.9/libgfortran/generated/spread_i1.c
@@ -101,8 +101,8 @@ spread_i1 (gfc_array_i1 *ret, const gfc_array_i1 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_i1 (gfc_array_i1 *ret, const GFC_INTEGER_1 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_i16.c b/gcc-4.9/libgfortran/generated/spread_i16.c
index fb565c3c3..f4ad0180c 100644
--- a/gcc-4.9/libgfortran/generated/spread_i16.c
+++ b/gcc-4.9/libgfortran/generated/spread_i16.c
@@ -101,8 +101,8 @@ spread_i16 (gfc_array_i16 *ret, const gfc_array_i16 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_16));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_16));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_16));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_16));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_i2.c b/gcc-4.9/libgfortran/generated/spread_i2.c
index 5895594d8..02e762839 100644
--- a/gcc-4.9/libgfortran/generated/spread_i2.c
+++ b/gcc-4.9/libgfortran/generated/spread_i2.c
@@ -101,8 +101,8 @@ spread_i2 (gfc_array_i2 *ret, const gfc_array_i2 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_2));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_2));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_i2 (gfc_array_i2 *ret, const GFC_INTEGER_2 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_2));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_2));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_i4.c b/gcc-4.9/libgfortran/generated/spread_i4.c
index 4cb64b0e8..0c8d92736 100644
--- a/gcc-4.9/libgfortran/generated/spread_i4.c
+++ b/gcc-4.9/libgfortran/generated/spread_i4.c
@@ -101,8 +101,8 @@ spread_i4 (gfc_array_i4 *ret, const gfc_array_i4 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_4));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_4));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_i4 (gfc_array_i4 *ret, const GFC_INTEGER_4 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_4));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_4));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_i8.c b/gcc-4.9/libgfortran/generated/spread_i8.c
index 2013c898e..402c746cf 100644
--- a/gcc-4.9/libgfortran/generated/spread_i8.c
+++ b/gcc-4.9/libgfortran/generated/spread_i8.c
@@ -101,8 +101,8 @@ spread_i8 (gfc_array_i8 *ret, const gfc_array_i8 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_8));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_8));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_i8 (gfc_array_i8 *ret, const GFC_INTEGER_8 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_8));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_8));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_r10.c b/gcc-4.9/libgfortran/generated/spread_r10.c
index d43f74575..248186eb3 100644
--- a/gcc-4.9/libgfortran/generated/spread_r10.c
+++ b/gcc-4.9/libgfortran/generated/spread_r10.c
@@ -101,8 +101,8 @@ spread_r10 (gfc_array_r10 *ret, const gfc_array_r10 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_10));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_10));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_r10 (gfc_array_r10 *ret, const GFC_REAL_10 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_10));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_10));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_r16.c b/gcc-4.9/libgfortran/generated/spread_r16.c
index f7452a111..50aef1087 100644
--- a/gcc-4.9/libgfortran/generated/spread_r16.c
+++ b/gcc-4.9/libgfortran/generated/spread_r16.c
@@ -101,8 +101,8 @@ spread_r16 (gfc_array_r16 *ret, const gfc_array_r16 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_16));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_16));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_r16 (gfc_array_r16 *ret, const GFC_REAL_16 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_16));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_16));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_r4.c b/gcc-4.9/libgfortran/generated/spread_r4.c
index b5383fa97..fab55c7a1 100644
--- a/gcc-4.9/libgfortran/generated/spread_r4.c
+++ b/gcc-4.9/libgfortran/generated/spread_r4.c
@@ -101,8 +101,8 @@ spread_r4 (gfc_array_r4 *ret, const gfc_array_r4 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_r4 (gfc_array_r4 *ret, const GFC_REAL_4 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/spread_r8.c b/gcc-4.9/libgfortran/generated/spread_r8.c
index 78bbcdc57..6076638d7 100644
--- a/gcc-4.9/libgfortran/generated/spread_r8.c
+++ b/gcc-4.9/libgfortran/generated/spread_r8.c
@@ -101,8 +101,8 @@ spread_r8 (gfc_array_r8 *ret, const gfc_array_r8 *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
if (rs <= 0)
return;
}
@@ -244,7 +244,7 @@ spread_scalar_r8 (gfc_array_r8 *ret, const GFC_REAL_8 *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/generated/sum_c10.c b/gcc-4.9/libgfortran/generated/sum_c10.c
index cb5fff68b..176623dff 100644
--- a/gcc-4.9/libgfortran/generated/sum_c10.c
+++ b/gcc-4.9/libgfortran/generated/sum_c10.c
@@ -97,10 +97,9 @@ sum_c10 (gfc_array_c10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
}
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
}
else
@@ -430,8 +428,7 @@ ssum_c10 (gfc_array_c10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_c10 (gfc_array_c10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_c16.c b/gcc-4.9/libgfortran/generated/sum_c16.c
index 3f616ec85..055a65930 100644
--- a/gcc-4.9/libgfortran/generated/sum_c16.c
+++ b/gcc-4.9/libgfortran/generated/sum_c16.c
@@ -97,10 +97,9 @@ sum_c16 (gfc_array_c16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
}
else
@@ -430,8 +428,7 @@ ssum_c16 (gfc_array_c16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_c16 (gfc_array_c16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_c4.c b/gcc-4.9/libgfortran/generated/sum_c4.c
index ec5160e3d..6fab436b2 100644
--- a/gcc-4.9/libgfortran/generated/sum_c4.c
+++ b/gcc-4.9/libgfortran/generated/sum_c4.c
@@ -97,10 +97,9 @@ sum_c4 (gfc_array_c4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
}
else
@@ -430,8 +428,7 @@ ssum_c4 (gfc_array_c4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_c4 (gfc_array_c4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_c8.c b/gcc-4.9/libgfortran/generated/sum_c8.c
index 946c722d7..c3d35804d 100644
--- a/gcc-4.9/libgfortran/generated/sum_c8.c
+++ b/gcc-4.9/libgfortran/generated/sum_c8.c
@@ -97,10 +97,9 @@ sum_c8 (gfc_array_c8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
}
else
@@ -430,8 +428,7 @@ ssum_c8 (gfc_array_c8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_c8 (gfc_array_c8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_i1.c b/gcc-4.9/libgfortran/generated/sum_i1.c
index 477581f96..88ee3338b 100644
--- a/gcc-4.9/libgfortran/generated/sum_i1.c
+++ b/gcc-4.9/libgfortran/generated/sum_i1.c
@@ -97,10 +97,9 @@ sum_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
@@ -430,8 +428,7 @@ ssum_i1 (gfc_array_i1 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_i1 (gfc_array_i1 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_i16.c b/gcc-4.9/libgfortran/generated/sum_i16.c
index 52c12a7df..dc35e0709 100644
--- a/gcc-4.9/libgfortran/generated/sum_i16.c
+++ b/gcc-4.9/libgfortran/generated/sum_i16.c
@@ -97,10 +97,9 @@ sum_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
@@ -430,8 +428,7 @@ ssum_i16 (gfc_array_i16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_i16 (gfc_array_i16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_i2.c b/gcc-4.9/libgfortran/generated/sum_i2.c
index af6e29dee..05c088206 100644
--- a/gcc-4.9/libgfortran/generated/sum_i2.c
+++ b/gcc-4.9/libgfortran/generated/sum_i2.c
@@ -97,10 +97,9 @@ sum_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
@@ -430,8 +428,7 @@ ssum_i2 (gfc_array_i2 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_i2 (gfc_array_i2 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_i4.c b/gcc-4.9/libgfortran/generated/sum_i4.c
index 87b10c7d0..3653883c4 100644
--- a/gcc-4.9/libgfortran/generated/sum_i4.c
+++ b/gcc-4.9/libgfortran/generated/sum_i4.c
@@ -97,10 +97,9 @@ sum_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
@@ -430,8 +428,7 @@ ssum_i4 (gfc_array_i4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_i4 (gfc_array_i4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_i8.c b/gcc-4.9/libgfortran/generated/sum_i8.c
index bc8b52ebc..d2878df6f 100644
--- a/gcc-4.9/libgfortran/generated/sum_i8.c
+++ b/gcc-4.9/libgfortran/generated/sum_i8.c
@@ -97,10 +97,9 @@ sum_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
@@ -430,8 +428,7 @@ ssum_i8 (gfc_array_i8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_i8 (gfc_array_i8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_r10.c b/gcc-4.9/libgfortran/generated/sum_r10.c
index 97bb66f3d..cb5169c8a 100644
--- a/gcc-4.9/libgfortran/generated/sum_r10.c
+++ b/gcc-4.9/libgfortran/generated/sum_r10.c
@@ -97,10 +97,9 @@ sum_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
@@ -430,8 +428,7 @@ ssum_r10 (gfc_array_r10 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_r10 (gfc_array_r10 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_r16.c b/gcc-4.9/libgfortran/generated/sum_r16.c
index c089cfdfa..6c67f295f 100644
--- a/gcc-4.9/libgfortran/generated/sum_r16.c
+++ b/gcc-4.9/libgfortran/generated/sum_r16.c
@@ -97,10 +97,9 @@ sum_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
@@ -430,8 +428,7 @@ ssum_r16 (gfc_array_r16 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_r16 (gfc_array_r16 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_r4.c b/gcc-4.9/libgfortran/generated/sum_r4.c
index 2fea0b7e2..a3a4b59ce 100644
--- a/gcc-4.9/libgfortran/generated/sum_r4.c
+++ b/gcc-4.9/libgfortran/generated/sum_r4.c
@@ -97,10 +97,9 @@ sum_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
@@ -430,8 +428,7 @@ ssum_r4 (gfc_array_r4 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_r4 (gfc_array_r4 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/sum_r8.c b/gcc-4.9/libgfortran/generated/sum_r8.c
index e52795da4..0cbf649db 100644
--- a/gcc-4.9/libgfortran/generated/sum_r8.c
+++ b/gcc-4.9/libgfortran/generated/sum_r8.c
@@ -97,10 +97,9 @@ sum_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -272,8 +271,7 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
}
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -285,7 +283,7 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
@@ -430,8 +428,7 @@ ssum_r8 (gfc_array_r8 * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -440,7 +437,7 @@ ssum_r8 (gfc_array_r8 * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_c10.c b/gcc-4.9/libgfortran/generated/transpose_c10.c
index e55883383..bd2012209 100644
--- a/gcc-4.9/libgfortran/generated/transpose_c10.c
+++ b/gcc-4.9/libgfortran/generated/transpose_c10.c
@@ -60,7 +60,8 @@ transpose_c10 (gfc_array_c10 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_COMPLEX_10));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_c16.c b/gcc-4.9/libgfortran/generated/transpose_c16.c
index f11128edd..044509f67 100644
--- a/gcc-4.9/libgfortran/generated/transpose_c16.c
+++ b/gcc-4.9/libgfortran/generated/transpose_c16.c
@@ -60,7 +60,8 @@ transpose_c16 (gfc_array_c16 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_COMPLEX_16));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_c4.c b/gcc-4.9/libgfortran/generated/transpose_c4.c
index f1e5fcebe..c6dd90580 100644
--- a/gcc-4.9/libgfortran/generated/transpose_c4.c
+++ b/gcc-4.9/libgfortran/generated/transpose_c4.c
@@ -60,7 +60,8 @@ transpose_c4 (gfc_array_c4 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_COMPLEX_4));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_c8.c b/gcc-4.9/libgfortran/generated/transpose_c8.c
index 46fde201f..cd5926bf8 100644
--- a/gcc-4.9/libgfortran/generated/transpose_c8.c
+++ b/gcc-4.9/libgfortran/generated/transpose_c8.c
@@ -60,7 +60,8 @@ transpose_c8 (gfc_array_c8 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_COMPLEX_8));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_i16.c b/gcc-4.9/libgfortran/generated/transpose_i16.c
index 236fcf1b5..44aff01ff 100644
--- a/gcc-4.9/libgfortran/generated/transpose_i16.c
+++ b/gcc-4.9/libgfortran/generated/transpose_i16.c
@@ -60,7 +60,8 @@ transpose_i16 (gfc_array_i16 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_INTEGER_16));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_i4.c b/gcc-4.9/libgfortran/generated/transpose_i4.c
index ba875303a..e6844fccb 100644
--- a/gcc-4.9/libgfortran/generated/transpose_i4.c
+++ b/gcc-4.9/libgfortran/generated/transpose_i4.c
@@ -60,7 +60,8 @@ transpose_i4 (gfc_array_i4 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_INTEGER_4));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_i8.c b/gcc-4.9/libgfortran/generated/transpose_i8.c
index 5514f8039..df4a28af2 100644
--- a/gcc-4.9/libgfortran/generated/transpose_i8.c
+++ b/gcc-4.9/libgfortran/generated/transpose_i8.c
@@ -60,7 +60,8 @@ transpose_i8 (gfc_array_i8 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_INTEGER_8));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_r10.c b/gcc-4.9/libgfortran/generated/transpose_r10.c
index a7b570653..2ce05798b 100644
--- a/gcc-4.9/libgfortran/generated/transpose_r10.c
+++ b/gcc-4.9/libgfortran/generated/transpose_r10.c
@@ -60,7 +60,8 @@ transpose_r10 (gfc_array_r10 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_REAL_10));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_r16.c b/gcc-4.9/libgfortran/generated/transpose_r16.c
index 3b9681acb..5009d16cc 100644
--- a/gcc-4.9/libgfortran/generated/transpose_r16.c
+++ b/gcc-4.9/libgfortran/generated/transpose_r16.c
@@ -60,7 +60,8 @@ transpose_r16 (gfc_array_r16 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_REAL_16));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_r4.c b/gcc-4.9/libgfortran/generated/transpose_r4.c
index edf43cbbd..71f70fcd9 100644
--- a/gcc-4.9/libgfortran/generated/transpose_r4.c
+++ b/gcc-4.9/libgfortran/generated/transpose_r4.c
@@ -60,7 +60,8 @@ transpose_r4 (gfc_array_r4 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_REAL_4));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/transpose_r8.c b/gcc-4.9/libgfortran/generated/transpose_r8.c
index 852bcdb2e..9f541e0fb 100644
--- a/gcc-4.9/libgfortran/generated/transpose_r8.c
+++ b/gcc-4.9/libgfortran/generated/transpose_r8.c
@@ -60,7 +60,8 @@ transpose_r8 (gfc_array_r8 * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof (GFC_REAL_8));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_c10.c b/gcc-4.9/libgfortran/generated/unpack_c10.c
index dcdb88d09..6fc2bdc87 100644
--- a/gcc-4.9/libgfortran/generated/unpack_c10.c
+++ b/gcc-4.9/libgfortran/generated/unpack_c10.c
@@ -99,7 +99,7 @@ unpack0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
}
else
{
@@ -244,7 +244,7 @@ unpack1_c10 (gfc_array_c10 *ret, const gfc_array_c10 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_c16.c b/gcc-4.9/libgfortran/generated/unpack_c16.c
index e7a533111..443a51eea 100644
--- a/gcc-4.9/libgfortran/generated/unpack_c16.c
+++ b/gcc-4.9/libgfortran/generated/unpack_c16.c
@@ -99,7 +99,7 @@ unpack0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
}
else
{
@@ -244,7 +244,7 @@ unpack1_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_c4.c b/gcc-4.9/libgfortran/generated/unpack_c4.c
index 927a4c34b..c8b30f5e6 100644
--- a/gcc-4.9/libgfortran/generated/unpack_c4.c
+++ b/gcc-4.9/libgfortran/generated/unpack_c4.c
@@ -99,7 +99,7 @@ unpack0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
}
else
{
@@ -244,7 +244,7 @@ unpack1_c4 (gfc_array_c4 *ret, const gfc_array_c4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_c8.c b/gcc-4.9/libgfortran/generated/unpack_c8.c
index f58a9876a..60d9de1b6 100644
--- a/gcc-4.9/libgfortran/generated/unpack_c8.c
+++ b/gcc-4.9/libgfortran/generated/unpack_c8.c
@@ -99,7 +99,7 @@ unpack0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
}
else
{
@@ -244,7 +244,7 @@ unpack1_c8 (gfc_array_c8 *ret, const gfc_array_c8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_i1.c b/gcc-4.9/libgfortran/generated/unpack_i1.c
index d6c6ee32d..522ce74a9 100644
--- a/gcc-4.9/libgfortran/generated/unpack_i1.c
+++ b/gcc-4.9/libgfortran/generated/unpack_i1.c
@@ -99,7 +99,7 @@ unpack0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
}
else
{
@@ -244,7 +244,7 @@ unpack1_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_i16.c b/gcc-4.9/libgfortran/generated/unpack_i16.c
index 2a5972539..7e0d1f766 100644
--- a/gcc-4.9/libgfortran/generated/unpack_i16.c
+++ b/gcc-4.9/libgfortran/generated/unpack_i16.c
@@ -99,7 +99,7 @@ unpack0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
}
else
{
@@ -244,7 +244,7 @@ unpack1_i16 (gfc_array_i16 *ret, const gfc_array_i16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_i2.c b/gcc-4.9/libgfortran/generated/unpack_i2.c
index 7aeca5066..b0d21dc24 100644
--- a/gcc-4.9/libgfortran/generated/unpack_i2.c
+++ b/gcc-4.9/libgfortran/generated/unpack_i2.c
@@ -99,7 +99,7 @@ unpack0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
}
else
{
@@ -244,7 +244,7 @@ unpack1_i2 (gfc_array_i2 *ret, const gfc_array_i2 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_i4.c b/gcc-4.9/libgfortran/generated/unpack_i4.c
index 2a385ff13..beac1969a 100644
--- a/gcc-4.9/libgfortran/generated/unpack_i4.c
+++ b/gcc-4.9/libgfortran/generated/unpack_i4.c
@@ -99,7 +99,7 @@ unpack0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
}
else
{
@@ -244,7 +244,7 @@ unpack1_i4 (gfc_array_i4 *ret, const gfc_array_i4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_i8.c b/gcc-4.9/libgfortran/generated/unpack_i8.c
index 399bd35a3..75cd2e93f 100644
--- a/gcc-4.9/libgfortran/generated/unpack_i8.c
+++ b/gcc-4.9/libgfortran/generated/unpack_i8.c
@@ -99,7 +99,7 @@ unpack0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
}
else
{
@@ -244,7 +244,7 @@ unpack1_i8 (gfc_array_i8 *ret, const gfc_array_i8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_r10.c b/gcc-4.9/libgfortran/generated/unpack_r10.c
index 406395c42..926a45777 100644
--- a/gcc-4.9/libgfortran/generated/unpack_r10.c
+++ b/gcc-4.9/libgfortran/generated/unpack_r10.c
@@ -99,7 +99,7 @@ unpack0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
}
else
{
@@ -244,7 +244,7 @@ unpack1_r10 (gfc_array_r10 *ret, const gfc_array_r10 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_r16.c b/gcc-4.9/libgfortran/generated/unpack_r16.c
index 0f70e57c5..6fff184cd 100644
--- a/gcc-4.9/libgfortran/generated/unpack_r16.c
+++ b/gcc-4.9/libgfortran/generated/unpack_r16.c
@@ -99,7 +99,7 @@ unpack0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
}
else
{
@@ -244,7 +244,7 @@ unpack1_r16 (gfc_array_r16 *ret, const gfc_array_r16 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_r4.c b/gcc-4.9/libgfortran/generated/unpack_r4.c
index 8b0dde104..c9008745f 100644
--- a/gcc-4.9/libgfortran/generated/unpack_r4.c
+++ b/gcc-4.9/libgfortran/generated/unpack_r4.c
@@ -99,7 +99,7 @@ unpack0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
}
else
{
@@ -244,7 +244,7 @@ unpack1_r4 (gfc_array_r4 *ret, const gfc_array_r4 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
}
else
{
diff --git a/gcc-4.9/libgfortran/generated/unpack_r8.c b/gcc-4.9/libgfortran/generated/unpack_r8.c
index 13e3540c6..5999a51ab 100644
--- a/gcc-4.9/libgfortran/generated/unpack_r8.c
+++ b/gcc-4.9/libgfortran/generated/unpack_r8.c
@@ -99,7 +99,7 @@ unpack0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
}
else
{
@@ -244,7 +244,7 @@ unpack1_r8 (gfc_array_r8 *ret, const gfc_array_r8 *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
}
else
{
diff --git a/gcc-4.9/libgfortran/intrinsics/cshift0.c b/gcc-4.9/libgfortran/intrinsics/cshift0.c
index 12f828927..f983754f1 100644
--- a/gcc-4.9/libgfortran/intrinsics/cshift0.c
+++ b/gcc-4.9/libgfortran/intrinsics/cshift0.c
@@ -79,8 +79,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/intrinsics/eoshift0.c b/gcc-4.9/libgfortran/intrinsics/eoshift0.c
index 1857ab065..7d3721320 100644
--- a/gcc-4.9/libgfortran/intrinsics/eoshift0.c
+++ b/gcc-4.9/libgfortran/intrinsics/eoshift0.c
@@ -86,8 +86,8 @@ eoshift0 (gfc_array_char * ret, const gfc_array_char * array,
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/intrinsics/eoshift2.c b/gcc-4.9/libgfortran/intrinsics/eoshift2.c
index ed264920d..c7ec5cf9f 100644
--- a/gcc-4.9/libgfortran/intrinsics/eoshift2.c
+++ b/gcc-4.9/libgfortran/intrinsics/eoshift2.c
@@ -78,8 +78,8 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array,
ret->offset = 0;
ret->dtype = array->dtype;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
diff --git a/gcc-4.9/libgfortran/intrinsics/pack_generic.c b/gcc-4.9/libgfortran/intrinsics/pack_generic.c
index 9924223b3..3fbfa0aaa 100644
--- a/gcc-4.9/libgfortran/intrinsics/pack_generic.c
+++ b/gcc-4.9/libgfortran/intrinsics/pack_generic.c
@@ -152,8 +152,8 @@ pack_internal (gfc_array_char *ret, const gfc_array_char *array,
GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, size);
if (total == 0)
return; /* In this case, nothing remains to be done. */
@@ -519,7 +519,7 @@ pack_s_internal (gfc_array_char *ret, const gfc_array_char *array,
ret->offset = 0;
- ret->base_addr = xmalloc (size * total);
+ ret->base_addr = xmallocarray (total, size);
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/intrinsics/reshape_generic.c b/gcc-4.9/libgfortran/intrinsics/reshape_generic.c
index 3b2e99487..f742051b5 100644
--- a/gcc-4.9/libgfortran/intrinsics/reshape_generic.c
+++ b/gcc-4.9/libgfortran/intrinsics/reshape_generic.c
@@ -99,11 +99,11 @@ reshape_internal (parray *ret, parray *source, shape_type *shape,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0; /* xmalloc will allocate 1 byte. */
else
- alloc_size = rs * size;
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, size);
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/intrinsics/spread_generic.c b/gcc-4.9/libgfortran/intrinsics/spread_generic.c
index 0fe5722f1..f3f23b8ce 100644
--- a/gcc-4.9/libgfortran/intrinsics/spread_generic.c
+++ b/gcc-4.9/libgfortran/intrinsics/spread_generic.c
@@ -100,7 +100,7 @@ spread_internal (gfc_array_char *ret, const gfc_array_char *source,
GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * size);
+ ret->base_addr = xmallocarray (rs, size);
if (rs <= 0)
return;
@@ -245,7 +245,7 @@ spread_internal_scalar (gfc_array_char *ret, const char *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * size);
+ ret->base_addr = xmallocarray (ncopies, size);
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c b/gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c
index 84182af18..5c50366f3 100644
--- a/gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c
+++ b/gcc-4.9/libgfortran/intrinsics/string_intrinsics_inc.c
@@ -164,7 +164,7 @@ string_trim (gfc_charlen_type *len, CHARTYPE **dest, gfc_charlen_type slen,
else
{
/* Allocate space for result string. */
- *dest = xmalloc (*len * sizeof (CHARTYPE));
+ *dest = xmallocarray (*len, sizeof (CHARTYPE));
/* Copy string if necessary. */
memcpy (*dest, src, *len * sizeof (CHARTYPE));
@@ -442,7 +442,7 @@ string_minmax (gfc_charlen_type *rlen, CHARTYPE **dest, int op, int nargs, ...)
*dest = &zero_length_string;
else
{
- CHARTYPE *tmp = xmalloc (*rlen * sizeof (CHARTYPE));
+ CHARTYPE *tmp = xmallocarray (*rlen, sizeof (CHARTYPE));
memcpy (tmp, res, reslen * sizeof (CHARTYPE));
MEMSET (&tmp[reslen], ' ', *rlen - reslen);
*dest = tmp;
diff --git a/gcc-4.9/libgfortran/intrinsics/transpose_generic.c b/gcc-4.9/libgfortran/intrinsics/transpose_generic.c
index 5ee12ee10..a5e2947a6 100644
--- a/gcc-4.9/libgfortran/intrinsics/transpose_generic.c
+++ b/gcc-4.9/libgfortran/intrinsics/transpose_generic.c
@@ -60,7 +60,7 @@ transpose_internal (gfc_array_char *ret, gfc_array_char *source)
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (size * size0 ((array_t*)ret));
+ ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
ret->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/intrinsics/unpack_generic.c b/gcc-4.9/libgfortran/intrinsics/unpack_generic.c
index 5d12cc11c..4bd99278e 100644
--- a/gcc-4.9/libgfortran/intrinsics/unpack_generic.c
+++ b/gcc-4.9/libgfortran/intrinsics/unpack_generic.c
@@ -125,7 +125,7 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * size);
+ ret->base_addr = xmallocarray (rs, size);
}
else
{
diff --git a/gcc-4.9/libgfortran/io/list_read.c b/gcc-4.9/libgfortran/io/list_read.c
index d871ce9be..b64189afe 100644
--- a/gcc-4.9/libgfortran/io/list_read.c
+++ b/gcc-4.9/libgfortran/io/list_read.c
@@ -2407,7 +2407,7 @@ nml_touch_nodes (namelist_info * nl)
{
index_type len = strlen (nl->var_name) + 1;
int dim;
- char * ext_name = (char*)xmalloc (len + 1);
+ char * ext_name = xmalloc (len + 1);
memcpy (ext_name, nl->var_name, len-1);
memcpy (ext_name + len - 1, "%", 2);
for (nl = nl->next; nl; nl = nl->next)
diff --git a/gcc-4.9/libgfortran/io/transfer.c b/gcc-4.9/libgfortran/io/transfer.c
index cfe92ca06..60b6012c7 100644
--- a/gcc-4.9/libgfortran/io/transfer.c
+++ b/gcc-4.9/libgfortran/io/transfer.c
@@ -3786,9 +3786,9 @@ st_set_nml_var (st_parameter_dt *dtp, void * var_addr, char * var_name,
if (nml->var_rank > 0)
{
nml->dim = (descriptor_dimension*)
- xmalloc (nml->var_rank * sizeof (descriptor_dimension));
+ xmallocarray (nml->var_rank, sizeof (descriptor_dimension));
nml->ls = (array_loop_spec*)
- xmalloc (nml->var_rank * sizeof (array_loop_spec));
+ xmallocarray (nml->var_rank, sizeof (array_loop_spec));
}
else
{
diff --git a/gcc-4.9/libgfortran/io/unit.c b/gcc-4.9/libgfortran/io/unit.c
index 385818adc..d191a8ae2 100644
--- a/gcc-4.9/libgfortran/io/unit.c
+++ b/gcc-4.9/libgfortran/io/unit.c
@@ -454,7 +454,7 @@ get_internal_unit (st_parameter_dt *dtp)
{
iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
iunit->ls = (array_loop_spec *)
- xmalloc (iunit->rank * sizeof (array_loop_spec));
+ xmallocarray (iunit->rank, sizeof (array_loop_spec));
dtp->internal_unit_len *=
init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
diff --git a/gcc-4.9/libgfortran/io/write.c b/gcc-4.9/libgfortran/io/write.c
index eccbe7e2a..f76ec673b 100644
--- a/gcc-4.9/libgfortran/io/write.c
+++ b/gcc-4.9/libgfortran/io/write.c
@@ -1864,7 +1864,7 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
base_var_name_len = base ? strlen (base->var_name) : 0;
ext_name_len = base_name_len + base_var_name_len
+ strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1;
- ext_name = (char*)xmalloc (ext_name_len);
+ ext_name = xmalloc (ext_name_len);
memcpy (ext_name, base_name, base_name_len);
clen = strlen (obj->var_name + base_var_name_len);
@@ -1893,7 +1893,7 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
/* Now obj_name. */
obj_name_len = strlen (obj->var_name) + 1;
- obj_name = xmalloc (obj_name_len+1);
+ obj_name = xmalloc (obj_name_len + 1);
memcpy (obj_name, obj->var_name, obj_name_len-1);
memcpy (obj_name + obj_name_len-1, "%", 2);
diff --git a/gcc-4.9/libgfortran/libgfortran.h b/gcc-4.9/libgfortran/libgfortran.h
index 0d6f432a2..e01d215dd 100644
--- a/gcc-4.9/libgfortran/libgfortran.h
+++ b/gcc-4.9/libgfortran/libgfortran.h
@@ -768,6 +768,9 @@ internal_proto(get_fpu_rounding_mode);
extern void *xmalloc (size_t) __attribute__ ((malloc));
internal_proto(xmalloc);
+extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc));
+internal_proto(xmallocarray);
+
extern void *xcalloc (size_t, size_t) __attribute__ ((malloc));
internal_proto(xcalloc);
diff --git a/gcc-4.9/libgfortran/m4/bessel.m4 b/gcc-4.9/libgfortran/m4/bessel.m4
index 15127e558..36ffd3356 100644
--- a/gcc-4.9/libgfortran/m4/bessel.m4
+++ b/gcc-4.9/libgfortran/m4/bessel.m4
@@ -56,7 +56,7 @@ bessel_jn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2, 'rtype_na
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
+ ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
ret->offset = 0;
}
@@ -123,7 +123,7 @@ bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2,
{
size_t size = n2 < n1 ? 0 : n2-n1+1;
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
+ ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
ret->offset = 0;
}
diff --git a/gcc-4.9/libgfortran/m4/cshift1.m4 b/gcc-4.9/libgfortran/m4/cshift1.m4
index 602bf9edb..e743e9e90 100644
--- a/gcc-4.9/libgfortran/m4/cshift1.m4
+++ b/gcc-4.9/libgfortran/m4/cshift1.m4
@@ -81,7 +81,7 @@ cshift1 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
diff --git a/gcc-4.9/libgfortran/m4/eoshift1.m4 b/gcc-4.9/libgfortran/m4/eoshift1.m4
index c373afe4b..df785ecdc 100644
--- a/gcc-4.9/libgfortran/m4/eoshift1.m4
+++ b/gcc-4.9/libgfortran/m4/eoshift1.m4
@@ -106,8 +106,8 @@ eoshift1 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/m4/eoshift3.m4 b/gcc-4.9/libgfortran/m4/eoshift3.m4
index f1997df36..1a257d98f 100644
--- a/gcc-4.9/libgfortran/m4/eoshift3.m4
+++ b/gcc-4.9/libgfortran/m4/eoshift3.m4
@@ -90,7 +90,7 @@ eoshift3 (gfc_array_char * const restrict ret,
{
int i;
- ret->base_addr = xmalloc (size * arraysize);
+ ret->base_addr = xmallocarray (arraysize, size);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -108,8 +108,8 @@ eoshift3 (gfc_array_char * const restrict ret,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (size * arraysize);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (arraysize, size);
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/m4/iforeach.m4 b/gcc-4.9/libgfortran/m4/iforeach.m4
index a875a2ac2..2b916af66 100644
--- a/gcc-4.9/libgfortran/m4/iforeach.m4
+++ b/gcc-4.9/libgfortran/m4/iforeach.m4
@@ -30,7 +30,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
}
else
{
@@ -133,7 +133,7 @@ void
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
}
else
{
@@ -264,7 +264,7 @@ void
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
retarray->offset = 0;
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
}
else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/m4/ifunction.m4 b/gcc-4.9/libgfortran/m4/ifunction.m4
index 1555aebbc..b4de9a876 100644
--- a/gcc-4.9/libgfortran/m4/ifunction.m4
+++ b/gcc-4.9/libgfortran/m4/ifunction.m4
@@ -85,10 +85,9 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
if (alloc_size == 0)
{
/* Make sure we have a zero-sized array. */
@@ -260,8 +259,7 @@ void
}
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -273,7 +271,7 @@ void
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
}
else
@@ -417,8 +415,7 @@ void
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -427,7 +424,7 @@ void
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
}
else
{
diff --git a/gcc-4.9/libgfortran/m4/ifunction_logical.m4 b/gcc-4.9/libgfortran/m4/ifunction_logical.m4
index 13dd7a928..fd3afb074 100644
--- a/gcc-4.9/libgfortran/m4/ifunction_logical.m4
+++ b/gcc-4.9/libgfortran/m4/ifunction_logical.m4
@@ -89,8 +89,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
retarray->offset = 0;
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
- * extent[rank-1];
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
if (alloc_size == 0)
{
@@ -99,7 +98,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
return;
}
else
- retarray->base_addr = xmalloc (alloc_size);
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
}
else
{
diff --git a/gcc-4.9/libgfortran/m4/in_pack.m4 b/gcc-4.9/libgfortran/m4/in_pack.m4
index 9d515d42b..a807e71e5 100644
--- a/gcc-4.9/libgfortran/m4/in_pack.m4
+++ b/gcc-4.9/libgfortran/m4/in_pack.m4
@@ -79,7 +79,7 @@ internal_pack_'rtype_ccode` ('rtype` * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = ('rtype_name` *)xmalloc (ssize * sizeof ('rtype_name`));
+ destptr = xmallocarray (ssize, sizeof ('rtype_name`));
dest = destptr;
src = source->base_addr;
stride0 = stride[0];
diff --git a/gcc-4.9/libgfortran/m4/matmul.m4 b/gcc-4.9/libgfortran/m4/matmul.m4
index 937daa829..e5f43e2d6 100644
--- a/gcc-4.9/libgfortran/m4/matmul.m4
+++ b/gcc-4.9/libgfortran/m4/matmul.m4
@@ -125,7 +125,7 @@ matmul_'rtype_code` ('rtype` * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/m4/matmull.m4 b/gcc-4.9/libgfortran/m4/matmull.m4
index 25bdc75b9..4be37d5a8 100644
--- a/gcc-4.9/libgfortran/m4/matmull.m4
+++ b/gcc-4.9/libgfortran/m4/matmull.m4
@@ -89,7 +89,7 @@ matmul_'rtype_code` ('rtype` * const restrict retarray,
}
retarray->base_addr
- = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
+ = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
retarray->offset = 0;
}
else if (unlikely (compile_options.bounds_check))
diff --git a/gcc-4.9/libgfortran/m4/pack.m4 b/gcc-4.9/libgfortran/m4/pack.m4
index 8495de4ef..a5517d07b 100644
--- a/gcc-4.9/libgfortran/m4/pack.m4
+++ b/gcc-4.9/libgfortran/m4/pack.m4
@@ -168,8 +168,8 @@ pack_'rtype_code` ('rtype` *ret, const 'rtype` *array,
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * total);
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (total, sizeof ('rtype_name`));
if (total == 0)
return;
diff --git a/gcc-4.9/libgfortran/m4/reshape.m4 b/gcc-4.9/libgfortran/m4/reshape.m4
index 943f3e936..6341b6e9a 100644
--- a/gcc-4.9/libgfortran/m4/reshape.m4
+++ b/gcc-4.9/libgfortran/m4/reshape.m4
@@ -115,11 +115,11 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
ret->offset = 0;
if (unlikely (rs < 1))
- alloc_size = 1;
+ alloc_size = 0;
else
- alloc_size = rs * sizeof ('rtype_name`);
+ alloc_size = rs;
- ret->base_addr = xmalloc (alloc_size);
+ ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`));
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
}
diff --git a/gcc-4.9/libgfortran/m4/shape.m4 b/gcc-4.9/libgfortran/m4/shape.m4
index 85dd233d1..9d02c6c40 100644
--- a/gcc-4.9/libgfortran/m4/shape.m4
+++ b/gcc-4.9/libgfortran/m4/shape.m4
@@ -50,7 +50,7 @@ shape_'rtype_kind` ('rtype` * const restrict ret,
{
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
ret->offset = 0;
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * rank);
+ ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`));
}
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
diff --git a/gcc-4.9/libgfortran/m4/spread.m4 b/gcc-4.9/libgfortran/m4/spread.m4
index 82ae240e1..62cfd81de 100644
--- a/gcc-4.9/libgfortran/m4/spread.m4
+++ b/gcc-4.9/libgfortran/m4/spread.m4
@@ -102,8 +102,8 @@ spread_'rtype_code` ('rtype` *ret, const 'rtype` *source,
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof('rtype_name`));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof('rtype_name`));
if (rs <= 0)
return;
}
@@ -245,7 +245,7 @@ spread_scalar_'rtype_code` ('rtype` *ret, const 'rtype_name` *source,
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof ('rtype_name`));
+ ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}
diff --git a/gcc-4.9/libgfortran/m4/transpose.m4 b/gcc-4.9/libgfortran/m4/transpose.m4
index da4f782b0..6d9f4764c 100644
--- a/gcc-4.9/libgfortran/m4/transpose.m4
+++ b/gcc-4.9/libgfortran/m4/transpose.m4
@@ -61,7 +61,8 @@ transpose_'rtype_code` ('rtype` * const restrict ret,
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
GFC_DESCRIPTOR_EXTENT(source, 1));
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) ret));
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
+ sizeof ('rtype_name`));
ret->offset = 0;
} else if (unlikely (compile_options.bounds_check))
{
diff --git a/gcc-4.9/libgfortran/m4/unpack.m4 b/gcc-4.9/libgfortran/m4/unpack.m4
index 4382ac425..e945446d8 100644
--- a/gcc-4.9/libgfortran/m4/unpack.m4
+++ b/gcc-4.9/libgfortran/m4/unpack.m4
@@ -100,7 +100,7 @@ unpack0_'rtype_code` ('rtype` *ret, const 'rtype` *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
+ ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
}
else
{
@@ -245,7 +245,7 @@ unpack1_'rtype_code` ('rtype` *ret, const 'rtype` *vector,
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
+ ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
}
else
{
diff --git a/gcc-4.9/libgfortran/runtime/convert_char.c b/gcc-4.9/libgfortran/runtime/convert_char.c
index aa819912a..c3cd1c28c 100644
--- a/gcc-4.9/libgfortran/runtime/convert_char.c
+++ b/gcc-4.9/libgfortran/runtime/convert_char.c
@@ -44,7 +44,7 @@ convert_char1_to_char4 (gfc_char4_t **dst, gfc_charlen_type len,
gfc_charlen_type i, l;
l = len > 0 ? len : 0;
- *dst = xmalloc ((l + 1) * sizeof (gfc_char4_t));
+ *dst = xmallocarray ((l + 1), sizeof (gfc_char4_t));
for (i = 0; i < l; i++)
(*dst)[i] = src[i];
@@ -60,7 +60,7 @@ convert_char4_to_char1 (unsigned char **dst, gfc_charlen_type len,
gfc_charlen_type i, l;
l = len > 0 ? len : 0;
- *dst = xmalloc ((l + 1) * sizeof (unsigned char));
+ *dst = xmalloc (l + 1);
for (i = 0; i < l; i++)
(*dst)[i] = src[i];
diff --git a/gcc-4.9/libgfortran/runtime/environ.c b/gcc-4.9/libgfortran/runtime/environ.c
index 0c0e9308f..1095f443a 100644
--- a/gcc-4.9/libgfortran/runtime/environ.c
+++ b/gcc-4.9/libgfortran/runtime/environ.c
@@ -837,7 +837,7 @@ void init_unformatted (variable * v)
}
else
{
- elist = xmalloc (unit_count * sizeof (exception_t));
+ elist = xmallocarray (unit_count, sizeof (exception_t));
do_count = 0;
p = val;
do_parse ();
diff --git a/gcc-4.9/libgfortran/runtime/in_pack_generic.c b/gcc-4.9/libgfortran/runtime/in_pack_generic.c
index 1b8c55843..aab155df6 100644
--- a/gcc-4.9/libgfortran/runtime/in_pack_generic.c
+++ b/gcc-4.9/libgfortran/runtime/in_pack_generic.c
@@ -180,7 +180,7 @@ internal_pack (gfc_array_char * source)
return source->base_addr;
/* Allocate storage for the destination. */
- destptr = xmalloc (ssize * size);
+ destptr = xmallocarray (ssize, size);
dest = (char *)destptr;
src = source->base_addr;
stride0 = stride[0] * size;
diff --git a/gcc-4.9/libgfortran/runtime/memory.c b/gcc-4.9/libgfortran/runtime/memory.c
index efeea86f1..c1e735894 100644
--- a/gcc-4.9/libgfortran/runtime/memory.c
+++ b/gcc-4.9/libgfortran/runtime/memory.c
@@ -25,6 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "libgfortran.h"
#include <stdlib.h>
+#include <errno.h>
+
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t)-1)
+#endif
void *
@@ -44,12 +49,34 @@ xmalloc (size_t n)
}
+void *
+xmallocarray (size_t nmemb, size_t size)
+{
+ void *p;
+
+ if (!nmemb || !size)
+ size = nmemb = 1;
+ else if (nmemb > SIZE_MAX / size)
+ {
+ errno = ENOMEM;
+ os_error ("Integer overflow in xmallocarray");
+ }
+
+ p = malloc (nmemb * size);
+
+ if (!p)
+ os_error ("Memory allocation failed in xmallocarray");
+
+ return p;
+}
+
+
/* calloc wrapper that aborts on error. */
void *
xcalloc (size_t nmemb, size_t size)
{
- if (nmemb * size == 0)
+ if (!nmemb || !size)
nmemb = size = 1;
void *p = calloc (nmemb, size);
diff --git a/gcc-4.9/libgomp/ChangeLog b/gcc-4.9/libgomp/ChangeLog
index 00e34875e..f84950d94 100644
--- a/gcc-4.9/libgomp/ChangeLog
+++ b/gcc-4.9/libgomp/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-06-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
diff --git a/gcc-4.9/libiberty/ChangeLog b/gcc-4.9/libiberty/ChangeLog
index 5b78c2e72..44e79a0f9 100644
--- a/gcc-4.9/libiberty/ChangeLog
+++ b/gcc-4.9/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libitm/ChangeLog b/gcc-4.9/libitm/ChangeLog
index 5c1b352a4..02afa89b5 100644
--- a/gcc-4.9/libitm/ChangeLog
+++ b/gcc-4.9/libitm/ChangeLog
@@ -1,3 +1,13 @@
+2014-07-24 Richard Henderson <rth@redhat.com>
+
+ * config/aarch64/sjlj.S: New file.
+ * config/aarch64/target.h: New file.
+ * configure.tgt: Enable aarch64.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-05-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* acinclude.m4 (LIBITM_CHECK_LINKER_HWCAP): Check for
diff --git a/gcc-4.9/libitm/configure.tgt b/gcc-4.9/libitm/configure.tgt
index 4694a9b8a..44c1a144a 100644
--- a/gcc-4.9/libitm/configure.tgt
+++ b/gcc-4.9/libitm/configure.tgt
@@ -46,6 +46,7 @@ fi
# Map the target cpu to an ARCH sub-directory. At the same time,
# work out any special compilation flags as necessary.
case "${target_cpu}" in
+ aarch64*) ARCH=aarch64 ;;
alpha*) ARCH=alpha ;;
rs6000 | powerpc*)
XCFLAGS="${XCFLAGS} -mhtm"
diff --git a/gcc-4.9/libjava/ChangeLog b/gcc-4.9/libjava/ChangeLog
index 93cbe8247..aeef0afe5 100644
--- a/gcc-4.9/libjava/ChangeLog
+++ b/gcc-4.9/libjava/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libjava/classpath/ChangeLog b/gcc-4.9/libjava/classpath/ChangeLog
index a9ed73596..961745fe2 100644
--- a/gcc-4.9/libjava/classpath/ChangeLog
+++ b/gcc-4.9/libjava/classpath/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libjava/libltdl/ChangeLog b/gcc-4.9/libjava/libltdl/ChangeLog
index 323fd2efe..45db6e124 100644
--- a/gcc-4.9/libjava/libltdl/ChangeLog
+++ b/gcc-4.9/libjava/libltdl/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libobjc/ChangeLog b/gcc-4.9/libobjc/ChangeLog
index 5a810fc08..9d7969bc4 100644
--- a/gcc-4.9/libobjc/ChangeLog
+++ b/gcc-4.9/libobjc/ChangeLog
@@ -1,3 +1,20 @@
+2014-07-28 Ulrich Weigand <uweigand@de.ibm.com>
+
+ PR libobjc/61920
+ * encoding.c (rs6000_special_adjust_field_align_p): Use definition
+ that matches the 4.9 branch ABI.
+
+2014-07-27 Alan Modra <amodra@gmail.com>
+ Matthias Klose <doko@ubuntu.com>
+
+ PR libobjc/61920
+
+ * encoding.c: Define rs6000_special_adjust_field_align_p.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libobjc/encoding.c b/gcc-4.9/libobjc/encoding.c
index 7ecc812a9..c476f22ad 100644
--- a/gcc-4.9/libobjc/encoding.c
+++ b/gcc-4.9/libobjc/encoding.c
@@ -192,6 +192,8 @@ _darwin_rs6000_special_round_type_align (const char *struc, int comp, int spec)
? MAX (MAX (COMPUTED, SPECIFIED), 64) \
: MAX (COMPUTED, SPECIFIED));})
+#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
+ (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
/* Skip a variable name, enclosed in quotes ("). */
static inline
diff --git a/gcc-4.9/libquadmath/ChangeLog b/gcc-4.9/libquadmath/ChangeLog
index a533dc49e..3c50d5191 100644
--- a/gcc-4.9/libquadmath/ChangeLog
+++ b/gcc-4.9/libquadmath/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libsanitizer/ChangeLog b/gcc-4.9/libsanitizer/ChangeLog
index fe2c4f8ce..840bca878 100644
--- a/gcc-4.9/libsanitizer/ChangeLog
+++ b/gcc-4.9/libsanitizer/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libssp/ChangeLog b/gcc-4.9/libssp/ChangeLog
index 1289c62de..a4455377a 100644
--- a/gcc-4.9/libssp/ChangeLog
+++ b/gcc-4.9/libssp/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/libstdc++-v3/ChangeLog b/gcc-4.9/libstdc++-v3/ChangeLog
index 7662fa12f..09b7017cd 100644
--- a/gcc-4.9/libstdc++-v3/ChangeLog
+++ b/gcc-4.9/libstdc++-v3/ChangeLog
@@ -1,3 +1,18 @@
+2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
+
+ PR libstdc++/60037 - SIGFPE in std::generate_canonical<unsigned int...>
+ * include/bits/random.h (_Adaptor): static_assert for non floating-point
+ result type.
+ * include/bits/random.tcc (generate_canonical): Ditto.
+ * include/ext/random.tcc (hypergeometric_distribution::operator()):
+ Use double as a rng result type.
+ * testsuite/26_numerics/random/pr60037-neg.cc: New.
+ * testsuite/ext/random/hypergeometric_distribution/pr60037.cc: New.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-06-23 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/61532
diff --git a/gcc-4.9/libstdc++-v3/include/bits/random.h b/gcc-4.9/libstdc++-v3/include/bits/random.h
index edfd797b7..b34dbe659 100644
--- a/gcc-4.9/libstdc++-v3/include/bits/random.h
+++ b/gcc-4.9/libstdc++-v3/include/bits/random.h
@@ -164,6 +164,8 @@ _GLIBCXX_END_NAMESPACE_VERSION
template<typename _Engine, typename _DInputType>
struct _Adaptor
{
+ static_assert(std::is_floating_point<_DInputType>::value,
+ "template argument not a floating point type");
public:
_Adaptor(_Engine& __g)
diff --git a/gcc-4.9/libstdc++-v3/include/bits/random.tcc b/gcc-4.9/libstdc++-v3/include/bits/random.tcc
index 0eda287f4..8849ee90d 100644
--- a/gcc-4.9/libstdc++-v3/include/bits/random.tcc
+++ b/gcc-4.9/libstdc++-v3/include/bits/random.tcc
@@ -3463,6 +3463,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_RealType
generate_canonical(_UniformRandomNumberGenerator& __urng)
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
const size_t __b
= std::min(static_cast<size_t>(std::numeric_limits<_RealType>::digits),
__bits);
diff --git a/gcc-4.9/libstdc++-v3/include/ext/random.tcc b/gcc-4.9/libstdc++-v3/include/ext/random.tcc
index dd7a14a42..fec7f862b 100644
--- a/gcc-4.9/libstdc++-v3/include/ext/random.tcc
+++ b/gcc-4.9/libstdc++-v3/include/ext/random.tcc
@@ -1314,7 +1314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator()(_UniformRandomNumberGenerator& __urng,
const param_type& __param)
{
- std::__detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
+ std::__detail::_Adaptor<_UniformRandomNumberGenerator, double>
__aurng(__urng);
result_type __a = __param.successful_size();
diff --git a/gcc-4.9/libvtv/ChangeLog b/gcc-4.9/libvtv/ChangeLog
index bda11cd48..bf84e4baa 100644
--- a/gcc-4.9/libvtv/ChangeLog
+++ b/gcc-4.9/libvtv/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/lto-plugin/ChangeLog b/gcc-4.9/lto-plugin/ChangeLog
index 6dfaee2a9..b58ed2614 100644
--- a/gcc-4.9/lto-plugin/ChangeLog
+++ b/gcc-4.9/lto-plugin/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-05-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR lto/60981
diff --git a/gcc-4.9/maintainer-scripts/ChangeLog b/gcc-4.9/maintainer-scripts/ChangeLog
index 07de6db6c..b598869d5 100644
--- a/gcc-4.9/maintainer-scripts/ChangeLog
+++ b/gcc-4.9/maintainer-scripts/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.
diff --git a/gcc-4.9/zlib/ChangeLog b/gcc-4.9/zlib/ChangeLog
index 9b334dd69..c7c8fa46e 100644
--- a/gcc-4.9/zlib/ChangeLog
+++ b/gcc-4.9/zlib/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-04-22 Release Manager
* GCC 4.9.0 released.