From 0ae9a828c4a2bc183decbf9288d50d6ccb9e2fdc Mon Sep 17 00:00:00 2001 From: hjl Date: Sat, 17 Apr 2010 13:47:40 +0000 Subject: [PATCH] Merged r158229 through r158464 into branch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ifunc@158465 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog | 24 + MAINTAINERS | 1 + config/ChangeLog | 4 + config/elf.m4 | 2 +- configure | 61 +- configure.ac | 25 +- fixincludes/ChangeLog | 6 + fixincludes/fixincl.x | 53 +- fixincludes/inclhack.def | 21 - fixincludes/tests/base/wchar.h | 15 - gcc/ChangeLog | 794 +- gcc/DATESTAMP | 2 +- gcc/Makefile.in | 15 +- gcc/ada/ChangeLog | 335 + gcc/ada/back_end.adb | 4 +- gcc/ada/g-socket.adb | 134 +- gcc/ada/gcc-interface/Make-lang.in | 3 +- gcc/ada/gcc-interface/ada-tree.def | 11 +- gcc/ada/gcc-interface/ada-tree.h | 49 +- gcc/ada/gcc-interface/cuintp.c | 63 +- gcc/ada/gcc-interface/decl.c | 559 +- gcc/ada/gcc-interface/gadaint.h | 35 + gcc/ada/gcc-interface/gigi.h | 114 +- gcc/ada/gcc-interface/misc.c | 55 +- gcc/ada/gcc-interface/trans.c | 1315 ++-- gcc/ada/gcc-interface/utils.c | 315 +- gcc/ada/gcc-interface/utils2.c | 255 +- gcc/ada/gsocket.h | 15 +- gcc/ada/uintp.adb | 16 +- gcc/ada/uintp.h | 42 +- gcc/alias.c | 38 +- gcc/basic-block.h | 4 + gcc/builtins.c | 101 +- gcc/c-common.c | 29 +- gcc/c-common.h | 1 + gcc/c-pch.c | 25 +- gcc/cfgcleanup.c | 164 +- gcc/cfgexpand.c | 12 +- gcc/common.opt | 4 + gcc/config.build | 7 +- gcc/config.gcc | 33 +- gcc/config.in | 18 + gcc/config/alpha/alpha.c | 5 +- gcc/config/alpha/{osf.h => osf5.h} | 56 +- gcc/config/alpha/{t-osf4 => t-osf5} | 0 gcc/config/arm/arm-generic.md | 10 +- gcc/config/arm/arm-protos.h | 12 + gcc/config/arm/arm.c | 79 +- gcc/config/arm/arm.h | 11 +- gcc/config/arm/arm.md | 59 +- gcc/config/arm/predicates.md | 7 + gcc/config/arm/thumb2.md | 17 +- gcc/config/arm/vfp.md | 24 +- gcc/config/h8300/h8300.c | 12 +- gcc/config/h8300/h8300.h | 31 +- gcc/config/h8300/h8300.md | 129 +- gcc/config/h8300/predicates.md | 13 +- gcc/config/i386/i386.c | 10 +- gcc/config/i386/i386.md | 857 +- gcc/config/i386/mmx.md | 10 +- gcc/config/i386/sse.md | 40 +- gcc/config/i386/sync.md | 2 +- gcc/config/pa/pa.c | 12 +- gcc/config/pa/pa.md | 31 +- gcc/config/s390/s390.c | 165 +- gcc/config/s390/s390.h | 68 +- gcc/config/s390/s390.md | 382 +- gcc/config/sh/sh.c | 64 +- gcc/config/sh/sh.h | 19 +- gcc/config/sh/sh.md | 18 +- gcc/config/sh/sh.opt | 4 + gcc/configure | 61 +- gcc/configure.ac | 20 +- gcc/cp/ChangeLog | 35 + gcc/cp/call.c | 2 + gcc/cp/cp-tree.h | 3 +- gcc/cp/init.c | 88 +- gcc/cp/parser.c | 40 +- gcc/cp/pt.c | 6 + gcc/cp/semantics.c | 7 +- gcc/df-core.c | 2 +- gcc/diagnostic.c | 38 +- gcc/doc/contrib.texi | 6 +- gcc/doc/install.texi | 95 +- gcc/doc/invoke.texi | 34 +- gcc/doc/plugins.texi | 8 + gcc/double-int.c | 784 +- gcc/double-int.h | 78 +- gcc/dwarf2asm.c | 16 +- gcc/dwarf2out.c | 55 +- gcc/except.c | 3 - gcc/except.h | 3 - gcc/expmed.c | 56 +- gcc/fold-const.c | 935 +-- gcc/fortran/ChangeLog | 382 + gcc/fortran/Make-lang.in | 6 +- gcc/fortran/arith.c | 297 +- gcc/fortran/arith.h | 3 - gcc/fortran/array.c | 455 +- gcc/fortran/check.c | 221 +- gcc/fortran/constructor.c | 253 + gcc/fortran/constructor.h | 90 + gcc/fortran/data.c | 252 +- gcc/fortran/decl.c | 92 +- gcc/fortran/dependency.c | 7 +- gcc/fortran/dump-parse-tree.c | 8 +- gcc/fortran/expr.c | 964 ++- gcc/fortran/gfortran.h | 46 +- gcc/fortran/gfortranspec.c | 5 +- gcc/fortran/intrinsic.c | 27 +- gcc/fortran/intrinsic.h | 8 + gcc/fortran/intrinsic.texi | 397 +- gcc/fortran/io.c | 27 +- gcc/fortran/iresolve.c | 34 +- gcc/fortran/match.c | 24 +- gcc/fortran/matchexp.c | 34 +- gcc/fortran/module.c | 21 +- gcc/fortran/primary.c | 66 +- gcc/fortran/resolve.c | 55 +- gcc/fortran/simplify.c | 2317 +++--- gcc/fortran/symbol.c | 44 +- gcc/fortran/target-memory.c | 113 +- gcc/fortran/trans-array.c | 76 +- gcc/fortran/trans-array.h | 2 +- gcc/fortran/trans-const.c | 9 +- gcc/fortran/trans-decl.c | 43 +- gcc/fortran/trans-expr.c | 35 +- gcc/fortran/trans-intrinsic.c | 6 +- gcc/fortran/trans-io.c | 19 +- gcc/fortran/trans.h | 2 +- gcc/gcc-plugin.h | 6 + gcc/gcc.c | 20 + gcc/genattrtab.c | 4 +- gcc/genoutput.c | 2 + gcc/ggc-common.c | 7 + gcc/gimple-fold.c | 1596 ++++ gcc/gimple-pretty-print.c | 100 +- gcc/gimple.c | 12 +- gcc/gimple.h | 12 + gcc/ifcvt.c | 89 +- gcc/ipa-inline.c | 161 +- gcc/ira-color.c | 90 +- gcc/longlong.h | 23 + gcc/lto/ChangeLog | 5 + gcc/lto/lto-elf.c | 16 + gcc/opt-functions.awk | 18 + gcc/optc-gen.awk | 6 +- gcc/opth-gen.awk | 8 +- gcc/plugin.c | 48 +- gcc/po/ChangeLog | 5 + gcc/po/be.po | 8147 +++++++++---------- gcc/po/da.po | 8175 +++++++++---------- gcc/po/de.po | 8204 +++++++++---------- gcc/po/el.po | 8163 +++++++++---------- gcc/po/es.po | 8218 ++++++++++---------- gcc/po/fi.po | 8159 +++++++++---------- gcc/po/fr.po | 8180 +++++++++---------- gcc/po/id.po | 8189 +++++++++---------- gcc/po/ja.po | 8180 +++++++++---------- gcc/po/nl.po | 8168 +++++++++---------- gcc/po/ru.po | 8164 +++++++++---------- gcc/po/sr.po | 8195 +++++++++---------- gcc/po/sv.po | 8210 +++++++++---------- gcc/po/tr.po | 8182 +++++++++---------- gcc/po/zh_CN.po | 8207 +++++++++---------- gcc/po/zh_TW.po | 8169 +++++++++---------- gcc/print-rtl.c | 2 +- gcc/recog.c | 2 + gcc/recog.h | 5 + gcc/reload.c | 2 +- gcc/testsuite/ChangeLog | 182 +- .../{gcc.dg => c-c++-common}/cpp/normalize-3.c | 3 +- .../c-c++-common/cpp/warning-directive-1.c | 4 + .../cpp/warning-directive-2.c | 5 +- .../cpp/warning-directive-3.c | 4 +- .../cpp/warning-directive-4.c | 4 +- gcc/testsuite/g++.dg/cpp/normalize-1.C | 34 - gcc/testsuite/g++.dg/cpp/warning-directive-1.C | 4 - gcc/testsuite/g++.dg/cpp/warning-directive-2.C | 4 - gcc/testsuite/g++.dg/cpp/warning-directive-3.C | 4 - gcc/testsuite/g++.dg/cpp/warning-directive-4.C | 4 - gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv4.C | 13 + gcc/testsuite/g++.dg/cpp0x/lambda/lambda-uneval.C | 7 + gcc/testsuite/g++.dg/dg.exp | 4 + gcc/testsuite/g++.dg/ext/attrib38.C | 11 + gcc/testsuite/g++.dg/init/pr25811.C | 195 + gcc/testsuite/g++.dg/torture/pr36191.C | 2 +- gcc/testsuite/g++.dg/warn/miss-format-1.C | 4 +- gcc/testsuite/gcc.dg/c99-stdint-6.c | 2 +- gcc/testsuite/gcc.dg/cpp/cpp.exp | 5 + gcc/testsuite/gcc.dg/cpp/warn-comments-2.c | 4 +- gcc/testsuite/gcc.dg/cpp/warn-cxx-compat-2.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-deprecated-2.c | 4 +- gcc/testsuite/gcc.dg/cpp/warn-long-long-2.c | 4 +- gcc/testsuite/gcc.dg/cpp/warn-multichar-2.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-traditional-2.c | 18 +- gcc/testsuite/gcc.dg/cpp/warn-trigraphs-3.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-trigraphs-4.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-undef-2.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-variadic-2.c | 4 +- gcc/testsuite/gcc.dg/cpp/warning-directive-1.c | 4 - gcc/testsuite/gcc.dg/guality/inline-params.c | 2 +- gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c | 50 + gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c | 30 + gcc/testsuite/gcc.dg/ipa/ipa-pta-11.c | 33 + gcc/testsuite/gcc.dg/ipa/ipa-pta-12.c | 34 + gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c | 56 + gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c | 25 + gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c | 28 + gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c | 33 + gcc/testsuite/gcc.dg/ipa/ipa-pta-5.c | 26 + gcc/testsuite/gcc.dg/ipa/ipa-pta-6.c | 25 + gcc/testsuite/gcc.dg/ipa/ipa-pta-7.c | 30 + gcc/testsuite/gcc.dg/ipa/ipa-pta-8.c | 31 + gcc/testsuite/gcc.dg/ipa/ipa-pta-9.c | 17 + gcc/testsuite/gcc.dg/plugindir1.c | 4 + gcc/testsuite/gcc.dg/plugindir2.c | 4 + gcc/testsuite/gcc.dg/plugindir3.c | 4 + gcc/testsuite/gcc.dg/plugindir4.c | 4 + gcc/testsuite/gcc.dg/pr42963.c | 28 + gcc/testsuite/gcc.dg/pr43643.c | 1 + gcc/testsuite/gcc.dg/pr43730.c | 19 + gcc/testsuite/gcc.dg/torture/ipa-pta-1.c | 2 +- gcc/testsuite/gcc.dg/torture/ipa-pta-2.c | 24 + gcc/testsuite/gcc.dg/tree-ssa/negate.c | 20 + gcc/testsuite/gcc.dg/tree-ssa/sra-9.c | 20 + gcc/testsuite/gcc.dg/tree-ssa/tailcall-5.c | 12 + gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c | 2 +- gcc/testsuite/gcc.target/arm/pr42496.c | 16 + gcc/testsuite/gcc.target/arm/thumb-cbranchqi.c | 15 + gcc/testsuite/gcc.target/arm/thumb-comparisons.c | 18 + gcc/testsuite/gcc.target/i386/rotate-2.c | 17 + gcc/testsuite/gfortran.dg/coarray_10.f90 | 28 + gcc/testsuite/gfortran.dg/coarray_11.f90 | 56 + gcc/testsuite/gfortran.dg/coarray_9.f90 | 7 +- gcc/testsuite/gfortran.dg/initialization_24.f90 | 9 + gcc/testsuite/gfortran.dg/warning-directive-2.F90 | 2 +- .../gnat.dg/{class_wide.adb => class_wide1.adb} | 2 +- gcc/testsuite/gnat.dg/class_wide2.adb | 13 + gcc/testsuite/gnat.dg/class_wide2.ads | 17 + gcc/testsuite/gnat.dg/derived_type1.adb | 28 + gcc/testsuite/gnat.dg/specs/discr_private.ads | 50 + gcc/testsuite/gnat.dg/wide_boolean.adb | 26 + gcc/testsuite/gnat.dg/wide_boolean_pkg.adb | 9 + gcc/testsuite/gnat.dg/wide_boolean_pkg.ads | 24 + gcc/timevar.def | 8 + gcc/tree-cfg.c | 205 +- gcc/tree-dfa.c | 5 +- gcc/tree-dump.c | 1 + gcc/tree-flow-inline.h | 9 - gcc/tree-flow.h | 12 +- gcc/tree-inline.c | 25 +- gcc/tree-into-ssa.c | 10 +- gcc/tree-nrv.c | 20 +- gcc/tree-pass.h | 3 +- gcc/tree-pretty-print.c | 7 + gcc/tree-sra.c | 51 +- gcc/tree-ssa-alias.c | 12 +- gcc/tree-ssa-alias.h | 13 +- gcc/tree-ssa-ccp.c | 1554 +--- gcc/tree-ssa-reassoc.c | 142 +- gcc/tree-ssa-structalias.c | 1578 +++- gcc/tree-tailcall.c | 44 +- gcc/tree-vect-data-refs.c | 148 +- gcc/tree-vect-loop.c | 35 +- gcc/tree-vect-slp.c | 25 +- gcc/tree-vectorizer.h | 8 +- gcc/tree.c | 35 +- gcc/tree.h | 55 +- include/ChangeLog | 10 +- include/filenames.h | 14 +- libcpp/po/ChangeLog | 9 + libcpp/po/be.po | 52 +- libcpp/po/ca.po | 52 +- libcpp/po/da.po | 52 +- libcpp/po/de.po | 52 +- libcpp/po/el.po | 52 +- libcpp/po/es.po | 52 +- libcpp/po/fr.po | 52 +- libcpp/po/id.po | 52 +- libcpp/po/ja.po | 52 +- libcpp/po/nl.po | 52 +- libcpp/po/sv.po | 56 +- libcpp/po/tr.po | 52 +- libcpp/po/uk.po | 52 +- libcpp/po/vi.po | 56 +- libcpp/po/zh_CN.po | 52 +- libcpp/po/zh_TW.po | 52 +- libgcc/ChangeLog | 9 + libgcc/config.host | 3 +- libgomp/ChangeLog | 6 + libgomp/acinclude.m4 | 2 +- libgomp/configure | 2 +- libjava/include/s390-signal.h | 74 +- libstdc++-v3/ChangeLog | 12 + libstdc++-v3/configure | 2 +- libstdc++-v3/configure.host | 2 +- libstdc++-v3/crossconfig.m4 | 2 +- libstdc++-v3/include/backward/hash_map | 3 + libstdc++-v3/include/backward/hash_set | 3 + maintainer-scripts/ChangeLog | 4 + maintainer-scripts/crontab | 2 +- 305 files changed, 82115 insertions(+), 73229 deletions(-) delete mode 100644 fixincludes/tests/base/wchar.h create mode 100644 gcc/ada/gcc-interface/gadaint.h rename gcc/config/alpha/{osf.h => osf5.h} (81%) rename gcc/config/alpha/{t-osf4 => t-osf5} (100%) create mode 100644 gcc/fortran/constructor.c create mode 100644 gcc/fortran/constructor.h create mode 100644 gcc/gimple-fold.c rename gcc/testsuite/{gcc.dg => c-c++-common}/cpp/normalize-3.c (88%) create mode 100644 gcc/testsuite/c-c++-common/cpp/warning-directive-1.c rename gcc/testsuite/{gcc.dg => c-c++-common}/cpp/warning-directive-2.c (52%) rename gcc/testsuite/{gcc.dg => c-c++-common}/cpp/warning-directive-3.c (56%) rename gcc/testsuite/{gcc.dg => c-c++-common}/cpp/warning-directive-4.c (60%) delete mode 100644 gcc/testsuite/g++.dg/cpp/normalize-1.C delete mode 100644 gcc/testsuite/g++.dg/cpp/warning-directive-1.C delete mode 100644 gcc/testsuite/g++.dg/cpp/warning-directive-2.C delete mode 100644 gcc/testsuite/g++.dg/cpp/warning-directive-3.C delete mode 100644 gcc/testsuite/g++.dg/cpp/warning-directive-4.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv4.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-uneval.C create mode 100644 gcc/testsuite/g++.dg/ext/attrib38.C create mode 100644 gcc/testsuite/g++.dg/init/pr25811.C delete mode 100644 gcc/testsuite/gcc.dg/cpp/warning-directive-1.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-11.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-12.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-5.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-6.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-7.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-8.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-pta-9.c create mode 100644 gcc/testsuite/gcc.dg/plugindir1.c create mode 100644 gcc/testsuite/gcc.dg/plugindir2.c create mode 100644 gcc/testsuite/gcc.dg/plugindir3.c create mode 100644 gcc/testsuite/gcc.dg/plugindir4.c create mode 100644 gcc/testsuite/gcc.dg/pr42963.c create mode 100644 gcc/testsuite/gcc.dg/pr43730.c create mode 100644 gcc/testsuite/gcc.dg/torture/ipa-pta-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/negate.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/sra-9.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/tailcall-5.c create mode 100644 gcc/testsuite/gcc.target/arm/pr42496.c create mode 100644 gcc/testsuite/gcc.target/arm/thumb-cbranchqi.c create mode 100644 gcc/testsuite/gcc.target/arm/thumb-comparisons.c create mode 100644 gcc/testsuite/gcc.target/i386/rotate-2.c create mode 100644 gcc/testsuite/gfortran.dg/coarray_10.f90 create mode 100644 gcc/testsuite/gfortran.dg/coarray_11.f90 create mode 100644 gcc/testsuite/gfortran.dg/initialization_24.f90 rename gcc/testsuite/gnat.dg/{class_wide.adb => class_wide1.adb} (94%) create mode 100644 gcc/testsuite/gnat.dg/class_wide2.adb create mode 100644 gcc/testsuite/gnat.dg/class_wide2.ads create mode 100644 gcc/testsuite/gnat.dg/derived_type1.adb create mode 100644 gcc/testsuite/gnat.dg/specs/discr_private.ads create mode 100644 gcc/testsuite/gnat.dg/wide_boolean.adb create mode 100644 gcc/testsuite/gnat.dg/wide_boolean_pkg.adb create mode 100644 gcc/testsuite/gnat.dg/wide_boolean_pkg.ads diff --git a/ChangeLog b/ChangeLog index be4491a225d..155e1abe374 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2010-04-17 Ralf Corsépius + + * configure.ac (*-*-rtems*): Add target-libiberty to $skipdirs. + * configure: Regenerate. + +2010-04-16 Rainer Orth + + * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx + separately. + * configure: Regenerate. + +2010-04-16 Kevin Williams + + * MAINTAINERS (Write After Approval): Add myself. + +2010-04-14 Tristan Gingold + + * configure.ac (alpha*-*-*vms*): Remove ld from noconfigdirs. + * configure: Regenerate. + +2010-04-13 Steve Ellcey + + * configure: Regenerate after change to elf.m4. + 2010-04-06 Iain Sandoe * MAINTAINERS (Write After Approval): Add myself. diff --git a/MAINTAINERS b/MAINTAINERS index 23a0a222de7..5310d5dbf5a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -478,6 +478,7 @@ Zack Weinberg zackw@panix.com Mark Wielaard mark@gcc.gnu.org Ollie Wild aaw@google.com Ralf Wildenhues Ralf.Wildenhues@gmx.de +Kevin Williams kevin.williams@inria.fr Carlo Wood carlo@alinoe.com Le-Chun Wu lcwu@google.com Canqun Yang canqun@nudt.edu.cn diff --git a/config/ChangeLog b/config/ChangeLog index 40921047283..e0ce47425a3 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2010-04-13 Steve Ellcey + + * elf.m4: Add hppa[12]*-*-hpux* to list of non-elf platforms. + 2010-03-23 Kai Tietz * mh-mingw: Revert accidentally checking r156315. diff --git a/config/elf.m4 b/config/elf.m4 index 44d02498f24..007006eaea2 100644 --- a/config/elf.m4 +++ b/config/elf.m4 @@ -15,7 +15,7 @@ target_elf=no case $target in *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \ *-msdosdjgpp* | *-netware* | *-vms* | *-wince* | *-*-pe* | \ - alpha*-dec-osf* | *-interix*) + alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux*) target_elf=no ;; *) diff --git a/configure b/configure index 02272032e70..c8c60593155 100755 --- a/configure +++ b/configure @@ -3291,6 +3291,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap" ;; *-*-rtems*) + skipdirs="${skipdirs} target-libiberty" noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; # The tpf target doesn't support gdb yet. @@ -3310,7 +3311,7 @@ case "${target}" in noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss" ;; alpha*-*-*vms*) - noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; alpha*-*-linux*) # newlib is not 64 bit ready @@ -6002,7 +6003,7 @@ target_elf=no case $target in *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \ *-msdosdjgpp* | *-netware* | *-vms* | *-wince* | *-*-pe* | \ - alpha*-dec-osf* | *-interix*) + alpha*-dec-osf* | *-interix* | hppa[12]*-*-hpux*) target_elf=no ;; *) @@ -6574,7 +6575,6 @@ main () elf_nextscn (0, 0); elf_strptr (0, 0, 0); elf_getident (0, 0); - elf_getshdrstrndx (0, 0); elf_begin (0, 0, 0); elf_ndxscn (0); elf_end (0); @@ -6594,6 +6594,61 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + # Check for elf_getshdrstrndx or elf_getshstrndx. The latter's flavor + # is determined in gcc/configure.ac. + if test x"$enable_lto" = x"yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_getshdrstrndx" >&5 +$as_echo_n "checking for elf_getshdrstrndx... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + elf_getshdrstrndx (0, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_getshstrndx" >&5 +$as_echo_n "checking for elf_getshstrndx... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + elf_getshstrndx (0, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; enable_lto=no; libelflibs= ; libelfinc= + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + # If we couldn't enable LTO and the user forced it, emit an error. if test x"$enable_lto" = x"no" \ && test x"$default_enable_lto" != x"yes" ; then diff --git a/configure.ac b/configure.ac index 2e8dbe0e9bd..34308c212c5 100644 --- a/configure.ac +++ b/configure.ac @@ -528,6 +528,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap" ;; *-*-rtems*) + skipdirs="${skipdirs} target-libiberty" noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; # The tpf target doesn't support gdb yet. @@ -547,7 +548,7 @@ case "${target}" in noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss" ;; alpha*-*-*vms*) - noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; alpha*-*-linux*) # newlib is not 64 bit ready @@ -1735,7 +1736,6 @@ if test x"$enable_lto" = x"yes" ; then elf_nextscn (0, 0); elf_strptr (0, 0, 0); elf_getident (0, 0); - elf_getshdrstrndx (0, 0); elf_begin (0, 0, 0); elf_ndxscn (0); elf_end (0); @@ -1744,6 +1744,27 @@ if test x"$enable_lto" = x"yes" ; then [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ] ) + # Check for elf_getshdrstrndx or elf_getshstrndx. The latter's flavor + # is determined in gcc/configure.ac. + if test x"$enable_lto" = x"yes" ; then + AC_MSG_CHECKING([for elf_getshdrstrndx]) + AC_TRY_LINK( + [#include ],[ + elf_getshdrstrndx (0, 0); + ], + [AC_MSG_RESULT([yes]);], + [AC_MSG_RESULT([no]); + AC_MSG_CHECKING([for elf_getshstrndx]) + AC_TRY_LINK( + [#include ],[ + elf_getshstrndx (0, 0); + ], + [AC_MSG_RESULT([yes]);], + [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ] + )] + ) + fi + # If we couldn't enable LTO and the user forced it, emit an error. if test x"$enable_lto" = x"no" \ && test x"$default_enable_lto" != x"yes" ; then diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index ee1087058d4..b0b26dfe3fd 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,9 @@ +2010-04-12 Rainer Orth + + * inclhack.def (alpha_wchar): Remove. + * fixincl.x: Regenerate. + * tests/base/wchar.h: Remove. + 2010-04-02 Ralf Wildenhues * aclocal.m4: Regenerate. diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index d66766cea2e..e80d50c5adc 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Tuesday March 30, 2010 at 09:51:20 PM MEST + * It has been AutoGen-ed Wednesday April 7, 2010 at 05:11:50 PM MEST * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Mar 30 21:51:20 MEST 2010 +/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Apr 7 17:11:50 MEST 2010 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 206 fixup descriptions. + * This file contains 205 fixup descriptions. * * See README for more information. * @@ -1354,43 +1354,6 @@ static const char* apzAlpha_SbrkPatch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * - * Description of Alpha_Wchar fix - */ -tSCC zAlpha_WcharName[] = - "alpha_wchar"; - -/* - * File name selection pattern - */ -tSCC zAlpha_WcharList[] = - "wchar.h\0"; -/* - * Machine/OS name selection pattern - */ -tSCC* apzAlpha_WcharMachs[] = { - "alpha*-dec-osf4*", - (const char*)NULL }; - -/* - * content selection pattern - do fix if pattern found - */ -tSCC zAlpha_WcharSelect0[] = - "#define wcstok wcstok_r"; - -#define ALPHA_WCHAR_TEST_CT 1 -static tTestDesc aAlpha_WcharTests[] = { - { TT_EGREP, zAlpha_WcharSelect0, (regex_t*)NULL }, }; - -/* - * Fix Command Arguments for Alpha_Wchar - */ -static const char* apzAlpha_WcharPatch[] = { sed_cmd_z, - "-e", "s@#define wcstok wcstok_r@extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__(\"wcstok_r\");@", - "-e", "s@#define wcsftime __wcsftime_isoc@extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__(\"__wcsftime_isoc\");@", - (char*)NULL }; - -/* * * * * * * * * * * * * * * * * * * * * * * * * * - * * Description of Avoid_Bool_Define fix */ tSCC zAvoid_Bool_DefineName[] = @@ -8395,9 +8358,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 246 +#define REGEX_COUNT 245 #define MACH_LIST_SIZE_LIMIT 181 -#define FIX_COUNT 206 +#define FIX_COUNT 205 /* * Enumerate the fixes @@ -8434,7 +8397,6 @@ typedef enum { ALPHA_PTHREAD_GCC_FIXIDX, ALPHA_PTHREAD_INIT_FIXIDX, ALPHA_SBRK_FIXIDX, - ALPHA_WCHAR_FIXIDX, AVOID_BOOL_DEFINE_FIXIDX, AVOID_BOOL_TYPE_FIXIDX, AVOID_WCHAR_T_TYPE_FIXIDX, @@ -8767,11 +8729,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ALPHA_SBRK_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aAlpha_SbrkTests, apzAlpha_SbrkPatch, 0 }, - { zAlpha_WcharName, zAlpha_WcharList, - apzAlpha_WcharMachs, - ALPHA_WCHAR_TEST_CT, FD_MACH_ONLY, - aAlpha_WcharTests, apzAlpha_WcharPatch, 0 }, - { zAvoid_Bool_DefineName, zAvoid_Bool_DefineList, apzAvoid_Bool_DefineMachs, AVOID_BOOL_DEFINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 910b3889270..4f70a9f3a64 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -794,27 +794,6 @@ fix = { /* - * Change external names of wcstok/wcsftime via asm instead of macros on - * Tru64 UNIX V4.0. - */ -fix = { - hackname = alpha_wchar; - files = wchar.h; - - mach = "alpha*-dec-osf4*"; - select = "#define wcstok wcstok_r"; - sed = "s@#define wcstok wcstok_r@" - "extern wchar_t *wcstok __((wchar_t *, const wchar_t *, " - "wchar_t **)) __asm__(\"wcstok_r\");@"; - sed = "s@#define wcsftime __wcsftime_isoc@" - "extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *" - ", const struct tm *)) __asm__(\"__wcsftime_isoc\");@"; - test_text = "#define wcstok wcstok_r\n" - "#define wcsftime __wcsftime_isoc"; -}; - - -/* * For C++, avoid any typedef or macro definition of bool, * and use the built in type instead. * HP/UX 10.20 also has it in curses_colr/curses.h. diff --git a/fixincludes/tests/base/wchar.h b/fixincludes/tests/base/wchar.h deleted file mode 100644 index 5c0b9dfe86a..00000000000 --- a/fixincludes/tests/base/wchar.h +++ /dev/null @@ -1,15 +0,0 @@ -/* DO NOT EDIT THIS FILE. - - It has been auto-edited by fixincludes from: - - "fixinc/tests/inc/wchar.h" - - This had to be done to correct non-standard usages in the - original, manufacturer supplied header file. */ - - - -#if defined( ALPHA_WCHAR_CHECK ) -extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__("wcstok_r"); -extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__("__wcsftime_isoc"); -#endif /* ALPHA_WCHAR_CHECK */ diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1496b859373..700faedc68d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,753 @@ +2010-04-17 Richard Earnshaw + + * arm-protos.h (tune_params): New structure. + * arm.c (current_tune): New variable. + (arm_constant_limit): Delete. + (struct processors): Add pointer to the tune parameters. + (arm_slowmul_tune): New tuning option. + (arm_fastmul_tune, arm_xscale_tune, arm_9e_tune): Likewise. + (all_cores): Adjust to pick up the tuning model. + (arm_constant_limit): New function. + (arm_override_options): Select the appropriate tuning model. Delete + initialization of arm_const_limit. + (arm_split_constant): Use the new constant-limit model. + (arm_rtx_costs): Pick up the current tuning model. + * arm.md (is_strongarm, is_xscale): Delete. + * arm-generic.md (load_ldsched_x, load_ldsched): Test explicitly + for Xscale variant architectures. + (mult_ldsched_strongarm, mult_ldsched): Similarly for StrongARM. + +2010-04-17 Ramana Radhakrishnan + + * config/arm/arm.c (arm_gen_constant): Remove unused variable + can_shift. + (arm_rtx_costs_1): Remove unused variable extra_cost. + (arm_unwind_emit_set): Use variable offset. + (thumb1_output_casesi): Remove unused variable flags. + +2010-04-16 Jeff Law + + * ira-color.c (ira_reassign_pseudos): Collect and sort all the pseudos + needing assignment rather than doing a two-phase assignment. Remove + unused variable 'm'. + +2010-04-16 Jakub Jelinek + + PR bootstrap/43767 + * alias.c (memrefs_conflict_p): Don't crash if CSELIB_VAL_PTR is NULL. + +2010-04-16 Doug Kwan + + * tree-ssa-reassoc.c (struct operand_entry): Add new field ID. + (next_operand_entry_id): New static variable. + (sort_by_operand_rank): Stabilize qsort comparator by using unique IDs. + (add_to_ops_vec): Assigned unique ID to operand entry. + (struct oecount_s): New field ID. + (oecount_cmp): Stabilize qsort comparotor by using unique IDs. + (undistribute_ops_list): Assign unique IDs to oecounts. + (init_reassoc): reset next_operand_entry_id. + +2010-04-16 Doug Kwan + + * config/i386/i386.md (*jcc_bt): Fix build breakage by adding + missing left parenthesis. + +2010-04-16 Uros Bizjak + + * config/i386/i386.md (*bt): Macroize insn from *btsi and + *btdi_rex64 using SWI48 mode iterator. + (*jcc_bt): Ditto from *jcc_btsi and *jcc_btdi_rex64. + (*jcc_bt_mask): Ditto from *jcc_btsi_mask and + *jcc_btdi_mask_rex64. + +2010-04-16 Anatoly Sokolov + + * double-int.h (tree_to_double_int): Convert to macro. + * double-int.c (tree_to_double_int): Remove. + +2010-04-16 Jakub Jelinek + + PR debug/43762 + * dwarf2out.c (add_bound_info): Always call loc_list_from_tree + with want_address 2 and in case a single element list might be + possible, call it again with want_address 0. + +2010-04-12 Kaushik Phatak + + * config/h8300/h8300.c (print_operand) : Modify case 'V' and + case 'W' print operands for HI mode. + * config/h8300/h8300.h (Y0, Y2) : New constraints. + * config/h8300/h8300.md (bclrqi_msx, bclrhi_msx): New patterns + (bsetqi_msx, bsethi_msx, bnotqi_msx, bnothi_msx): Likewise. + * config/h8300/predicate.md (bit_register_indirect_operand): New. + + * config/h8300/h8300.h (OK_FOR_U): Support 'U' constraint for H8300SX. + + * config/h8300/h8300.md (movqi_h8sx, movhi_h8sx, movsi_h8sx, + cmphi_h8300hs_znvc, cmpsi, addhi3_h8sx) : Emit instructions in + #xx:3 and #xx:4 mode. + + * config/h8300/h8300.md (inverted load with HImode dest): Add + support for H8300SX. + + * config/h8300/predicate.md (bit_operand): Allow immediate values that + satisfy 'U' constraint. + +2010-04-16 Rainer Orth + + * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx + flavor. + * configure: Regenerate. + * config.in: Regenerate. + * doc/install.texi (Prerequisites): Document that Solaris 2 libelf + works. + +2010-04-16 Richard Guenther + + * tree.h (struct tree_decl_minimal): Move pt_uid ... + (struct tree_decl_common): ... here. + (DECL_PT_UID): Adjust. + (SET_DECL_PT_UID): Likewise. + (DECL_PT_UID_SET_P): Likewise. + +2010-04-16 Richard Guenther + + PR tree-optimization/43572 + * tree-ssa-alias.h (call_may_clobber_ref_p): Declare. + * tree-ssa-alias.c (call_may_clobber_ref_p): Export. + * tree-flow.h (is_call_clobbered): Remove. + * tree-flow-inline.h (is_call_clobbered): Likewise. + * tree-dfa.c (dump_variable): Do not dump call clobber state. + * tree-nrv.c (dest_safe_for_nrv_p): Use the alias oracle. + (execute_return_slot_opt): Adjust. + * tree-tailcall.c (suitable_for_tail_opt_p): Remove + check for call clobbered vars here. + (find_tail_calls): Move tailcall verification to the + proper place. + +2010-04-16 Diego Novillo + + * doc/invoke.texi: Explain how are unrecognized -Wno- warnings + handled. + +2010-04-16 Bernd Schmidt + + PR target/40603 + * config/arm/arm.md (cbranchqi4): New pattern. + * config/arm/predicates.md (const0_operand, + cbranchqi4_comparison_operator): New predicates. + +2010-04-16 Richard Guenther + + * gimple-pretty-print.c (dump_gimple_phi): Dump alias info. + (dump_gimple_stmt): Likewise. + +2010-04-16 Bernd Schmidt + + * recog.h (struct recog_data): New field is_operator. + (struct insn_operand_data): New field is_operator. + * recog.c (extract_insn): Set recog_data.is_operator. + * genoutput.c (output_operand_data): Emit code to set the + is_operator field. + * reload.c (find_reloads): Use it rather than testing for an + empty constraint string. + + PR target/41514 + * config/arm/arm.md (cbranchsi4_insn): Renamed from "*cbranchsi4_insn". + If the previous insn is a cbranchsi4_insn with the same arguments, + omit the compare instruction. + + * config/arm/arm.md (addsi3_cbranch): If destination is a high + register, inputs must be low registers and we need a low register + scratch. Handle alternative 2 like alternative 3. + +2010-04-16 Jakub Jelinek + + * alias.c (memrefs_conflict_p): If x and y are the same VALUE, + don't call get_addr on both. If one expression is a VALUE and + the other a REG, check VALUE's locs if the REG isn't among them. + +2010-04-16 Christian Bruel + + * config/sh/sh.h (sh_frame_pointer_required): New function. + * config/sh/sh.h (TARGET_FRAME_POINTER_REQUIRED): New macro. + (flag_omit_frame_pointer) Set. + (MASK_ACCUMULATE_OUTGOING_ARGS) Define and Set. + (rounded_frame_size): Adjust size with outgoing_args_size. + (sh_set_return_address): Must return from stack pointer. + * gcc/config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Define. + (SUBTARGET_FRAME_POINTER_REQUIRED): Define. + (ACCUMULATE_OUTGOING_ARGS): Define. + * doc/invoke.texi (maccumulate-outgoing-args): Document for SH. + * gcc/config/sh/sh.opt: (maccumulate-outgoing-args): New option. + +2010-04-15 Kaz Kojima + + PR target/43471 + * config/sh/sh.c (sh_legitimize_reload_address): Use + MAYBE_BASE_REGISTER_RTX_P instead of BASE_REGISTER_RTX_P. + Remove a unneeded check for offset_base. + +2010-04-15 H.J. Lu + + * configure: Regenerated. + +2010-04-15 Andreas Krebbel + + * config/s390/s390.c (s390_call_save_register_used): Switch back + to HARD_REGNO_NREGS. + +2010-04-15 Richard Guenther + + * alias.c (alias_set_subset_of): Handle alias-set zero + child properly. + +2010-04-15 Mark Shinwell + Julian Brown + + * config/arm/thumb2.md (thumb2_movsi_insn): Split ldr and str + alternatives according to use of high and low regs. + * config/arm/vfp.md (thumb2_movsi_vfp): Likewise. + * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Use high regs when + optimizing for size on Thumb-2. + +2010-04-15 Thomas Schwinge + + * config.gcc : Handle softfp as for Linux. + +2010-04-15 Richard Guenther + + * tree-ssa-structalias.c (struct variable_info): Add + is_fn_info flag. + (new_var_info): Initialize it. + (dump_constraints): Support printing last added constraints. + (debug_constraints): Adjust. + (dump_constraint_graph): Likewise. + (make_heapvar_for): Check for NULL cfun. + (get_function_part_constraint): New function. + (get_fi_for_callee): Likewise. + (find_func_aliases): Properly implement IPA PTA constraints. + (process_ipa_clobber): New function. + (find_func_clobbers): Likewise. + (insert_into_field_list_sorted): Remove. + (create_function_info_for): Properly allocate vars for IPA mode. + Do not use insert_into_field_list_sorted. + (create_variable_info_for): Properly generate constraints for + global vars in IPA mode. + (dump_solution_for_var): Always dump the solution. + (set_uids_in_ptset): Initialize DECL_PT_UID if in ipa-mode. + (find_what_var_points_to): Adjust. + (pt_solution_set): Change. + (pt_solution_ior_into): New function. + (pt_solution_empty_p): Export. + (pt_solution_includes_global): Adjust. + (pt_solution_includes_1): Likewise. + (pt_solutions_intersect_1): Likewise. + (dump_sa_points_to_info): Check some invariants. + (solve_constraints): Move constraint dumping ... + (compute_points_to_sets): ... here. + (ipa_pta_execute): ... and here. + (compute_may_aliases): Do not re-compute points-to info + locally if IPA info is available. + (ipa_escaped_pt): New global var. + (ipa_pta_execute): Properly implement IPA PTA. + * tree-into-ssa.c (dump_decl_set): Support dumping + decls not in referenced-vars. + * tree-flow.h (struct gimple_df): Add ipa_pta flag. + * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Adjust. + (dump_points_to_solution): Likewise. + * tree-dfa.c (dump_variable): Also dump DECL_PT_UID. + * tree-inline.c (remap_ssa_name): Copy IPA points-to solution. + (remap_gimple_stmt): Reset call clobber/use information if + necessary. + (copy_decl_to_var): Copy DECL_PT_UID. + (copy_result_decl_to_var): Likewise. + * tree.c (make_node_stat): Initialize DECL_PT_UID. + (copy_node_stat): Copy it. + * tree.h (DECL_PT_UID): New macro. + (SET_DECL_PT_UID): Likewise. + (DECL_PT_UID_SET_P): Likewise. + (struct tree_decl_minimal): Add pt_uid member. + * tree-ssa-alias.h (struct pt_solution): Add ipa_escaped flag. + (pt_solution_empty_p): Declare. + (pt_solution_set): Adjust. + (ipa_escaped_pt): Declare. + * cfgexpand.c (update_alias_info_with_stack_vars): Adjust. + * gimple-pretty-print.c (pp_points_to_solution): New function. + (dump_gimple_call): Dump call clobber/use information. + * tree-dump.c (dump_option_value_in): Add TDF_ALIAS entry. + * tree-pass.h (TDF_ALIAS): New dump option. + * tree-pretty-print.c (dump_decl_name): Dump DECL_PT_UID if asked to. + * doc/invoke.texi (-fipa-pta): Update documentation. + +2010-04-15 Richard Guenther + + * Makefile.in (OBJS-common): Add gimple-fold.o. + (gimple-fold.o): New rule. + * tree.h (maybe_fold_offset_to_reference, + maybe_fold_offset_to_address, maybe_fold_stmt_addition): Move + prototypes ... + * gimple.h: ... here. + * tree-flow.h (fold_stmt, fold_stmt_inplace, get_symbol_constant_value, + may_propagate_address_into_dereference): Move prototypes ... + * gimple.h: ... here. + * tree-ssa-ccp.c (get_symbol_constant_value, + may_propagate_address_into_dereference, maybe_fold_offset_to_array_ref, + maybe_fold_offset_to_component_ref, maybe_fold_offset_to_reference, + maybe_fold_offset_to_address, maybe_fold_stmt_indirect, + maybe_fold_stmt_addition, maybe_fold_reference, get_maxval_strlen, + ccp_fold_builtin, fold_gimple_assign, fold_gimple_cond, + fold_gimple_call, fold_stmt_1, fold_stmt, fold_stmt_inplace, + gimplify_and_update_call_from_tree): Move ... + * gimple-fold.c: ... here. New file. + (ccp_fold_builtin): Rename to ... + (gimple_fold_builtin): ... this. + * tree-ssa-ccp.c (execute_fold_all_builtins): Adjust. + +2010-04-15 Richard Guenther + + * fold-const.c (LOWPART, HIGHPART, BASE, encode, decode, + fit_double_type, force_fit_type_double, add_double_with_sign, + neg_double, mul_double_with_sign, lshift_double, rshift_double, + lrotate_double, rrotate_double, div_and_round_double): Move ... + * double-int.c: ... here. + * tree.h (force_fit_type_double, fit_double_type, add_double_with_sign, + add_double, neg_double, mul_double_with_sign, mul_double, + lshift_double, rshift_double, lrotate_double, rrotate_double, + div_and_round_double): Move prototypes ... + * double-int.h: ... here. + +2010-04-15 Bernd Schmidt + + PR target/43742 + * config/sh/sh.md (doloop_end_split, dect): Undo previous patch. Use + matching constraints to ensure inputs match the output. + +2010-04-15 Kaz Kojima + + PR target/43742 + * config/sh/sh.md (doloop_end_split): Remove "+r" constraint + in an input-only operand. + +2010-04-15 Anatoly Sokolov + + * double-int.h (HOST_BITS_PER_DOUBLE_INT): Define. + (double_int_not, double_int_lshift, double_int_rshift): Declare. + (double_int_negative_p): Convert to static inline function. + * double-int.c (double_int_lshift, double_int_lshift): Add new function. + (double_int_negative_p): Remove. + * tree.h (lshift_double, rshift_double): + * tree.c (build_low_bits_mask): Clean up, use double_int_* functions. + * fold-const.c (fold_convert_const_int_from_real, + fold_convert_const_int_from_fixed, div_if_zero_remainder): (Ditto.). + (lshift_double): Change type of arith argument to bool. + (rshift_double): Change type of arith argument to bool. Correct + comment. + * expmed.c (mask_rtx, lshift_value): (Ditto.). + +2010-04-14 Bernd Schmidt + + PR target/21803 + * ifcvt.c (cond_exec_process_if_block): Look for identical sequences + at the start and end of the then/else blocks, and omit them from the + conversion. + * cfgcleanup.c (flow_find_cross_jump): No longer static. Remove MODE + argument; all callers changed. Pass zero to old_insns_match_p instead. + (flow_find_head_matching_sequence): New function. + (old_insns_match_p): Check REG_EH_REGION notes for calls. + * basic-block.h (flow_find_cross_jump, + flow_find_head_matching_sequence): Declare functions. + +2010-04-14 Jason Merrill + + PR c++/36625 + * c-common.c (attribute_takes_identifier_p): New fn. + * c-common.h: Declare it. + +2010-04-14 Uros Bizjak + + * config/i386/i386.md (*divmod4): Remove stray "&&" from + splitter condition. + (*udivmod4): Ditto. + +2010-04-14 Uros Bizjak + + * config/i386/i386.md (maxmin_int): Rename code attribute from + maxminiprefix and update all users. + (maxmin_float): Ditto from maxminfprefix. + (logic): Ditto from logicprefix. + (absneg_mnemonic): Ditto from absnegprefix. + * config/i386/mmx.md: Update all users of maxminiprefix, + maxminfprefix and logicprefix for rename. + * config/i386/sse.md: Ditto. + * config/i386/sync.md (sync_): Update for + logicprefix rename. + +2010-04-14 Manuel López-Ibáñez + + PR 42966 + * diagnostics.c (diagnostic_report_diagnostic): Mark specially + warnings converted to errors. + +2010-04-14 Uros Bizjak + + * config/alpha/alpha.c (alpha_adjust_cost): Remove set but not + used insn_type variable. + (function_value): Add ATTRIBUTE_UNUSED to dummy variable declaration + to avoid set-but-not-used warning. + +2010-04-14 Uros Bizjak + + * df-core.c (df_ref_debug): Change format string placeholder + from 0x%x to %#x. + * dwarf2asm.c (dw2_asm_output_data_raw, + dw2_asm_output_data_uleb128_raw, dw2_asm_output_data_uleb128, + dw2_asm_output_data_sleb128_raw, dw2_asm_output_data_sleb128): Ditto. + * dwarf2out.c (output_cfi, output_cfi_directive, + dwarf2out_do_cfi_startproc, output_loc_sequence_raw, + output_cfa_loc_raw, output_die, output_ranges, output_file_names): + Ditto. + * genattrtab.c (write_test_expr, write_attr_valueq): Ditto. + * print-rtl.c (print_rtx): Ditto. + +2010-04-14 Michael Meissner + + PR middle-end/42694 + * builtins.c (expand_builtin_pow_root): New function to expand pow + calls with exponents 0.25, 0.50, 0.75, 1./3., and 1./6. into a + series of sqrt and cbrt calls under -ffast-math. + (expand_builtin_pow): Call it. + +2010-04-14 Michael Matz + + PR tree-optimization/42963 + * tree-cfg.c (touched_switch_bbs): New static variable. + (group_case_labels_stmt): New function broken out from ... + (group_case_labels): ... here, use the above. + (start_recording_case_labels): Allocate touched_switch_bbs. + (end_recording_case_labels): Deallocate it, call + group_case_labels_stmt. + (gimple_redirect_edge_and_branch): Remember index of affected BB. + +2010-04-14 Uros Bizjak + + * config/i386/i386.md (*popcountsi2_cmp_zext): Remove mode attribute + from insn template. + +2010-04-14 Uros Bizjak + + * config/i386/i386.md (*ashlqi3_1_slp): New insn pattern. + +2010-04-13 Jan Hubicka + + * ipa-inline.c (cgraph_mark_inline_edge): Avoid double accounting + of optimized out static functions. + (cgraph_edge_badness): Add DUMP parameter and dump reasons for the + cost computation. Also sanity check for overflows. + (update_caller_keys): Update cgraph_edge_badness call; properly + update fibheap and sanity check that it is up to date. + (add_new_edges_to_heap): Update cgraph_edge_badness. + (cgraph_decide_inlining_of_small_function): Likewise; + add sanity checking that badness in heap is up to date; + improve dumping of reason; Update badness of calls to the + offline copy of function currently inlined; dump badness + of functions not inlined because of unit growth limits. + +2010-04-13 Eric Botcazou + + PR middle-end/32628 + * c-common.c (pointer_int_sum): Disregard overflow that occured only + because of sign-extension change when converting to sizetype here... + * fold-const.c (fold_convert_const_int_from_int): ...and not here. + + * fold-const.c (fold_binary_op_with_conditional_arg): Do not restrict + the folding to constants. Remove redundant final conversion. + (fold_binary) : Do not associate if the re-association of + constants alone overflows. + (fold_binary) : Move transformation into BIT_AND_EXPR + to the end of the list. + (multiple_of_p) : New case. + +2010-04-13 Manuel López-Ibáñez + + * opt-functions.awk (opt_sanitized_name): New. + (opt_enum): New. + * optc-gen.awk: Use it + * opth-gen.awk: Use it. + +2010-04-13 Martin Jambor + + * tree-sra.c (replace_uses_with_default_def_ssa_name): New function. + (sra_modify_assign): Delete stmts loading dead data even if racc has no + children. Call replace_uses_with_default_def_ssa_name to handle + SSA_NAES on lhs. + +2010-04-13 Michael Matz + + PR middle-end/43730 + * builtins.c (expand_builtin_interclass_mathfn): Also create + a register if the predicate doesn't match. + +2010-04-13 Diego Novillo + + * Makefile.in (c-pch.o, ggc-common.o): Depend on timevar.h. + * c-pch.c: Include timevar.h. + (c_common_write_pch): Use TV_PCH_SAVE and TV_PCH_CPP_SAVE timers. + (c_common_read_pch): Use TV_PCH_RESTORE and TV_PCH_CPP_RESTORE timers. + * ggc-common.c: Include timevar.h. + (gt_pch_save): Use TV_PCH_PTR_REALLOC and TV_PCH_PTR_SORT timers. + * timevar.def (TV_PCH_SAVE): Define. + (TV_PCH_CPP_SAVE): Define. + (TV_PCH_PTR_REALLOC): Define. + (TV_PCH_PTR_SORT): Define. + (TV_PCH_RESTORE): Define. + (TV_PCH_CPP_RESTORE): Define. + +2010-04-13 Michael Matz + + * tree-ssa-reassoc.c (repropagate_negates): Merge negates also + into MINUS_EXPRs. + (can_reassociate_p): New function. + (break_up_subtract_bb, reassociate_bb): Use it. + +2010-04-13 Richard Guenther + + PR bootstrap/43737 + * builtins.c (c_readstr): Fix assert. + +2010-04-13 Uros Bizjak + + * config/i386/i386.md (extendsidi2 splitter): Also check for DX_REG + when generating cltd insn. + + (*ashl3_1): Remove special handling for register operand 2. + (*ashlsi3_1_zext): Ditto. + (*ashlhi3_1): Ditto. + (*ashlhi3_1_lea): Ditto. + (*ashlqi3_1): Ditto. + (*ashlqi3_1_lea): Ditto. + (*3_1): Ditto. + (*si3_1_zext): Ditto. + (*qi3_1_slp): Ditto. + (*3_1): Ditto. + (*si3_1_zext): Ditto. + (*qi3_1_slp): Ditto. + +2010-04-13 Richard Guenther + + * tree-ssa-structalias.c (callused_id): Remove. + (call_stmt_vars): New. + (get_call_vi): Likewise. + (lookup_call_use_vi): Likewise. + (lookup_call_clobber_vi): Likewise. + (get_call_use_vi): Likewise. + (get_call_clobber_vi): Likewise. + (make_transitive_closure_constraints): Likewise. + (handle_const_call): Adjust to do per-call call-used handling. + (handle_pure_call): Likewise. + (find_what_var_points_to): Remove general callused handling. + (init_base_vars): Likewise. + (init_alias_vars): Initialize call_stmt_vars. + (compute_points_to_sets): Process call-used and call-clobbered + vars for call statements. + (delete_points_to_sets): Free call_stmt_vars. + +2010-04-13 Richard Guenther + + * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): + Only add RW dependence for dependence distance zero. + Adjust maximal vectorization factor according to dependences. + Move alignment handling ... + (vect_find_same_alignment_drs): ... here. New function. + (vect_analyze_data_ref_dependences): Adjust. + (vect_analyze_data_refs_alignment): Call vect_find_same_alignment_drs. + (vect_analyze_data_refs): Adjust minimal vectorization factor + according to data references. + * tree-vect-loop.c (vect_analyze_loop): Analyze data-ref + dependences before determining the vectorization factor. + Analyze alignment after determining the vectorization factor. + * tree-vect-slp.c ((vect_slp_analyze_bb): Analyze data-ref + dependences before alignment. + * tree-vectorizer.h (vect_analyze_data_ref_dependences): + Adjust prototype. + (vect_analyze_data_refs): Likewise. + (MAX_VECTORIZATION_FACTOR): New define. + +2010-04-13 Duncan Sands + + * except.h (lang_eh_type_covers): Remove. + * except.c (lang_eh_type_covers): Likewise. + +2010-04-13 Andreas Krebbel + Ulrich Weigand + + * gcc/config/s390/s390.md: Replace TARGET_64BIT with TARGET_ZARCH. + * gcc/config/s390/s390.c: Replace UNTIS_PER_WORD with + UNITS_PER_LONG where it is ABI relevant. + (s390_return_addr_rtx): Likewise. + (s390_back_chain_rtx): Likewise. + (s390_frame_area): Likewise. + (s390_frame_info): Likewise. + (s390_initial_elimination_offset): Likewise. + (save_gprs): Likewise. + (s390_emit_prologue): Likewise. + (s390_emit_epilogue): Likewise. + (s390_function_arg_advance): Likewise. + (s390_function_arg): Likewise. + (s390_va_start): Likewise. + (s390_gimplify_va_arg): Likewise. + (s390_function_profiler): Likewise. + (s390_optimize_prologue): Likewise. + (s390_rtx_costs): Likewise. + (s390_secondary_reload): Likewise. + (s390_promote_function_mode): Likewise. + (s390_hard_regno_mode_ok): Replace TARGET_64BIT with TARGET_ZARCH. + (s390_scalar_mode_supported_p): Disallow TImode if no 64 bit + registers available. + (s390_unwind_word_mode): New function. + (s390_function_value): Split 64 bit values into register pair if + used as return value. + (s390_call_saved_register_used): Don't use HARD_REGNO_NREGS for + function call parameters. Handle parallels. + (TARGET_SCALAR_MODE_SUPPORTED_P): New macro. + (HARD_REGNO_CALL_PART_CLOBBERED): New macro. + (DWARF_CIE_DATA_ALIGNMENT): New macro. + (s390_expand_setmem): Remove unused variable src_addr. + * gcc/longlong.h: Make smul_ppmm and sdiv_qrnnd inline asms to + deal with 64 bit registers. + * gcc/config/s390/s390.h: Define __zarch__ predefined macro. + Replace UNITS_PER_WORD with UNITS_PER_LONG where it is ABI relevant. + (UNITS_PER_LONG): New macro. + * libjava/include/s390-signal.h: Define extended ucontext + structure containing the upper halfs of the 64 bit registers. + +2010-04-13 Simon Baldwin + + * cfgexpand.c (gimple_expand_cfg): Clarify warning message text. + +2010-04-13 Eric Botcazou + + * gimple.c (walk_gimple_op) : Do not request a pure + rvalue on the RHS if the LHS is of a non-renamable type. + * tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Fold result. + +2010-04-13 Matthias Klose + + * gcc.c (cc1_options): Handle -iplugindir before processing + the cc1 spec. Only add -iplugindir once. + (cpp_unique_options): Add -iplugindir option if -fplugin* options + found. + * common.opt (iplugindir): Remove `Separate' property, initialize. + * plugin.c (default_plugin_dir_name): Error with missing -iplugindir + option. + * Makefile.in (check-%, check-parallel-%): Create plugin dir. + (distclean): Remove plugin dir. + * doc/invoke.texi: Document -iplugindir. + +2010-04-13 Basile Starynkevitch + + * doc/plugins.texi (Loading Plugins): Document short + -fplugin=foo option. + (Plugin API): Mention default_plugin_dir_name function. + + * gcc.c (find_file_spec_function): Add new declaration. + (static_spec_func): Use it for "find-file". + (find_file_spec_function): Add new function. + (cc1_options): Add -iplugindir option if -fplugin* options found. + + * gcc-plugin.h (default_plugin_dir_name): Added new declaration. + + * plugin.c (add_new_plugin): Updated comment, and handle short + plugin name. + (default_plugin_dir_name): Added new function. + + * common.opt (iplugindir): New option to set the plugin directory. + +2010-04-12 Uros Bizjak + + * config/i386/i386.md (any_rotate): New code iterator. + (rotate_insn): New code attribute. + (rotate): Ditto. + (SWIM124): New mode iterator. + (ti3): New expander. + (di3): Macroize expander from {rotl,rotr}di3 using + any_rotate code iterator. + (3) Macroize expander from {rotl,rotr}{qi,hi,si}3 + using any_rotate code iterator and SWIM124 mode iterator. + (ix86_rotlti3): New insn_and_split pattern. + (ix86_rotrti3): Ditto. + (ix86_rotl3_doubleword): Macroize insn_and_split pattern from + ix86_rotl{di,ti}3 patterns. + (ix86_rotr3_doubleword): Ditto from ix86_rotr{di,ti}3 patterns. + (*3_1): Merge with *{rotl,rotr}{qi,hi,si}3_1_one_bit + and *{rotl,rotr}di3_1_one_bit_rex64. Macroize insn from + *{rotl,rotr}{qi,hi,si}3_1 and *{rotl,rotr}di3_1_rex64 using any_rotate + code iterator and SWI mode iterator. + (*si3_1_zext): Merge with *{rotl,rotr}si3_1_one_bit_zext. + Macroize insn from {rotl,rotr}si3_1_zext using any_rotate + code iterator. + (*qi3_1_slp): Merge with *{rotl,rotr}qi3_1_one_bit_slp. + Macroize insn from {rotl,rotr}qi3_1_slp using any_rotate code iterator. + (bswap rotatert splitter): Add splitter. + (bswap splitter): Macroize splitter using any_rotate code iterator. + Add insn predicate to split only for TARGET_USE_XCHGB or when + optimizing function for size. + +2010-04-12 Steve Ellcey + + * config/pa/pa.c (emit_move_sequence): Remove use of + deleted variable flag_argument_noalias. + +2010-04-12 Rainer Orth + + * config.gcc: Removed *-*-solaris2.7* from list of obsolete + configurations. + Add to unsupported targets list. + * configure.ac (gcc_cv_as_tls): Removed i[34567]86-*-solaris2.[567]*, + sparc*-sun-solaris2.[567]* from target lists. + * configure: Regenerate. + * doc/install.texi (Specific, *-*-solaris2*): Document Solaris 7 + removal. + Remove Solaris 7 patch references. + (Specific, sparc-sun-solaris2.7): Removed. + (sparc-sun-solaris2*): Update Solaris 7 example. + (sparc64-*-solaris2*): Likewise. + +2010-04-12 Rainer Orth + + * config.build (alpha*-dec-osf4*): Remove. + * config.gcc: Remove alpha*-dec-osf4*, alpha-dec-osf5.0* from list + of obsolete configurations. + (alpha*-dec-osf[45]*): Remove alpha*-dec-osf4*, alpha-dec-osf5.0* + support. + * config/alpha/t-osf4: Renamed to ... + * config/alpha/t-osf5: ... this. + * config/alpha/osf.h: Renamed to ... + * config/alpha/osf5.h: ... this. + Merged old osf5.h contents. + Update comments. + (ASM_SPEC): Use ASM_OLDAS_SPEC directly. + (EXTRA_SPECS): Removed. + * doc/install.texi (Specific, alpha*-dec-osf5.1): Renamed to + reflect removal of Tru64 UNIX V4.0/V5.0 support. + Document that. + +2010-04-12 Rainer Orth + + * doc/contrib.texi (Contributors, Rainer Orth): Update. + +2010-04-12 Kai Tietz + + PR/43702 + * config/i386/i386.c (x86_this_parameter): Handle aggregate for + __thiscall convention. + +2010-04-12 Steve Ellcey + + * config/pa/pa.c (hppa_legitimize_address): Remove unused variable + orig_base. + * config/pa/pa.md (call, call_value): Remove unused variable call_insn. + 2010-04-12 Steve Ellcey * function.c (assign_parms_initialize_all): Add unused attribute @@ -40,8 +790,7 @@ * ipa.c (cgraph_postorder): Adjust postorder to guarantee single-iteration always-inline inlining. * ipa-inline.c (cgraph_mark_inline): Do not return anything. - (cgraph_decide_inlining): Do not handle always-inline - specially. + (cgraph_decide_inlining): Do not handle always-inline specially. (try_inline): Remove always-inline cycle detection special case. Do not recurse on always-inlines. (cgraph_early_inlining): Do not iterate if not optimizing. @@ -96,25 +845,20 @@ * config/i386/i386.md (any_shiftrt): New code iterator. (shiftrt_insn): New code attribute. (shiftrt): Ditto. - (3): Macroize expander from ashr3 and - lshr3 using any_shiftrt code iterator. + (3): Macroize expander from {ashr,lshr}3 + using any_shiftrt code iterator. (*3_doubleword): Macroize insn_and_split from - *ashr3_doubleword and *lshr3_doubleword using - any_shiftrt code iterator. + *{ashr,lshr}3_doubleword using any_shiftrt code iterator. (*3_doubleword peephole2): Macroize peephole2 pattern from corresponding peephole2 patterns. - (*3_1): Macroize insn from *ashr3_1 - and *lshr3_1 using any_shiftrt code iterator. - (*si3_1_zext): Ditto from *ashrsi3_1_zext - and *lshrsi3_1_zext. - (*qi3_1_slp): Ditto from *ashrqi3_1_slp - and *lshrqi3_1_slp. - (*3_cmp): Ditto from *ashr3_cmp - and *lshr3_cmp. - (*3_cmp_zext): Ditto from *ashr3_cmp_zext - and *lshr3_cmp_zext. - (*3_cconly): Ditto from *ashr3_cconly - and *lshr3_cconly. + (*3_1): Macroize insn from *{ashr,lshr}3_1 + using any_shiftrt code iterator. + (*si3_1_zext): Ditto from *{ashr,lshr}si3_1_zext. + (*qi3_1_slp): Ditto from *{ashr,lshr}qi3_1_slp. + (*3_cmp): Ditto from *{ashr,lshr}3_cmp. + (*3_cmp_zext): Ditto from + *{ashr,lshr}3_cmp_zext. + (*3_cconly): Ditto from *{ashr,lshr}3_cconly. 2010-04-11 Uros Bizjak @@ -132,8 +876,8 @@ (*lshr3_doubleword peephole2): Macroize peephole2 pattern from corresponding peephole2 patterns. (*lshr3_1): Merge with *lshr{qi,hi,si}3_1_one_bit and - *lshrdi3_1_one_bit_rex64. Macroize insn from *lshr{qi,hi,si}3_cmp - and *lshrdi3_cmp_rex64 using SWI mode iterator. + *lshrdi3_1_one_bit_rex64. Macroize insn from *lshr{qi,hi,si}3_1 + and *lshrdi3_1_rex64 using SWI mode iterator. (*lshrsi3_1_zext): Merge with *lshrsi3_1_one_bit_zext. (*lshrqi3_1_slp): Merge with *lshrqi3_1_one_bit_slp. (*lshr3_cmp): Merge with *lshr{qi,hi,si}3_one_bit_cmp and @@ -160,8 +904,8 @@ (x86_shift_adj_3): Macroize expander from x86_shift_adj_3 and x86_64_shift_adj_3 using SWI48 mode iterator. (*ashr3_1): Merge with *ashr{qi,hi,si}3_1_one_bit and - *ashrdi3_1_one_bit_rex64. Macroize insn from *ashr{qi,hi,si}3_cmp - and *ashrdi3_cmp_rex64 using SWI mode iterator. + *ashrdi3_1_one_bit_rex64. Macroize insn from *ashr{qi,hi,si}3_1 + and *ashrdi3_1_rex64 using SWI mode iterator. (*ashrsi3_1_zext): Merge with *ashrsi3_1_one_bit_zext. (*ashrqi3_1_slp): Merge with *ashrqi3_1_one_bit_slp. (*ashr3_cmp): Merge with *ashr{qi,hi,si}3_one_bit_cmp and @@ -185,7 +929,7 @@ (arm_output_addr_const_extra): Output expression for new pattern. * config/arm/arm.md (UNSPEC_SYMBOL_OFFSET): New unspec symbol. -2010-04-10 Bernd Schmidt +2010-04-10 Bernd Schmidt * ira-costs.c (record_reg_classes): Ignore alternatives that are not enabled. @@ -215,7 +959,7 @@ * ipa-prop.c (ipa_print_node_jump_functions): Likewise. 2010-04-09 Eric Botcazou - Bernd Schmidt + Bernd Schmidt * loop-invariant.c (replace_uses): New static function. (move_invariant_reg): Use it to ensure we can replace the uses. @@ -1749,7 +2493,7 @@ * c-decl.c (grokparms): Set arg_types to NULL_TREE if there was an error. -2010-03-19 Bernd Schmidt +2010-03-19 Bernd Schmidt PR rtl-optimization/42258 * ira-lives.c (check_and_make_def_conflict): Ignore conflict for a diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 4b737bd6ca0..d96e14963aa 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20100412 +20100417 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index c1cec397253..e212225fdeb 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1207,6 +1207,7 @@ OBJS-common = \ ggc-common.o \ gimple.o \ gimple-iterator.o \ + gimple-fold.o \ gimple-low.o \ gimple-pretty-print.o \ gimplify.o \ @@ -2088,7 +2089,8 @@ c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(CPPLIB_H) $(TREE_H) \ $(C_COMMON_H) output.h $(TOPLEV_H) $(C_PRAGMA_H) $(GGC_H) debug.h \ - langhooks.h $(FLAGS_H) hosthooks.h version.h $(TARGET_H) opts.h + langhooks.h $(FLAGS_H) hosthooks.h version.h $(TARGET_H) opts.h \ + timevar.h $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ -DHOST_MACHINE=\"$(host)\" -DTARGET_MACHINE=\"$(target)\" \ $< $(OUTPUT_OPTION) @@ -2183,7 +2185,7 @@ gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(GGC_H) $(HASHTAB_H) $(TOPLEV_H) $(PARAMS_H) hosthooks.h \ - $(HOSTHOOKS_DEF_H) vec.h $(PLUGIN_H) + $(HOSTHOOKS_DEF_H) vec.h $(PLUGIN_H) timevar.h ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ $(FLAGS_H) $(TOPLEV_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) $(TREE_FLOW_H) $(PLUGIN_H) @@ -2533,6 +2535,11 @@ gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GIMPLE_H) \ $(REAL_H) $(SPLAY_TREE_H) vec.h tree-iterator.h tree-pass.h gimple-iterator.o : gimple-iterator.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TREE_H) $(GIMPLE_H) $(TREE_FLOW_H) value-prof.h +gimple-fold.o : gimple-fold.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) $(BASIC_BLOCK_H) $(TREE_PASS_H) langhooks.h \ + tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ $(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \ $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ @@ -4233,7 +4240,7 @@ distclean: clean lang.distclean -rm -f gcov.pod # Delete po/*.gmo only if we are not building in the source directory. -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi - -rmdir ada cp f java objc intl po testsuite 2>/dev/null + -rmdir ada cp f java objc intl po testsuite plugin 2>/dev/null # Get rid of every file that's generated from some other file, except for `configure'. # Most of these files ARE PRESENT in the GCC distribution. @@ -4690,6 +4697,7 @@ $(TESTSUITEDIR)/site.exp: site.exp # This is only used for check-% targets that aren't parallelized. $(filter-out $(lang_checks_parallelized),$(lang_checks)): check-% : site.exp + -test -d plugin || mkdir plugin -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$* -(rootme=`${PWD_COMMAND}`; export rootme; \ @@ -4777,6 +4785,7 @@ $(patsubst %,%-subtargets,$(lang_checks_parallelized)): check-%-subtargets: # Otherwise check-$lang isn't parallelized and runtest is invoked just with # the $(RUNTESTFLAGS) arguments. check-parallel-% : site.exp + -test -d plugin || mkdir plugin -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) test -d $(TESTSUITEDIR)/$(check_p_subdir) || mkdir $(TESTSUITEDIR)/$(check_p_subdir) -(rootme=`${PWD_COMMAND}`; export rootme; \ diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 22a68c4cc89..2a0af0b7bcc 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,338 @@ +2010-04-17 Eric Botcazou + + * back-end.adb (Call_Back_End): Pass Standard_Character to gigi. + * gcc-interface/gigi.h (gigi): Add standard_character parameter. + (CHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, + LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, + LONG_DOUBLE_TYPE_SIZE, SIZE_TYPE): Delete. + * gcc-interface/decl.c (gnat_to_gnu_entity) : Call + rm_size. + * gcc-interface/misc.c (gnat_init): Set signedness of char as per + flag_signed_char. Tag sizetype with "size_type" moniker. + * gcc-interface/trans.c (gigi): Add standard_character parameter. + Remove useless built-in types. Equate unsigned_char_type_node to + Standard.Character. Use it instead of char_type_node throughout. + (Attribute_to_gnu): Likewise. + (gnat_to_gnu): Likewise. + * gcc-interface/utils2.c (build_call_raise): Likewise. + +2010-04-17 Eric Botcazou + + * gcc-interface/gigi.h (enum standard_datatypes): Add new values + ADT_sbitsize_one_node and ADT_sbitsize_unit_node. + (sbitsize_one_node): New macro. + (sbitsize_unit_node): Likewise. + * gcc-interface/decl.c (gnat_to_gnu_entity) : Fix + latent bug in the computation of subrange_p. Fold wider_p predicate. + (cannot_be_superflat_p): Use an explicitly signed 64-bit type to do + the final comparison. + (make_aligning_type): Build real negation and use sizetype throughout + the offset computation. + (maybe_pad_type): Do not issue the warning when the new size expression + is too complex. + (annotate_value) : Simplify code handling negative values. + * gcc-interface/misc.c (gnat_init): Initialize sbitsize_one_node and + sbitsize_unit_node. + * gcc-interface/trans.c (Attribute_to_gnu) : Fold + double negation. + (gnat_to_gnu) : Likewise. + * gcc-interface/utils.c (convert): Use sbitsize_unit_node. + * gcc-interface/utils2.c (compare_arrays): Compute real lengths and use + constants in sizetype. Remove dead code and tweak comments. Generate + equality instead of inequality comparisons for zero length tests. + +2010-04-16 Eric Botcazou + + * gcc-interface/gigi.h (gnat_init_decl_processing): Delete. + * gcc-interface/decl.c (gnat_to_gnu_entity): Constify a few variables. + : Do not create the fake PARM_DECL if no debug info is needed. + Do not create the corresponding VAR_DECL of a CONST_DECL for debugging + purposes if no debug info is needed. + Fix formatting. Reorder and add comments. + * gcc-interface/trans.c (gnat_to_gnu) : Constify + variable and remove obsolete comment. + * gcc-interface/utils.c (convert_vms_descriptor64): Tweak comment. + (convert_vms_descriptor32): Likewise. + (convert): Remove dead code. + : Pass the field instead of its name to build + the reference to the P_ARRAY pointer. + : Likewise. + (maybe_unconstrained_array) : Likewise. + (gnat_init_decl_processing): Delete, move contents to... + * gcc-interface/misc.c (gnat_init): ...here. + +2010-04-16 Eric Botcazou + + * gcc-interface/trans.c (unchecked_conversion_nop): Handle function + calls. Return true for conversion from a record subtype to its type. + +2010-04-16 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity): Use boolean_type_node in + lieu of integer_type_node for boolean operations. + (choices_to_gnu): Likewise. + * gcc-interface/trans.c (Attribute_to_gnu): Likewise. + (Loop_Statement_to_gnu): Likewise. + (establish_gnat_vms_condition_handler): Likewise. + (Exception_Handler_to_gnu_sjlj): Likewise. + (gnat_to_gnu): Likewise. + (build_unary_op_trapv): Likewise. + (build_binary_op_trapv): Likewise. + (emit_range_check): Likewise. + (emit_index_check): Likewise. + (convert_with_check): Likewise. + * gcc-interface/utils.c (convert_vms_descriptor64): Likewise. + (convert_vms_descriptor32): Likewise. + (convert_vms_descriptor): Likewise. + * gcc-interface/utils2.c (nonbinary_modular_operation): Likewise. + (compare_arrays): Use boolean instead of integer constants. + (build_binary_op) : New case. Check that the result type + is a boolean type. + : Remove obsolete assertion. + : Check that the result type is a boolean type. + : Delete. + : Check that the result type is a boolean type. + (build_unary_op): Use boolean_type_node in lieu of integer_type_node + for boolean operations. + (fill_vms_descriptor): Likewise. Fix formatting nits. + +2010-04-16 Eric Botcazou + + * gcc-interface/ada-tree.def (LOOP_STMT): Change to 4-operand nodes. + * gcc-interface/ada-tree.h (LOOP_STMT_TOP_COND, LOOP_STMT_BOT_COND): + Merge into... + (LOOP_STMT_COND): ...this. + (LOOP_STMT_BOTTOM_COND_P): New flag. + (LOOP_STMT_TOP_UPDATE_P): Likewise. + * gcc-interface/trans.c (can_equal_min_or_max_val_p): New function. + (can_equal_min_val_p): New static inline function. + (can_equal_max_val_p): Likewise. + (Loop_Statement_to_gnu): Use build4 in lieu of build5 and adjust to + new LOOP_STMT semantics. Use two different strategies depending on + whether optimization is enabled to translate the loop. + (gnat_gimplify_stmt) : Adjust to new LOOP_STMT semantics. + +2010-04-16 Eric Botcazou + + * uintp.adb (UI_From_Dint): Remove useless code. + (UI_From_Int): Likewise. + * uintp.h: Reorder declarations. + (UI_From_gnu): Declare. + (UI_Base): Likewise. + (Vector_Template): Likewise. + (Vector_To_Uint): Likewise. + (Uint_0): Remove. + (Uint_1): Likewise. + * gcc-interface/gigi.h: Tweak comments. + * gcc-interface/cuintp.c (UI_From_gnu): New global function. + * gcc-interface/decl.c (maybe_pad_type): Do not warn if either size + overflows. + (annotate_value) : Call UI_From_gnu. + * gcc-interface/trans.c (post_error_ne_num): Call post_error_ne. + (post_error_ne_tree): Call UI_From_gnu and post_error_ne. + * gcc-interface/utils.c (max_size) : Do not special-case + TYPE_MAX_VALUE. + +2010-04-16 Eric Botcazou + + * gcc-interface/decl.c (make_type_from_size) : Just copy + TYPE_NAME. + * gcc-interface/trans.c (smaller_packable_type_p): Rename into... + (smaller_form_type_p): ...this. Change parameter and variable names. + (call_to_gnu): Use the nominal type of the parameter to create the + temporary if it's a smaller form of the actual type. + (addressable_p): Return false if the actual type is integral and its + size is greater than that of the expected type. + +2010-04-15 Eric Botcazou + + * gcc-interface/cuintp.c (UI_To_gnu): Fix long line. + * gcc-interface/gigi.h (MARK_VISITED): Skip objects of constant class. + (process_attributes): Delete. + (post_error_ne_num): Change parameter name. + * gcc-interface/decl.c (gnat_to_gnu_entity): Do not force debug info + with -g3. Remove a couple of obsolete lines. Minor tweaks. + If type annotating mode, operate on trees to compute the adjustment to + the sizes of tagged types. Fix long line. + (cannot_be_superflat_p): Tweak head comment. + (annotate_value): Fold local constant. + (set_rm_size): Fix long line. + * gcc-interface/trans.c (Identifier_to_gnu): Rework comments. + (Attribute_to_gnu): Fix long line. + : Remove useless assertion. + Reorder statements. Use size_binop routine. + (Loop_Statement_to_gnu): Use build5 in lieu of build_nt. + Create local variables for the label and the test. Tweak comments. + (Subprogram_Body_to_gnu): Reset cfun to NULL. + (Compilation_Unit_to_gnu): Use the Sloc of the Unit node. + (process_inlined_subprograms): Integrate into... + (Compilation_Unit_to_gnu): ...this. + (gnat_to_gnu): Fix long line. + (post_error_ne_num): Change parameter name. + * gcc-interface/utils.c (process_attributes): Static-ify. + : Set input_location before proceeding. + (create_type_decl): Add comment. + (create_var_decl_1): Process the attributes after adding the VAR_DECL + to the current binding level. + (create_subprog_decl): Likewise for the FUNCTION_DECL. + (end_subprog_body): Do not reset cfun to NULL. + (build_vms_descriptor32): Fix long line. + (build_vms_descriptor): Likewise. + (handle_nonnull_attribute): Likewise. + (convert_vms_descriptor64): Likewise. + * gcc-interface/utils2.c (fill_vms_descriptor): Fix long line. + (gnat_protect_expr): Fix thinko. + +2010-04-15 Eric Botcazou + + * gcc-interface/trans.c (gigi): Set DECL_IGNORED_P on EH functions. + (gnat_to_gnu) : Restore the value of input_location + before translating the top-level node. + (lvalue_required_p) : Return 1 if !constant. + : Likewise. + : Likewise. + : Likewise. + (call_to_gnu): Remove kludge. + (gnat_to_gnu) : When not optimizing, force labels + associated with user returns to be preserved. + (gnat_to_gnu): Add special code to deal with boolean rvalues. + * gcc-interface/utils2.c (compare_arrays): Set input_location on all + comparisons. + (build_unary_op) : Call build_fold_addr_expr. + : Call build_fold_indirect_ref. + +2010-04-15 Joel Sherrill + + * g-socket.adb: A target can have multiple missing errno's. This + will result in multiple errno's being defined as -1. Because of this + we can not use a case but must use a series of if's to avoid + a duplicate case error in GNAT.Sockets.Resolve_Error. + +2010-04-15 Eric Botcazou + + * gcc-interface/trans.c (call_to_gnu): Open a nesting level if this is + a statement. Otherwise, if at top-level, push the processing of the + elaboration routine. In the misaligned case, issue the error messages + again on entry and create the temporary explicitly. Do not issue them + for CONSTRUCTORs. + For a function call, emit the range check if necessary. + In the copy-in copy-out case, create the temporary for the return + value explicitly. + Do not unnecessarily convert by-ref parameters to the formal's type. + Remove obsolete guards in conditions. + (gnat_to_gnu) : For a function call, pass the + target to call_to_gnu in all cases. + (gnat_gimplify_expr) : Remove handling of SAVE_EXPR. + (addressable_p) : Return false if not static. + : New case. + * gcc-interface/utils2.c (build_unary_op) : Fold a compound + expression if it has unconstrained array type. + (gnat_mark_addressable) : New case. + (gnat_stabilize_reference) : Stabilize operands on an + individual basis. + +2010-04-15 Eric Botcazou + + * gcc-interface/trans.c (gigi): Do not start statement group. + (Compilation_Unit_to_gnu): Set current_function_decl to NULL. + Start statement group and push binding level here... + (gnat_to_gnu) : ...and not here. + Do not push fake contexts at top level. Remove redundant code. + (call_to_gnu): Rename a local variable and constify another. + * gcc-interface/utils.c (gnat_pushlevel): Fix formatting nits. + (set_current_block_context): Set it as the group's block. + (gnat_init_decl_processing): Delete unrelated init code. + (end_subprog_body): Use NULL_TREE. + +2010-04-15 Eric Botcazou + + * gcc-interface/trans.c (call_to_gnu): Do not unnecessarily force + side-effects of actual parameters before the call. + +2010-04-15 Eric Botcazou + + * gcc-interface/decl.c (validate_size): Reorder, remove obsolete test + and warning. + (set_rm_size): Reorder and remove obsolete test. + +2010-04-14 Eric Botcazou + + * gcc-interface/gigi.h: Reorder declarations and tweak comments. + (gigi): Adjust ATTRIBUTE_UNUSED markers. + * gcc-interface/gadaint.h: New file. + * gcc-interface/trans.c: Include it in lieu of adaint.h. Reorder. + (__gnat_to_canonical_file_spec): Remove declaration. + (number_names): Delete. + (number_files): Likewise. + (gigi): Adjust. + * gcc-interface/Make-lang.in (ada/trans.o): Adjust dependencies to + above change. + +2010-04-14 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : Fix + comment. + * gcc-interface/trans.c (process_freeze_entity): Use local copy of + Ekind. Return early for class-wide types. Do not compute initializer + unless necessary. Reuse the tree for an associated class-wide type + only if processing its root type. + +2010-04-13 Joel Sherrill + + * gsocket.h: Run-time can no longer be built without network + OS headers available. Changing RTEMS GNAT build procedure to + reflect this and letting run-time build use network .h files. + +2010-04-13 Duncan Sands + + * gcc-interface/misc.c (gnat_eh_type_covers): Remove. + * gcc-interface/trans.c (Exception_Handler_to_gnu_zcx): Update comment. + +2010-04-13 Eric Botcazou + + * gcc-interface/gigi.h (standard_datatypes): Add ADT_parent_name_id. + (parent_name_id): New macro. + * gcc-interface/decl.c (gnat_to_gnu_entity) : Use it. + * gcc-interface/trans.c (gigi): Initialize it. + (lvalue_required_p) : New case. + : Likewise. + : Likewise. + * gcc-interface/utils.c (convert): Try to properly upcast tagged types. + +2010-04-13 Eric Botcazou + + * gcc-interface/ada-tree.h (TYPE_BY_REFERENCE_P): Delete. + (DECL_CONST_ADDRESS_P): New macro. + (SET_DECL_ORIGINAL_FIELD_TO_FIELD): Likewise. + (SAME_FIELD_P): Likewise. + * gcc-interface/decl.c (constructor_address_p): New static function. + (gnat_to_gnu_entity) : Set DECL_CONST_ADDRESS_P according to + the return value of above function. + (gnat_to_gnu_entity) : Force BLKmode for all types + passed by reference. + : Likewise. + Set TREE_ADDRESSABLE on the type if it passed by reference. + (make_packable_type): Use SET_DECL_ORIGINAL_FIELD_TO_FIELD. + (create_field_decl_from): Likewise. + (substitute_in_type): Likewise. + (purpose_member_field): Use SAME_FIELD_P. + * gcc-interface/misc.c (must_pass_by_ref): Test TREE_ADDRESSABLE. + * gcc-interface/trans.c (lvalue_required_p): Add ADDRESS_OF_CONSTANT + parameter and adjust recursive calls. + : New case. + : Return 1 if the object is of a class-wide type. + Adjust calls to lvalue_required_p. Do not return the initializer of a + DECL_CONST_ADDRESS_P constant if an lvalue is required for it. + (call_to_gnu): Delay issuing error message for a misaligned actual and + avoid the associated back-end assertion. Test TREE_ADDRESSABLE. + (gnat_gimplify_expr) : Handle non-static constructors. + * gcc-interface/utils.c (make_dummy_type): Set TREE_ADDRESSABLE if the + type is passed by reference. + (convert) : Convert in-place in more cases. + * gcc-interface/utils2.c (build_cond_expr): Drop TYPE_BY_REFERENCE_P. + (build_simple_component_ref): Use SAME_FIELD_P. + 2010-04-12 Eric Botcazou * gcc-interface/trans.c (Identifier_to_gnu): Use boolean variable. diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index a15d9ecfc16..f23a320d1ae 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -78,6 +78,7 @@ package body Back_End is file_info_ptr : Address; gigi_standard_boolean : Entity_Id; gigi_standard_integer : Entity_Id; + gigi_standard_character : Entity_Id; gigi_standard_long_long_float : Entity_Id; gigi_standard_exception_type : Entity_Id; gigi_operating_mode : Back_End_Mode_Type); @@ -115,6 +116,7 @@ package body Back_End is file_info_ptr => File_Info_Array'Address, gigi_standard_boolean => Standard_Boolean, gigi_standard_integer => Standard_Integer, + gigi_standard_character => Standard_Character, gigi_standard_long_long_float => Standard_Long_Long_Float, gigi_standard_exception_type => Standard_Exception_Type, gigi_operating_mode => Mode); diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index 09537baf452..bbfaecf89c3 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -1750,53 +1750,93 @@ package body GNAT.Sockets is pragma Warnings (On); - case Error_Value is - when ENOERROR => return Success; - when EACCES => return Permission_Denied; - when EADDRINUSE => return Address_Already_In_Use; - when EADDRNOTAVAIL => return Cannot_Assign_Requested_Address; - when EAFNOSUPPORT => return - Address_Family_Not_Supported_By_Protocol; - when EALREADY => return Operation_Already_In_Progress; - when EBADF => return Bad_File_Descriptor; - when ECONNABORTED => return Software_Caused_Connection_Abort; - when ECONNREFUSED => return Connection_Refused; - when ECONNRESET => return Connection_Reset_By_Peer; - when EDESTADDRREQ => return Destination_Address_Required; - when EFAULT => return Bad_Address; - when EHOSTDOWN => return Host_Is_Down; - when EHOSTUNREACH => return No_Route_To_Host; - when EINPROGRESS => return Operation_Now_In_Progress; - when EINTR => return Interrupted_System_Call; - when EINVAL => return Invalid_Argument; - when EIO => return Input_Output_Error; - when EISCONN => return Transport_Endpoint_Already_Connected; - when ELOOP => return Too_Many_Symbolic_Links; - when EMFILE => return Too_Many_Open_Files; - when EMSGSIZE => return Message_Too_Long; - when ENAMETOOLONG => return File_Name_Too_Long; - when ENETDOWN => return Network_Is_Down; - when ENETRESET => return - Network_Dropped_Connection_Because_Of_Reset; - when ENETUNREACH => return Network_Is_Unreachable; - when ENOBUFS => return No_Buffer_Space_Available; - when ENOPROTOOPT => return Protocol_Not_Available; - when ENOTCONN => return Transport_Endpoint_Not_Connected; - when ENOTSOCK => return Socket_Operation_On_Non_Socket; - when EOPNOTSUPP => return Operation_Not_Supported; - when EPFNOSUPPORT => return Protocol_Family_Not_Supported; - when EPIPE => return Broken_Pipe; - when EPROTONOSUPPORT => return Protocol_Not_Supported; - when EPROTOTYPE => return Protocol_Wrong_Type_For_Socket; - when ESHUTDOWN => return - Cannot_Send_After_Transport_Endpoint_Shutdown; - when ESOCKTNOSUPPORT => return Socket_Type_Not_Supported; - when ETIMEDOUT => return Connection_Timed_Out; - when ETOOMANYREFS => return Too_Many_References; - when EWOULDBLOCK => return Resource_Temporarily_Unavailable; - - when others => return Cannot_Resolve_Error; - end case; + -- This is not a case statement because if a particular error + -- number constant is not defined, s-oscons-tmplt.c defines + -- it to -1. If multiple constants are not defined, they + -- would each be -1 and result in a "duplicate value in case" error. + if Error_Value = ENOERROR then + return Success; + elsif Error_Value = EACCES then + return Permission_Denied; + elsif Error_Value = EADDRINUSE then + return Address_Already_In_Use; + elsif Error_Value = EADDRNOTAVAIL then + return Cannot_Assign_Requested_Address; + elsif Error_Value = EAFNOSUPPORT then + return Address_Family_Not_Supported_By_Protocol; + elsif Error_Value = EALREADY then + return Operation_Already_In_Progress; + elsif Error_Value = EBADF then + return Bad_File_Descriptor; + elsif Error_Value = ECONNABORTED then + return Software_Caused_Connection_Abort; + elsif Error_Value = ECONNREFUSED then + return Connection_Refused; + elsif Error_Value = ECONNRESET then + return Connection_Reset_By_Peer; + elsif Error_Value = EDESTADDRREQ then + return Destination_Address_Required; + elsif Error_Value = EFAULT then + return Bad_Address; + elsif Error_Value = EHOSTDOWN then + return Host_Is_Down; + elsif Error_Value = EHOSTUNREACH then + return No_Route_To_Host; + elsif Error_Value = EINPROGRESS then + return Operation_Now_In_Progress; + elsif Error_Value = EINTR then + return Interrupted_System_Call; + elsif Error_Value = EINVAL then + return Invalid_Argument; + elsif Error_Value = EIO then + return Input_Output_Error; + elsif Error_Value = EISCONN then + return Transport_Endpoint_Already_Connected; + elsif Error_Value = ELOOP then + return Too_Many_Symbolic_Links; + elsif Error_Value = EMFILE then + return Too_Many_Open_Files; + elsif Error_Value = EMSGSIZE then + return Message_Too_Long; + elsif Error_Value = ENAMETOOLONG then + return File_Name_Too_Long; + elsif Error_Value = ENETDOWN then + return Network_Is_Down; + elsif Error_Value = ENETRESET then + return Network_Dropped_Connection_Because_Of_Reset; + elsif Error_Value = ENETUNREACH then + return Network_Is_Unreachable; + elsif Error_Value = ENOBUFS then + return No_Buffer_Space_Available; + elsif Error_Value = ENOPROTOOPT then + return Protocol_Not_Available; + elsif Error_Value = ENOTCONN then + return Transport_Endpoint_Not_Connected; + elsif Error_Value = ENOTSOCK then + return Socket_Operation_On_Non_Socket; + elsif Error_Value = EOPNOTSUPP then + return Operation_Not_Supported; + elsif Error_Value = EPFNOSUPPORT then + return Protocol_Family_Not_Supported; + elsif Error_Value = EPIPE then + return Broken_Pipe; + elsif Error_Value = EPROTONOSUPPORT then + return Protocol_Not_Supported; + elsif Error_Value = EPROTOTYPE then + return Protocol_Wrong_Type_For_Socket; + elsif Error_Value = ESHUTDOWN then + return Cannot_Send_After_Transport_Endpoint_Shutdown; + elsif Error_Value = ESOCKTNOSUPPORT then + return Socket_Type_Not_Supported; + elsif Error_Value = ETIMEDOUT then + return Connection_Timed_Out; + elsif Error_Value = ETOOMANYREFS then + return Too_Many_References; + elsif Error_Value = EWOULDBLOCK then + return Resource_Temporarily_Unavailable; + else + return Cannot_Resolve_Error; + end if; end Resolve_Error; ----------------------- diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index 467c43cfb1a..25c0964a1f8 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -1254,7 +1254,8 @@ ada/trans.o : ada/gcc-interface/trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(GIMPLE_H) ada/gcc-interface/ada.h ada/adadecode.h ada/types.h \ ada/atree.h ada/elists.h ada/namet.h ada/nlists.h ada/snames.h \ ada/stringt.h ada/uintp.h ada/urealp.h ada/fe.h ada/sinfo.h ada/einfo.h \ - $(ADA_TREE_H) ada/gcc-interface/gigi.h gt-ada-trans.h + ada/gcc-interface/gadaint.h $(ADA_TREE_H) ada/gcc-interface/gigi.h \ + gt-ada-trans.h $(COMPILER) -c $(ALL_COMPILERFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@ ada/utils.o : ada/gcc-interface/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ diff --git a/gcc/ada/gcc-interface/ada-tree.def b/gcc/ada/gcc-interface/ada-tree.def index 454b4bd1106..93967b58cb3 100644 --- a/gcc/ada/gcc-interface/ada-tree.def +++ b/gcc/ada/gcc-interface/ada-tree.def @@ -61,12 +61,11 @@ DEFTREECODE (ATTR_ADDR_EXPR, "attr_addr_expr", tcc_reference, 1) just returning the inner statement. */ DEFTREECODE (STMT_STMT, "stmt_stmt", tcc_statement, 1) -/* A loop. LOOP_STMT_TOP_COND and LOOP_STMT_BOT_COND are the tests to exit a - loop at the top and bottom respectively. LOOP_STMT_UPDATE is the statement - to update the loop iterator at the continue point. LOOP_STMT_BODY are the - statements in the body of the loop. LOOP_STMT_LABEL points to the - LABEL_DECL of the end label of the loop. */ -DEFTREECODE (LOOP_STMT, "loop_stmt", tcc_statement, 5) +/* A loop. LOOP_STMT_COND is the test to exit the loop. LOOP_STMT_UPDATE + is the statement to update the loop iteration variable at the continue + point. LOOP_STMT_BODY are the statements in the body of the loop. And + LOOP_STMT_LABEL points to the LABEL_DECL of the end label of the loop. */ +DEFTREECODE (LOOP_STMT, "loop_stmt", tcc_statement, 4) /* Conditionally exit a loop. EXIT_STMT_COND is the condition, which, if true, will cause the loop to be exited. If no condition is specified, diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h index 8a646fe3704..60a5595fe22 100644 --- a/gcc/ada/gcc-interface/ada-tree.h +++ b/gcc/ada/gcc-interface/ada-tree.h @@ -102,9 +102,6 @@ do { \ front-end. */ #define TYPE_EXTRA_SUBTYPE_P(NODE) TYPE_LANG_FLAG_2 (NODE) -/* Nonzero for composite types if this is a by-reference type. */ -#define TYPE_BY_REFERENCE_P(NODE) TYPE_LANG_FLAG_2 (NODE) - /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is the type for an object whose type includes its template in addition to its value (only true for RECORD_TYPE). */ @@ -325,6 +322,10 @@ do { \ been elaborated and TREE_READONLY is not set on it. */ #define DECL_READONLY_ONCE_ELAB(NODE) DECL_LANG_FLAG_0 (VAR_DECL_CHECK (NODE)) +/* Nonzero in a CONST_DECL if its value is (essentially) the address of a + constant CONSTRUCTOR. */ +#define DECL_CONST_ADDRESS_P(NODE) DECL_LANG_FLAG_0 (CONST_DECL_CHECK (NODE)) + /* Nonzero if this decl is always used by reference; i.e., an INDIRECT_REF is needed to access the object. */ #define DECL_BY_REF_P(NODE) DECL_LANG_FLAG_1 (NODE) @@ -369,6 +370,20 @@ do { \ #define SET_DECL_ORIGINAL_FIELD(NODE, X) \ SET_DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE), X) +/* Set DECL_ORIGINAL_FIELD of FIELD1 to (that of) FIELD2. */ +#define SET_DECL_ORIGINAL_FIELD_TO_FIELD(FIELD1, FIELD2) \ + SET_DECL_ORIGINAL_FIELD ((FIELD1), \ + DECL_ORIGINAL_FIELD (FIELD2) \ + ? DECL_ORIGINAL_FIELD (FIELD2) : (FIELD2)) + +/* Return true if FIELD1 and FIELD2 represent the same field. */ +#define SAME_FIELD_P(FIELD1, FIELD2) \ + ((FIELD1) == (FIELD2) \ + || DECL_ORIGINAL_FIELD (FIELD1) == (FIELD2) \ + || (FIELD1) == DECL_ORIGINAL_FIELD (FIELD2) \ + || (DECL_ORIGINAL_FIELD (FIELD1) \ + && (DECL_ORIGINAL_FIELD (FIELD1) == DECL_ORIGINAL_FIELD (FIELD2)))) + /* In a VAR_DECL, points to the object being renamed if the VAR_DECL is a renaming pointer, otherwise 0. Note that this object is guaranteed to be protected against multiple evaluations. */ @@ -402,10 +417,28 @@ do { \ (STATEMENT_CLASS_P (NODE) && TREE_CODE (NODE) >= STMT_STMT) #define STMT_STMT_STMT(NODE) TREE_OPERAND_CHECK_CODE (NODE, STMT_STMT, 0) -#define LOOP_STMT_TOP_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 0) -#define LOOP_STMT_BOT_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 1) -#define LOOP_STMT_UPDATE(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 2) -#define LOOP_STMT_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 3) -#define LOOP_STMT_LABEL(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 4) + +#define LOOP_STMT_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 0) +#define LOOP_STMT_UPDATE(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 1) +#define LOOP_STMT_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 2) +#define LOOP_STMT_LABEL(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_STMT, 3) + +/* A loop statement is conceptually made up of 6 sub-statements: + + loop: + TOP_CONDITION + TOP_UPDATE + BODY + BOTTOM_CONDITION + BOTTOM_UPDATE + GOTO loop + + However, only 4 of them can exist for a given loop, the pair of conditions + and the pair of updates being mutually exclusive. The default setting is + TOP_CONDITION and BOTTOM_UPDATE and the following couple of flags are used + to toggle the individual settings. */ +#define LOOP_STMT_BOTTOM_COND_P(NODE) TREE_LANG_FLAG_0 (LOOP_STMT_CHECK (NODE)) +#define LOOP_STMT_TOP_UPDATE_P(NODE) TREE_LANG_FLAG_1 (LOOP_STMT_CHECK (NODE)) + #define EXIT_STMT_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXIT_STMT, 0) #define EXIT_STMT_LABEL(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXIT_STMT, 1) diff --git a/gcc/ada/gcc-interface/cuintp.c b/gcc/ada/gcc-interface/cuintp.c index 9b4204012b5..31ed801e63c 100644 --- a/gcc/ada/gcc-interface/cuintp.c +++ b/gcc/ada/gcc-interface/cuintp.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2009, Free Software Foundation, Inc. * + * Copyright (C) 1992-2010, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -106,7 +106,8 @@ UI_To_gnu (Uint Input, tree type) The base integer precision must be superior than 16. */ if (TREE_CODE (comp_type) != REAL_TYPE - && TYPE_PRECISION (comp_type) < TYPE_PRECISION (long_integer_type_node)) + && TYPE_PRECISION (comp_type) + < TYPE_PRECISION (long_integer_type_node)) { comp_type = long_integer_type_node; gcc_assert (TYPE_PRECISION (comp_type) > 16); @@ -141,3 +142,61 @@ UI_To_gnu (Uint Input, tree type) return gnu_ret; } + +/* Similar to UI_From_Int, but take a GCC INTEGER_CST. We use UI_From_Int + when possible, i.e. for a 32-bit signed value, to take advantage of its + built-in caching mechanism. For values of larger magnitude, we compute + digits into a vector and call Vector_To_Uint. */ + +Uint +UI_From_gnu (tree Input) +{ + tree gnu_type = TREE_TYPE (Input), gnu_base, gnu_temp; + /* UI_Base is defined so that 5 Uint digits is sufficient to hold the + largest possible signed 64-bit value. */ + const int Max_For_Dint = 5; + int v[Max_For_Dint], i; + Vector_Template temp; + Int_Vector vec; + +#if HOST_BITS_PER_WIDE_INT == 64 + /* On 64-bit hosts, host_integerp tells whether the input fits in a + signed 64-bit integer. Then a truncation tells whether it fits + in a signed 32-bit integer. */ + if (host_integerp (Input, 0)) + { + HOST_WIDE_INT hw_input = TREE_INT_CST_LOW (Input); + if (hw_input == (int) hw_input) + return UI_From_Int (hw_input); + } + else + return No_Uint; +#else + /* On 32-bit hosts, host_integerp tells whether the input fits in a + signed 32-bit integer. Then a sign test tells whether it fits + in a signed 64-bit integer. */ + if (host_integerp (Input, 0)) + return UI_From_Int (TREE_INT_CST_LOW (Input)); + else if (TREE_INT_CST_HIGH (Input) < 0 + && TYPE_UNSIGNED (gnu_type) + && !(TREE_CODE (gnu_type) == INTEGER_TYPE + && TYPE_IS_SIZETYPE (gnu_type))) + return No_Uint; +#endif + + gnu_base = build_int_cst (gnu_type, UI_Base); + gnu_temp = Input; + + for (i = Max_For_Dint - 1; i >= 0; i--) + { + v[i] = tree_low_cst (fold_build1 (ABS_EXPR, gnu_type, + fold_build2 (TRUNC_MOD_EXPR, gnu_type, + gnu_temp, gnu_base)), + 0); + gnu_temp = fold_build2 (TRUNC_DIV_EXPR, gnu_type, gnu_temp, gnu_base); + } + + temp.Low_Bound = 1, temp.High_Bound = Max_For_Dint; + vec.Array = v, vec.Bounds = &temp; + return Vector_To_Uint (vec, tree_int_cst_sgn (Input) < 0); +} diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index dd768910022..5d6bc79fd93 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -138,6 +138,7 @@ static bool same_discriminant_p (Entity_Id, Entity_Id); static bool array_type_has_nonaliased_component (tree, Entity_Id); static bool compile_time_known_address_p (Node_Id); static bool cannot_be_superflat_p (Node_Id); +static bool constructor_address_p (tree); static void components_to_record (tree, Node_Id, tree, int, bool, tree *, bool, bool, bool, bool, bool); static Uint annotate_value (tree); @@ -181,6 +182,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) const Entity_Kind kind = Ekind (gnat_entity); /* True if this is a type. */ const bool is_type = IN (kind, Type_Kind); + /* True if debug info is requested for this entity. */ + const bool debug_info_p = Needs_Debug_Info (gnat_entity); + /* True if this entity is to be considered as imported. */ + const bool imported_p + = (Is_Imported (gnat_entity) && No (Address_Clause (gnat_entity))); /* For a type, contains the equivalent GNAT node to be used in gigi. */ Entity_Id gnat_equiv_type = Empty; /* Temporary used to walk the GNAT tree. */ @@ -205,12 +211,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) bool maybe_present = false; /* True if we made GNU_DECL and its type here. */ bool this_made_decl = false; - /* True if debug info is requested for this entity. */ - bool debug_info_p = (Needs_Debug_Info (gnat_entity) - || debug_info_level == DINFO_LEVEL_VERBOSE); - /* True if this entity is to be considered as imported. */ - bool imported_p = (Is_Imported (gnat_entity) - && No (Address_Clause (gnat_entity))); /* Size and alignment of the GCC node, if meaningful. */ unsigned int esize = 0, align = 0; /* Contains the list of attributes directly attached to the entity. */ @@ -548,10 +548,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) case E_Out_Parameter: case E_Variable: - /* Simple variables, loop variables, Out parameters, and exceptions. */ + /* Simple variables, loop variables, Out parameters and exceptions. */ object: { - bool used_by_ref = false; bool const_flag = ((kind == E_Constant || kind == E_Variable) && Is_True_Constant (gnat_entity) @@ -563,6 +562,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) bool inner_const_flag = const_flag; bool static_p = Is_Statically_Allocated (gnat_entity); bool mutable_p = false; + bool used_by_ref = false; tree gnu_ext_name = NULL_TREE; tree renamed_obj = NULL_TREE; tree gnu_object_size; @@ -604,9 +604,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) if (kind == E_Loop_Parameter) gnu_type = get_base_type (gnu_type); - /* Reject non-renamed objects whose types are unconstrained arrays or - any object whose type is a dummy type or VOID_TYPE. */ - + /* Reject non-renamed objects whose type is an unconstrained array or + any object whose type is a dummy type or void. */ if ((TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE && No (Renamed_Object (gnat_entity))) || TYPE_IS_DUMMY_P (gnu_type) @@ -626,6 +625,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gcc_assert (Present (Alignment (gnat_entity))); align = validate_alignment (Alignment (gnat_entity), gnat_entity, TYPE_ALIGN (gnu_type)); + /* No point in changing the type if there is an address clause as the final type of the object will be a reference type. */ if (Present (Address_Clause (gnat_entity))) @@ -636,11 +636,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) false, false, definition, true); } - /* If we are defining the object, see if it has a Size value and - validate it if so. If we are not defining the object and a Size - clause applies, simply retrieve the value. We don't want to ignore - the clause and it is expected to have been validated already. Then - get the new type, if any. */ + /* If we are defining the object, see if it has a Size and validate it + if so. If we are not defining the object and a Size clause applies, + simply retrieve the value. We don't want to ignore the clause and + it is expected to have been validated already. Then get the new + type, if any. */ if (definition) gnu_size = validate_size (Esize (gnat_entity), gnu_type, gnat_entity, VAR_DECL, false, @@ -659,8 +659,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } /* If this object has self-referential size, it must be a record with - a default value. We are supposed to allocate an object of the - maximum size in this case unless it is a constant with an + a default discriminant. We are supposed to allocate an object of + the maximum size in this case, unless it is a constant with an initializing expression, in which case we can get the size from that. Note that the resulting size may still be a variable, so this may end up with an indirect allocation. */ @@ -707,8 +707,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } } - /* If the size is zero bytes, make it one byte since some linkers have - trouble with zero-sized objects. If the object will have a + /* If the size is zero byte, make it one byte since some linkers have + troubles with zero-sized objects. If the object will have a template, that will make it nonzero so don't bother. Also avoid doing that for an object renaming or an object with an address clause, as we would lose useful information on the view size @@ -774,7 +774,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ??? Note that we ignore Has_Volatile_Components on objects; it's not at all clear what to do in that case. */ - if (Has_Atomic_Components (gnat_entity)) { tree gnu_inner = (TREE_CODE (gnu_type) == ARRAY_TYPE @@ -789,10 +788,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* Now check if the type of the object allows atomic access. Note that we must test the type, even if this object has size and - alignment to allow such access, because we will be going - inside the padded record to assign to the object. We could fix - this by always copying via an intermediate value, but it's not - clear it's worth the effort. */ + alignment to allow such access, because we will be going inside + the padded record to assign to the object. We could fix this by + always copying via an intermediate value, but it's not clear it's + worth the effort. */ if (Is_Atomic (gnat_entity)) check_ok_for_atomic (gnu_type, gnat_entity, false); @@ -982,8 +981,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) as we have a VAR_DECL for the pointer we make. */ } - gnu_expr - = build_unary_op (ADDR_EXPR, gnu_type, maybe_stable_expr); + gnu_expr = build_unary_op (ADDR_EXPR, gnu_type, + maybe_stable_expr); gnu_size = NULL_TREE; used_by_ref = true; @@ -1024,16 +1023,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) = TYPE_PADDING_P (gnu_type) ? TYPE_FIELDS (TREE_TYPE (TYPE_FIELDS (gnu_type))) : TYPE_FIELDS (gnu_type); - gnu_expr = gnat_build_constructor - (gnu_type, - tree_cons - (template_field, - build_template (TREE_TYPE (template_field), - TREE_TYPE (TREE_CHAIN (template_field)), - NULL_TREE), - NULL_TREE)); + (gnu_type, + tree_cons + (template_field, + build_template (TREE_TYPE (template_field), + TREE_TYPE (TREE_CHAIN (template_field)), + NULL_TREE), + NULL_TREE)); } /* Convert the expression to the type of the object except in the @@ -1050,12 +1048,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type)))))) gnu_expr = convert (gnu_type, gnu_expr); - /* If this is a pointer and it does not have an initializing - expression, initialize it to NULL, unless the object is - imported. */ + /* If this is a pointer that doesn't have an initializing expression, + initialize it to NULL, unless the object is imported. */ if (definition && (POINTER_TYPE_P (gnu_type) || TYPE_IS_FAT_POINTER_P (gnu_type)) - && !Is_Imported (gnat_entity) && !gnu_expr) + && !gnu_expr + && !Is_Imported (gnat_entity)) gnu_expr = integer_zero_node; /* If we are defining the object and it has an Address clause, we must @@ -1065,10 +1063,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) effects in this case. */ if (definition && Present (Address_Clause (gnat_entity))) { + Node_Id gnat_expr = Expression (Address_Clause (gnat_entity)); tree gnu_address = present_gnu_tree (gnat_entity) - ? get_gnu_tree (gnat_entity) - : gnat_to_gnu (Expression (Address_Clause (gnat_entity))); + ? get_gnu_tree (gnat_entity) : gnat_to_gnu (gnat_expr); save_gnu_tree (gnat_entity, NULL_TREE, false); @@ -1081,9 +1079,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) = build_reference_type_for_mode (gnu_type, ptr_mode, true); gnu_address = convert (gnu_type, gnu_address); used_by_ref = true; - const_flag = !Is_Public (gnat_entity) - || compile_time_known_address_p (Expression (Address_Clause - (gnat_entity))); + const_flag + = !Is_Public (gnat_entity) + || compile_time_known_address_p (gnat_expr); /* If this is a deferred constant, the initializer is attached to the full view. */ @@ -1154,14 +1152,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) If the object's size overflows, make an allocator too, so that Storage_Error gets raised. Note that we will never free such memory, so we presume it never will get allocated. */ - if (!allocatable_size_p (TYPE_SIZE_UNIT (gnu_type), - global_bindings_p () || !definition + global_bindings_p () + || !definition || static_p) - || (gnu_size - && ! allocatable_size_p (gnu_size, - global_bindings_p () || !definition - || static_p))) + || (gnu_size && !allocatable_size_p (gnu_size, + global_bindings_p () + || !definition + || static_p))) { gnu_type = build_reference_type (gnu_type); gnu_size = NULL_TREE; @@ -1180,7 +1178,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) If we are elaborating a mutable object, tell build_allocator to ignore a possibly simpler size from the initializer, if any, as we must allocate the maximum possible size in this case. */ - if (definition) { tree gnu_alloc_type = TREE_TYPE (gnu_type); @@ -1290,10 +1287,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) || Is_Exported (gnat_entity))))) gnu_ext_name = create_concat_name (gnat_entity, NULL); - /* If this is constant initialized to a static constant and the - object has an aggregate type, force it to be statically - allocated. This will avoid an initialization copy. */ - if (!static_p && const_flag + /* If this is an aggregate constant initialized to a constant, force it + to be statically allocated. This saves an initialization copy. */ + if (!static_p + && const_flag && gnu_expr && TREE_CONSTANT (gnu_expr) && AGGREGATE_TYPE_P (gnu_type) && host_integerp (TYPE_SIZE_UNIT (gnu_type), 1) @@ -1302,13 +1299,32 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) (TREE_TYPE (TYPE_FIELDS (gnu_type))), 1))) static_p = true; - gnu_decl = create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type, - gnu_expr, const_flag, - Is_Public (gnat_entity), - imported_p || !definition, - static_p, attr_list, gnat_entity); + /* Now create the variable or the constant and set various flags. */ + gnu_decl + = create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type, + gnu_expr, const_flag, Is_Public (gnat_entity), + imported_p || !definition, static_p, attr_list, + gnat_entity); DECL_BY_REF_P (gnu_decl) = used_by_ref; DECL_POINTS_TO_READONLY_P (gnu_decl) = used_by_ref && inner_const_flag; + + /* If we are defining an Out parameter and optimization isn't enabled, + create a fake PARM_DECL for debugging purposes and make it point to + the VAR_DECL. Suppress debug info for the latter but make sure it + will live on the stack so that it can be accessed from within the + debugger through the PARM_DECL. */ + if (kind == E_Out_Parameter && definition && !optimize && debug_info_p) + { + tree param = create_param_decl (gnu_entity_name, gnu_type, false); + gnat_pushdecl (param, gnat_entity); + SET_DECL_VALUE_EXPR (param, gnu_decl); + DECL_HAS_VALUE_EXPR_P (param) = 1; + DECL_IGNORED_P (gnu_decl) = 1; + TREE_ADDRESSABLE (gnu_decl) = 1; + } + + /* If this is a renaming pointer, attach the renamed object to it and + register it if we are at top level. */ if (TREE_CODE (gnu_decl) == VAR_DECL && renamed_obj) { SET_DECL_RENAMED_OBJECT (gnu_decl, renamed_obj); @@ -1319,46 +1335,18 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } } - if (definition && DECL_SIZE_UNIT (gnu_decl) - && get_block_jmpbuf_decl () - && (TREE_CODE (DECL_SIZE_UNIT (gnu_decl)) != INTEGER_CST - || (flag_stack_check == GENERIC_STACK_CHECK - && compare_tree_int (DECL_SIZE_UNIT (gnu_decl), - STACK_CHECK_MAX_VAR_SIZE) > 0))) - add_stmt_with_node (build_call_1_expr - (update_setjmp_buf_decl, - build_unary_op (ADDR_EXPR, NULL_TREE, - get_block_jmpbuf_decl ())), - gnat_entity); - - /* If we are defining an Out parameter and we're not optimizing, - create a fake PARM_DECL for debugging purposes and make it - point to the VAR_DECL. Suppress debug info for the latter - but make sure it will still live on the stack so it can be - accessed from within the debugger through the PARM_DECL. */ - if (kind == E_Out_Parameter && definition && !optimize) - { - tree param = create_param_decl (gnu_entity_name, gnu_type, false); - gnat_pushdecl (param, gnat_entity); - SET_DECL_VALUE_EXPR (param, gnu_decl); - DECL_HAS_VALUE_EXPR_P (param) = 1; - if (debug_info_p) - debug_info_p = false; - else - DECL_IGNORED_P (param) = 1; - TREE_ADDRESSABLE (gnu_decl) = 1; - } - - /* If this is a public constant or we're not optimizing and we're not - making a VAR_DECL for it, make one just for export or debugger use. - Likewise if the address is taken or if either the object or type is - aliased. Make an external declaration for a reference, unless this - is a Standard entity since there no real symbol at the object level - for these. */ + /* If this is a constant and we are defining it or it generates a real + symbol at the object level and we are referencing it, we may want + or need to have a true variable to represent it: + - if optimization isn't enabled, for debugging purposes, + - if the constant is public and not overlaid on something else, + - if its address is taken, + - if either itself or its type is aliased. */ if (TREE_CODE (gnu_decl) == CONST_DECL && (definition || Sloc (gnat_entity) > Standard_Location) - && ((Is_Public (gnat_entity) && No (Address_Clause (gnat_entity))) - || !optimize + && ((!optimize && debug_info_p) + || (Is_Public (gnat_entity) + && No (Address_Clause (gnat_entity))) || Address_Taken (gnat_entity) || Is_Aliased (gnat_entity) || Is_Aliased (Etype (gnat_entity)))) @@ -1372,17 +1360,47 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) SET_DECL_CONST_CORRESPONDING_VAR (gnu_decl, gnu_corr_var); /* As debugging information will be generated for the variable, - do not generate information for the constant. */ - DECL_IGNORED_P (gnu_decl) = 1; + do not generate debugging information for the constant. */ + if (debug_info_p) + DECL_IGNORED_P (gnu_decl) = 1; + else + DECL_IGNORED_P (gnu_corr_var) = 1; } - /* If this is declared in a block that contains a block with an - exception handler, we must force this variable in memory to - suppress an invalid optimization. */ - if (Has_Nested_Block_With_Handler (Scope (gnat_entity)) - && Exception_Mechanism != Back_End_Exceptions) + /* If this is a constant, even if we don't need a true variable, we + may need to avoid returning the initializer in every case. That + can happen for the address of a (constant) constructor because, + upon dereferencing it, the constructor will be reinjected in the + tree, which may not be valid in every case; see lvalue_required_p + for more details. */ + if (TREE_CODE (gnu_decl) == CONST_DECL) + DECL_CONST_ADDRESS_P (gnu_decl) = constructor_address_p (gnu_expr); + + /* If this object is declared in a block that contains a block with an + exception handler, and we aren't using the GCC exception mechanism, + we must force this variable in memory in order to avoid an invalid + optimization. */ + if (Exception_Mechanism != Back_End_Exceptions + && Has_Nested_Block_With_Handler (Scope (gnat_entity))) TREE_ADDRESSABLE (gnu_decl) = 1; + /* If we are defining an object with variable size or an object with + fixed size that will be dynamically allocated, and we are using the + setjmp/longjmp exception mechanism, update the setjmp buffer. */ + if (definition + && Exception_Mechanism == Setjmp_Longjmp + && get_block_jmpbuf_decl () + && DECL_SIZE_UNIT (gnu_decl) + && (TREE_CODE (DECL_SIZE_UNIT (gnu_decl)) != INTEGER_CST + || (flag_stack_check == GENERIC_STACK_CHECK + && compare_tree_int (DECL_SIZE_UNIT (gnu_decl), + STACK_CHECK_MAX_VAR_SIZE) > 0))) + add_stmt_with_node (build_call_1_expr + (update_setjmp_buf_decl, + build_unary_op (ADDR_EXPR, NULL_TREE, + get_block_jmpbuf_decl ())), + gnat_entity); + /* Back-annotate Esize and Alignment of the object if not already known. Note that we pick the values of the type, not those of the object, to shield ourselves from low-level platform-dependent @@ -1907,7 +1925,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* Compute the size of this dimension. */ gnu_max = build3 (COND_EXPR, gnu_index_base_type, - build2 (GE_EXPR, integer_type_node, gnu_high, gnu_low), + build2 (GE_EXPR, boolean_type_node, gnu_high, gnu_low), gnu_high, build2 (MINUS_EXPR, gnu_index_base_type, gnu_low, fold_convert (gnu_index_base_type, @@ -1960,7 +1978,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* Now make the array of arrays and update the pointer to the array in the fat pointer. Note that it is the first field. */ - tem = gnat_to_gnu_component_type (gnat_entity, definition, + tem = gnat_to_gnu_component_type (gnat_entity, definition, debug_info_p); /* If Component_Size is not already specified, annotate it with the @@ -2014,7 +2032,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) SET_TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type, gnu_type); /* If the maximum size doesn't overflow, use it. */ - if (gnu_max_size + if (gnu_max_size && TREE_CODE (gnu_max_size) == INTEGER_CST && !TREE_OVERFLOW (gnu_max_size) && TREE_CODE (gnu_max_size_unit) == INTEGER_CST @@ -2040,9 +2058,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gnu_fat_type, NULL, true, debug_info_p, gnat_entity); - /* Create the type to be used as what a thin pointer designates: an - record type for the object and its template with the field offsets - shifted to have the template at a negative offset. */ + /* Create the type to be used as what a thin pointer designates: + a record type for the object and its template with the fields + shifted to have the template at a negative offset. */ tem = build_unc_object_type (gnu_template_type, tem, create_concat_name (gnat_name, "XUT")); shift_unc_components_for_thin_pointers (tem); @@ -2095,13 +2113,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) { tree gnu_index_type = get_unpadded_type (Etype (gnat_index)); const int prec_comp - = compare_tree_int (TYPE_RM_SIZE (gnu_index_type), + = compare_tree_int (rm_size (gnu_index_type), TYPE_PRECISION (sizetype)); - const bool subrange_p = (prec_comp < 0) - || (prec_comp == 0 - && TYPE_UNSIGNED (gnu_index_type) - == TYPE_UNSIGNED (sizetype)); - const bool wider_p = (prec_comp > 0); + const bool subrange_p = (prec_comp < 0 + && (TYPE_UNSIGNED (gnu_index_type) + || !TYPE_UNSIGNED (sizetype))) + || (prec_comp == 0 + && TYPE_UNSIGNED (gnu_index_type) + == TYPE_UNSIGNED (sizetype)); tree gnu_orig_min = TYPE_MIN_VALUE (gnu_index_type); tree gnu_orig_max = TYPE_MAX_VALUE (gnu_index_type); tree gnu_min = convert (sizetype, gnu_orig_min); @@ -2205,7 +2224,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gnu_high = build_cond_expr (sizetype, build_binary_op (GE_EXPR, - integer_type_node, + boolean_type_node, gnu_orig_max, gnu_orig_min), gnu_max, gnu_high); @@ -2280,7 +2299,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) && TREE_CODE (TREE_TYPE (gnu_index_type)) != INTEGER_TYPE) || TYPE_BIASED_REPRESENTATION_P (gnu_index_type) - || wider_p) + || prec_comp > 0) need_index_type_struct = true; } @@ -2841,8 +2860,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* ...and reference the _Parent field of this record. */ gnu_field - = create_field_decl (get_identifier - (Get_Name_String (Name_uParent)), + = create_field_decl (parent_name_id, gnu_parent, gnu_type, 0, has_rep ? TYPE_SIZE (gnu_parent) : NULL_TREE, @@ -2892,10 +2910,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) false, all_rep, is_unchecked_union, debug_info_p, false); - /* If it is a tagged record force the type to BLKmode to insure that - these objects will always be put in memory. Likewise for limited - record types. */ - if (Is_Tagged_Type (gnat_entity) || Is_Limited_Record (gnat_entity)) + /* If it is passed by reference, force BLKmode to ensure that objects + of this type will always be put in memory. */ + if (Is_By_Reference_Type (gnat_entity)) SET_TYPE_MODE (gnu_type, BLKmode); /* We used to remove the associations of the discriminants and _Parent @@ -3216,8 +3233,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) finish_record_type (gnu_type, gnu_field_list, 2, false); /* See the E_Record_Type case for the rationale. */ - if (Is_Tagged_Type (gnat_entity) - || Is_Limited_Record (gnat_entity)) + if (Is_By_Reference_Type (gnat_entity)) SET_TYPE_MODE (gnu_type, BLKmode); else compute_record_mode (gnu_type); @@ -3466,7 +3482,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) SET_TYPE_UNCONSTRAINED_ARRAY (gnu_type, gnu_old); TYPE_POINTER_TO (gnu_old) = gnu_type; - Sloc_to_locus (Sloc (gnat_entity), &input_location); fields = chainon (chainon (NULL_TREE, create_field_decl @@ -4163,8 +4178,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) | (TYPE_QUAL_CONST * const_flag) | (TYPE_QUAL_VOLATILE * volatile_flag)); - Sloc_to_locus (Sloc (gnat_entity), &input_location); - if (has_stub) gnu_stub_type = build_qualified_type (gnu_stub_type, @@ -4336,9 +4349,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) break; } - /* Simple class_wide types are always viewed as their root_type - by Gigi unless an Equivalent_Type is specified. */ case E_Class_Wide_Type: + /* Class-wide types are always transformed into their root type. */ gnu_decl = gnat_to_gnu_entity (gnat_equiv_type, NULL_TREE, 0); maybe_present = true; break; @@ -4384,12 +4396,18 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) handling alignment and possible padding. */ if (is_type && (!gnu_decl || this_made_decl)) { + /* Tell the middle-end that objects of tagged types are guaranteed to + be properly aligned. This is necessary because conversions to the + class-wide type are translated into conversions to the root type, + which can be less aligned than some of its derived types. */ if (Is_Tagged_Type (gnat_entity) || Is_Class_Wide_Equivalent_Type (gnat_entity)) TYPE_ALIGN_OK (gnu_type) = 1; - if (AGGREGATE_TYPE_P (gnu_type) && Is_By_Reference_Type (gnat_entity)) - TYPE_BY_REFERENCE_P (gnu_type) = 1; + /* If the type is passed by reference, objects of this type must be + fully addressable and cannot be copied. */ + if (Is_By_Reference_Type (gnat_entity)) + TREE_ADDRESSABLE (gnu_type) = 1; /* ??? Don't set the size for a String_Literal since it is either confirming or we don't handle it properly (if the low bound is @@ -4693,38 +4711,40 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) if (Unknown_Esize (gnat_entity) && TYPE_SIZE (gnu_type)) { - /* If the size is self-referential, we annotate the maximum - value of that size. */ tree gnu_size = TYPE_SIZE (gnu_type); + /* If the size is self-referential, annotate the maximum value. */ if (CONTAINS_PLACEHOLDER_P (gnu_size)) gnu_size = max_size (gnu_size, true); - Set_Esize (gnat_entity, annotate_value (gnu_size)); - if (type_annotate_only && Is_Tagged_Type (gnat_entity)) { - /* In this mode the tag and the parent components are not - generated by the front-end, so the sizes must be adjusted - explicitly now. */ - int size_offset, new_size; + /* In this mode, the tag and the parent components are not + generated by the front-end so the sizes must be adjusted. */ + tree pointer_size = bitsize_int (POINTER_SIZE), offset; + Uint uint_size; if (Is_Derived_Type (gnat_entity)) { - size_offset - = UI_To_Int (Esize (Etype (Base_Type (gnat_entity)))); + offset = UI_To_gnu (Esize (Etype (Base_Type (gnat_entity))), + bitsizetype); Set_Alignment (gnat_entity, Alignment (Etype (Base_Type (gnat_entity)))); } else - size_offset = POINTER_SIZE; - - new_size = UI_To_Int (Esize (gnat_entity)) + size_offset; - Set_Esize (gnat_entity, - UI_From_Int (((new_size + (POINTER_SIZE - 1)) - / POINTER_SIZE) * POINTER_SIZE)); - Set_RM_Size (gnat_entity, Esize (gnat_entity)); + offset = pointer_size; + + gnu_size = size_binop (PLUS_EXPR, gnu_size, offset); + gnu_size = size_binop (MULT_EXPR, pointer_size, + size_binop (CEIL_DIV_EXPR, + gnu_size, + pointer_size)); + uint_size = annotate_value (gnu_size); + Set_Esize (gnat_entity, uint_size); + Set_RM_Size (gnat_entity, uint_size); } + else + Set_Esize (gnat_entity, annotate_value (gnu_size)); } if (Unknown_RM_Size (gnat_entity) && rm_size (gnu_type)) @@ -5354,16 +5374,15 @@ compile_time_known_address_p (Node_Id gnat_address) return Compile_Time_Known_Value (gnat_address); } -/* Return true if GNAT_RANGE, a N_Range node, cannot be superflat, i.e. - cannot verify HB < LB-1 when LB and HB are the low and high bounds. */ +/* Return true if GNAT_RANGE, a N_Range node, cannot be superflat, i.e. if the + inequality HB >= LB-1 is true. LB and HB are the low and high bounds. */ static bool cannot_be_superflat_p (Node_Id gnat_range) { Node_Id gnat_lb = Low_Bound (gnat_range), gnat_hb = High_Bound (gnat_range); Node_Id scalar_range; - - tree gnu_lb, gnu_hb; + tree gnu_lb, gnu_hb, gnu_lb_minus_one; /* If the low bound is not constant, try to find an upper bound. */ while (Nkind (gnat_lb) != N_Integer_Literal @@ -5383,19 +5402,37 @@ cannot_be_superflat_p (Node_Id gnat_range) || Nkind (scalar_range) == N_Range)) gnat_hb = Low_Bound (scalar_range); - if (!(Nkind (gnat_lb) == N_Integer_Literal - && Nkind (gnat_hb) == N_Integer_Literal)) + /* If we have failed to find constant bounds, punt. */ + if (Nkind (gnat_lb) != N_Integer_Literal + || Nkind (gnat_hb) != N_Integer_Literal) return false; - gnu_lb = UI_To_gnu (Intval (gnat_lb), bitsizetype); - gnu_hb = UI_To_gnu (Intval (gnat_hb), bitsizetype); + /* We need at least a signed 64-bit type to catch most cases. */ + gnu_lb = UI_To_gnu (Intval (gnat_lb), sbitsizetype); + gnu_hb = UI_To_gnu (Intval (gnat_hb), sbitsizetype); + if (TREE_OVERFLOW (gnu_lb) || TREE_OVERFLOW (gnu_hb)) + return false; /* If the low bound is the smallest integer, nothing can be smaller. */ - gnu_lb = size_binop (MINUS_EXPR, gnu_lb, bitsize_one_node); - if (TREE_OVERFLOW (gnu_lb)) + gnu_lb_minus_one = size_binop (MINUS_EXPR, gnu_lb, sbitsize_one_node); + if (TREE_OVERFLOW (gnu_lb_minus_one)) return true; - return (tree_int_cst_lt (gnu_hb, gnu_lb) == 0); + return !tree_int_cst_lt (gnu_hb, gnu_lb_minus_one); +} + +/* Return true if GNU_EXPR is (essentially) the address of a CONSTRUCTOR. */ + +static bool +constructor_address_p (tree gnu_expr) +{ + while (TREE_CODE (gnu_expr) == NOP_EXPR + || TREE_CODE (gnu_expr) == CONVERT_EXPR + || TREE_CODE (gnu_expr) == NON_LVALUE_EXPR) + gnu_expr = TREE_OPERAND (gnu_expr, 0); + + return (TREE_CODE (gnu_expr) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (gnu_expr, 0)) == CONSTRUCTOR); } /* Given GNAT_ENTITY, elaborate all expressions that are required to @@ -5844,7 +5881,6 @@ make_aligning_type (tree type, unsigned int align, tree size, /* We will be crafting a record type with one field at a position set to be the next multiple of ALIGN past record'address + room bytes. We use a record placeholder to express record'address. */ - tree record_type = make_node (RECORD_TYPE); tree record = build0 (PLACEHOLDER_EXPR, record_type); @@ -5864,7 +5900,6 @@ make_aligning_type (tree type, unsigned int align, tree size, Every length is in sizetype bytes there, except "pos" which has to be set as a bit position in the GCC tree for the record. */ - tree room_st = size_int (room); tree vblock_addr_st = size_binop (PLUS_EXPR, record_addr_st, room_st); tree voffset_st, pos, field; @@ -5879,13 +5914,11 @@ make_aligning_type (tree type, unsigned int align, tree size, /* Compute VOFFSET and then POS. The next byte position multiple of some alignment after some address is obtained by "and"ing the alignment minus 1 with the two's complement of the address. */ - voffset_st = size_binop (BIT_AND_EXPR, - size_diffop (size_zero_node, vblock_addr_st), - ssize_int ((align / BITS_PER_UNIT) - 1)); + fold_build1 (NEGATE_EXPR, sizetype, vblock_addr_st), + size_int ((align / BITS_PER_UNIT) - 1)); /* POS = (ROOM + VOFFSET) * BIT_PER_UNIT, in bitsizetype. */ - pos = size_binop (MULT_EXPR, convert (bitsizetype, size_binop (PLUS_EXPR, room_st, voffset_st)), @@ -5904,7 +5937,6 @@ make_aligning_type (tree type, unsigned int align, tree size, consequences on the alignment computation, and create_field_decl would make one without this special argument, for instance because of the complex position expression. */ - field = create_field_decl (get_identifier ("F"), type, record_type, 1, size, pos, -1); TYPE_FIELDS (record_type) = field; @@ -6033,10 +6065,7 @@ make_packable_type (tree type, bool in_record) !DECL_NONADDRESSABLE_P (old_field)); DECL_INTERNAL_P (new_field) = DECL_INTERNAL_P (old_field); - SET_DECL_ORIGINAL_FIELD - (new_field, (DECL_ORIGINAL_FIELD (old_field) - ? DECL_ORIGINAL_FIELD (old_field) : old_field)); - + SET_DECL_ORIGINAL_FIELD_TO_FIELD (new_field, old_field); if (TREE_CODE (new_type) == QUAL_UNION_TYPE) DECL_QUALIFIER (new_field) = DECL_QUALIFIER (old_field); @@ -6258,10 +6287,13 @@ maybe_pad_type (tree type, tree size, unsigned int align, if (Present (gnat_entity) && size && TREE_CODE (size) != MAX_EXPR + && TREE_CODE (size) != COND_EXPR && !operand_equal_p (size, orig_size, 0) && !(TREE_CODE (size) == INTEGER_CST && TREE_CODE (orig_size) == INTEGER_CST - && tree_int_cst_lt (size, orig_size))) + && (TREE_OVERFLOW (size) + || TREE_OVERFLOW (orig_size) + || tree_int_cst_lt (size, orig_size)))) { Node_Id gnat_error_node = Empty; @@ -6313,13 +6345,11 @@ choices_to_gnu (tree operand, Node_Id choices) low = gnat_to_gnu (Low_Bound (choice)); high = gnat_to_gnu (High_Bound (choice)); - /* There's no good type to use here, so we might as well use - integer_type_node. */ this_test - = build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, - build_binary_op (GE_EXPR, integer_type_node, + = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node, + build_binary_op (GE_EXPR, boolean_type_node, operand, low), - build_binary_op (LE_EXPR, integer_type_node, + build_binary_op (LE_EXPR, boolean_type_node, operand, high)); break; @@ -6330,10 +6360,10 @@ choices_to_gnu (tree operand, Node_Id choices) high = gnat_to_gnu (High_Bound (gnat_temp)); this_test - = build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, - build_binary_op (GE_EXPR, integer_type_node, + = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node, + build_binary_op (GE_EXPR, boolean_type_node, operand, low), - build_binary_op (LE_EXPR, integer_type_node, + build_binary_op (LE_EXPR, boolean_type_node, operand, high)); break; @@ -6351,10 +6381,10 @@ choices_to_gnu (tree operand, Node_Id choices) high = TYPE_MAX_VALUE (type); this_test - = build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, - build_binary_op (GE_EXPR, integer_type_node, + = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node, + build_binary_op (GE_EXPR, boolean_type_node, operand, low), - build_binary_op (LE_EXPR, integer_type_node, + build_binary_op (LE_EXPR, boolean_type_node, operand, high)); break; } @@ -6364,7 +6394,7 @@ choices_to_gnu (tree operand, Node_Id choices) case N_Character_Literal: case N_Integer_Literal: single = gnat_to_gnu (choice); - this_test = build_binary_op (EQ_EXPR, integer_type_node, operand, + this_test = build_binary_op (EQ_EXPR, boolean_type_node, operand, single); break; @@ -6376,8 +6406,8 @@ choices_to_gnu (tree operand, Node_Id choices) gcc_unreachable (); } - result = build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, - result, this_test); + result = build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, result, + this_test); } return result; @@ -7064,12 +7094,10 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list, static Uint annotate_value (tree gnu_size) { - int len = TREE_CODE_LENGTH (TREE_CODE (gnu_size)); TCode tcode; Node_Ref_Or_Val ops[3], ret; - int i; - int size; struct tree_int_map **h = NULL; + int i; /* See if we've already saved the value for this node. */ if (EXPR_P (gnu_size)) @@ -7096,46 +7124,19 @@ annotate_value (tree gnu_size) if (TREE_OVERFLOW (gnu_size)) return No_Uint; - /* This may have come from a conversion from some smaller type, - so ensure this is in bitsizetype. */ + /* This may come from a conversion from some smaller type, so ensure + this is in bitsizetype. */ gnu_size = convert (bitsizetype, gnu_size); - /* For negative values, use NEGATE_EXPR of the supplied value. */ + /* For a negative value, use NEGATE_EXPR of the opposite. Such values + appear in expressions containing aligning patterns. */ if (tree_int_cst_sgn (gnu_size) < 0) { - /* The ridiculous code below is to handle the case of the largest - negative integer. */ - tree negative_size = size_diffop (bitsize_zero_node, gnu_size); - bool adjust = false; - tree temp; - - if (TREE_OVERFLOW (negative_size)) - { - negative_size - = size_binop (MINUS_EXPR, bitsize_zero_node, - size_binop (PLUS_EXPR, gnu_size, - bitsize_one_node)); - adjust = true; - } - - temp = build1 (NEGATE_EXPR, bitsizetype, negative_size); - if (adjust) - temp = build2 (MINUS_EXPR, bitsizetype, temp, bitsize_one_node); - - return annotate_value (temp); + tree op_size = fold_build1 (NEGATE_EXPR, bitsizetype, gnu_size); + return annotate_value (build1 (NEGATE_EXPR, bitsizetype, op_size)); } - if (!host_integerp (gnu_size, 1)) - return No_Uint; - - size = tree_low_cst (gnu_size, 1); - - /* This peculiar test is to make sure that the size fits in an int - on machines where HOST_WIDE_INT is not "int". */ - if (tree_low_cst (gnu_size, 1) == size) - return UI_From_Int (size); - else - return No_Uint; + return UI_From_gnu (gnu_size); case COMPONENT_REF: /* The only case we handle here is a simple discriminant reference. */ @@ -7200,7 +7201,7 @@ annotate_value (tree gnu_size) for (i = 0; i < 3; i++) ops[i] = No_Uint; - for (i = 0; i < len; i++) + for (i = 0; i < TREE_CODE_LENGTH (TREE_CODE (gnu_size)); i++) { ops[i] = annotate_value (TREE_OPERAND (gnu_size, i)); if (ops[i] == No_Uint) @@ -7253,9 +7254,8 @@ annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref) UI_From_Int (TYPE_ALIGN (gnu_type) / BITS_PER_UNIT)); } -/* Return first element of field list whose TREE_PURPOSE is ELEM or whose - DECL_ORIGINAL_FIELD of TREE_PURPOSE is ELEM. Return NULL_TREE if there - is no such element in the list. */ +/* Return first element of field list whose TREE_PURPOSE is the same as ELEM. + Return NULL_TREE if there is no such element in the list. */ static tree purpose_member_field (const_tree elem, tree list) @@ -7263,7 +7263,7 @@ purpose_member_field (const_tree elem, tree list) while (list) { tree field = TREE_PURPOSE (list); - if (elem == field || elem == DECL_ORIGINAL_FIELD (field)) + if (SAME_FIELD_P (field, elem)) return list; list = TREE_CHAIN (list); } @@ -7494,13 +7494,9 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, Node_Id gnat_error_node; tree type_size, size; - if (kind == VAR_DECL - /* If a type needs strict alignment, a component of this type in - a packed record cannot be packed and thus uses the type size. */ - || (kind == TYPE_DECL && Strict_Alignment (gnat_object))) - type_size = TYPE_SIZE (gnu_type); - else - type_size = rm_size (gnu_type); + /* Return 0 if no size was specified. */ + if (uint_size == No_Uint) + return NULL_TREE; /* Find the node to use for errors. */ if ((Ekind (gnat_object) == E_Component @@ -7512,19 +7508,17 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, else gnat_error_node = gnat_object; - /* Return 0 if no size was specified, either because Esize was not Present - or the specified size was zero. */ - if (No (uint_size) || uint_size == No_Uint) - return NULL_TREE; - /* Get the size as a tree. Issue an error if a size was specified but cannot be represented in sizetype. */ size = UI_To_gnu (uint_size, bitsizetype); if (TREE_OVERFLOW (size)) { - post_error_ne (component_p ? "component size of & is too large" - : "size of & is too large", - gnat_error_node, gnat_object); + if (component_p) + post_error_ne ("component size of & is too large", gnat_error_node, + gnat_object); + else + post_error_ne ("size of & is too large", gnat_error_node, + gnat_object); return NULL_TREE; } @@ -7560,6 +7554,14 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, && TYPE_CONTAINS_TEMPLATE_P (gnu_type)) size = size_binop (PLUS_EXPR, DECL_SIZE (TYPE_FIELDS (gnu_type)), size); + if (kind == VAR_DECL + /* If a type needs strict alignment, a component of this type in + a packed record cannot be packed and thus uses the type size. */ + || (kind == TYPE_DECL && Strict_Alignment (gnat_object))) + type_size = TYPE_SIZE (gnu_type); + else + type_size = rm_size (gnu_type); + /* Modify the size of the type to be that of the maximum size if it has a discriminant. */ if (type_size && CONTAINS_PLACEHOLDER_P (type_size)) @@ -7569,13 +7571,9 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, by the smallest integral mode that's valid for pointers. */ if (TREE_CODE (gnu_type) == POINTER_TYPE || TYPE_IS_FAT_POINTER_P (gnu_type)) { - enum machine_mode p_mode; - - for (p_mode = GET_CLASS_NARROWEST_MODE (MODE_INT); - !targetm.valid_pointer_mode (p_mode); - p_mode = GET_MODE_WIDER_MODE (p_mode)) - ; - + enum machine_mode p_mode = GET_CLASS_NARROWEST_MODE (MODE_INT); + while (!targetm.valid_pointer_mode (p_mode)) + p_mode = GET_MODE_WIDER_MODE (p_mode); type_size = bitsize_int (GET_MODE_BITSIZE (p_mode)); } @@ -7590,22 +7588,11 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, ("component size for& too small{, minimum allowed is ^}", gnat_error_node, gnat_object, type_size); else - post_error_ne_tree ("size for& too small{, minimum allowed is ^}", - gnat_error_node, gnat_object, type_size); - - if (kind == VAR_DECL && !component_p - && TREE_CODE (rm_size (gnu_type)) == INTEGER_CST - && !tree_int_cst_lt (size, rm_size (gnu_type))) - post_error_ne_tree_2 - ("\\size of ^ is not a multiple of alignment (^ bits)", - gnat_error_node, gnat_object, rm_size (gnu_type), - TYPE_ALIGN (gnu_type)); - - else if (INTEGRAL_TYPE_P (gnu_type)) - post_error_ne ("\\size would be legal if & were not aliased!", - gnat_error_node, gnat_object); + post_error_ne_tree + ("size for& too small{, minimum allowed is ^}", + gnat_error_node, gnat_object, type_size); - return NULL_TREE; + size = NULL_TREE; } return size; @@ -7617,16 +7604,17 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, static void set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity) { + Node_Id gnat_attr_node; + tree old_size, size; + + /* Do nothing if no size was specified. */ + if (uint_size == No_Uint) + return; + /* Only issue an error if a Value_Size clause was explicitly given. Otherwise, we'd be duplicating an error on the Size clause. */ - Node_Id gnat_attr_node + gnat_attr_node = Get_Attribute_Definition_Clause (gnat_entity, Attr_Value_Size); - tree old_size = rm_size (gnu_type), size; - - /* Do nothing if no size was specified, either because RM size was not - Present or if the specified size was zero. */ - if (No (uint_size) || uint_size == No_Uint) - return; /* Get the size as a tree. Issue an error if a size was specified but cannot be represented in sizetype. */ @@ -7650,6 +7638,8 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity) && !Is_Discrete_Or_Fixed_Point_Type (gnat_entity))) return; + old_size = rm_size (gnu_type); + /* If the old size is self-referential, get the maximum size. */ if (CONTAINS_PLACEHOLDER_P (old_size)) old_size = max_size (old_size, true); @@ -7663,7 +7653,8 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity) && TYPE_PACKED_ARRAY_TYPE_P (gnu_type)) && !(TYPE_IS_PADDING_P (gnu_type) && TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type))) == ARRAY_TYPE - && TYPE_PACKED_ARRAY_TYPE_P (TREE_TYPE (TYPE_FIELDS (gnu_type)))) + && TYPE_PACKED_ARRAY_TYPE_P + (TREE_TYPE (TYPE_FIELDS (gnu_type)))) && tree_int_cst_lt (size, old_size))) { if (Present (gnat_attr_node)) @@ -7740,14 +7731,9 @@ make_type_from_size (tree type, tree size_tree, bool for_biased) SET_TYPE_RM_MAX_VALUE (new_type, convert (TREE_TYPE (new_type), TYPE_MAX_VALUE (type))); - /* Propagate the name to avoid creating a fake subrange type. */ - if (TYPE_NAME (type)) - { - if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL) - TYPE_NAME (new_type) = DECL_NAME (TYPE_NAME (type)); - else - TYPE_NAME (new_type) = TYPE_NAME (type); - } + /* Copy the name to show that it's essentially the same type and + not a subrange type. */ + TYPE_NAME (new_type) = TYPE_NAME (type); TYPE_BIASED_REPRESENTATION_P (new_type) = biased_p; SET_TYPE_RM_SIZE (new_type, bitsize_int (size)); return new_type; @@ -8035,8 +8021,7 @@ create_field_decl_from (tree old_field, tree field_type, tree record_type, } DECL_INTERNAL_P (new_field) = DECL_INTERNAL_P (old_field); - t = DECL_ORIGINAL_FIELD (old_field); - SET_DECL_ORIGINAL_FIELD (new_field, t ? t : old_field); + SET_DECL_ORIGINAL_FIELD_TO_FIELD (new_field, old_field); DECL_DISCRIMINANT_NUMBER (new_field) = DECL_DISCRIMINANT_NUMBER (old_field); TREE_THIS_VOLATILE (new_field) = TREE_THIS_VOLATILE (old_field); @@ -8372,9 +8357,7 @@ substitute_in_type (tree t, tree f, tree r) } DECL_CONTEXT (new_field) = nt; - SET_DECL_ORIGINAL_FIELD (new_field, - (DECL_ORIGINAL_FIELD (field) - ? DECL_ORIGINAL_FIELD (field) : field)); + SET_DECL_ORIGINAL_FIELD_TO_FIELD (new_field, field); TREE_CHAIN (new_field) = TYPE_FIELDS (nt); TYPE_FIELDS (nt) = new_field; diff --git a/gcc/ada/gcc-interface/gadaint.h b/gcc/ada/gcc-interface/gadaint.h new file mode 100644 index 00000000000..57503f069fe --- /dev/null +++ b/gcc/ada/gcc-interface/gadaint.h @@ -0,0 +1,35 @@ +/**************************************************************************** + * * + * GNAT COMPILER COMPONENTS * + * * + * G A D A I N T * + * * + * C Header File * + * * + * Copyright (C) 2010, Free Software Foundation, Inc. * + * * + * GNAT is free software; you can redistribute it and/or modify it under * + * terms of the GNU General Public License as published by the Free Soft- * + * ware Foundation; either version 3, or (at your option) any later ver- * + * sion. GNAT is distributed in the hope that it will be useful, but WITH- * + * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. You should have received a copy of the GNU General * + * Public License distributed with GNAT; see file COPYING3. If not see * + * . * + * * + * GNAT was originally developed by the GNAT team at New York University. * + * Extensive contributions were provided by Ada Core Technologies Inc. * + * * + ****************************************************************************/ + +/* This file contains the declarations of adaint.c material used in gigi. + It should be used in lieu of adaint.h in gigi because the latter drags + a lot of stuff on Windows and this pollutes the namespace of macros. */ + +#ifndef GCC_ADAINT_H +#define GCC_ADAINT_H + +extern char *__gnat_to_canonical_file_spec (char *); + +#endif /* GCC_ADAINT_H */ diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 8ba0637bebf..b7f6639d9fb 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -85,7 +85,7 @@ extern void mark_visited (tree t); #define MARK_VISITED(EXP) \ do { \ - if((EXP) && !TREE_CONSTANT (EXP)) \ + if((EXP) && !CONSTANT_CLASS_P (EXP)) \ mark_visited (EXP); \ } while (0) @@ -168,12 +168,18 @@ extern tree create_concat_name (Entity_Id gnat_entity, const char *suffix); the name followed by "___" and the specified suffix. */ extern tree concat_name (tree gnu_name, const char *suffix); -/* If true, then gigi is being called on an analyzed but unexpanded tree, and - the only purpose of the call is to properly annotate types with - representation information. */ +/* Highest number in the front-end node table. */ +extern int max_gnat_nodes; + +/* Current node being treated, in case abort called. */ +extern Node_Id error_gnat_node; + +/* True when gigi is being called on an analyzed but unexpanded + tree, and the only purpose of the call is to properly annotate + types with representation information. */ extern bool type_annotate_only; -/* Current file name without path */ +/* Current file name without path. */ extern const char *ref_filename; /* This structure must be kept synchronized with Call_Back_End. */ @@ -184,11 +190,9 @@ struct File_Info_Type }; /* This is the main program of the back-end. It sets up all the table - structures and then generates code. - - ??? Needs parameter descriptions */ - -extern void gigi (Node_Id gnat_root, int max_gnat_node, int number_name, + structures and then generates code. */ +extern void gigi (Node_Id gnat_root, int max_gnat_node, + int number_name ATTRIBUTE_UNUSED, struct Node *nodes_ptr, Node_Id *next_node_ptr, Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr, struct Elmt_Item *elmts_ptr, @@ -199,6 +203,7 @@ extern void gigi (Node_Id gnat_root, int max_gnat_node, int number_name, struct File_Info_Type *file_info_ptr, Entity_Id standard_boolean, Entity_Id standard_integer, + Entity_Id standard_character, Entity_Id standard_long_long_float, Entity_Id standard_exception_type, Int gigi_operating_mode); @@ -228,28 +233,25 @@ extern bool Sloc_to_locus (Source_Ptr Sloc, location_t *locus); /* Post an error message. MSG is the error message, properly annotated. NODE is the node at which to post the error and the node to use for the - "&" substitution. */ + '&' substitution. */ extern void post_error (const char *msg, Node_Id node); -/* Similar, but NODE is the node at which to post the error and ENT - is the node to use for the "&" substitution. */ +/* Similar to post_error, but NODE is the node at which to post the error and + ENT is the node to use for the '&' substitution. */ extern void post_error_ne (const char *msg, Node_Id node, Entity_Id ent); -/* Similar, but NODE is the node at which to post the error, ENT is the node - to use for the "&" substitution, and N is the number to use for the ^. */ +/* Similar to post_error_ne, but NUM is the number to use for the '^'. */ extern void post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent, - int n); + int num); -/* Similar to post_error_ne_num, but T is a GCC tree representing the number - to write. If the tree represents a constant that fits within a - host integer, the text inside curly brackets in MSG will be output - (presumably including a '^'). Otherwise that text will not be output - and the text inside square brackets will be output instead. */ +/* Similar to post_error_ne, but T is a GCC tree representing the number to + write. If T represents a constant, the text inside curly brackets in + MSG will be output (presumably including a '^'). Otherwise it will not + be output and the text inside square brackets will be output instead. */ extern void post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent, tree t); -/* Similar to post_error_ne_tree, except that NUM is a second - integer to write in the message. */ +/* Similar to post_error_ne_tree, but NUM is a second integer to write. */ extern void post_error_ne_tree_2 (const char *msg, Node_Id node, Entity_Id ent, tree t, int num); @@ -257,13 +259,6 @@ extern void post_error_ne_tree_2 (const char *msg, Node_Id node, Entity_Id ent, if none. */ extern tree get_exception_label (char kind); -/* Current node being treated, in case gigi_abort or Check_Elaboration_Code - called. */ -extern Node_Id error_gnat_node; - -/* Highest number in the front-end node table. */ -extern int max_gnat_nodes; - /* If nonzero, pretend we are allocating at global level. */ extern int force_global; @@ -276,45 +271,6 @@ extern int double_float_alignment; types whose size is greater or equal to 64 bits, or 0 if this alignment is not specifically capped. */ extern int double_scalar_alignment; - -/* Standard data type sizes. Most of these are not used. */ - -#ifndef CHAR_TYPE_SIZE -#define CHAR_TYPE_SIZE BITS_PER_UNIT -#endif - -#ifndef SHORT_TYPE_SIZE -#define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2)) -#endif - -#ifndef INT_TYPE_SIZE -#define INT_TYPE_SIZE BITS_PER_WORD -#endif - -#ifndef LONG_TYPE_SIZE -#define LONG_TYPE_SIZE BITS_PER_WORD -#endif - -#ifndef LONG_LONG_TYPE_SIZE -#define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2) -#endif - -#ifndef FLOAT_TYPE_SIZE -#define FLOAT_TYPE_SIZE BITS_PER_WORD -#endif - -#ifndef DOUBLE_TYPE_SIZE -#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2) -#endif - -#ifndef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2) -#endif - -/* The choice of SIZE_TYPE here is very problematic. We need a signed - type whose bit width is Pmode. Assume "long" is such a type here. */ -#undef SIZE_TYPE -#define SIZE_TYPE "long int" /* Data structures used to represent attributes. */ @@ -362,9 +318,15 @@ enum standard_datatypes /* Type declaration node <==> typedef virtual void *T() */ ADT_fdesc_type, - /* Null pointer for above type */ + /* Null pointer for above type. */ ADT_null_fdesc, + /* Value 1 in signed bitsizetype. */ + ADT_sbitsize_one_node, + + /* Value BITS_PER_UNIT in signed bitsizetype. */ + ADT_sbitsize_unit_node, + /* Function declaration nodes for run-time functions for allocating memory. Ada allocators cause calls to these functions to be generated. Malloc32 is used only on 64bit systems needing to allocate 32bit memory. */ @@ -374,9 +336,12 @@ enum standard_datatypes /* Likewise for freeing memory. */ ADT_free_decl, - /* Function decl node for 64-bit multiplication with overflow checking */ + /* Function decl node for 64-bit multiplication with overflow checking. */ ADT_mulv64_decl, + /* Identifier for the name of the _Parent field in tagged record types. */ + ADT_parent_name_id, + /* Types and decls used by our temporary exception mechanism. See init_gigi_decls for details. */ ADT_jmpbuf_type, @@ -404,10 +369,13 @@ extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1]; #define ptr_void_ftype gnat_std_decls[(int) ADT_ptr_void_ftype] #define fdesc_type_node gnat_std_decls[(int) ADT_fdesc_type] #define null_fdesc_node gnat_std_decls[(int) ADT_null_fdesc] +#define sbitsize_one_node gnat_std_decls[(int) ADT_sbitsize_one_node] +#define sbitsize_unit_node gnat_std_decls[(int) ADT_sbitsize_unit_node] #define malloc_decl gnat_std_decls[(int) ADT_malloc_decl] #define malloc32_decl gnat_std_decls[(int) ADT_malloc32_decl] #define free_decl gnat_std_decls[(int) ADT_free_decl] #define mulv64_decl gnat_std_decls[(int) ADT_mulv64_decl] +#define parent_name_id gnat_std_decls[(int) ADT_parent_name_id] #define jmpbuf_type gnat_std_decls[(int) ADT_jmpbuf_type] #define jmpbuf_ptr_type gnat_std_decls[(int) ADT_jmpbuf_ptr_type] #define get_jmpbuf_decl gnat_std_decls[(int) ADT_get_jmpbuf_decl] @@ -446,7 +414,6 @@ extern tree get_block_jmpbuf_decl (void); and uses GNAT_NODE for location information. */ extern void gnat_pushdecl (tree decl, Node_Id gnat_node); -extern void gnat_init_decl_processing (void); extern void gnat_init_gcc_eh (void); extern void gnat_install_builtins (void); @@ -621,9 +588,6 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init, const_flag, public_flag, extern_flag, \ static_flag, false, attr_list, gnat_node) -/* Given a DECL and ATTR_LIST, apply the listed attributes. */ -extern void process_attributes (tree decl, struct attrib *attr_list); - /* Record DECL as a global renaming pointer. */ extern void record_global_renaming_pointer (tree decl); diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 570bd111a95..f3e7b1b7482 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -74,7 +74,6 @@ static void gnat_print_type (FILE *, tree, int); static const char *gnat_printable_name (tree, int); static const char *gnat_dwarf_name (tree, int); static tree gnat_return_tree (tree); -static int gnat_eh_type_covers (tree, tree); static void gnat_parse_file (int); static void internal_error_function (const char *, va_list *); static tree gnat_type_max_size (const_tree); @@ -389,9 +388,35 @@ internal_error_function (const char *msgid, va_list *ap) static bool gnat_init (void) { - /* Performs whatever initialization steps needed by the language-dependent - lexical analyzer. */ - gnat_init_decl_processing (); + /* Do little here, most of the standard declarations are set up after the + front-end has been run. Use the same `char' as C, this doesn't really + matter since we'll use the explicit `unsigned char' for Character. */ + build_common_tree_nodes (flag_signed_char, true); + + /* In Ada, we use a signed type for SIZETYPE. Use the signed type + corresponding to the width of Pmode. In most cases when ptr_mode + and Pmode differ, C will use the width of ptr_mode for SIZETYPE. + But we get far better code using the width of Pmode. */ + size_type_node = gnat_type_for_mode (Pmode, 0); + set_sizetype (size_type_node); + TYPE_NAME (sizetype) = get_identifier ("size_type"); + + /* In Ada, we use an unsigned 8-bit type for the default boolean type. */ + boolean_type_node = make_unsigned_type (8); + TREE_SET_CODE (boolean_type_node, BOOLEAN_TYPE); + SET_TYPE_RM_MAX_VALUE (boolean_type_node, + build_int_cst (boolean_type_node, 1)); + SET_TYPE_RM_SIZE (boolean_type_node, bitsize_int (1)); + + build_common_tree_nodes_2 (0); + sbitsize_one_node = sbitsize_int (1); + sbitsize_unit_node = sbitsize_int (BITS_PER_UNIT); + boolean_true_node = TYPE_MAX_VALUE (boolean_type_node); + + ptr_void_type_node = build_pointer_type (void_type_node); + + /* Show that REFERENCE_TYPEs are internal and should be Pmode. */ + internal_reference_types (); /* Add the input filename as the last argument. */ if (main_input_filename) @@ -401,11 +426,9 @@ gnat_init (void) gnat_argv[gnat_argc] = NULL; } + /* Register our internal error function. */ global_dc->internal_error = &internal_error_function; - /* Show that REFERENCE_TYPEs are internal and should be Pmode. */ - internal_reference_types (); - return true; } @@ -434,8 +457,6 @@ gnat_init_gcc_eh (void) right exception regions. */ using_eh_for_cleanups (); - lang_eh_type_covers = gnat_eh_type_covers; - /* Turn on -fexceptions and -fnon-call-exceptions. The first one triggers the generation of the necessary exception runtime tables. The second one is useful for two reasons: 1/ we map some asynchronous signals like SEGV @@ -580,20 +601,6 @@ gnat_return_tree (tree t) return t; } -/* Return true if type A catches type B. Callback for flow analysis from - the exception handling part of the back-end. */ - -static int -gnat_eh_type_covers (tree a, tree b) -{ - /* a catches b if they represent the same exception id or if a - is an "others". - - ??? integer_zero_node for "others" is hardwired in too many places - currently. */ - return (a == b || a == integer_zero_node); -} - /* Get the alias set corresponding to a type or expression. */ static alias_set_type @@ -700,7 +707,7 @@ must_pass_by_ref (tree gnu_type) and does not produce compatibility problems with C, since C does not have such objects. */ return (TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE - || (AGGREGATE_TYPE_P (gnu_type) && TYPE_BY_REFERENCE_P (gnu_type)) + || TREE_ADDRESSABLE (gnu_type) || (TYPE_SIZE (gnu_type) && TREE_CODE (TYPE_SIZE (gnu_type)) != INTEGER_CST)); } diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 42e07b5d170..71c9e862aba 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -49,6 +49,7 @@ #include "fe.h" #include "sinfo.h" #include "einfo.h" +#include "gadaint.h" #include "ada-tree.h" #include "gigi.h" @@ -75,11 +76,7 @@ #endif #endif -extern char *__gnat_to_canonical_file_spec (char *); - -int max_gnat_nodes; -int number_names; -int number_files; +/* Pointers to front-end tables accessed through macros. */ struct Node *Nodes_Ptr; Node_Id *Next_Node_Ptr; Node_Id *Prev_Node_Ptr; @@ -89,14 +86,20 @@ struct String_Entry *Strings_Ptr; Char_Code *String_Chars_Ptr; struct List_Header *List_Headers_Ptr; -/* Current filename without path. */ -const char *ref_filename; +/* Highest number in the front-end node table. */ +int max_gnat_nodes; + +/* Current node being treated, in case abort called. */ +Node_Id error_gnat_node; /* True when gigi is being called on an analyzed but unexpanded tree, and the only purpose of the call is to properly annotate types with representation information. */ bool type_annotate_only; +/* Current filename without path. */ +const char *ref_filename; + /* When not optimizing, we cache the 'First, 'Last and 'Length attributes of unconstrained array IN parameters to avoid emitting a great deal of redundant instructions to recompute them each time. */ @@ -183,9 +186,6 @@ static GTY(()) tree gnu_program_error_label_stack; /* Map GNAT tree codes to GCC tree codes for simple expressions. */ static enum tree_code gnu_codes[Number_Node_Kinds]; -/* Current node being treated, in case abort called. */ -Node_Id error_gnat_node; - static void init_code_table (void); static void Compilation_Unit_to_gnu (Node_Id); static void record_code_position (Node_Id); @@ -200,7 +200,6 @@ static void pop_stack (tree *); static enum gimplify_status gnat_gimplify_stmt (tree *); static void elaborate_all_entities (Node_Id); static void process_freeze_entity (Node_Id); -static void process_inlined_subprograms (Node_Id); static void process_decls (List_Id, List_Id, Node_Id, bool, bool); static tree emit_range_check (tree, Node_Id, Node_Id); static tree emit_index_check (tree, tree, tree, tree, Node_Id); @@ -208,14 +207,14 @@ static tree emit_check (tree, tree, int, Node_Id); static tree build_unary_op_trapv (enum tree_code, tree, tree, Node_Id); static tree build_binary_op_trapv (enum tree_code, tree, tree, tree, Node_Id); static tree convert_with_check (Entity_Id, tree, bool, bool, bool, Node_Id); -static bool smaller_packable_type_p (tree, tree); +static bool smaller_form_type_p (tree, tree); static bool addressable_p (tree, tree); static tree assoc_to_constructor (Entity_Id, Node_Id, tree); static tree extract_values (tree, tree); static tree pos_to_constructor (Node_Id, tree, Entity_Id); static tree maybe_implicit_deref (tree); static void set_expr_location_from_node (tree, Node_Id); -static int lvalue_required_p (Node_Id, tree, bool, bool); +static int lvalue_required_p (Node_Id, tree, bool, bool, bool); /* Hooks for debug info back-ends, only supported and used in a restricted set of configurations. */ @@ -226,13 +225,14 @@ static const char *decode_name (const char *) ATTRIBUTE_UNUSED; structures and then generates code. */ void -gigi (Node_Id gnat_root, int max_gnat_node, int number_name, +gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED, struct Node *nodes_ptr, Node_Id *next_node_ptr, Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr, struct Elmt_Item *elmts_ptr, struct String_Entry *strings_ptr, Char_Code *string_chars_ptr, struct List_Header *list_headers_ptr, Nat number_file, - struct File_Info_Type *file_info_ptr, Entity_Id standard_boolean, - Entity_Id standard_integer, Entity_Id standard_long_long_float, + struct File_Info_Type *file_info_ptr, + Entity_Id standard_boolean, Entity_Id standard_integer, + Entity_Id standard_character, Entity_Id standard_long_long_float, Entity_Id standard_exception_type, Int gigi_operating_mode) { Entity_Id gnat_literal; @@ -242,8 +242,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, int i; max_gnat_nodes = max_gnat_node; - number_names = number_name; - number_files = number_file; + Nodes_Ptr = nodes_ptr; Next_Node_Ptr = next_node_ptr; Prev_Node_Ptr = prev_node_ptr; @@ -262,7 +261,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, t = create_concat_name (Defining_Entity (Unit (gnat_root)), NULL); first_global_object_name = ggc_strdup (IDENTIFIER_POINTER (t)); - for (i = 0; i < number_files; i++) + for (i = 0; i < number_file; i++) { /* Use the identifier table to make a permanent copy of the filename as the name table gets reallocated after Gigi returns but before all the @@ -319,23 +318,26 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, double_float_alignment = get_target_double_float_alignment (); double_scalar_alignment = get_target_double_scalar_alignment (); - /* Record the builtin types. Define `integer' and `unsigned char' first so - that dbx will output them first. */ + /* Record the builtin types. Define `integer' and `character' first so that + dbx will output them first. */ record_builtin_type ("integer", integer_type_node); - record_builtin_type ("unsigned char", char_type_node); - record_builtin_type ("long integer", long_integer_type_node); - unsigned_type_node = gnat_type_for_size (INT_TYPE_SIZE, 1); - record_builtin_type ("unsigned int", unsigned_type_node); - record_builtin_type (SIZE_TYPE, sizetype); + record_builtin_type ("character", unsigned_char_type_node); record_builtin_type ("boolean", boolean_type_node); record_builtin_type ("void", void_type_node); /* Save the type we made for integer as the type for Standard.Integer. */ - save_gnu_tree (Base_Type (standard_integer), TYPE_NAME (integer_type_node), + save_gnu_tree (Base_Type (standard_integer), + TYPE_NAME (integer_type_node), false); - /* Save the type we made for boolean as the type for Standard.Boolean. */ - save_gnu_tree (Base_Type (standard_boolean), TYPE_NAME (boolean_type_node), + /* Likewise for character as the type for Standard.Character. */ + save_gnu_tree (Base_Type (standard_character), + TYPE_NAME (unsigned_char_type_node), + false); + + /* Likewise for boolean as the type for Standard.Boolean. */ + save_gnu_tree (Base_Type (standard_boolean), + TYPE_NAME (boolean_type_node), false); gnat_literal = First_Literal (Base_Type (standard_boolean)); t = UI_To_gnu (Enumeration_Rep (gnat_literal), boolean_type_node); @@ -396,6 +398,9 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, int64_type, NULL_TREE), NULL_TREE, false, true, true, NULL, Empty); + /* Name of the _Parent field in tagged record types. */ + parent_name_id = get_identifier (Get_Name_String (Name_uParent)); + /* Make the types and functions used for exception processing. */ jmpbuf_type = build_array_type (gnat_type_for_mode (Pmode, 0), @@ -411,6 +416,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, NULL_TREE, false, true, true, NULL, Empty); /* Avoid creating superfluous edges to __builtin_setjmp receivers. */ DECL_PURE_P (get_jmpbuf_decl) = 1; + DECL_IGNORED_P (get_jmpbuf_decl) = 1; set_jmpbuf_decl = create_subprog_decl @@ -419,6 +425,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, build_function_type (void_type_node, tree_cons (NULL_TREE, jmpbuf_ptr_type, t)), NULL_TREE, false, true, true, NULL, Empty); + DECL_IGNORED_P (set_jmpbuf_decl) = 1; /* setjmp returns an integer and has one operand, which is a pointer to a jmpbuf. */ @@ -428,7 +435,6 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, build_function_type (integer_type_node, tree_cons (NULL_TREE, jmpbuf_ptr_type, t)), NULL_TREE, false, true, true, NULL, Empty); - DECL_BUILT_IN_CLASS (setjmp_decl) = BUILT_IN_NORMAL; DECL_FUNCTION_CODE (setjmp_decl) = BUILT_IN_SETJMP; @@ -440,7 +446,6 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, build_function_type (void_type_node, tree_cons (NULL_TREE, jmpbuf_ptr_type, t)), NULL_TREE, false, true, true, NULL, Empty); - DECL_BUILT_IN_CLASS (update_setjmp_buf_decl) = BUILT_IN_NORMAL; DECL_FUNCTION_CODE (update_setjmp_buf_decl) = BUILT_IN_UPDATE_SETJMP_BUF; @@ -452,6 +457,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, ptr_void_type_node, t)), NULL_TREE, false, true, true, NULL, Empty); + DECL_IGNORED_P (begin_handler_decl) = 1; end_handler_decl = create_subprog_decl (get_identifier ("__gnat_end_handler"), NULL_TREE, @@ -460,6 +466,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, ptr_void_type_node, t)), NULL_TREE, false, true, true, NULL, Empty); + DECL_IGNORED_P (end_handler_decl) = 1; /* If in no exception handlers mode, all raise statements are redirected to __gnat_last_chance_handler. No need to redefine raise_nodefer_decl since @@ -471,7 +478,8 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, (get_identifier ("__gnat_last_chance_handler"), NULL_TREE, build_function_type (void_type_node, tree_cons (NULL_TREE, - build_pointer_type (char_type_node), + build_pointer_type + (unsigned_char_type_node), tree_cons (NULL_TREE, integer_type_node, t))), @@ -493,7 +501,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, build_function_type (void_type_node, tree_cons (NULL_TREE, build_pointer_type - (char_type_node), + (unsigned_char_type_node), tree_cons (NULL_TREE, integer_type_node, t))), @@ -509,9 +517,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, TYPE_QUAL_VOLATILE); } - /* Set the types that GCC and Gigi use from the front end. We would - like to do this for char_type_node, but it needs to correspond to - the C char type. */ + /* Set the types that GCC and Gigi use from the front end. */ exception_type = gnat_to_gnu_entity (Base_Type (standard_exception_type), NULL_TREE, 0); except_type_node = TREE_TYPE (exception_type); @@ -618,7 +624,6 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, gnat_init_gcc_eh (); /* Now translate the compilation unit proper. */ - start_stmt_group (); Compilation_Unit_to_gnu (gnat_root); /* Finally see if we have any elaboration procedures to deal with. */ @@ -703,8 +708,9 @@ lvalue_required_for_attribute_p (Node_Id gnat_node) /* Return a positive value if an lvalue is required for GNAT_NODE. GNU_TYPE is the type that will be used for GNAT_NODE in the translated GNU tree. CONSTANT indicates whether the underlying object represented by GNAT_NODE - is constant in the Ada sense, ALIASED whether it is aliased (but the latter - doesn't affect the outcome if CONSTANT is not true). + is constant in the Ada sense. If it is, ADDRESS_OF_CONSTANT indicates + whether its value is the address of a constant and ALIASED whether it is + aliased. If it isn't, ADDRESS_OF_CONSTANT and ALIASED are ignored. The function climbs up the GNAT tree starting from the node and returns 1 upon encountering a node that effectively requires an lvalue downstream. @@ -713,7 +719,7 @@ lvalue_required_for_attribute_p (Node_Id gnat_node) static int lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant, - bool aliased) + bool address_of_constant, bool aliased) { Node_Id gnat_parent = Parent (gnat_node), gnat_temp; @@ -728,7 +734,10 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant, case N_Parameter_Association: case N_Function_Call: case N_Procedure_Call_Statement: - return (must_pass_by_ref (gnu_type) || default_pass_by_ref (gnu_type)); + /* If the parameter is by reference, an lvalue is required. */ + return (!constant + || must_pass_by_ref (gnu_type) + || default_pass_by_ref (gnu_type)); case N_Indexed_Component: /* Only the array expression can require an lvalue. */ @@ -753,11 +762,13 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant, return 0; aliased |= Has_Aliased_Components (Etype (gnat_node)); - return lvalue_required_p (gnat_parent, gnu_type, constant, aliased); + return lvalue_required_p (gnat_parent, gnu_type, constant, + address_of_constant, aliased); case N_Selected_Component: aliased |= Is_Aliased (Entity (Selector_Name (gnat_parent))); - return lvalue_required_p (gnat_parent, gnu_type, constant, aliased); + return lvalue_required_p (gnat_parent, gnu_type, constant, + address_of_constant, aliased); case N_Object_Renaming_Declaration: /* We need to make a real renaming only if the constant object is @@ -775,22 +786,57 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant, case N_Object_Declaration: /* We cannot use a constructor if this is an atomic object because the actual assignment might end up being done component-wise. */ - return Is_Composite_Type (Underlying_Type (Etype (gnat_node))) - && Is_Atomic (Defining_Entity (gnat_parent)); + return (!constant + ||(Is_Composite_Type (Underlying_Type (Etype (gnat_node))) + && Is_Atomic (Defining_Entity (gnat_parent))) + /* We don't use a constructor if this is a class-wide object + because the effective type of the object is the equivalent + type of the class-wide subtype and it smashes most of the + data into an array of bytes to which we cannot convert. */ + || Ekind ((Etype (Defining_Entity (gnat_parent)))) + == E_Class_Wide_Subtype); case N_Assignment_Statement: /* We cannot use a constructor if the LHS is an atomic object because the actual assignment might end up being done component-wise. */ - return (Name (gnat_parent) == gnat_node + return (!constant + || Name (gnat_parent) == gnat_node || (Is_Composite_Type (Underlying_Type (Etype (gnat_node))) && Is_Atomic (Entity (Name (gnat_parent))))); + case N_Type_Conversion: + case N_Qualified_Expression: + /* We must look through all conversions for composite types because we + may need to bypass an intermediate conversion to a narrower record + type that is generated for a formal conversion, e.g. the conversion + to the root type of a hierarchy of tagged types generated for the + formal conversion to the class-wide type. */ + if (!Is_Composite_Type (Underlying_Type (Etype (gnat_node)))) + return 0; + + /* ... fall through ... */ + case N_Unchecked_Type_Conversion: - /* Returning 0 is very likely correct but we get better code if we - go through the conversion. */ - return lvalue_required_p (gnat_parent, - get_unpadded_type (Etype (gnat_parent)), - constant, aliased); + return (!constant + || lvalue_required_p (gnat_parent, + get_unpadded_type (Etype (gnat_parent)), + constant, address_of_constant, aliased)); + + case N_Allocator: + /* We should only reach here through the N_Qualified_Expression case + and, therefore, only for composite types. Force an lvalue since + a block-copy to the newly allocated area of memory is made. */ + return 1; + + case N_Explicit_Dereference: + /* We look through dereferences for address of constant because we need + to handle the special cases listed above. */ + if (constant && address_of_constant) + return lvalue_required_p (gnat_parent, + get_unpadded_type (Etype (gnat_parent)), + true, false, true); + + /* ... fall through ... */ default: return 0; @@ -895,12 +941,13 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) statement alternative or a record discriminant. There is no possible volatile-ness short-circuit here since Volatile constants must bei imported per C.6. */ - if (Ekind (gnat_temp) == E_Constant && Is_Scalar_Type (gnat_temp_type) + if (Ekind (gnat_temp) == E_Constant + && Is_Scalar_Type (gnat_temp_type) && !Is_Imported (gnat_temp) && Present (Address_Clause (gnat_temp))) { require_lvalue = lvalue_required_p (gnat_node, gnu_result_type, true, - Is_Aliased (gnat_temp)); + false, Is_Aliased (gnat_temp)); use_constant_initializer = !require_lvalue; } @@ -989,29 +1036,35 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) gnu_result_type = TREE_TYPE (TYPE_FIELDS (gnu_result_type)); } - /* If we have a constant declaration and its initializer at hand, - try to return the latter to avoid the need to call fold in lots - of places and the need of elaboration code if this Id is used as - an initializer itself. */ + /* If we have a constant declaration and its initializer, try to return the + latter to avoid the need to call fold in lots of places and the need for + elaboration code if this identifier is used as an initializer itself. */ if (TREE_CONSTANT (gnu_result) && DECL_P (gnu_result) && DECL_INITIAL (gnu_result)) { bool constant_only = (TREE_CODE (gnu_result) == CONST_DECL && !DECL_CONST_CORRESPONDING_VAR (gnu_result)); - - /* If there is a (corresponding) variable, we only want to return - the constant value if an lvalue is not required. Evaluate this - now if we have not already done so. */ - if (!constant_only && require_lvalue < 0) - require_lvalue = lvalue_required_p (gnat_node, gnu_result_type, true, - Is_Aliased (gnat_temp)); - - if (constant_only || !require_lvalue) + bool address_of_constant = (TREE_CODE (gnu_result) == CONST_DECL + && DECL_CONST_ADDRESS_P (gnu_result)); + + /* If there is a (corresponding) variable or this is the address of a + constant, we only want to return the initializer if an lvalue isn't + required. Evaluate this now if we have not already done so. */ + if ((!constant_only || address_of_constant) && require_lvalue < 0) + require_lvalue + = lvalue_required_p (gnat_node, gnu_result_type, true, + address_of_constant, Is_Aliased (gnat_temp)); + + /* ??? We need to unshare the initializer if the object is external + as such objects are not marked for unsharing if we are not at the + global level. This should be fixed in add_decl_expr. */ + if ((constant_only && !address_of_constant) || !require_lvalue) gnu_result = unshare_expr (DECL_INITIAL (gnu_result)); } *gnu_result_type_p = gnu_result_type; + return gnu_result; } @@ -1162,7 +1215,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) gnu_expr = gnat_protect_expr (gnu_expr); gnu_expr = emit_check - (build_binary_op (EQ_EXPR, integer_type_node, + (build_binary_op (EQ_EXPR, boolean_type_node, gnu_expr, attribute == Attr_Pred ? TYPE_MIN_VALUE (gnu_result_type) @@ -1304,16 +1357,12 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) if (TREE_CODE (gnu_obj_type) == RECORD_TYPE && TYPE_CONTAINS_TEMPLATE_P (gnu_obj_type)) { - tree gnu_char_ptr_type = build_pointer_type (char_type_node); + tree gnu_char_ptr_type + = build_pointer_type (unsigned_char_type_node); tree gnu_pos = byte_position (TYPE_FIELDS (gnu_obj_type)); - tree gnu_byte_offset - = convert (sizetype, - size_diffop (size_zero_node, gnu_pos)); - gnu_byte_offset = fold_build1 (NEGATE_EXPR, sizetype, gnu_byte_offset); - gnu_ptr = convert (gnu_char_ptr_type, gnu_ptr); gnu_ptr = build_binary_op (POINTER_PLUS_EXPR, gnu_char_ptr_type, - gnu_ptr, gnu_byte_offset); + gnu_ptr, gnu_pos); } gnu_result = convert (gnu_result_type, gnu_ptr); @@ -1408,17 +1457,14 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) else gnu_result = rm_size (gnu_type); - gcc_assert (gnu_result); - /* Deal with a self-referential size by returning the maximum size for - a type and by qualifying the size with the object for 'Size of an - object. */ + a type and by qualifying the size with the object otherwise. */ if (CONTAINS_PLACEHOLDER_P (gnu_result)) { - if (TREE_CODE (gnu_prefix) != TYPE_DECL) - gnu_result = substitute_placeholder_in_expr (gnu_result, gnu_expr); - else + if (TREE_CODE (gnu_prefix) == TYPE_DECL) gnu_result = max_size (gnu_result, true); + else + gnu_result = substitute_placeholder_in_expr (gnu_result, gnu_expr); } /* If the type contains a template, subtract its size. */ @@ -1427,11 +1473,11 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) gnu_result = size_binop (MINUS_EXPR, gnu_result, DECL_SIZE (TYPE_FIELDS (gnu_type))); - gnu_result_type = get_unpadded_type (Etype (gnat_node)); - + /* For 'Max_Size_In_Storage_Elements, adjust the unit. */ if (attribute == Attr_Max_Size_In_Storage_Elements) - gnu_result = fold_build2 (CEIL_DIV_EXPR, bitsizetype, - gnu_result, bitsize_unit_node); + gnu_result = size_binop (CEIL_DIV_EXPR, gnu_result, bitsize_unit_node); + + gnu_result_type = get_unpadded_type (Etype (gnat_node)); break; case Attr_Alignment: @@ -1629,7 +1675,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) gnu_result = build_cond_expr (comp_type, build_binary_op (GE_EXPR, - integer_type_node, + boolean_type_node, hb, lb), gnu_result, convert (comp_type, integer_zero_node)); @@ -1998,31 +2044,68 @@ Case_Statement_to_gnu (Node_Id gnat_node) return gnu_result; } +/* Return true if VAL (of type TYPE) can equal the minimum value if MAX is + false, or the maximum value if MAX is true, of TYPE. */ + +static bool +can_equal_min_or_max_val_p (tree val, tree type, bool max) +{ + tree min_or_max_val = (max ? TYPE_MAX_VALUE (type) : TYPE_MIN_VALUE (type)); + + if (TREE_CODE (min_or_max_val) != INTEGER_CST) + return true; + + if (TREE_CODE (val) == NOP_EXPR) + val = (max + ? TYPE_MAX_VALUE (TREE_TYPE (TREE_OPERAND (val, 0))) + : TYPE_MIN_VALUE (TREE_TYPE (TREE_OPERAND (val, 0)))); + + if (TREE_CODE (val) != INTEGER_CST) + return true; + + return tree_int_cst_equal (val, min_or_max_val) == 1; +} + +/* Return true if VAL (of type TYPE) can equal the minimum value of TYPE. + If REVERSE is true, minimum value is taken as maximum value. */ + +static inline bool +can_equal_min_val_p (tree val, tree type, bool reverse) +{ + return can_equal_min_or_max_val_p (val, type, reverse); +} + +/* Return true if VAL (of type TYPE) can equal the maximum value of TYPE. + If REVERSE is true, maximum value is taken as minimum value. */ + +static inline bool +can_equal_max_val_p (tree val, tree type, bool reverse) +{ + return can_equal_min_or_max_val_p (val, type, !reverse); +} + /* Subroutine of gnat_to_gnu to translate gnat_node, an N_Loop_Statement, to a GCC tree, which is returned. */ static tree Loop_Statement_to_gnu (Node_Id gnat_node) { - /* ??? It would be nice to use "build" here, but there's no build5. */ - tree gnu_loop_stmt = build_nt (LOOP_STMT, NULL_TREE, NULL_TREE, - NULL_TREE, NULL_TREE, NULL_TREE); - tree gnu_loop_var = NULL_TREE; - Node_Id gnat_iter_scheme = Iteration_Scheme (gnat_node); - tree gnu_cond_expr = NULL_TREE; + const Node_Id gnat_iter_scheme = Iteration_Scheme (gnat_node); + tree gnu_loop_stmt = build4 (LOOP_STMT, void_type_node, NULL_TREE, + NULL_TREE, NULL_TREE, NULL_TREE); + tree gnu_loop_label = create_artificial_label (input_location); + tree gnu_loop_var = NULL_TREE, gnu_cond_expr = NULL_TREE; tree gnu_result; - TREE_TYPE (gnu_loop_stmt) = void_type_node; - TREE_SIDE_EFFECTS (gnu_loop_stmt) = 1; - LOOP_STMT_LABEL (gnu_loop_stmt) = create_artificial_label (input_location); + /* Set location information for statement and end label. */ set_expr_location_from_node (gnu_loop_stmt, gnat_node); Sloc_to_locus (Sloc (End_Label (gnat_node)), - &DECL_SOURCE_LOCATION (LOOP_STMT_LABEL (gnu_loop_stmt))); + &DECL_SOURCE_LOCATION (gnu_loop_label)); + LOOP_STMT_LABEL (gnu_loop_stmt) = gnu_loop_label; - /* Save the end label of this LOOP_STMT in a stack so that the corresponding + /* Save the end label of this LOOP_STMT in a stack so that a corresponding N_Exit_Statement can find it. */ - push_stack (&gnu_loop_label_stack, NULL_TREE, - LOOP_STMT_LABEL (gnu_loop_stmt)); + push_stack (&gnu_loop_label_stack, NULL_TREE, gnu_loop_label); /* Set the condition under which the loop must keep going. For the case "LOOP .... END LOOP;" the condition is always true. */ @@ -2031,11 +2114,11 @@ Loop_Statement_to_gnu (Node_Id gnat_node) /* For the case "WHILE condition LOOP ..... END LOOP;" it's immediate. */ else if (Present (Condition (gnat_iter_scheme))) - LOOP_STMT_TOP_COND (gnu_loop_stmt) + LOOP_STMT_COND (gnu_loop_stmt) = gnat_to_gnu (Condition (gnat_iter_scheme)); - /* Otherwise we have an iteration scheme and the condition is given by - the bounds of the subtype of the iteration variable. */ + /* Otherwise we have an iteration scheme and the condition is given by the + bounds of the subtype of the iteration variable. */ else { Node_Id gnat_loop_spec = Loop_Parameter_Specification (gnat_iter_scheme); @@ -2044,93 +2127,180 @@ Loop_Statement_to_gnu (Node_Id gnat_node) tree gnu_type = get_unpadded_type (gnat_type); tree gnu_low = TYPE_MIN_VALUE (gnu_type); tree gnu_high = TYPE_MAX_VALUE (gnu_type); - tree gnu_first, gnu_last, gnu_limit; - enum tree_code update_code, end_code; tree gnu_base_type = get_base_type (gnu_type); + tree gnu_one_node = convert (gnu_base_type, integer_one_node); + tree gnu_first, gnu_last; + enum tree_code update_code, test_code, shift_code; + bool reverse = Reverse_Present (gnat_loop_spec), fallback = false; - /* We must disable modulo reduction for the loop variable, if any, + /* We must disable modulo reduction for the iteration variable, if any, in order for the loop comparison to be effective. */ - if (Reverse_Present (gnat_loop_spec)) + if (reverse) { gnu_first = gnu_high; gnu_last = gnu_low; update_code = MINUS_NOMOD_EXPR; - end_code = GE_EXPR; - gnu_limit = TYPE_MIN_VALUE (gnu_base_type); + test_code = GE_EXPR; + shift_code = PLUS_NOMOD_EXPR; } else { gnu_first = gnu_low; gnu_last = gnu_high; update_code = PLUS_NOMOD_EXPR; - end_code = LE_EXPR; - gnu_limit = TYPE_MAX_VALUE (gnu_base_type); + test_code = LE_EXPR; + shift_code = MINUS_NOMOD_EXPR; } - /* We know the loop variable will not overflow if GNU_LAST is a constant - and is not equal to GNU_LIMIT. If it might overflow, we have to move - the limit test to the end of the loop. In that case, we have to test - for an empty loop outside the loop. */ - if (TREE_CODE (gnu_last) != INTEGER_CST - || TREE_CODE (gnu_limit) != INTEGER_CST - || tree_int_cst_equal (gnu_last, gnu_limit)) + /* We use two different strategies to translate the loop, depending on + whether optimization is enabled. + + If it is, we try to generate the canonical form of loop expected by + the loop optimizer, which is the do-while form: + + ENTRY_COND + loop: + TOP_UPDATE + BODY + BOTTOM_COND + GOTO loop + + This makes it possible to bypass loop header copying and to turn the + BOTTOM_COND into an inequality test. This should catch (almost) all + loops with constant starting point. If we cannot, we try to generate + the default form, which is: + + loop: + TOP_COND + BODY + BOTTOM_UPDATE + GOTO loop + + It will be rotated during loop header copying and an entry test added + to yield the do-while form. This should catch (almost) all loops with + constant ending point. If we cannot, we generate the fallback form: + + ENTRY_COND + loop: + BODY + BOTTOM_COND + BOTTOM_UPDATE + GOTO loop + + which works in all cases but for which loop header copying will copy + the BOTTOM_COND, thus adding a third conditional branch. + + If optimization is disabled, loop header copying doesn't come into + play and we try to generate the loop forms with the less conditional + branches directly. First, the default form, it should catch (almost) + all loops with constant ending point. Then, if we cannot, we try to + generate the shifted form: + + loop: + TOP_COND + TOP_UPDATE + BODY + GOTO loop + + which should catch loops with constant starting point. Otherwise, if + we cannot, we generate the fallback form. */ + + if (optimize) + { + /* We can use the do-while form if GNU_FIRST-1 doesn't overflow. */ + if (!can_equal_min_val_p (gnu_first, gnu_base_type, reverse)) + { + gnu_first = build_binary_op (shift_code, gnu_base_type, + gnu_first, gnu_one_node); + LOOP_STMT_TOP_UPDATE_P (gnu_loop_stmt) = 1; + LOOP_STMT_BOTTOM_COND_P (gnu_loop_stmt) = 1; + } + + /* Otherwise, we can use the default form if GNU_LAST+1 doesn't. */ + else if (!can_equal_max_val_p (gnu_last, gnu_base_type, reverse)) + ; + + /* Otherwise, use the fallback form. */ + else + fallback = true; + } + else { + /* We can use the default form if GNU_LAST+1 doesn't overflow. */ + if (!can_equal_max_val_p (gnu_last, gnu_base_type, reverse)) + ; + + /* Otherwise, we can use the shifted form if neither GNU_FIRST-1 nor + GNU_LAST-1 does. */ + else if (!can_equal_min_val_p (gnu_first, gnu_base_type, reverse) + && !can_equal_min_val_p (gnu_last, gnu_base_type, reverse)) + { + gnu_first = build_binary_op (shift_code, gnu_base_type, + gnu_first, gnu_one_node); + gnu_last = build_binary_op (shift_code, gnu_base_type, + gnu_last, gnu_one_node); + LOOP_STMT_TOP_UPDATE_P (gnu_loop_stmt) = 1; + } + + /* Otherwise, use the fallback form. */ + else + fallback = true; + } + + if (fallback) + LOOP_STMT_BOTTOM_COND_P (gnu_loop_stmt) = 1; + + /* If we use the BOTTOM_COND, we can turn the test into an inequality + test but we have to add an ENTRY_COND to protect the empty loop. */ + if (LOOP_STMT_BOTTOM_COND_P (gnu_loop_stmt)) + { + test_code = NE_EXPR; gnu_cond_expr = build3 (COND_EXPR, void_type_node, - build_binary_op (LE_EXPR, integer_type_node, + build_binary_op (LE_EXPR, boolean_type_node, gnu_low, gnu_high), NULL_TREE, alloc_stmt_list ()); set_expr_location_from_node (gnu_cond_expr, gnat_loop_spec); } /* Open a new nesting level that will surround the loop to declare the - loop index variable. */ + iteration variable. */ start_stmt_group (); gnat_pushlevel (); - /* Declare the loop index and set it to its initial value. */ + /* Declare the iteration variable and set it to its initial value. */ gnu_loop_var = gnat_to_gnu_entity (gnat_loop_var, gnu_first, 1); if (DECL_BY_REF_P (gnu_loop_var)) gnu_loop_var = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_loop_var); - /* The loop variable might be a padded type, so use `convert' to get a - reference to the inner variable if so. */ - gnu_loop_var = convert (get_base_type (gnu_type), gnu_loop_var); + /* Do all the arithmetics in the base type. */ + gnu_loop_var = convert (gnu_base_type, gnu_loop_var); - /* Set either the top or bottom exit condition as appropriate depending - on whether or not we know an overflow cannot occur. */ - if (gnu_cond_expr) - LOOP_STMT_BOT_COND (gnu_loop_stmt) - = build_binary_op (NE_EXPR, integer_type_node, - gnu_loop_var, gnu_last); - else - LOOP_STMT_TOP_COND (gnu_loop_stmt) - = build_binary_op (end_code, integer_type_node, - gnu_loop_var, gnu_last); + /* Set either the top or bottom exit condition. */ + LOOP_STMT_COND (gnu_loop_stmt) + = build_binary_op (test_code, boolean_type_node, gnu_loop_var, + gnu_last); + /* Set either the top or bottom update statement and give it the source + location of the iteration for better coverage info. */ LOOP_STMT_UPDATE (gnu_loop_stmt) - = build_binary_op (MODIFY_EXPR, NULL_TREE, - gnu_loop_var, - build_binary_op (update_code, - TREE_TYPE (gnu_loop_var), - gnu_loop_var, - convert (TREE_TYPE (gnu_loop_var), - integer_one_node))); + = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_loop_var, + build_binary_op (update_code, gnu_base_type, + gnu_loop_var, gnu_one_node)); set_expr_location_from_node (LOOP_STMT_UPDATE (gnu_loop_stmt), gnat_iter_scheme); } /* If the loop was named, have the name point to this loop. In this case, - the association is not a ..._DECL node, but the end label from this - LOOP_STMT. */ + the association is not a DECL node, but the end label of the loop. */ if (Present (Identifier (gnat_node))) - save_gnu_tree (Entity (Identifier (gnat_node)), - LOOP_STMT_LABEL (gnu_loop_stmt), true); + save_gnu_tree (Entity (Identifier (gnat_node)), gnu_loop_label, true); /* Make the loop body into its own block, so any allocated storage will be released every iteration. This is needed for stack allocation. */ LOOP_STMT_BODY (gnu_loop_stmt) = build_stmt_group (Statements (gnat_node), true); + TREE_SIDE_EFFECTS (gnu_loop_stmt) = 1; /* If we declared a variable, then we are in a statement group for that declaration. Add the LOOP_STMT to it and make that the "loop". */ @@ -2187,7 +2357,7 @@ establish_gnat_vms_condition_handler (void) gnat_vms_condition_handler_decl = create_subprog_decl (get_identifier ("__gnat_handle_vms_condition"), NULL_TREE, - build_function_type_list (integer_type_node, + build_function_type_list (boolean_type_node, ptr_void_type_node, ptr_void_type_node, NULL_TREE), @@ -2277,13 +2447,14 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) allocate_struct_function (gnu_subprog_decl, false); DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language = GGC_CNEW (struct language_function); + set_cfun (NULL); begin_subprog_body (gnu_subprog_decl); - gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type); /* If there are Out parameters, we need to ensure that the return statement properly copies them out. We do this by making a new block and converting any inner return into a goto to a label at the end of the block. */ + gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type); push_stack (&gnu_return_label_stack, NULL_TREE, gnu_cico_list ? create_artificial_label (input_location) : NULL_TREE); @@ -2430,8 +2601,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) /* Subroutine of gnat_to_gnu to translate gnat_node, either an N_Function_Call or an N_Procedure_Call_Statement, to a GCC tree, which is returned. GNU_RESULT_TYPE_P is a pointer to where we should place the result type. - If GNU_TARGET is non-null, this must be a function call and the result - of the call is to be placed into that object. */ + If GNU_TARGET is non-null, this must be a function call on the RHS of a + N_Assignment_Statement and the result is to be placed into that object. */ static tree call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) @@ -2451,6 +2622,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) tree gnu_before_list = NULL_TREE; tree gnu_after_list = NULL_TREE; tree gnu_call; + bool went_into_elab_proc = false; gcc_assert (TREE_CODE (gnu_subprog_type) == FUNCTION_TYPE); @@ -2487,6 +2659,22 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) else gnat_formal = First_Formal_With_Extras (Entity (Name (gnat_node))); + /* If we are translating a statement, open a new nesting level that will + surround it to declare the temporaries created for the call. */ + if (Nkind (gnat_node) == N_Procedure_Call_Statement || gnu_target) + { + start_stmt_group (); + gnat_pushlevel (); + } + + /* The lifetime of the temporaries created for the call ends with the call + so we can give them the scope of the elaboration routine at top level. */ + else if (!current_function_decl) + { + current_function_decl = TREE_VALUE (gnu_elab_proc_stack); + went_into_elab_proc = true; + } + /* Create the list of the actual parameters as GCC expects it, namely a chain of TREE_LIST nodes in which the TREE_VALUE field of each node is an expression and the TREE_PURPOSE field is null. But skip Out @@ -2536,13 +2724,17 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) && (gnu_name_type = gnat_to_gnu_type (Etype (gnat_name))) && !addressable_p (gnu_name, gnu_name_type)) { - tree gnu_copy = gnu_name; + tree gnu_orig = gnu_name, gnu_temp, gnu_stmt; + + /* Do not issue warnings for CONSTRUCTORs since this is not a copy + but sort of an instantiation for them. */ + if (TREE_CODE (gnu_name) == CONSTRUCTOR) + ; /* If the type is passed by reference, a copy is not allowed. */ - if (AGGREGATE_TYPE_P (gnu_formal_type) - && TYPE_BY_REFERENCE_P (gnu_formal_type)) - post_error - ("misaligned actual cannot be passed by reference", gnat_actual); + else if (TREE_ADDRESSABLE (gnu_formal_type)) + post_error ("misaligned actual cannot be passed by reference", + gnat_actual); /* For users of Starlet we issue a warning because the interface apparently assumes that by-ref parameters outlive the procedure @@ -2568,38 +2760,54 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) && !CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_name_type))) ; - /* Otherwise remove unpadding from the object and reset the copy. */ + /* Otherwise remove the unpadding from all the objects. */ else if (TREE_CODE (gnu_name) == COMPONENT_REF && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_name, 0)))) - gnu_name = gnu_copy = TREE_OPERAND (gnu_name, 0); + gnu_orig = gnu_name = TREE_OPERAND (gnu_name, 0); - /* Otherwise convert to the nominal type of the object if it's - a record type. There are several cases in which we need to - make the temporary using this type instead of the actual type - of the object if they are distinct, because the expectations - of the callee would otherwise not be met: + /* Otherwise convert to the nominal type of the object if needed. + There are several cases in which we need to make the temporary + using this type instead of the actual type of the object when + they are distinct, because the expectations of the callee would + otherwise not be met: - if it's a justified modular type, - - if the actual type is a smaller packable version of it. */ - else if (TREE_CODE (gnu_name_type) == RECORD_TYPE - && (TYPE_JUSTIFIED_MODULAR_P (gnu_name_type) - || smaller_packable_type_p (TREE_TYPE (gnu_name), - gnu_name_type))) + - if the actual type is a smaller form of it, + - if it's a smaller form of the actual type. */ + else if ((TREE_CODE (gnu_name_type) == RECORD_TYPE + && (TYPE_JUSTIFIED_MODULAR_P (gnu_name_type) + || smaller_form_type_p (TREE_TYPE (gnu_name), + gnu_name_type))) + || (INTEGRAL_TYPE_P (gnu_name_type) + && smaller_form_type_p (gnu_name_type, + TREE_TYPE (gnu_name)))) gnu_name = convert (gnu_name_type, gnu_name); - /* Make a SAVE_EXPR to force the creation of a temporary. Special - code in gnat_gimplify_expr ensures that the same temporary is - used as the object and copied back after the call if needed. */ - gnu_name = build1 (SAVE_EXPR, TREE_TYPE (gnu_name), gnu_name); - TREE_SIDE_EFFECTS (gnu_name) = 1; + /* Create an explicit temporary holding the copy. This ensures that + its lifetime is as narrow as possible around a statement. */ + gnu_temp = create_var_decl (create_tmp_var_name ("A"), NULL_TREE, + TREE_TYPE (gnu_name), NULL_TREE, false, + false, false, false, NULL, Empty); + DECL_ARTIFICIAL (gnu_temp) = 1; + DECL_IGNORED_P (gnu_temp) = 1; + + /* But initialize it on the fly like for an implicit temporary as + we aren't necessarily dealing with a statement. */ + gnu_stmt + = build_binary_op (INIT_EXPR, NULL_TREE, gnu_temp, gnu_name); + set_expr_location_from_node (gnu_stmt, gnat_actual); + + /* From now on, the real object is the temporary. */ + gnu_name = build2 (COMPOUND_EXPR, TREE_TYPE (gnu_name), gnu_stmt, + gnu_temp); /* Set up to move the copy back to the original if needed. */ if (Ekind (gnat_formal) != E_In_Parameter) { - tree stmt = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_copy, - gnu_name); - set_expr_location_from_node (stmt, gnat_node); - append_to_statement_list (stmt, &gnu_after_list); + gnu_stmt = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_orig, + gnu_temp); + set_expr_location_from_node (gnu_stmt, gnat_node); + append_to_statement_list (gnu_stmt, &gnu_after_list); } } @@ -2632,10 +2840,6 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) gnu_actual = emit_range_check (gnu_actual, Etype (gnat_formal), gnat_actual); - /* And convert it to this type. */ - if (TREE_CODE (gnu_actual) != SAVE_EXPR) - gnu_actual = convert (gnu_formal_type, gnu_actual); - /* Unless this is an In parameter, we must remove any justified modular building from GNU_NAME to get an lvalue. */ if (Ekind (gnat_formal) != E_In_Parameter @@ -2647,7 +2851,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) /* If we have not saved a GCC object for the formal, it means it is an Out parameter not passed by reference and that need not be copied in. - Otherwise, first see if the PARM_DECL is passed by reference. */ + Otherwise, first see if the parameter is passed by reference. */ if (gnu_formal && TREE_CODE (gnu_formal) == PARM_DECL && DECL_BY_REF_P (gnu_formal)) @@ -2660,8 +2864,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) gnu_actual = gnu_name; /* If we have a padded type, be sure we've removed padding. */ - if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual)) - && TREE_CODE (gnu_actual) != SAVE_EXPR) + if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual))) gnu_actual = convert (get_unpadded_type (Etype (gnat_actual)), gnu_actual); @@ -2673,13 +2876,18 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) and takes its address. */ if (TREE_CODE (TREE_TYPE (gnu_actual)) == RECORD_TYPE && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (gnu_actual)) - && TREE_CODE (gnu_actual) != SAVE_EXPR && Is_Constr_Subt_For_UN_Aliased (Etype (gnat_actual)) && Is_Array_Type (Etype (gnat_actual))) gnu_actual = convert (gnat_to_gnu_type (Etype (gnat_actual)), gnu_actual); } + /* There is no need to convert the actual to the formal's type before + taking its address. The only exception is for unconstrained array + types because of the way we build fat pointers. */ + else if (TREE_CODE (gnu_formal_type) == UNCONSTRAINED_ARRAY_TYPE) + gnu_actual = convert (gnu_formal_type, gnu_actual); + /* The symmetry of the paths to the type of an entity is broken here since arguments don't know that they will be passed by ref. */ gnu_formal_type = TREE_TYPE (get_gnu_tree (gnat_formal)); @@ -2705,14 +2913,14 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) possibility that the ARRAY_REF might return a constant and we'd be getting the wrong address. Neither approach is exactly correct, but this is the most likely to work in all cases. */ - gnu_actual = convert (gnu_formal_type, - build_unary_op (ADDR_EXPR, NULL_TREE, - gnu_actual)); + gnu_actual = build_unary_op (ADDR_EXPR, gnu_formal_type, gnu_actual); } else if (gnu_formal && TREE_CODE (gnu_formal) == PARM_DECL && DECL_BY_DESCRIPTOR_P (gnu_formal)) { + gnu_actual = convert (gnu_formal_type, gnu_actual); + /* If this is 'Null_Parameter, pass a zero descriptor. */ if ((TREE_CODE (gnu_actual) == INDIRECT_REF || TREE_CODE (gnu_actual) == UNCONSTRAINED_ARRAY_REF) @@ -2733,7 +2941,14 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) gnu_name_list = tree_cons (NULL_TREE, gnu_name, gnu_name_list); if (!(gnu_formal && TREE_CODE (gnu_formal) == PARM_DECL)) - continue; + { + /* Make sure side-effects are evaluated before the call. */ + if (TREE_SIDE_EFFECTS (gnu_name)) + append_to_statement_list (gnu_name, &gnu_before_list); + continue; + } + + gnu_actual = convert (gnu_formal_type, gnu_actual); /* If this is 'Null_Parameter, pass a zero even though we are dereferencing it. */ @@ -2765,7 +2980,6 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) if (Nkind (gnat_node) == N_Function_Call) { tree gnu_result = gnu_call; - enum tree_code op_code; /* If the function returns an unconstrained array or by direct reference, we have to dereference the pointer. */ @@ -2775,6 +2989,15 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) if (gnu_target) { + Node_Id gnat_parent = Parent (gnat_node); + enum tree_code op_code; + + /* If range check is needed, emit code to generate it. */ + if (Do_Range_Check (gnat_node)) + gnu_result + = emit_range_check (gnu_result, Etype (Name (gnat_parent)), + gnat_parent); + /* ??? If the return type has non-constant size, then force the return slot optimization as we would not be able to generate a temporary. That's what has been done historically. */ @@ -2785,9 +3008,16 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) gnu_result = build_binary_op (op_code, NULL_TREE, gnu_target, gnu_result); + add_stmt_with_node (gnu_result, gnat_parent); + gnat_poplevel (); + gnu_result = end_stmt_group (); } else - *gnu_result_type_p = get_unpadded_type (Etype (gnat_node)); + { + if (went_into_elab_proc) + current_function_decl = NULL_TREE; + *gnu_result_type_p = get_unpadded_type (Etype (gnat_node)); + } return gnu_result; } @@ -2797,29 +3027,32 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) passing mechanism must be used. */ if (TYPE_CI_CO_LIST (gnu_subprog_type)) { - /* List of FIELD_DECLs associated with the PARM_DECLs of the copy - in copy out parameters. */ - tree scalar_return_list = TYPE_CI_CO_LIST (gnu_subprog_type); - int length = list_length (scalar_return_list); + /* List of FIELD_DECLs associated with the PARM_DECLs of the copy-in/ + copy-out parameters. */ + tree gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type); + const int length = list_length (gnu_cico_list); if (length > 1) { - tree gnu_name; + tree gnu_temp, gnu_stmt; /* The call sequence must contain one and only one call, even though - the function is const or pure. So force a SAVE_EXPR. */ - gnu_call = build1 (SAVE_EXPR, TREE_TYPE (gnu_call), gnu_call); - TREE_SIDE_EFFECTS (gnu_call) = 1; - gnu_name_list = nreverse (gnu_name_list); + the function is pure. Save the result into a temporary. */ + gnu_temp = create_var_decl (create_tmp_var_name ("R"), NULL_TREE, + TREE_TYPE (gnu_call), NULL_TREE, false, + false, false, false, NULL, Empty); + DECL_ARTIFICIAL (gnu_temp) = 1; + DECL_IGNORED_P (gnu_temp) = 1; + + gnu_stmt + = build_binary_op (INIT_EXPR, NULL_TREE, gnu_temp, gnu_call); + set_expr_location_from_node (gnu_stmt, gnat_node); + + /* Add the call statement to the list and start from its result. */ + append_to_statement_list (gnu_stmt, &gnu_before_list); + gnu_call = gnu_temp; - /* If any of the names had side-effects, ensure they are all - evaluated before the call. */ - for (gnu_name = gnu_name_list; - gnu_name; - gnu_name = TREE_CHAIN (gnu_name)) - if (TREE_SIDE_EFFECTS (TREE_VALUE (gnu_name))) - append_to_statement_list (TREE_VALUE (gnu_name), - &gnu_before_list); + gnu_name_list = nreverse (gnu_name_list); } if (Nkind (Name (gnat_node)) == N_Explicit_Dereference) @@ -2849,8 +3082,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) = length == 1 ? gnu_call : build_component_ref (gnu_call, NULL_TREE, - TREE_PURPOSE (scalar_return_list), - false); + TREE_PURPOSE (gnu_cico_list), false); /* If the actual is a conversion, get the inner expression, which will be the real destination, and convert the result to the @@ -2903,17 +3135,11 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) gnu_result = convert (TREE_TYPE (gnu_actual), gnu_result); } - /* Undo wrapping of boolean rvalues. */ - if (TREE_CODE (gnu_actual) == NE_EXPR - && TREE_CODE (get_base_type (TREE_TYPE (gnu_actual))) - == BOOLEAN_TYPE - && integer_zerop (TREE_OPERAND (gnu_actual, 1))) - gnu_actual = TREE_OPERAND (gnu_actual, 0); gnu_result = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_actual, gnu_result); set_expr_location_from_node (gnu_result, gnat_node); append_to_statement_list (gnu_result, &gnu_before_list); - scalar_return_list = TREE_CHAIN (scalar_return_list); + gnu_cico_list = TREE_CHAIN (gnu_cico_list); gnu_name_list = TREE_CHAIN (gnu_name_list); } } @@ -2922,7 +3148,9 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) append_to_statement_list (gnu_after_list, &gnu_before_list); - return gnu_before_list; + add_stmt (gnu_before_list); + gnat_poplevel (); + return end_stmt_group (); } /* Subroutine of gnat_to_gnu to translate gnat_node, an @@ -3156,7 +3384,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) else this_choice = build_binary_op - (EQ_EXPR, integer_type_node, + (EQ_EXPR, boolean_type_node, convert (integer_type_node, build_component_ref @@ -3183,7 +3411,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) this_choice = build_binary_op - (EQ_EXPR, integer_type_node, TREE_VALUE (gnu_except_ptr_stack), + (EQ_EXPR, boolean_type_node, TREE_VALUE (gnu_except_ptr_stack), convert (TREE_TYPE (TREE_VALUE (gnu_except_ptr_stack)), build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr))); @@ -3200,8 +3428,8 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) this_choice = build_binary_op - (TRUTH_ORIF_EXPR, integer_type_node, - build_binary_op (EQ_EXPR, integer_type_node, gnu_comp, + (TRUTH_ORIF_EXPR, boolean_type_node, + build_binary_op (EQ_EXPR, boolean_type_node, gnu_comp, build_int_cst (TREE_TYPE (gnu_comp), 'V')), this_choice); } @@ -3209,7 +3437,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) else gcc_unreachable (); - gnu_choice = build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, + gnu_choice = build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, gnu_choice, this_choice); } @@ -3233,11 +3461,7 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node) handler can catch, with special cases for others and all others cases. Each exception type is actually identified by a pointer to the exception - id, or to a dummy object for "others" and "all others". - - Care should be taken to ensure that the control flow impact of "others" - and "all others" is known to GCC. lang_eh_type_covers is doing the trick - currently. */ + id, or to a dummy object for "others" and "all others". */ for (gnat_temp = First (Exception_Choices (gnat_node)); gnat_temp; gnat_temp = Next (gnat_temp)) { @@ -3325,26 +3549,29 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node) static void Compilation_Unit_to_gnu (Node_Id gnat_node) { + const Node_Id gnat_unit = Unit (gnat_node); + const bool body_p = (Nkind (gnat_unit) == N_Package_Body + || Nkind (gnat_unit) == N_Subprogram_Body); + const Entity_Id gnat_unit_entity = Defining_Entity (gnat_unit); /* Make the decl for the elaboration procedure. */ - bool body_p = (Defining_Entity (Unit (gnat_node)), - Nkind (Unit (gnat_node)) == N_Package_Body - || Nkind (Unit (gnat_node)) == N_Subprogram_Body); - Entity_Id gnat_unit_entity = Defining_Entity (Unit (gnat_node)); tree gnu_elab_proc_decl = create_subprog_decl - (create_concat_name (gnat_unit_entity, - body_p ? "elabb" : "elabs"), - NULL_TREE, void_ftype, NULL_TREE, false, true, false, NULL, - gnat_unit_entity); + (create_concat_name (gnat_unit_entity, body_p ? "elabb" : "elabs"), + NULL_TREE, void_ftype, NULL_TREE, false, true, false, NULL, gnat_unit); struct elab_info *info; push_stack (&gnu_elab_proc_stack, NULL_TREE, gnu_elab_proc_decl); - DECL_ELABORATION_PROC_P (gnu_elab_proc_decl) = 1; + + /* Initialize the information structure for the function. */ allocate_struct_function (gnu_elab_proc_decl, false); - Sloc_to_locus (Sloc (gnat_unit_entity), &cfun->function_end_locus); set_cfun (NULL); + current_function_decl = NULL_TREE; + + start_stmt_group (); + gnat_pushlevel (); + /* For a body, first process the spec if there is one. */ if (Nkind (Unit (gnat_node)) == N_Package_Body || (Nkind (Unit (gnat_node)) == N_Subprogram_Body @@ -3354,7 +3581,34 @@ Compilation_Unit_to_gnu (Node_Id gnat_node) finalize_from_with_types (); } - process_inlined_subprograms (gnat_node); + /* If we can inline, generate code for all the inlined subprograms. */ + if (optimize) + { + Entity_Id gnat_entity; + + for (gnat_entity = First_Inlined_Subprogram (gnat_node); + Present (gnat_entity); + gnat_entity = Next_Inlined_Subprogram (gnat_entity)) + { + Node_Id gnat_body = Parent (Declaration_Node (gnat_entity)); + + if (Nkind (gnat_body) != N_Subprogram_Body) + { + /* ??? This really should always be present. */ + if (No (Corresponding_Body (gnat_body))) + continue; + gnat_body + = Parent (Declaration_Node (Corresponding_Body (gnat_body))); + } + + if (Present (gnat_body)) + { + /* Define the entity first so we set DECL_EXTERNAL. */ + gnat_to_gnu_entity (gnat_entity, NULL_TREE, 0); + add_stmt (gnat_to_gnu (gnat_body)); + } + } + } if (type_annotate_only && gnat_node == Cunit (Main_Unit)) { @@ -3381,6 +3635,11 @@ Compilation_Unit_to_gnu (Node_Id gnat_node) set_current_block_context (gnu_elab_proc_decl); gnat_poplevel (); DECL_SAVED_TREE (gnu_elab_proc_decl) = end_stmt_group (); + + Sloc_to_locus + (Sloc (gnat_unit), + &DECL_STRUCT_FUNCTION (gnu_elab_proc_decl)->function_end_locus); + info->next = elab_info_list; info->elab_proc = gnu_elab_proc_decl; info->gnat_node = gnat_node; @@ -3409,7 +3668,8 @@ unchecked_conversion_nop (Node_Id gnat_node) could de facto ensure type consistency and this should be preserved. */ if (!(Nkind (Parent (gnat_node)) == N_Assignment_Statement && Name (Parent (gnat_node)) == gnat_node) - && !(Nkind (Parent (gnat_node)) == N_Procedure_Call_Statement + && !((Nkind (Parent (gnat_node)) == N_Procedure_Call_Statement + || Nkind (Parent (gnat_node)) == N_Function_Call) && Name (Parent (gnat_node)) != gnat_node)) return false; @@ -3427,11 +3687,16 @@ unchecked_conversion_nop (Node_Id gnat_node) if (to_type == from_type) return true; - /* For an array type, the conversion to the PAT is a no-op. */ + /* For an array subtype, the conversion to the PAT is a no-op. */ if (Ekind (from_type) == E_Array_Subtype && to_type == Packed_Array_Type (from_type)) return true; + /* For a record subtype, the conversion to the type is a no-op. */ + if (Ekind (from_type) == E_Record_Subtype + && to_type == Etype (from_type)) + return true; + return false; } @@ -3473,7 +3738,6 @@ gnat_to_gnu (Node_Id gnat_node) N_Raise_Constraint_Error)); if ((IN (kind, N_Statement_Other_Than_Procedure_Call) - && !IN (kind, N_SCIL_Node) && kind != N_Null_Statement) || kind == N_Procedure_Call_Statement || kind == N_Label @@ -3482,13 +3746,10 @@ gnat_to_gnu (Node_Id gnat_node) || (IN (kind, N_Raise_xxx_Error) && Ekind (Etype (gnat_node)) == E_Void)) { /* If this is a statement and we are at top level, it must be part of - the elaboration procedure, so mark us as being in that procedure - and push our context. */ + the elaboration procedure, so mark us as being in that procedure. */ if (!current_function_decl) { current_function_decl = TREE_VALUE (gnu_elab_proc_stack); - start_stmt_group (); - gnat_pushlevel (); went_into_elab_proc = true; } @@ -3909,14 +4170,14 @@ gnat_to_gnu (Node_Id gnat_node) gnu_expr_type = get_base_type (gnu_index_type); /* Test whether the minimum slice value is too small. */ - gnu_expr_l = build_binary_op (LT_EXPR, integer_type_node, + gnu_expr_l = build_binary_op (LT_EXPR, boolean_type_node, convert (gnu_expr_type, gnu_min_expr), convert (gnu_expr_type, gnu_base_min_expr)); /* Test whether the maximum slice value is too large. */ - gnu_expr_h = build_binary_op (GT_EXPR, integer_type_node, + gnu_expr_h = build_binary_op (GT_EXPR, boolean_type_node, convert (gnu_expr_type, gnu_max_expr), convert (gnu_expr_type, @@ -3925,7 +4186,7 @@ gnat_to_gnu (Node_Id gnat_node) /* Build a slice index check that returns the low bound, assuming the slice is not empty. */ gnu_expr = emit_check - (build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, + (build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, gnu_expr_l, gnu_expr_h), gnu_min_expr, CE_Index_Check_Failed, gnat_node); @@ -4022,21 +4283,20 @@ gnat_to_gnu (Node_Id gnat_node) case N_Attribute_Reference: { - /* The attribute designator (like an enumeration value). */ - int attribute = Get_Attribute_Id (Attribute_Name (gnat_node)); - - /* The Elab_Spec and Elab_Body attributes are special in that - Prefix is a unit, not an object with a GCC equivalent. Similarly - for Elaborated, since that variable isn't otherwise known. */ - if (attribute == Attr_Elab_Body || attribute == Attr_Elab_Spec) - return (create_subprog_decl - (create_concat_name (Entity (Prefix (gnat_node)), - attribute == Attr_Elab_Body - ? "elabb" : "elabs"), - NULL_TREE, void_ftype, NULL_TREE, false, true, true, NULL, - gnat_node)); - - gnu_result = Attribute_to_gnu (gnat_node, &gnu_result_type, attribute); + /* The attribute designator. */ + const int attr = Get_Attribute_Id (Attribute_Name (gnat_node)); + + /* The Elab_Spec and Elab_Body attributes are special in that Prefix + is a unit, not an object with a GCC equivalent. */ + if (attr == Attr_Elab_Spec || attr == Attr_Elab_Body) + return + create_subprog_decl (create_concat_name + (Entity (Prefix (gnat_node)), + attr == Attr_Elab_Body ? "elabb" : "elabs"), + NULL_TREE, void_ftype, NULL_TREE, false, + true, true, NULL, gnat_node); + + gnu_result = Attribute_to_gnu (gnat_node, &gnu_result_type, attr); } break; @@ -4257,6 +4517,7 @@ gnat_to_gnu (Node_Id gnat_node) { enum tree_code code = gnu_codes[kind]; bool ignore_lhs_overflow = false; + location_t saved_location = input_location; tree gnu_type; gnu_lhs = gnat_to_gnu (Left_Opnd (gnat_node)); @@ -4348,7 +4609,12 @@ gnat_to_gnu (Node_Id gnat_node) gnu_result = build_binary_op_trapv (code, gnu_type, gnu_lhs, gnu_rhs, gnat_node); else - gnu_result = build_binary_op (code, gnu_type, gnu_lhs, gnu_rhs); + { + /* Some operations, e.g. comparisons of arrays, generate complex + trees that need to be annotated while they are being built. */ + input_location = saved_location; + gnu_result = build_binary_op (code, gnu_type, gnu_lhs, gnu_rhs); + } /* If this is a logical shift with the shift count not verified, we must return zero if it is too large. We cannot compensate @@ -4358,7 +4624,7 @@ gnat_to_gnu (Node_Id gnat_node) gnu_result = build_cond_expr (gnu_type, - build_binary_op (GE_EXPR, integer_type_node, + build_binary_op (GE_EXPR, boolean_type_node, gnu_rhs, convert (TREE_TYPE (gnu_rhs), TYPE_SIZE (gnu_type))), @@ -4506,9 +4772,7 @@ gnat_to_gnu (Node_Id gnat_node) case N_Assignment_Statement: /* Get the LHS and RHS of the statement and convert any reference to an - unconstrained array into a reference to the underlying array. - If we are not to do range checking and the RHS is an N_Function_Call, - pass the LHS to the call function. */ + unconstrained array into a reference to the underlying array. */ gnu_lhs = maybe_unconstrained_array (gnat_to_gnu (Name (gnat_node))); /* If the type has a size that overflows, convert this into raise of @@ -4517,10 +4781,9 @@ gnat_to_gnu (Node_Id gnat_node) && TREE_OVERFLOW (TYPE_SIZE_UNIT (TREE_TYPE (gnu_lhs)))) gnu_result = build_call_raise (SE_Object_Too_Large, gnat_node, N_Raise_Storage_Error); - else if (Nkind (Expression (gnat_node)) == N_Function_Call - && !Do_Range_Check (Expression (gnat_node))) - gnu_result = call_to_gnu (Expression (gnat_node), - &gnu_result_type, gnu_lhs); + else if (Nkind (Expression (gnat_node)) == N_Function_Call) + gnu_result + = call_to_gnu (Expression (gnat_node), &gnu_result_type, gnu_lhs); else { gnu_rhs @@ -4632,6 +4895,9 @@ gnat_to_gnu (Node_Id gnat_node) { gnu_result = build1 (GOTO_EXPR, void_type_node, TREE_VALUE (gnu_return_label_stack)); + /* When not optimizing, make sure the return is preserved. */ + if (!optimize && Comes_From_Source (gnat_node)) + DECL_ARTIFICIAL (TREE_VALUE (gnu_return_label_stack)) = 0; break; } @@ -4831,12 +5097,7 @@ gnat_to_gnu (Node_Id gnat_node) /*********************************************************/ case N_Compilation_Unit: - - /* This is not called for the main unit, which is handled in function - gigi above. */ - start_stmt_group (); - gnat_pushlevel (); - + /* This is not called for the main unit on which gigi is invoked. */ Compilation_Unit_to_gnu (gnat_node); gnu_result = alloc_stmt_list (); break; @@ -5123,7 +5384,8 @@ gnat_to_gnu (Node_Id gnat_node) gnu_actual_obj_type = build_unc_object_type_from_ptr (gnu_ptr_type, gnu_actual_obj_type, - get_identifier ("DEALLOC")); + get_identifier + ("DEALLOC")); } else gnu_actual_obj_type = gnu_obj_type; @@ -5133,16 +5395,12 @@ gnat_to_gnu (Node_Id gnat_node) if (TREE_CODE (gnu_obj_type) == RECORD_TYPE && TYPE_CONTAINS_TEMPLATE_P (gnu_obj_type)) { - tree gnu_char_ptr_type = build_pointer_type (char_type_node); + tree gnu_char_ptr_type + = build_pointer_type (unsigned_char_type_node); tree gnu_pos = byte_position (TYPE_FIELDS (gnu_obj_type)); - tree gnu_byte_offset - = convert (sizetype, - size_diffop (size_zero_node, gnu_pos)); - gnu_byte_offset = fold_build1 (NEGATE_EXPR, sizetype, gnu_byte_offset); - gnu_ptr = convert (gnu_char_ptr_type, gnu_ptr); gnu_ptr = build_binary_op (POINTER_PLUS_EXPR, gnu_char_ptr_type, - gnu_ptr, gnu_byte_offset); + gnu_ptr, gnu_pos); } gnu_result @@ -5263,35 +5521,33 @@ gnat_to_gnu (Node_Id gnat_node) gnu_result = alloc_stmt_list (); break; - case N_SCIL_Dispatch_Table_Object_Init: - case N_SCIL_Dispatch_Table_Tag_Init: - case N_SCIL_Dispatching_Call: - case N_SCIL_Membership_Test: - case N_SCIL_Tag_Init: - /* SCIL nodes require no processing for GCC. */ - gnu_result = alloc_stmt_list (); - break; - - case N_Raise_Statement: - case N_Function_Specification: - case N_Procedure_Specification: - case N_Op_Concat: - case N_Component_Association: - case N_Task_Body: default: - gcc_assert (type_annotate_only); + /* SCIL nodes require no processing for GCC. Other nodes should only + be present when annotating types. */ + gcc_assert (IN (kind, N_SCIL_Node) || type_annotate_only); gnu_result = alloc_stmt_list (); } - /* If we pushed our level as part of processing the elaboration routine, - pop it back now. */ + /* If we pushed the processing of the elaboration routine, pop it back. */ if (went_into_elab_proc) - { - add_stmt (gnu_result); - gnat_poplevel (); - gnu_result = end_stmt_group (); - current_function_decl = NULL_TREE; - } + current_function_decl = NULL_TREE; + + /* When not optimizing, turn boolean rvalues B into B != false tests + so that the code just below can put the location information of the + reference to B on the inequality operator for better debug info. */ + if (!optimize + && (kind == N_Identifier + || kind == N_Expanded_Name + || kind == N_Explicit_Dereference + || kind == N_Function_Call + || kind == N_Indexed_Component + || kind == N_Selected_Component) + && TREE_CODE (get_base_type (gnu_result_type)) == BOOLEAN_TYPE + && !lvalue_required_p (gnat_node, gnu_result_type, false, false, false)) + gnu_result = build_binary_op (NE_EXPR, gnu_result_type, + convert (gnu_result_type, gnu_result), + convert (gnu_result_type, + boolean_false_node)); /* Set the location information on the result if it is a real expression. References can be reused for multiple GNAT nodes and they would get @@ -5770,49 +6026,41 @@ gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p, case ADDR_EXPR: op = TREE_OPERAND (expr, 0); - /* If we are taking the address of a constant CONSTRUCTOR, force it to - be put into static memory. We know it's going to be readonly given - the semantics we have and it's required to be in static memory when - the reference is in an elaboration procedure. */ - if (TREE_CODE (op) == CONSTRUCTOR && TREE_CONSTANT (op)) + if (TREE_CODE (op) == CONSTRUCTOR) { - tree new_var = create_tmp_var (TREE_TYPE (op), "C"); - TREE_ADDRESSABLE (new_var) = 1; + /* If we are taking the address of a constant CONSTRUCTOR, make sure + it is put into static memory. We know it's going to be read-only + given the semantics we have and it must be in static memory when + the reference is in an elaboration procedure. */ + if (TREE_CONSTANT (op)) + { + tree new_var = create_tmp_var_raw (TREE_TYPE (op), "C"); + TREE_ADDRESSABLE (new_var) = 1; + gimple_add_tmp_var (new_var); - TREE_READONLY (new_var) = 1; - TREE_STATIC (new_var) = 1; - DECL_INITIAL (new_var) = op; + TREE_READONLY (new_var) = 1; + TREE_STATIC (new_var) = 1; + DECL_INITIAL (new_var) = op; - TREE_OPERAND (expr, 0) = new_var; - recompute_tree_invariant_for_addr_expr (expr); - return GS_ALL_DONE; - } + TREE_OPERAND (expr, 0) = new_var; + recompute_tree_invariant_for_addr_expr (expr); + } - /* If we are taking the address of a SAVE_EXPR, we are typically dealing - with a misaligned argument to be passed by reference in a subprogram - call. We cannot let the common gimplifier code perform the creation - of the temporary and its initialization because, in order to ensure - that the final copy operation is a store and since the temporary made - for a SAVE_EXPR is not addressable, it may create another temporary, - addressable this time, which would break the back copy mechanism for - an IN OUT parameter. */ - if (TREE_CODE (op) == SAVE_EXPR && !SAVE_EXPR_RESOLVED_P (op)) - { - tree mod, val = TREE_OPERAND (op, 0); - tree new_var = create_tmp_var (TREE_TYPE (op), "S"); - TREE_ADDRESSABLE (new_var) = 1; + /* Otherwise explicitly create the local temporary. That's required + if the type is passed by reference. */ + else + { + tree mod, new_var = create_tmp_var_raw (TREE_TYPE (op), "C"); + TREE_ADDRESSABLE (new_var) = 1; + gimple_add_tmp_var (new_var); - mod = build2 (INIT_EXPR, TREE_TYPE (new_var), new_var, val); - if (EXPR_HAS_LOCATION (val)) - SET_EXPR_LOCATION (mod, EXPR_LOCATION (val)); - gimplify_and_add (mod, pre_p); - ggc_free (mod); + mod = build2 (INIT_EXPR, TREE_TYPE (new_var), new_var, op); + gimplify_and_add (mod, pre_p); - TREE_OPERAND (op, 0) = new_var; - SAVE_EXPR_RESOLVED_P (op) = 1; + TREE_OPERAND (expr, 0) = new_var; + recompute_tree_invariant_for_addr_expr (expr); + } - TREE_OPERAND (expr, 0) = new_var; - recompute_tree_invariant_for_addr_expr (expr); return GS_ALL_DONE; } @@ -5880,43 +6128,43 @@ gnat_gimplify_stmt (tree *stmt_p) case LOOP_STMT: { tree gnu_start_label = create_artificial_label (input_location); + tree gnu_cond = LOOP_STMT_COND (stmt); + tree gnu_update = LOOP_STMT_UPDATE (stmt); tree gnu_end_label = LOOP_STMT_LABEL (stmt); tree t; + /* Build the condition expression from the test, if any. */ + if (gnu_cond) + gnu_cond + = build3 (COND_EXPR, void_type_node, gnu_cond, alloc_stmt_list (), + build1 (GOTO_EXPR, void_type_node, gnu_end_label)); + /* Set to emit the statements of the loop. */ *stmt_p = NULL_TREE; - /* We first emit the start label and then a conditional jump to - the end label if there's a top condition, then the body of the - loop, then a conditional branch to the end label, then the update, - if any, and finally a jump to the start label and the definition - of the end label. */ + /* We first emit the start label and then a conditional jump to the + end label if there's a top condition, then the update if it's at + the top, then the body of the loop, then a conditional jump to + the end label if there's a bottom condition, then the update if + it's at the bottom, and finally a jump to the start label and the + definition of the end label. */ append_to_statement_list (build1 (LABEL_EXPR, void_type_node, gnu_start_label), stmt_p); - if (LOOP_STMT_TOP_COND (stmt)) - append_to_statement_list (build3 (COND_EXPR, void_type_node, - LOOP_STMT_TOP_COND (stmt), - alloc_stmt_list (), - build1 (GOTO_EXPR, - void_type_node, - gnu_end_label)), - stmt_p); + if (gnu_cond && !LOOP_STMT_BOTTOM_COND_P (stmt)) + append_to_statement_list (gnu_cond, stmt_p); + + if (gnu_update && LOOP_STMT_TOP_UPDATE_P (stmt)) + append_to_statement_list (gnu_update, stmt_p); append_to_statement_list (LOOP_STMT_BODY (stmt), stmt_p); - if (LOOP_STMT_BOT_COND (stmt)) - append_to_statement_list (build3 (COND_EXPR, void_type_node, - LOOP_STMT_BOT_COND (stmt), - alloc_stmt_list (), - build1 (GOTO_EXPR, - void_type_node, - gnu_end_label)), - stmt_p); + if (gnu_cond && LOOP_STMT_BOTTOM_COND_P (stmt)) + append_to_statement_list (gnu_cond, stmt_p); - if (LOOP_STMT_UPDATE (stmt)) - append_to_statement_list (LOOP_STMT_UPDATE (stmt), stmt_p); + if (gnu_update && !LOOP_STMT_TOP_UPDATE_P (stmt)) + append_to_statement_list (gnu_update, stmt_p); t = build1 (GOTO_EXPR, void_type_node, gnu_start_label); SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (gnu_end_label)); @@ -6011,92 +6259,85 @@ elaborate_all_entities (Node_Id gnat_node) elaborate_all_entities (Library_Unit (gnat_node)); } -/* Do the processing of N_Freeze_Entity, GNAT_NODE. */ +/* Do the processing of GNAT_NODE, an N_Freeze_Entity. */ static void process_freeze_entity (Node_Id gnat_node) { - Entity_Id gnat_entity = Entity (gnat_node); - tree gnu_old; - tree gnu_new; - tree gnu_init - = (Nkind (Declaration_Node (gnat_entity)) == N_Object_Declaration - && present_gnu_tree (Declaration_Node (gnat_entity))) - ? get_gnu_tree (Declaration_Node (gnat_entity)) : NULL_TREE; + const Entity_Id gnat_entity = Entity (gnat_node); + const Entity_Kind kind = Ekind (gnat_entity); + tree gnu_old, gnu_new; - /* If this is a package, need to generate code for the package. */ - if (Ekind (gnat_entity) == E_Package) + /* If this is a package, we need to generate code for the package. */ + if (kind == E_Package) { insert_code_for - (Parent (Corresponding_Body - (Parent (Declaration_Node (gnat_entity))))); + (Parent (Corresponding_Body + (Parent (Declaration_Node (gnat_entity))))); return; } - /* Check for old definition after the above call. This Freeze_Node - might be for one its Itypes. */ + /* Don't do anything for class-wide types as they are always transformed + into their root type. */ + if (kind == E_Class_Wide_Type) + return; + + /* Check for an old definition. This freeze node might be for an Itype. */ gnu_old - = present_gnu_tree (gnat_entity) ? get_gnu_tree (gnat_entity) : 0; + = present_gnu_tree (gnat_entity) ? get_gnu_tree (gnat_entity) : NULL_TREE; - /* If this entity has an Address representation clause, GNU_OLD is the + /* If this entity has an address representation clause, GNU_OLD is the address, so discard it here. */ if (Present (Address_Clause (gnat_entity))) - gnu_old = 0; - - /* Don't do anything for class-wide types as they are always transformed - into their root type. */ - if (Ekind (gnat_entity) == E_Class_Wide_Type) - return; + gnu_old = NULL_TREE; /* Don't do anything for subprograms that may have been elaborated before - their freeze nodes. This can happen, for example because of an inner call - in an instance body, or a previous compilation of a spec for inlining - purposes. */ + their freeze nodes. This can happen, for example, because of an inner + call in an instance body or because of previous compilation of a spec + for inlining purposes. */ if (gnu_old && ((TREE_CODE (gnu_old) == FUNCTION_DECL - && (Ekind (gnat_entity) == E_Function - || Ekind (gnat_entity) == E_Procedure)) - || (gnu_old - && TREE_CODE (TREE_TYPE (gnu_old)) == FUNCTION_TYPE - && Ekind (gnat_entity) == E_Subprogram_Type))) + && (kind == E_Function || kind == E_Procedure)) + || (TREE_CODE (TREE_TYPE (gnu_old)) == FUNCTION_TYPE + && kind == E_Subprogram_Type))) return; /* If we have a non-dummy type old tree, we have nothing to do, except aborting if this is the public view of a private type whose full view was not delayed, as this node was never delayed as it should have been. We let this happen for concurrent types and their Corresponding_Record_Type, - however, because each might legitimately be elaborated before it's own + however, because each might legitimately be elaborated before its own freeze node, e.g. while processing the other. */ if (gnu_old && !(TREE_CODE (gnu_old) == TYPE_DECL && TYPE_IS_DUMMY_P (TREE_TYPE (gnu_old)))) { - gcc_assert ((IN (Ekind (gnat_entity), Incomplete_Or_Private_Kind) + gcc_assert ((IN (kind, Incomplete_Or_Private_Kind) && Present (Full_View (gnat_entity)) && No (Freeze_Node (Full_View (gnat_entity)))) || Is_Concurrent_Type (gnat_entity) - || (IN (Ekind (gnat_entity), Record_Kind) + || (IN (kind, Record_Kind) && Is_Concurrent_Record_Type (gnat_entity))); return; } /* Reset the saved tree, if any, and elaborate the object or type for real. - If there is a full declaration, elaborate it and copy the type to - GNAT_ENTITY. Likewise if this is the record subtype corresponding to - a class wide type or subtype. */ + If there is a full view, elaborate it and use the result. And, if this + is the root type of a class-wide type, reuse it for the latter. */ if (gnu_old) { save_gnu_tree (gnat_entity, NULL_TREE, false); - if (IN (Ekind (gnat_entity), Incomplete_Or_Private_Kind) - && Present (Full_View (gnat_entity)) - && present_gnu_tree (Full_View (gnat_entity))) - save_gnu_tree (Full_View (gnat_entity), NULL_TREE, false); - if (Present (Class_Wide_Type (gnat_entity)) - && Class_Wide_Type (gnat_entity) != gnat_entity) + if (IN (kind, Incomplete_Or_Private_Kind) + && Present (Full_View (gnat_entity)) + && present_gnu_tree (Full_View (gnat_entity))) + save_gnu_tree (Full_View (gnat_entity), NULL_TREE, false); + if (IN (kind, Type_Kind) + && Present (Class_Wide_Type (gnat_entity)) + && Root_Type (Class_Wide_Type (gnat_entity)) == gnat_entity) save_gnu_tree (Class_Wide_Type (gnat_entity), NULL_TREE, false); } - if (IN (Ekind (gnat_entity), Incomplete_Or_Private_Kind) + if (IN (kind, Incomplete_Or_Private_Kind) && Present (Full_View (gnat_entity))) { gnu_new = gnat_to_gnu_entity (Full_View (gnat_entity), NULL_TREE, 1); @@ -6112,16 +6353,25 @@ process_freeze_entity (Node_Id gnat_node) Set_RM_Size (gnat_entity, RM_Size (Full_View (gnat_entity))); /* The above call may have defined this entity (the simplest example - of this is when we have a private enumeral type since the bounds - will have the public view. */ + of this is when we have a private enumeral type since the bounds + will have the public view). */ if (!present_gnu_tree (gnat_entity)) - save_gnu_tree (gnat_entity, gnu_new, false); - if (Present (Class_Wide_Type (gnat_entity)) - && Class_Wide_Type (gnat_entity) != gnat_entity) - save_gnu_tree (Class_Wide_Type (gnat_entity), gnu_new, false); + save_gnu_tree (gnat_entity, gnu_new, false); } else - gnu_new = gnat_to_gnu_entity (gnat_entity, gnu_init, 1); + { + tree gnu_init + = (Nkind (Declaration_Node (gnat_entity)) == N_Object_Declaration + && present_gnu_tree (Declaration_Node (gnat_entity))) + ? get_gnu_tree (Declaration_Node (gnat_entity)) : NULL_TREE; + + gnu_new = gnat_to_gnu_entity (gnat_entity, gnu_init, 1); + } + + if (IN (kind, Type_Kind) + && Present (Class_Wide_Type (gnat_entity)) + && Root_Type (Class_Wide_Type (gnat_entity)) == gnat_entity) + save_gnu_tree (Class_Wide_Type (gnat_entity), gnu_new, false); /* If we've made any pointers to the old version of this type, we have to update them. */ @@ -6130,42 +6380,6 @@ process_freeze_entity (Node_Id gnat_node) TREE_TYPE (gnu_new)); } -/* Process the list of inlined subprograms of GNAT_NODE, which is an - N_Compilation_Unit. */ - -static void -process_inlined_subprograms (Node_Id gnat_node) -{ - Entity_Id gnat_entity; - Node_Id gnat_body; - - /* If we can inline, generate Gimple for all the inlined subprograms. - Define the entity first so we set DECL_EXTERNAL. */ - if (optimize > 0) - for (gnat_entity = First_Inlined_Subprogram (gnat_node); - Present (gnat_entity); - gnat_entity = Next_Inlined_Subprogram (gnat_entity)) - { - gnat_body = Parent (Declaration_Node (gnat_entity)); - - if (Nkind (gnat_body) != N_Subprogram_Body) - { - /* ??? This really should always be Present. */ - if (No (Corresponding_Body (gnat_body))) - continue; - - gnat_body - = Parent (Declaration_Node (Corresponding_Body (gnat_body))); - } - - if (Present (gnat_body)) - { - gnat_to_gnu_entity (gnat_entity, NULL_TREE, 0); - add_stmt (gnat_to_gnu (gnat_body)); - } - } -} - /* Elaborate decls in the lists GNAT_DECLS and GNAT_DECLS2, if present. We make two passes, one to elaborate anything other than bodies (but we declare a function if there was no spec). The second pass @@ -6307,7 +6521,7 @@ build_unary_op_trapv (enum tree_code code, tree gnu_type, tree operand, operand = gnat_protect_expr (operand); - return emit_check (build_binary_op (EQ_EXPR, integer_type_node, + return emit_check (build_binary_op (EQ_EXPR, boolean_type_node, operand, TYPE_MIN_VALUE (gnu_type)), build_unary_op (code, gnu_type, operand), CE_Overflow_Check_Failed, gnat_node); @@ -6351,8 +6565,8 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, } rhs_lt_zero = tree_expr_nonnegative_p (rhs) - ? integer_zero_node - : build_binary_op (LT_EXPR, integer_type_node, rhs, zero); + ? boolean_false_node + : build_binary_op (LT_EXPR, boolean_type_node, rhs, zero); /* ??? Should use more efficient check for operand_equal_p (lhs, rhs, 0) */ @@ -6388,10 +6602,10 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, convert (wide_type, rhs)); tree check = build_binary_op - (TRUTH_ORIF_EXPR, integer_type_node, - build_binary_op (LT_EXPR, integer_type_node, wide_result, + (TRUTH_ORIF_EXPR, boolean_type_node, + build_binary_op (LT_EXPR, boolean_type_node, wide_result, convert (wide_type, type_min)), - build_binary_op (GT_EXPR, integer_type_node, wide_result, + build_binary_op (GT_EXPR, boolean_type_node, wide_result, convert (wide_type, type_max))); tree result = convert (gnu_type, wide_result); @@ -6414,9 +6628,9 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, /* Overflow when (rhs < 0) ^ (wrapped_expr < lhs)), for addition or when (rhs < 0) ^ (wrapped_expr > lhs) for subtraction. */ tree check = build_binary_op - (TRUTH_XOR_EXPR, integer_type_node, rhs_lt_zero, + (TRUTH_XOR_EXPR, boolean_type_node, rhs_lt_zero, build_binary_op (code == PLUS_EXPR ? LT_EXPR : GT_EXPR, - integer_type_node, wrapped_expr, lhs)); + boolean_type_node, wrapped_expr, lhs)); return emit_check (check, result, CE_Overflow_Check_Failed, gnat_node); @@ -6427,24 +6641,24 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, { case PLUS_EXPR: /* When rhs >= 0, overflow when lhs > type_max - rhs. */ - check_pos = build_binary_op (GT_EXPR, integer_type_node, lhs, + check_pos = build_binary_op (GT_EXPR, boolean_type_node, lhs, build_binary_op (MINUS_EXPR, gnu_type, type_max, rhs)), /* When rhs < 0, overflow when lhs < type_min - rhs. */ - check_neg = build_binary_op (LT_EXPR, integer_type_node, lhs, + check_neg = build_binary_op (LT_EXPR, boolean_type_node, lhs, build_binary_op (MINUS_EXPR, gnu_type, type_min, rhs)); break; case MINUS_EXPR: /* When rhs >= 0, overflow when lhs < type_min + rhs. */ - check_pos = build_binary_op (LT_EXPR, integer_type_node, lhs, + check_pos = build_binary_op (LT_EXPR, boolean_type_node, lhs, build_binary_op (PLUS_EXPR, gnu_type, type_min, rhs)), /* When rhs < 0, overflow when lhs > type_max + rhs. */ - check_neg = build_binary_op (GT_EXPR, integer_type_node, lhs, + check_neg = build_binary_op (GT_EXPR, boolean_type_node, lhs, build_binary_op (PLUS_EXPR, gnu_type, type_max, rhs)); break; @@ -6462,19 +6676,31 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, tmp1 = build_binary_op (TRUNC_DIV_EXPR, gnu_type, type_max, rhs); tmp2 = build_binary_op (TRUNC_DIV_EXPR, gnu_type, type_min, rhs); - check_pos = build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, - build_binary_op (NE_EXPR, integer_type_node, zero, rhs), - build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, - build_binary_op (GT_EXPR, integer_type_node, lhs, tmp1), - build_binary_op (LT_EXPR, integer_type_node, lhs, tmp2))); - - check_neg = fold_build3 (COND_EXPR, integer_type_node, - build_binary_op (EQ_EXPR, integer_type_node, rhs, - build_int_cst (gnu_type, -1)), - build_binary_op (EQ_EXPR, integer_type_node, lhs, type_min), - build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, - build_binary_op (GT_EXPR, integer_type_node, lhs, tmp2), - build_binary_op (LT_EXPR, integer_type_node, lhs, tmp1))); + check_pos + = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node, + build_binary_op (NE_EXPR, boolean_type_node, zero, + rhs), + build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, + build_binary_op (GT_EXPR, + boolean_type_node, + lhs, tmp1), + build_binary_op (LT_EXPR, + boolean_type_node, + lhs, tmp2))); + + check_neg + = fold_build3 (COND_EXPR, boolean_type_node, + build_binary_op (EQ_EXPR, boolean_type_node, rhs, + build_int_cst (gnu_type, -1)), + build_binary_op (EQ_EXPR, boolean_type_node, lhs, + type_min), + build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, + build_binary_op (GT_EXPR, + boolean_type_node, + lhs, tmp2), + build_binary_op (LT_EXPR, + boolean_type_node, + lhs, tmp1))); break; default: @@ -6488,8 +6714,8 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, if (TREE_CONSTANT (gnu_expr)) return gnu_expr; - check = fold_build3 (COND_EXPR, integer_type_node, - rhs_lt_zero, check_neg, check_pos); + check = fold_build3 (COND_EXPR, boolean_type_node, rhs_lt_zero, check_neg, + check_pos); return emit_check (check, gnu_expr, CE_Overflow_Check_Failed, gnat_node); } @@ -6523,19 +6749,18 @@ emit_range_check (tree gnu_expr, Entity_Id gnat_range_type, Node_Id gnat_node) /* Checked expressions must be evaluated only once. */ gnu_expr = gnat_protect_expr (gnu_expr); - /* There's no good type to use here, so we might as well use - integer_type_node. Note that the form of the check is + /* Note that the form of the check is (not (expr >= lo)) or (not (expr <= hi)) the reason for this slightly convoluted form is that NaNs are not considered to be in range in the float case. */ return emit_check - (build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, + (build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, invert_truthvalue - (build_binary_op (GE_EXPR, integer_type_node, + (build_binary_op (GE_EXPR, boolean_type_node, convert (gnu_compare_type, gnu_expr), convert (gnu_compare_type, gnu_low))), invert_truthvalue - (build_binary_op (LE_EXPR, integer_type_node, + (build_binary_op (LE_EXPR, boolean_type_node, convert (gnu_compare_type, gnu_expr), convert (gnu_compare_type, gnu_high)))), @@ -6572,15 +6797,13 @@ emit_index_check (tree gnu_array_object, tree gnu_expr, tree gnu_low, gnu_low = SUBSTITUTE_PLACEHOLDER_IN_EXPR (gnu_low, gnu_array_object); gnu_high = SUBSTITUTE_PLACEHOLDER_IN_EXPR (gnu_high, gnu_array_object); - /* There's no good type to use here, so we might as well use - integer_type_node. */ return emit_check - (build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, - build_binary_op (LT_EXPR, integer_type_node, + (build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, + build_binary_op (LT_EXPR, boolean_type_node, gnu_expr_check, convert (TREE_TYPE (gnu_expr_check), gnu_low)), - build_binary_op (GT_EXPR, integer_type_node, + build_binary_op (GT_EXPR, boolean_type_node, gnu_expr_check, convert (TREE_TYPE (gnu_expr_check), gnu_high))), @@ -6693,7 +6916,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, : 1)) gnu_cond = invert_truthvalue - (build_binary_op (GE_EXPR, integer_type_node, + (build_binary_op (GE_EXPR, boolean_type_node, gnu_input, convert (gnu_in_basetype, gnu_out_lb))); @@ -6704,9 +6927,9 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, TREE_REAL_CST (gnu_in_lb)) : 1)) gnu_cond - = build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, gnu_cond, + = build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, gnu_cond, invert_truthvalue - (build_binary_op (LE_EXPR, integer_type_node, + (build_binary_op (LE_EXPR, boolean_type_node, gnu_input, convert (gnu_in_basetype, gnu_out_ub)))); @@ -6764,7 +6987,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, gnu_result = gnat_protect_expr (gnu_result); gnu_conv = convert (calc_type, gnu_result); gnu_comp - = fold_build2 (GE_EXPR, integer_type_node, gnu_result, gnu_zero); + = fold_build2 (GE_EXPR, boolean_type_node, gnu_result, gnu_zero); gnu_add_pred_half = fold_build2 (PLUS_EXPR, calc_type, gnu_conv, gnu_pred_half); gnu_subtract_pred_half @@ -6790,28 +7013,28 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, return convert (gnu_type, gnu_result); } -/* Return true if TYPE is a smaller packable version of RECORD_TYPE. */ +/* Return true if TYPE is a smaller form of ORIG_TYPE. */ static bool -smaller_packable_type_p (tree type, tree record_type) +smaller_form_type_p (tree type, tree orig_type) { - tree size, rsize; + tree size, osize; /* We're not interested in variants here. */ - if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (record_type)) + if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (orig_type)) return false; /* Like a variant, a packable version keeps the original TYPE_NAME. */ - if (TYPE_NAME (type) != TYPE_NAME (record_type)) + if (TYPE_NAME (type) != TYPE_NAME (orig_type)) return false; size = TYPE_SIZE (type); - rsize = TYPE_SIZE (record_type); + osize = TYPE_SIZE (orig_type); - if (!(TREE_CODE (size) == INTEGER_CST && TREE_CODE (rsize) == INTEGER_CST)) + if (!(TREE_CODE (size) == INTEGER_CST && TREE_CODE (osize) == INTEGER_CST)) return false; - return tree_int_cst_lt (size, rsize) != 0; + return tree_int_cst_lt (size, osize) != 0; } /* Return true if GNU_EXPR can be directly addressed. This is the case @@ -6876,13 +7099,21 @@ smaller_packable_type_p (tree type, tree record_type) static bool addressable_p (tree gnu_expr, tree gnu_type) { - /* The size of the real type of the object must not be smaller than - that of the expected type, otherwise an indirect access in the - latter type would be larger than the object. Only records need - to be considered in practice. */ + /* For an integral type, the size of the actual type of the object may not + be greater than that of the expected type, otherwise an indirect access + in the latter type wouldn't correctly set all the bits of the object. */ + if (gnu_type + && INTEGRAL_TYPE_P (gnu_type) + && smaller_form_type_p (gnu_type, TREE_TYPE (gnu_expr))) + return false; + + /* The size of the actual type of the object may not be smaller than that + of the expected type, otherwise an indirect access in the latter type + would be larger than the object. But only record types need to be + considered in practice for this case. */ if (gnu_type && TREE_CODE (gnu_type) == RECORD_TYPE - && smaller_packable_type_p (TREE_TYPE (gnu_expr), gnu_type)) + && smaller_form_type_p (TREE_TYPE (gnu_expr), gnu_type)) return false; switch (TREE_CODE (gnu_expr)) @@ -6897,11 +7128,19 @@ addressable_p (tree gnu_expr, tree gnu_type) case UNCONSTRAINED_ARRAY_REF: case INDIRECT_REF: + /* Taking the address of a dereference yields the original pointer. */ return true; - case CONSTRUCTOR: case STRING_CST: case INTEGER_CST: + /* Taking the address yields a pointer to the constant pool. */ + return true; + + case CONSTRUCTOR: + /* Taking the address of a static constructor yields a pointer to the + tree constant pool. */ + return TREE_STATIC (gnu_expr) ? true : false; + case NULL_EXPR: case SAVE_EXPR: case CALL_EXPR: @@ -6915,6 +7154,10 @@ addressable_p (tree gnu_expr, tree gnu_type) force a temporary to be created by the middle-end. */ return true; + case COMPOUND_EXPR: + /* The address of a compound expression is that of its 2nd operand. */ + return addressable_p (TREE_OPERAND (gnu_expr, 1), gnu_type); + case COND_EXPR: /* We accept &COND_EXPR as soon as both operands are addressable and expect the outcome to be the address of the selected operand. */ @@ -7297,7 +7540,7 @@ decode_name (const char *name) /* Post an error message. MSG is the error message, properly annotated. NODE is the node at which to post the error and the node to use for the - "&" substitution. */ + '&' substitution. */ void post_error (const char *msg, Node_Id node) @@ -7311,8 +7554,8 @@ post_error (const char *msg, Node_Id node) Error_Msg_N (fp, node); } -/* Similar, but NODE is the node at which to post the error and ENT - is the node to use for the "&" substitution. */ +/* Similar to post_error, but NODE is the node at which to post the error and + ENT is the node to use for the '&' substitution. */ void post_error_ne (const char *msg, Node_Id node, Entity_Id ent) @@ -7326,56 +7569,37 @@ post_error_ne (const char *msg, Node_Id node, Entity_Id ent) Error_Msg_NE (fp, node, ent); } -/* Similar, but NODE is the node at which to post the error, ENT is the node - to use for the "&" substitution, and N is the number to use for the ^. */ +/* Similar to post_error_ne, but NUM is the number to use for the '^'. */ void -post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent, int n) +post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent, int num) { - String_Template temp; - Fat_Pointer fp; - - temp.Low_Bound = 1, temp.High_Bound = strlen (msg); - fp.Array = msg, fp.Bounds = &temp; - Error_Msg_Uint_1 = UI_From_Int (n); - - if (Present (node)) - Error_Msg_NE (fp, node, ent); + Error_Msg_Uint_1 = UI_From_Int (num); + post_error_ne (msg, node, ent); } -/* Similar to post_error_ne_num, but T is a GCC tree representing the - number to write. If the tree represents a constant that fits within - a host integer, the text inside curly brackets in MSG will be output - (presumably including a '^'). Otherwise that text will not be output - and the text inside square brackets will be output instead. */ +/* Similar to post_error_ne, but T is a GCC tree representing the number to + write. If T represents a constant, the text inside curly brackets in + MSG will be output (presumably including a '^'). Otherwise it will not + be output and the text inside square brackets will be output instead. */ void post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent, tree t) { - char *newmsg = XALLOCAVEC (char, strlen (msg) + 1); - String_Template temp = {1, 0}; - Fat_Pointer fp; + char *new_msg = XALLOCAVEC (char, strlen (msg) + 1); char start_yes, end_yes, start_no, end_no; const char *p; char *q; - fp.Array = newmsg, fp.Bounds = &temp; - - if (host_integerp (t, 1) -#if HOST_BITS_PER_WIDE_INT > HOST_BITS_PER_INT - && - compare_tree_int - (t, (((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_INT - 1)) - 1)) < 0 -#endif - ) + if (TREE_CODE (t) == INTEGER_CST) { - Error_Msg_Uint_1 = UI_From_Int (tree_low_cst (t, 1)); + Error_Msg_Uint_1 = UI_From_gnu (t); start_yes = '{', end_yes = '}', start_no = '[', end_no = ']'; } else start_yes = '[', end_yes = ']', start_no = '{', end_no = '}'; - for (p = msg, q = newmsg; *p; p++) + for (p = msg, q = new_msg; *p; p++) { if (*p == start_yes) for (p++; *p != end_yes; p++) @@ -7389,13 +7613,10 @@ post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent, tree t) *q = 0; - temp.High_Bound = strlen (newmsg); - if (Present (node)) - Error_Msg_NE (fp, node, ent); + post_error_ne (new_msg, node, ent); } -/* Similar to post_error_ne_tree, except that NUM is a second - integer to write in the message. */ +/* Similar to post_error_ne_tree, but NUM is a second integer to write. */ void post_error_ne_tree_2 (const char *msg, Node_Id node, Entity_Id ent, tree t, diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index cf0ff60b485..668226bd906 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -203,6 +203,7 @@ static tree convert_to_fat_pointer (tree, tree); static tree convert_to_thin_pointer (tree, tree); static tree make_descriptor_field (const char *,tree, tree, tree); static bool potential_alignment_gap (tree, tree, tree); +static void process_attributes (tree, struct attrib *); /* Initialize the association of GNAT nodes to GCC trees. */ @@ -294,8 +295,8 @@ make_dummy_type (Entity_Id gnat_type) TYPE_DUMMY_P (gnu_type) = 1; TYPE_STUB_DECL (gnu_type) = create_type_stub_decl (TYPE_NAME (gnu_type), gnu_type); - if (AGGREGATE_TYPE_P (gnu_type) && Is_By_Reference_Type (gnat_type)) - TYPE_BY_REFERENCE_P (gnu_type) = 1; + if (Is_By_Reference_Type (gnat_type)) + TREE_ADDRESSABLE (gnu_type) = 1; SET_DUMMY_NODE (gnat_underlying, gnu_type); @@ -310,7 +311,7 @@ global_bindings_p (void) return ((force_global || !current_function_decl) ? -1 : 0); } -/* Enter a new binding level. */ +/* Enter a new binding level. */ void gnat_pushlevel (void) @@ -342,11 +343,11 @@ gnat_pushlevel (void) if (current_binding_level) BLOCK_SUPERCONTEXT (newlevel->block) = current_binding_level->block; - BLOCK_VARS (newlevel->block) = BLOCK_SUBBLOCKS (newlevel->block) = NULL_TREE; + BLOCK_VARS (newlevel->block) = NULL_TREE; + BLOCK_SUBBLOCKS (newlevel->block) = NULL_TREE; TREE_USED (newlevel->block) = 1; - /* Add this level to the front of the chain (stack) of levels that are - active. */ + /* Add this level to the front of the chain (stack) of active levels. */ newlevel->chain = current_binding_level; newlevel->jmpbuf_decl = NULL_TREE; current_binding_level = newlevel; @@ -360,6 +361,7 @@ set_current_block_context (tree fndecl) { BLOCK_SUPERCONTEXT (current_binding_level->block) = fndecl; DECL_INITIAL (fndecl) = current_binding_level->block; + set_block_for_group (current_binding_level->block); } /* Set the jmpbuf_decl for the current binding level to DECL. */ @@ -378,7 +380,7 @@ get_block_jmpbuf_decl (void) return current_binding_level->jmpbuf_decl; } -/* Exit a binding level. Set any BLOCK into the current code group. */ +/* Exit a binding level. Set any BLOCK into the current code group. */ void gnat_poplevel (void) @@ -391,7 +393,7 @@ gnat_poplevel (void) /* If this is a function-level BLOCK don't do anything. Otherwise, if there are no variables free the block and merge its subblocks into those of its - parent block. Otherwise, add it to the list of its parent. */ + parent block. Otherwise, add it to the list of its parent. */ if (TREE_CODE (BLOCK_SUPERCONTEXT (block)) == FUNCTION_DECL) ; else if (BLOCK_VARS (block) == NULL_TREE) @@ -512,40 +514,6 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) } } -/* Do little here. Set up the standard declarations later after the - front end has been run. */ - -void -gnat_init_decl_processing (void) -{ - /* Make the binding_level structure for global names. */ - current_function_decl = 0; - current_binding_level = 0; - free_binding_level = 0; - gnat_pushlevel (); - - build_common_tree_nodes (true, true); - - /* In Ada, we use a signed type for SIZETYPE. Use the signed type - corresponding to the width of Pmode. In most cases when ptr_mode - and Pmode differ, C will use the width of ptr_mode for SIZETYPE. - But we get far better code using the width of Pmode. */ - size_type_node = gnat_type_for_mode (Pmode, 0); - set_sizetype (size_type_node); - - /* In Ada, we use an unsigned 8-bit type for the default boolean type. */ - boolean_type_node = make_unsigned_type (8); - TREE_SET_CODE (boolean_type_node, BOOLEAN_TYPE); - SET_TYPE_RM_MAX_VALUE (boolean_type_node, - build_int_cst (boolean_type_node, 1)); - SET_TYPE_RM_SIZE (boolean_type_node, bitsize_int (1)); - - build_common_tree_nodes_2 (0); - boolean_true_node = TYPE_MAX_VALUE (boolean_type_node); - - ptr_void_type_node = build_pointer_type (void_type_node); -} - /* Record TYPE as a builtin type for Ada. NAME is the name of the type. */ void @@ -1288,7 +1256,10 @@ create_type_decl (tree type_name, tree type, struct attrib *attr_list, TYPE_DECL, type_name, type); DECL_ARTIFICIAL (type_decl) = artificial_p; + + /* Add this decl to the current binding level. */ gnat_pushdecl (type_decl, gnat_node); + process_attributes (type_decl, attr_list); /* If we're naming the type, equate the TYPE_STUB_DECL to the name. @@ -1418,21 +1389,17 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init, != null_pointer_node) DECL_IGNORED_P (var_decl) = 1; - if (TREE_CODE (var_decl) == VAR_DECL) - { - if (asm_name) - SET_DECL_ASSEMBLER_NAME (var_decl, asm_name); - process_attributes (var_decl, attr_list); - } - /* Add this decl to the current binding level. */ gnat_pushdecl (var_decl, gnat_node); if (TREE_SIDE_EFFECTS (var_decl)) TREE_ADDRESSABLE (var_decl) = 1; - if (TREE_CODE (var_decl) != CONST_DECL) + if (TREE_CODE (var_decl) == VAR_DECL) { + if (asm_name) + SET_DECL_ASSEMBLER_NAME (var_decl, asm_name); + process_attributes (var_decl, attr_list); if (global_bindings_p ()) rest_of_decl_compilation (var_decl, true, 0); } @@ -1652,13 +1619,14 @@ create_param_decl (tree param_name, tree param_type, bool readonly) /* Given a DECL and ATTR_LIST, process the listed attributes. */ -void +static void process_attributes (tree decl, struct attrib *attr_list) { for (; attr_list; attr_list = attr_list->next) switch (attr_list->type) { case ATTR_MACHINE_ATTRIBUTE: + input_location = DECL_SOURCE_LOCATION (decl); decl_attributes (&decl, tree_cons (attr_list->name, attr_list->args, NULL_TREE), ATTR_FLAG_TYPE_IN_PLACE); @@ -1868,11 +1836,11 @@ create_subprog_decl (tree subprog_name, tree asm_name, DECL_NAME (subprog_decl) = main_identifier_node; } - process_attributes (subprog_decl, attr_list); - /* Add this decl to the current binding level. */ gnat_pushdecl (subprog_decl, gnat_node); + process_attributes (subprog_decl, attr_list); + /* Output the assembler code and/or RTL for the declaration. */ rest_of_decl_compilation (subprog_decl, global_bindings_p (), 0); @@ -1888,12 +1856,14 @@ begin_subprog_body (tree subprog_decl) { tree param_decl; - current_function_decl = subprog_decl; announce_function (subprog_decl); + current_function_decl = subprog_decl; + /* Enter a new binding level and show that all the parameters belong to this function. */ gnat_pushlevel (); + for (param_decl = DECL_ARGUMENTS (subprog_decl); param_decl; param_decl = TREE_CHAIN (param_decl)) DECL_CONTEXT (param_decl) = subprog_decl; @@ -1915,7 +1885,7 @@ end_subprog_body (tree body) /* Mark the BLOCK for this level as being for this function and pop the level. Since the vars in it are the parameters, clear them. */ - BLOCK_VARS (current_binding_level->block) = 0; + BLOCK_VARS (current_binding_level->block) = NULL_TREE; BLOCK_SUPERCONTEXT (current_binding_level->block) = fndecl; DECL_INITIAL (fndecl) = current_binding_level->block; gnat_poplevel (); @@ -1930,7 +1900,6 @@ end_subprog_body (tree body) DECL_SAVED_TREE (fndecl) = body; current_function_decl = DECL_CONTEXT (fndecl); - set_cfun (NULL); /* We cannot track the location of errors past this point. */ error_gnat_node = Empty; @@ -2231,8 +2200,7 @@ max_size (tree exp, bool max_p) In that case, if one side overflows, return the other. sizetype is signed, but we know sizes are non-negative. Likewise, handle a MINUS_EXPR or PLUS_EXPR with the LHS - overflowing or the maximum possible value and the RHS - a variable. */ + overflowing and the RHS a variable. */ if (max_p && code == MIN_EXPR && TREE_CODE (rhs) == INTEGER_CST @@ -2244,9 +2212,8 @@ max_size (tree exp, bool max_p) && TREE_OVERFLOW (lhs)) return rhs; else if ((code == MINUS_EXPR || code == PLUS_EXPR) - && ((TREE_CODE (lhs) == INTEGER_CST - && TREE_OVERFLOW (lhs)) - || operand_equal_p (lhs, TYPE_MAX_VALUE (type), 0)) + && TREE_CODE (lhs) == INTEGER_CST + && TREE_OVERFLOW (lhs) && !TREE_CONSTANT (rhs)) return lhs; else @@ -2333,12 +2300,12 @@ build_template (tree template_type, tree array_type, tree expr) return gnat_build_constructor (template_type, nreverse (template_elts)); } -/* Build a 32bit VMS descriptor from a Mechanism_Type, which must specify - a descriptor type, and the GCC type of an object. Each FIELD_DECL - in the type contains in its DECL_INITIAL the expression to use when - a constructor is made for the type. GNAT_ENTITY is an entity used - to print out an error message if the mechanism cannot be applied to - an object of that type and also for the name. */ +/* Build a 32-bit VMS descriptor from a Mechanism_Type, which must specify a + descriptor type, and the GCC type of an object. Each FIELD_DECL in the + type contains in its DECL_INITIAL the expression to use when a constructor + is made for the type. GNAT_ENTITY is an entity used to print out an error + message if the mechanism cannot be applied to an object of that type and + also for the name. */ tree build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) @@ -2477,25 +2444,24 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) break; } - /* Make the type for a descriptor for VMS. The first four fields - are the same for all types. */ - + /* Make the type for a descriptor for VMS. The first four fields are the + same for all types. */ + field_list + = chainon (field_list, + make_descriptor_field ("LENGTH", gnat_type_for_size (16, 1), + record_type, + size_in_bytes + ((mech == By_Descriptor_A + || mech == By_Short_Descriptor_A) + ? inner_type : type))); field_list = chainon (field_list, - make_descriptor_field - ("LENGTH", gnat_type_for_size (16, 1), record_type, - size_in_bytes ((mech == By_Descriptor_A || - mech == By_Short_Descriptor_A) - ? inner_type : type))); - - field_list = chainon (field_list, - make_descriptor_field ("DTYPE", - gnat_type_for_size (8, 1), - record_type, size_int (dtype))); - field_list = chainon (field_list, - make_descriptor_field ("CLASS", - gnat_type_for_size (8, 1), - record_type, size_int (klass))); + make_descriptor_field ("DTYPE", gnat_type_for_size (8, 1), + record_type, size_int (dtype))); + field_list + = chainon (field_list, + make_descriptor_field ("CLASS", gnat_type_for_size (8, 1), + record_type, size_int (klass))); /* Of course this will crash at run-time if the address space is not within the low 32 bits, but there is nothing else we can do. */ @@ -2503,11 +2469,11 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) field_list = chainon (field_list, - make_descriptor_field - ("POINTER", pointer32_type, record_type, - build_unary_op (ADDR_EXPR, - pointer32_type, - build0 (PLACEHOLDER_EXPR, type)))); + make_descriptor_field ("POINTER", pointer32_type, record_type, + build_unary_op (ADDR_EXPR, + pointer32_type, + build0 (PLACEHOLDER_EXPR, + type)))); switch (mech) { @@ -2648,12 +2614,12 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) return record_type; } -/* Build a 64bit VMS descriptor from a Mechanism_Type, which must specify - a descriptor type, and the GCC type of an object. Each FIELD_DECL - in the type contains in its DECL_INITIAL the expression to use when - a constructor is made for the type. GNAT_ENTITY is an entity used - to print out an error message if the mechanism cannot be applied to - an object of that type and also for the name. */ +/* Build a 64-bit VMS descriptor from a Mechanism_Type, which must specify a + descriptor type, and the GCC type of an object. Each FIELD_DECL in the + type contains in its DECL_INITIAL the expression to use when a constructor + is made for the type. GNAT_ENTITY is an entity used to print out an error + message if the mechanism cannot be applied to an object of that type and + also for the name. */ tree build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) @@ -2787,43 +2753,41 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) break; } - /* Make the type for a 64bit descriptor for VMS. The first six fields + /* Make the type for a 64-bit descriptor for VMS. The first six fields are the same for all types. */ - - field_list64 = chainon (field_list64, - make_descriptor_field ("MBO", - gnat_type_for_size (16, 1), - record64_type, size_int (1))); - - field_list64 = chainon (field_list64, - make_descriptor_field ("DTYPE", - gnat_type_for_size (8, 1), - record64_type, size_int (dtype))); - field_list64 = chainon (field_list64, - make_descriptor_field ("CLASS", - gnat_type_for_size (8, 1), - record64_type, size_int (klass))); - - field_list64 = chainon (field_list64, - make_descriptor_field ("MBMO", - gnat_type_for_size (32, 1), - record64_type, ssize_int (-1))); - field_list64 = chainon (field_list64, - make_descriptor_field - ("LENGTH", gnat_type_for_size (64, 1), record64_type, - size_in_bytes (mech == By_Descriptor_A ? inner_type : type))); + make_descriptor_field ("MBO", gnat_type_for_size (16, 1), + record64_type, size_int (1))); + field_list64 + = chainon (field_list64, + make_descriptor_field ("DTYPE", gnat_type_for_size (8, 1), + record64_type, size_int (dtype))); + field_list64 + = chainon (field_list64, + make_descriptor_field ("CLASS", gnat_type_for_size (8, 1), + record64_type, size_int (klass))); + field_list64 + = chainon (field_list64, + make_descriptor_field ("MBMO", gnat_type_for_size (32, 1), + record64_type, ssize_int (-1))); + field_list64 + = chainon (field_list64, + make_descriptor_field ("LENGTH", gnat_type_for_size (64, 1), + record64_type, + size_in_bytes (mech == By_Descriptor_A + ? inner_type : type))); pointer64_type = build_pointer_type_for_mode (type, DImode, false); field_list64 = chainon (field_list64, - make_descriptor_field - ("POINTER", pointer64_type, record64_type, - build_unary_op (ADDR_EXPR, - pointer64_type, - build0 (PLACEHOLDER_EXPR, type)))); + make_descriptor_field ("POINTER", pointer64_type, + record64_type, + build_unary_op (ADDR_EXPR, + pointer64_type, + build0 (PLACEHOLDER_EXPR, + type)))); switch (mech) { @@ -2987,11 +2951,11 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) /* The CLASS field is the 3rd field in the descriptor. */ tree klass = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type))); /* The POINTER field is the 6th field in the descriptor. */ - tree pointer64 = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (klass))); + tree pointer = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (klass))); /* Retrieve the value of the POINTER field. */ tree gnu_expr64 - = build3 (COMPONENT_REF, TREE_TYPE (pointer64), desc, pointer64, NULL_TREE); + = build3 (COMPONENT_REF, TREE_TYPE (pointer), desc, pointer, NULL_TREE); if (POINTER_TYPE_P (gnu_type)) return convert (gnu_type, gnu_expr64); @@ -3008,7 +2972,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass)); tree lfield, ufield; - /* Convert POINTER to the type of the P_ARRAY field. */ + /* Convert POINTER to the pointer-to-array type. */ gnu_expr64 = convert (p_array_type, gnu_expr64); switch (iklass) @@ -3033,11 +2997,11 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) /* Test that we really have a SB descriptor, like DEC Ada. */ t = build3 (COMPONENT_REF, TREE_TYPE (klass), desc, klass, NULL); u = convert (TREE_TYPE (klass), DECL_INITIAL (klass)); - u = build_binary_op (EQ_EXPR, integer_type_node, t, u); + u = build_binary_op (EQ_EXPR, boolean_type_node, t, u); /* If so, there is already a template in the descriptor and it is located right after the POINTER field. The fields are 64bits so they must be repacked. */ - t = TREE_CHAIN (pointer64); + t = TREE_CHAIN (pointer); lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield); @@ -3062,7 +3026,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) case 4: /* Class A */ /* The AFLAGS field is the 3rd field after the pointer in the descriptor. */ - t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (pointer64))); + t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (pointer))); aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); /* The DIMCT field is the next field in the descriptor after aflags. */ @@ -3071,12 +3035,12 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) /* Raise CONSTRAINT_ERROR if either more than 1 dimension or FL_COEFF or FL_BOUNDS not set. */ u = build_int_cst (TREE_TYPE (aflags), 192); - u = build_binary_op (TRUTH_OR_EXPR, integer_type_node, - build_binary_op (NE_EXPR, integer_type_node, + u = build_binary_op (TRUTH_OR_EXPR, boolean_type_node, + build_binary_op (NE_EXPR, boolean_type_node, dimct, convert (TREE_TYPE (dimct), size_one_node)), - build_binary_op (NE_EXPR, integer_type_node, + build_binary_op (NE_EXPR, boolean_type_node, build2 (BIT_AND_EXPR, TREE_TYPE (aflags), aflags, u), @@ -3156,7 +3120,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) /* See the head comment of build_vms_descriptor. */ int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass)); - /* Convert POINTER to the type of the P_ARRAY field. */ + /* Convert POINTER to the pointer-to-array type. */ gnu_expr32 = convert (p_array_type, gnu_expr32); switch (iklass) @@ -3181,7 +3145,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) /* Test that we really have a SB descriptor, like DEC Ada. */ t = build3 (COMPONENT_REF, TREE_TYPE (klass), desc, klass, NULL); u = convert (TREE_TYPE (klass), DECL_INITIAL (klass)); - u = build_binary_op (EQ_EXPR, integer_type_node, t, u); + u = build_binary_op (EQ_EXPR, boolean_type_node, t, u); /* If so, there is already a template in the descriptor and it is located right after the POINTER field. */ t = TREE_CHAIN (pointer); @@ -3204,12 +3168,12 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) /* Raise CONSTRAINT_ERROR if either more than 1 dimension or FL_COEFF or FL_BOUNDS not set. */ u = build_int_cst (TREE_TYPE (aflags), 192); - u = build_binary_op (TRUTH_OR_EXPR, integer_type_node, - build_binary_op (NE_EXPR, integer_type_node, + u = build_binary_op (TRUTH_OR_EXPR, boolean_type_node, + build_binary_op (NE_EXPR, boolean_type_node, dimct, convert (TREE_TYPE (dimct), size_one_node)), - build_binary_op (NE_EXPR, integer_type_node, + build_binary_op (NE_EXPR, boolean_type_node, build2 (BIT_AND_EXPR, TREE_TYPE (aflags), aflags, u), @@ -3271,11 +3235,11 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type, mbo = build3 (COMPONENT_REF, TREE_TYPE (mbo), desc, mbo, NULL_TREE); mbmo = build3 (COMPONENT_REF, TREE_TYPE (mbmo), desc, mbmo, NULL_TREE); is64bit - = build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, - build_binary_op (EQ_EXPR, integer_type_node, + = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node, + build_binary_op (EQ_EXPR, boolean_type_node, convert (integer_type_node, mbo), integer_one_node), - build_binary_op (EQ_EXPR, integer_type_node, + build_binary_op (EQ_EXPR, boolean_type_node, convert (integer_type_node, mbmo), integer_minus_one_node)); @@ -3852,11 +3816,14 @@ convert (tree type, tree expr) return expr; } - /* Likewise for a conversion between original and packable version, but - we have to work harder in order to preserve type consistency. */ + /* Likewise for a conversion between original and packable version, or + conversion between types of the same size and with the same list of + fields, but we have to work harder to preserve type consistency. */ if (code == ecode && code == RECORD_TYPE - && TYPE_NAME (type) == TYPE_NAME (etype)) + && (TYPE_NAME (type) == TYPE_NAME (etype) + || tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (etype)))) + { VEC(constructor_elt,gc) *e = CONSTRUCTOR_ELTS (expr); unsigned HOST_WIDE_INT len = VEC_length (constructor_elt, e); @@ -3871,10 +3838,14 @@ convert (tree type, tree expr) FOR_EACH_CONSTRUCTOR_ELT(e, idx, index, value) { - constructor_elt *elt = VEC_quick_push (constructor_elt, v, NULL); - /* We expect only simple constructors. Otherwise, punt. */ - if (!(index == efield || index == DECL_ORIGINAL_FIELD (efield))) + constructor_elt *elt; + /* We expect only simple constructors. */ + if (!SAME_FIELD_P (index, efield)) + break; + /* The field must be the same. */ + if (!SAME_FIELD_P (efield, field)) break; + elt = VEC_quick_push (constructor_elt, v, NULL); elt->index = field; elt->value = convert (TREE_TYPE (field), value); @@ -3956,10 +3927,12 @@ convert (tree type, tree expr) case UNCONSTRAINED_ARRAY_REF: /* Convert this to the type of the inner array by getting the address of the array from the template. */ + expr = TREE_OPERAND (expr, 0); expr = build_unary_op (INDIRECT_REF, NULL_TREE, - build_component_ref (TREE_OPERAND (expr, 0), - get_identifier ("P_ARRAY"), - NULL_TREE, false)); + build_component_ref (expr, NULL_TREE, + TYPE_FIELDS + (TREE_TYPE (expr)), + false)); etype = TREE_TYPE (expr); ecode = TREE_CODE (etype); break; @@ -4020,10 +3993,21 @@ convert (tree type, tree expr) etype))) return build1 (VIEW_CONVERT_EXPR, type, expr); + /* If we are converting between tagged types, try to upcast properly. */ + else if (ecode == RECORD_TYPE && code == RECORD_TYPE + && TYPE_ALIGN_OK (etype) && TYPE_ALIGN_OK (type)) + { + tree child_etype = etype; + do { + tree field = TYPE_FIELDS (child_etype); + if (DECL_NAME (field) == parent_name_id && TREE_TYPE (field) == type) + return build_component_ref (expr, NULL_TREE, field, false); + child_etype = TREE_TYPE (field); + } while (TREE_CODE (child_etype) == RECORD_TYPE); + } + /* In all other cases of related types, make a NOP_EXPR. */ - else if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (etype) - || (code == INTEGER_CST && ecode == INTEGER_CST - && (type == TREE_TYPE (etype) || etype == TREE_TYPE (type)))) + else if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (etype)) return fold_convert (type, expr); switch (code) @@ -4082,9 +4066,8 @@ convert (tree type, tree expr) tree bit_diff = size_diffop (bit_position (TYPE_FIELDS (TREE_TYPE (etype))), bit_position (TYPE_FIELDS (TREE_TYPE (type)))); - tree byte_diff = size_binop (CEIL_DIV_EXPR, bit_diff, - sbitsize_int (BITS_PER_UNIT)); - + tree byte_diff + = size_binop (CEIL_DIV_EXPR, bit_diff, sbitsize_unit_node); expr = build1 (NOP_EXPR, type, expr); TREE_CONSTANT (expr) = TREE_CONSTANT (TREE_OPERAND (expr, 0)); if (integer_zerop (byte_diff)) @@ -4102,8 +4085,8 @@ convert (tree type, tree expr) /* If converting fat pointer to normal pointer, get the pointer to the array and then convert it. */ else if (TYPE_IS_FAT_POINTER_P (etype)) - expr = build_component_ref (expr, get_identifier ("P_ARRAY"), - NULL_TREE, false); + expr + = build_component_ref (expr, NULL_TREE, TYPE_FIELDS (etype), false); return fold (convert_to_pointer (type, expr)); @@ -4214,7 +4197,7 @@ remove_conversions (tree exp, bool true_address) } /* If EXP's type is an UNCONSTRAINED_ARRAY_TYPE, return an expression that - refers to the underlying array. If its type has TYPE_CONTAINS_TEMPLATE_P, + refers to the underlying array. If it has TYPE_CONTAINS_TEMPLATE_P, likewise return an expression pointing to the underlying array. */ tree @@ -4228,11 +4211,13 @@ maybe_unconstrained_array (tree exp) case UNCONSTRAINED_ARRAY_TYPE: if (code == UNCONSTRAINED_ARRAY_REF) { + new_exp = TREE_OPERAND (exp, 0); new_exp = build_unary_op (INDIRECT_REF, NULL_TREE, - build_component_ref (TREE_OPERAND (exp, 0), - get_identifier ("P_ARRAY"), - NULL_TREE, false)); + build_component_ref (new_exp, NULL_TREE, + TYPE_FIELDS + (TREE_TYPE (new_exp)), + false)); TREE_READONLY (new_exp) = TREE_READONLY (exp); return new_exp; } @@ -5068,7 +5053,8 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), if (!argument || TREE_CODE (TREE_VALUE (argument)) == VOID_TYPE) { - error ("nonnull argument with out-of-range operand number (argument %lu, operand %lu)", + error ("nonnull argument with out-of-range operand number " + "(argument %lu, operand %lu)", (unsigned long) attr_arg_num, (unsigned long) arg_num); *no_add_attrs = true; return NULL_TREE; @@ -5076,7 +5062,8 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE) { - error ("nonnull argument references non-pointer operand (argument %lu, operand %lu)", + error ("nonnull argument references non-pointer operand " + "(argument %lu, operand %lu)", (unsigned long) attr_arg_num, (unsigned long) arg_num); *no_add_attrs = true; return NULL_TREE; diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index 7d78c25ffba..be7044bddfa 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -242,11 +242,11 @@ find_common_type (tree t1, tree t2) static tree compare_arrays (tree result_type, tree a1, tree a2) { + tree result = convert (result_type, boolean_true_node); + tree a1_is_null = convert (result_type, boolean_false_node); + tree a2_is_null = convert (result_type, boolean_false_node); tree t1 = TREE_TYPE (a1); tree t2 = TREE_TYPE (a2); - tree result = convert (result_type, integer_one_node); - tree a1_is_null = convert (result_type, integer_zero_node); - tree a2_is_null = convert (result_type, integer_zero_node); bool a1_side_effects_p = TREE_SIDE_EFFECTS (a1); bool a2_side_effects_p = TREE_SIDE_EFFECTS (a2); bool length_zero_p = false; @@ -260,28 +260,27 @@ compare_arrays (tree result_type, tree a1, tree a2) a2 = gnat_protect_expr (a2); /* Process each dimension separately and compare the lengths. If any - dimension has a size known to be zero, set SIZE_ZERO_P to 1 to - suppress the comparison of the data. */ + dimension has a length known to be zero, set LENGTH_ZERO_P to true + in order to suppress the comparison of the data at the end. */ while (TREE_CODE (t1) == ARRAY_TYPE && TREE_CODE (t2) == ARRAY_TYPE) { tree lb1 = TYPE_MIN_VALUE (TYPE_DOMAIN (t1)); tree ub1 = TYPE_MAX_VALUE (TYPE_DOMAIN (t1)); tree lb2 = TYPE_MIN_VALUE (TYPE_DOMAIN (t2)); tree ub2 = TYPE_MAX_VALUE (TYPE_DOMAIN (t2)); - tree bt = get_base_type (TREE_TYPE (lb1)); - tree length1 = fold_build2 (MINUS_EXPR, bt, ub1, lb1); - tree length2 = fold_build2 (MINUS_EXPR, bt, ub2, lb2); + tree length1 = size_binop (PLUS_EXPR, size_binop (MINUS_EXPR, ub1, lb1), + size_one_node); + tree length2 = size_binop (PLUS_EXPR, size_binop (MINUS_EXPR, ub2, lb2), + size_one_node); tree comparison, this_a1_is_null, this_a2_is_null; - tree nbt, tem; - bool btem; /* If the length of the first array is a constant, swap our operands - unless the length of the second array is the constant zero. - Note that we have set the `length' values to the length - 1. */ - if (TREE_CODE (length1) == INTEGER_CST - && !integer_zerop (fold_build2 (PLUS_EXPR, bt, length2, - convert (bt, integer_one_node)))) + unless the length of the second array is the constant zero. */ + if (TREE_CODE (length1) == INTEGER_CST && !integer_zerop (length2)) { + tree tem; + bool btem; + tem = a1, a1 = a2, a2 = tem; tem = t1, t1 = t2, t2 = tem; tem = lb1, lb1 = lb2, lb2 = tem; @@ -292,51 +291,56 @@ compare_arrays (tree result_type, tree a1, tree a2) a2_side_effects_p = btem; } - /* If the length of this dimension in the second array is the constant - zero, we can just go inside the original bounds for the first - array and see if last < first. */ - if (integer_zerop (fold_build2 (PLUS_EXPR, bt, length2, - convert (bt, integer_one_node)))) + /* If the length of the second array is the constant zero, we can just + use the original stored bounds for the first array and see whether + last < first holds. */ + if (integer_zerop (length2)) { - tree ub = TYPE_MAX_VALUE (TYPE_INDEX_TYPE (TYPE_DOMAIN (t1))); - tree lb = TYPE_MIN_VALUE (TYPE_INDEX_TYPE (TYPE_DOMAIN (t1))); + length_zero_p = true; - comparison = build_binary_op (LT_EXPR, result_type, ub, lb); + ub1 = TYPE_MAX_VALUE (TYPE_INDEX_TYPE (TYPE_DOMAIN (t1))); + lb1 = TYPE_MIN_VALUE (TYPE_INDEX_TYPE (TYPE_DOMAIN (t1))); + + comparison = build_binary_op (LT_EXPR, result_type, ub1, lb1); comparison = SUBSTITUTE_PLACEHOLDER_IN_EXPR (comparison, a1); - length1 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (length1, a1); + if (EXPR_P (comparison)) + SET_EXPR_LOCATION (comparison, input_location); - length_zero_p = true; this_a1_is_null = comparison; - this_a2_is_null = convert (result_type, integer_one_node); + this_a2_is_null = convert (result_type, boolean_true_node); } - /* If the length is some other constant value, we know that the - this dimension in the first array cannot be superflat, so we - can just use its length from the actual stored bounds. */ + /* Otherwise, if the length is some other constant value, we know that + this dimension in the second array cannot be superflat, so we can + just use its length computed from the actual stored bounds. */ else if (TREE_CODE (length2) == INTEGER_CST) { + tree bt; + ub1 = TYPE_MAX_VALUE (TYPE_INDEX_TYPE (TYPE_DOMAIN (t1))); lb1 = TYPE_MIN_VALUE (TYPE_INDEX_TYPE (TYPE_DOMAIN (t1))); + /* Note that we know that UB2 and LB2 are constant and hence + cannot contain a PLACEHOLDER_EXPR. */ ub2 = TYPE_MAX_VALUE (TYPE_INDEX_TYPE (TYPE_DOMAIN (t2))); lb2 = TYPE_MIN_VALUE (TYPE_INDEX_TYPE (TYPE_DOMAIN (t2))); - nbt = get_base_type (TREE_TYPE (ub1)); + bt = get_base_type (TREE_TYPE (ub1)); comparison = build_binary_op (EQ_EXPR, result_type, - build_binary_op (MINUS_EXPR, nbt, ub1, lb1), - build_binary_op (MINUS_EXPR, nbt, ub2, lb2)); - - /* Note that we know that UB2 and LB2 are constant and hence - cannot contain a PLACEHOLDER_EXPR. */ - + build_binary_op (MINUS_EXPR, bt, ub1, lb1), + build_binary_op (MINUS_EXPR, bt, ub2, lb2)); comparison = SUBSTITUTE_PLACEHOLDER_IN_EXPR (comparison, a1); - length1 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (length1, a1); + if (EXPR_P (comparison)) + SET_EXPR_LOCATION (comparison, input_location); this_a1_is_null = build_binary_op (LT_EXPR, result_type, ub1, lb1); - this_a2_is_null = convert (result_type, integer_zero_node); + if (EXPR_P (this_a1_is_null)) + SET_EXPR_LOCATION (this_a1_is_null, input_location); + + this_a2_is_null = convert (result_type, boolean_false_node); } - /* Otherwise compare the computed lengths. */ + /* Otherwise, compare the computed lengths. */ else { length1 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (length1, a1); @@ -344,20 +348,27 @@ compare_arrays (tree result_type, tree a1, tree a2) comparison = build_binary_op (EQ_EXPR, result_type, length1, length2); - - this_a1_is_null - = build_binary_op (LT_EXPR, result_type, length1, - convert (bt, integer_zero_node)); - this_a2_is_null - = build_binary_op (LT_EXPR, result_type, length2, - convert (bt, integer_zero_node)); + if (EXPR_P (comparison)) + SET_EXPR_LOCATION (comparison, input_location); + + this_a1_is_null = build_binary_op (EQ_EXPR, result_type, length1, + size_zero_node); + if (EXPR_P (this_a1_is_null)) + SET_EXPR_LOCATION (this_a1_is_null, input_location); + + this_a2_is_null = build_binary_op (EQ_EXPR, result_type, length2, + size_zero_node); + if (EXPR_P (this_a2_is_null)) + SET_EXPR_LOCATION (this_a2_is_null, input_location); } + /* Append expressions for this dimension to the final expressions. */ result = build_binary_op (TRUTH_ANDIF_EXPR, result_type, result, comparison); a1_is_null = build_binary_op (TRUTH_ORIF_EXPR, result_type, this_a1_is_null, a1_is_null); + a2_is_null = build_binary_op (TRUTH_ORIF_EXPR, result_type, this_a2_is_null, a2_is_null); @@ -365,11 +376,12 @@ compare_arrays (tree result_type, tree a1, tree a2) t2 = TREE_TYPE (t2); } - /* Unless the size of some bound is known to be zero, compare the + /* Unless the length of some dimension is known to be zero, compare the data in the array. */ if (!length_zero_p) { tree type = find_common_type (TREE_TYPE (a1), TREE_TYPE (a2)); + tree comparison; if (type) { @@ -377,8 +389,12 @@ compare_arrays (tree result_type, tree a1, tree a2) a2 = convert (type, a2); } - result = build_binary_op (TRUTH_ANDIF_EXPR, result_type, result, - fold_build2 (EQ_EXPR, result_type, a1, a2)); + comparison = fold_build2 (EQ_EXPR, result_type, a1, a2); + if (EXPR_P (comparison)) + SET_EXPR_LOCATION (comparison, input_location); + + result + = build_binary_op (TRUTH_ANDIF_EXPR, result_type, result, comparison); } /* The result is also true if both sizes are zero. */ @@ -473,7 +489,7 @@ nonbinary_modular_operation (enum tree_code op_code, tree type, tree lhs, { result = gnat_protect_expr (result); result = fold_build3 (COND_EXPR, op_type, - fold_build2 (LT_EXPR, integer_type_node, result, + fold_build2 (LT_EXPR, boolean_type_node, result, convert (op_type, integer_zero_node)), fold_build2 (PLUS_EXPR, op_type, result, modulus), result); @@ -484,7 +500,7 @@ nonbinary_modular_operation (enum tree_code op_code, tree type, tree lhs, { result = gnat_protect_expr (result); result = fold_build3 (COND_EXPR, op_type, - fold_build2 (GE_EXPR, integer_type_node, + fold_build2 (GE_EXPR, boolean_type_node, result, modulus), fold_build2 (MINUS_EXPR, op_type, result, modulus), @@ -698,16 +714,28 @@ build_binary_op (enum tree_code op_code, tree result_type, modulus = NULL_TREE; break; + case TRUTH_ANDIF_EXPR: + case TRUTH_ORIF_EXPR: + case TRUTH_AND_EXPR: + case TRUTH_OR_EXPR: + case TRUTH_XOR_EXPR: +#ifdef ENABLE_CHECKING + gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE); +#endif + operation_type = left_base_type; + left_operand = convert (operation_type, left_operand); + right_operand = convert (operation_type, right_operand); + break; + case GE_EXPR: case LE_EXPR: case GT_EXPR: case LT_EXPR: - gcc_assert (!POINTER_TYPE_P (left_type)); - - /* ... fall through ... */ - case EQ_EXPR: case NE_EXPR: +#ifdef ENABLE_CHECKING + gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE); +#endif /* If either operand is a NULL_EXPR, just return a new one. */ if (TREE_CODE (left_operand) == NULL_EXPR) return build2 (op_code, result_type, @@ -824,13 +852,6 @@ build_binary_op (enum tree_code op_code, tree result_type, modulus = NULL_TREE; break; - case PREINCREMENT_EXPR: - case PREDECREMENT_EXPR: - case POSTINCREMENT_EXPR: - case POSTDECREMENT_EXPR: - /* These operations are not used anymore. */ - gcc_unreachable (); - case LSHIFT_EXPR: case RSHIFT_EXPR: case LROTATE_EXPR: @@ -983,7 +1004,9 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) break; case TRUTH_NOT_EXPR: - gcc_assert (result_type == base_type); +#ifdef ENABLE_CHECKING + gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE); +#endif result = invert_truthvalue (operand); break; @@ -1025,6 +1048,22 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) TREE_TYPE (result) = type = build_pointer_type (type); break; + case COMPOUND_EXPR: + /* Fold a compound expression if it has unconstrained array type + since the middle-end cannot handle it. But we don't it in the + general case because it may introduce aliasing issues if the + first operand is an indirect assignment and the second operand + the corresponding address, e.g. for an allocator. */ + if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE) + { + result = build_unary_op (ADDR_EXPR, result_type, + TREE_OPERAND (operand, 1)); + result = build2 (COMPOUND_EXPR, TREE_TYPE (result), + TREE_OPERAND (operand, 0), result); + break; + } + goto common; + case ARRAY_REF: case ARRAY_RANGE_REF: case COMPONENT_REF: @@ -1137,21 +1176,17 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) operand = convert (type, operand); } - if (type != error_mark_node) - operation_type = build_pointer_type (type); - gnat_mark_addressable (operand); - result = fold_build1 (ADDR_EXPR, operation_type, operand); + result = build_fold_addr_expr (operand); } TREE_CONSTANT (result) = staticp (operand) || TREE_CONSTANT (operand); break; case INDIRECT_REF: - /* If we want to refer to an entire unconstrained array, - make up an expression to do so. This will never survive to - the backend. If TYPE is a thin pointer, first convert the - operand to a fat pointer. */ + /* If we want to refer to an unconstrained array, use the appropriate + expression to do so. This will never survive down to the back-end. + But if TYPE is a thin pointer, first convert to a fat pointer. */ if (TYPE_IS_THIN_POINTER_P (type) && TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))) { @@ -1168,12 +1203,15 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) TREE_READONLY (result) = TYPE_READONLY (TYPE_UNCONSTRAINED_ARRAY (type)); } + + /* If we are dereferencing an ADDR_EXPR, return its operand. */ else if (TREE_CODE (operand) == ADDR_EXPR) result = TREE_OPERAND (operand, 0); + /* Otherwise, build and fold the indirect reference. */ else { - result = fold_build1 (op_code, TREE_TYPE (type), operand); + result = build_fold_indirect_ref (operand); TREE_READONLY (result) = TYPE_READONLY (TREE_TYPE (type)); } @@ -1226,7 +1264,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) result = fold_build3 (COND_EXPR, operation_type, fold_build2 (NE_EXPR, - integer_type_node, + boolean_type_node, operand, convert (operation_type, @@ -1293,10 +1331,9 @@ build_cond_expr (tree result_type, tree condition_operand, /* If the result type is unconstrained, take the address of the operands and then dereference the result. Likewise if the result type is passed by - reference because creating a temporary of this type is not allowed. */ + reference, but this is natively handled in the gimplifier. */ if (TREE_CODE (result_type) == UNCONSTRAINED_ARRAY_TYPE - || CONTAINS_PLACEHOLDER_P (TYPE_SIZE (result_type)) - || (AGGREGATE_TYPE_P (result_type) && TYPE_BY_REFERENCE_P (result_type))) + || CONTAINS_PLACEHOLDER_P (TYPE_SIZE (result_type))) { result_type = build_pointer_type (result_type); true_operand = build_unary_op (ADDR_EXPR, result_type, true_operand); @@ -1462,12 +1499,13 @@ build_call_raise (int msg, Node_Id gnat_node, char kind) = (gnat_node != Empty && Sloc (gnat_node) != No_Location) ? Get_Logical_Line_Number (Sloc(gnat_node)) : input_line; - TREE_TYPE (filename) - = build_array_type (char_type_node, build_index_type (size_int (len))); + TREE_TYPE (filename) = build_array_type (unsigned_char_type_node, + build_index_type (size_int (len))); return build_call_2_expr (fndecl, - build1 (ADDR_EXPR, build_pointer_type (char_type_node), + build1 (ADDR_EXPR, + build_pointer_type (unsigned_char_type_node), filename), build_int_cst (NULL_TREE, line_number)); } @@ -1588,22 +1626,15 @@ build_simple_component_ref (tree record_variable, tree component, tree new_field; /* First loop thru normal components. */ - for (new_field = TYPE_FIELDS (record_type); new_field; new_field = TREE_CHAIN (new_field)) - if (field == new_field - || DECL_ORIGINAL_FIELD (new_field) == field - || new_field == DECL_ORIGINAL_FIELD (field) - || (DECL_ORIGINAL_FIELD (field) - && (DECL_ORIGINAL_FIELD (field) - == DECL_ORIGINAL_FIELD (new_field)))) + if (SAME_FIELD_P (field, new_field)) break; /* Next, loop thru DECL_INTERNAL_P components if we haven't found the component in the first search. Doing this search in 2 steps is required to avoiding hidden homonymous fields in the _Parent field. */ - if (!new_field) for (new_field = TYPE_FIELDS (record_type); new_field; new_field = TREE_CHAIN (new_field)) @@ -2063,12 +2094,11 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, tree fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual) { - tree field; tree parm_decl = get_gnu_tree (gnat_formal); - tree const_list = NULL_TREE; tree record_type = TREE_TYPE (TREE_TYPE (parm_decl)); - int do_range_check = - strcmp ("MBO", + tree const_list = NULL_TREE, field; + const bool do_range_check + = strcmp ("MBO", IDENTIFIER_POINTER (DECL_NAME (TYPE_FIELDS (record_type)))); expr = maybe_unconstrained_array (expr); @@ -2080,23 +2110,24 @@ fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual) SUBSTITUTE_PLACEHOLDER_IN_EXPR (DECL_INITIAL (field), expr)); - /* Check to ensure that only 32bit pointers are passed in - 32bit descriptors */ - if (do_range_check && - strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), "POINTER") == 0) + /* Check to ensure that only 32-bit pointers are passed in + 32-bit descriptors */ + if (do_range_check + && strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), "POINTER") == 0) { - tree pointer64type = - build_pointer_type_for_mode (void_type_node, DImode, false); + tree pointer64type + = build_pointer_type_for_mode (void_type_node, DImode, false); tree addr64expr = build_unary_op (ADDR_EXPR, pointer64type, expr); - tree malloc64low = - build_int_cstu (long_integer_type_node, 0x80000000); + tree malloc64low + = build_int_cstu (long_integer_type_node, 0x80000000); add_stmt (build3 (COND_EXPR, void_type_node, - build_binary_op (GE_EXPR, long_integer_type_node, + build_binary_op (GE_EXPR, boolean_type_node, convert (long_integer_type_node, addr64expr), malloc64low), - build_call_raise (CE_Range_Check_Failed, gnat_actual, + build_call_raise (CE_Range_Check_Failed, + gnat_actual, N_Raise_Constraint_Error), NULL_TREE)); } @@ -2127,6 +2158,10 @@ gnat_mark_addressable (tree t) t = TREE_OPERAND (t, 0); break; + case COMPOUND_EXPR: + t = TREE_OPERAND (t, 1); + break; + case CONSTRUCTOR: TREE_ADDRESSABLE (t) = 1; return true; @@ -2199,9 +2234,12 @@ gnat_protect_expr (tree exp) unshared for gimplification; in order to avoid a complexity explosion at that point, we protect any expressions more complex than a simple arithmetic expression. */ - if (!TREE_SIDE_EFFECTS (exp) - && !EXPRESSION_CLASS_P (skip_simple_arithmetic (exp))) - return exp; + if (!TREE_SIDE_EFFECTS (exp)) + { + tree inner = skip_simple_arithmetic (exp); + if (!EXPR_P (inner) || REFERENCE_CLASS_P (inner)) + return exp; + } /* If this is a conversion, protect what's inside the conversion. */ if (code == NON_LVALUE_EXPR @@ -2385,10 +2423,17 @@ gnat_stabilize_reference (tree ref, bool force, bool *success) break; case CALL_EXPR: - case COMPOUND_EXPR: result = gnat_stabilize_reference_1 (ref, force); break; + case COMPOUND_EXPR: + result = build2 (COMPOUND_EXPR, type, + gnat_stabilize_reference (TREE_OPERAND (ref, 0), force, + success), + gnat_stabilize_reference_1 (TREE_OPERAND (ref, 1), + force)); + break; + case CONSTRUCTOR: /* Constructors with 1 element are used extensively to formally convert objects to special wrapping types. */ diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h index 24928a1f936..ca016c921c0 100644 --- a/gcc/ada/gsocket.h +++ b/gcc/ada/gsocket.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 2004-2009, Free Software Foundation, Inc. * + * Copyright (C) 2004-2010, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -179,14 +179,13 @@ #endif /* - * RTEMS has these .h files but not until you have built RTEMS. When - * IN_RTS, you only have the .h files in the newlib C library. - * Because this file is also included from gen-soccon.c which is built - * to run on RTEMS (not IN_RTS), we must distinguish between IN_RTS - * and using this file to compile gen-soccon. + * RTEMS has these .h files but not until you have built and installed + * RTEMS. When building a C/C++ toolset, you also build the newlib C library. + * So the build procedure for an RTEMS GNAT toolset requires that + * you build a C/C++ toolset, then build and install RTEMS with + * --enable-multilib, and finally build the Ada part of the toolset. */ -#if !(defined (VMS) || defined (__MINGW32__) || \ - (defined(__rtems__) && defined(IN_RTS))) +#if !(defined (VMS) || defined (__MINGW32__)) #include #include #include diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index 93377219175..3b72d154c10 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -1703,15 +1703,9 @@ package body Uintp is V : UI_Vector (1 .. Max_For_Dint); - Temp_Integer : Dint; + Temp_Integer : Dint := Input; begin - for J in V'Range loop - V (J) := 0; - end loop; - - Temp_Integer := Input; - for J in reverse V'Range loop V (J) := Int (abs (Temp_Integer rem Dint (Base))); Temp_Integer := Temp_Integer / Dint (Base); @@ -1752,15 +1746,9 @@ package body Uintp is V : UI_Vector (1 .. Max_For_Int); - Temp_Integer : Int; + Temp_Integer : Int := Input; begin - for J in V'Range loop - V (J) := 0; - end loop; - - Temp_Integer := Input; - for J in reverse V'Range loop V (J) := abs (Temp_Integer rem Base); Temp_Integer := Temp_Integer / Base; diff --git a/gcc/ada/uintp.h b/gcc/ada/uintp.h index 5921945f3c0..de70e115f43 100644 --- a/gcc/ada/uintp.h +++ b/gcc/ada/uintp.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 1992-2007, Free Software Foundation, Inc. * + * Copyright (C) 1992-2010, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -38,27 +38,42 @@ struct Uint_Entry #define UI_Is_In_Int_Range uintp__ui_is_in_int_range extern Boolean UI_Is_In_Int_Range (Uint); -/* Obtain Char_Code value from Uint input. Value must be in range. */ +/* Obtain Char_Code value from Uint input. Value must be in range. */ #define UI_To_CC uintp__ui_to_cc -extern Char_Code UI_To_CC (Uint); +extern Char_Code UI_To_CC (Uint); -/* Obtain Int value from Uint input. This will abort if the result is - out of range. */ +/* Convert a Char_Code into a Uint. */ +#define UI_From_CC uintp__ui_from_cc +extern Uint UI_From_CC (Char_Code); + +/* Obtain Int value from Uint input. Abort if the result is out of range. */ #define UI_To_Int uintp__ui_to_int extern Int UI_To_Int (Uint); +/* Similarly, but return a GCC INTEGER_CST. */ +extern tree UI_To_gnu (Uint, tree); + /* Convert an Int into a Uint. */ #define UI_From_Int uintp__ui_from_int extern Uint UI_From_Int (int); -/* Convert a Char_Code into a Uint. */ -#define UI_From_CC uintp__ui_from_cc -extern Uint UI_From_CC (Char_Code); +/* Similarly, but take a GCC INTEGER_CST. */ +extern Uint UI_From_gnu (tree); -/* Similarly, but return a GCC INTEGER_CST. Overflow is tested by the - constant-folding used to build the node. TYPE is the GCC type of the - resulting node. */ -extern tree UI_To_gnu (Uint, tree); +/* Uint values are represented as multiple precision integers stored in a + multi-digit format using UI_Base as the base. This value is chosen so + that the product UI_Base*UI_Base is within the range of Int values. */ +#define UI_Base uintp__base +extern const int UI_Base; + +/* Types for the fat pointer of Int vectors and the template it points to. */ +typedef struct {int Low_Bound, High_Bound; } Vector_Template; +typedef struct {const int *Array; Vector_Template *Bounds; } + __attribute ((aligned (sizeof (char *) * 2))) Int_Vector; + +/* Create and return the Uint value from the Int vector. */ +#define Vector_To_Uint uintp__vector_to_uint +extern Uint Vector_To_Uint (Int_Vector, Boolean); /* Universal integers are represented by the Uint type which is an index into the Uints_Ptr table containing Uint_Entry values. A Uint_Entry contains an @@ -75,6 +90,3 @@ extern struct Uint_Entry *uintp__uints__table; #define Udigits_Ptr uintp__udigits__table extern int *uintp__udigits__table; - -#define Uint_0 (Uint_Direct_Bias + 0) -#define Uint_1 (Uint_Direct_Bias + 1) diff --git a/gcc/alias.c b/gcc/alias.c index c10b971e3df..a1e12fba44e 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -413,7 +413,7 @@ alias_set_subset_of (alias_set_type set1, alias_set_type set2) /* Otherwise, check if set1 is a subset of set2. */ ase = get_alias_set_entry (set2); if (ase != 0 - && ((ase->has_zero_child && set1 == 0) + && (ase->has_zero_child || splay_tree_lookup (ase->children, (splay_tree_key) set1))) return true; @@ -1789,9 +1789,41 @@ static int memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) { if (GET_CODE (x) == VALUE) - x = get_addr (x); + { + if (REG_P (y)) + { + struct elt_loc_list *l = NULL; + if (CSELIB_VAL_PTR (x)) + for (l = CSELIB_VAL_PTR (x)->locs; l; l = l->next) + if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, y)) + break; + if (l) + x = y; + else + x = get_addr (x); + } + /* Don't call get_addr if y is the same VALUE. */ + else if (x != y) + x = get_addr (x); + } if (GET_CODE (y) == VALUE) - y = get_addr (y); + { + if (REG_P (x)) + { + struct elt_loc_list *l = NULL; + if (CSELIB_VAL_PTR (y)) + for (l = CSELIB_VAL_PTR (y)->locs; l; l = l->next) + if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, x)) + break; + if (l) + y = x; + else + y = get_addr (y); + } + /* Don't call get_addr if x is the same VALUE. */ + else if (y != x) + y = get_addr (y); + } if (GET_CODE (x) == HIGH) x = XEXP (x, 0); else if (GET_CODE (x) == LO_SUM) diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 524d00d9d66..34b18bd51e8 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -894,6 +894,10 @@ extern void rtl_make_eh_edge (sbitmap, basic_block, rtx); /* In cfgcleanup.c. */ extern bool cleanup_cfg (int); +extern int flow_find_cross_jump (basic_block, basic_block, rtx *, rtx *); +extern int flow_find_head_matching_sequence (basic_block, basic_block, + rtx *, rtx *, int); + extern bool delete_unreachable_blocks (void); extern bool mark_dfs_back_edges (void); diff --git a/gcc/builtins.c b/gcc/builtins.c index 7787f695ac8..dbab4847af0 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -560,7 +560,7 @@ c_readstr (const char *str, enum machine_mode mode) && GET_MODE_SIZE (mode) > UNITS_PER_WORD) j = j + UNITS_PER_WORD - 2 * (j % UNITS_PER_WORD) - 1; j *= BITS_PER_UNIT; - gcc_assert (j <= 2 * HOST_BITS_PER_WIDE_INT); + gcc_assert (j < 2 * HOST_BITS_PER_WIDE_INT); if (ch) ch = (unsigned char) str[i]; @@ -2316,7 +2316,8 @@ expand_builtin_interclass_mathfn (tree exp, rtx target, rtx subtarget) tree orig_arg = arg; /* Make a suitable register to place result in. */ if (!target - || GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp))) + || GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)) + || !insn_data[icode].operand[0].predicate (target, GET_MODE (target))) target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp))); gcc_assert (insn_data[icode].operand[0].predicate @@ -2922,6 +2923,95 @@ expand_powi (rtx x, enum machine_mode mode, HOST_WIDE_INT n) return result; } +/* Fold a builtin function call to pow, powf, or powl into a series of sqrts or + cbrts. Return NULL_RTX if no simplification can be made or expand the tree + if we can simplify it. */ +static rtx +expand_builtin_pow_root (location_t loc, tree arg0, tree arg1, tree type, + rtx subtarget) +{ + if (TREE_CODE (arg1) == REAL_CST + && !TREE_OVERFLOW (arg1) + && flag_unsafe_math_optimizations) + { + enum machine_mode mode = TYPE_MODE (type); + tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT); + tree cbrtfn = mathfn_built_in (type, BUILT_IN_CBRT); + REAL_VALUE_TYPE c = TREE_REAL_CST (arg1); + tree op = NULL_TREE; + + if (sqrtfn) + { + /* Optimize pow (x, 0.5) into sqrt. */ + if (REAL_VALUES_EQUAL (c, dconsthalf)) + op = build_call_nofold_loc (loc, sqrtfn, 1, arg0); + + else + { + REAL_VALUE_TYPE dconst1_4 = dconst1; + REAL_VALUE_TYPE dconst3_4; + SET_REAL_EXP (&dconst1_4, REAL_EXP (&dconst1_4) - 2); + + real_from_integer (&dconst3_4, VOIDmode, 3, 0, 0); + SET_REAL_EXP (&dconst3_4, REAL_EXP (&dconst3_4) - 2); + + /* Optimize pow (x, 0.25) into sqrt (sqrt (x)). Assume on most + machines that a builtin sqrt instruction is smaller than a + call to pow with 0.25, so do this optimization even if + -Os. */ + if (REAL_VALUES_EQUAL (c, dconst1_4)) + { + op = build_call_nofold_loc (loc, sqrtfn, 1, arg0); + op = build_call_nofold_loc (loc, sqrtfn, 1, op); + } + + /* Optimize pow (x, 0.75) = sqrt (x) * sqrt (sqrt (x)) unless we + are optimizing for space. */ + else if (optimize_insn_for_speed_p () + && !TREE_SIDE_EFFECTS (arg0) + && REAL_VALUES_EQUAL (c, dconst3_4)) + { + tree sqrt1 = build_call_expr_loc (loc, sqrtfn, 1, arg0); + tree sqrt2 = builtin_save_expr (sqrt1); + tree sqrt3 = build_call_expr_loc (loc, sqrtfn, 1, sqrt1); + op = fold_build2_loc (loc, MULT_EXPR, type, sqrt2, sqrt3); + } + } + } + + /* Check whether we can do cbrt insstead of pow (x, 1./3.) and + cbrt/sqrts instead of pow (x, 1./6.). */ + if (cbrtfn && ! op + && (tree_expr_nonnegative_p (arg0) || !HONOR_NANS (mode))) + { + /* First try 1/3. */ + REAL_VALUE_TYPE dconst1_3 + = real_value_truncate (mode, dconst_third ()); + + if (REAL_VALUES_EQUAL (c, dconst1_3)) + op = build_call_nofold_loc (loc, cbrtfn, 1, arg0); + + /* Now try 1/6. */ + else if (optimize_insn_for_speed_p ()) + { + REAL_VALUE_TYPE dconst1_6 = dconst1_3; + SET_REAL_EXP (&dconst1_6, REAL_EXP (&dconst1_6) - 1); + + if (REAL_VALUES_EQUAL (c, dconst1_6)) + { + op = build_call_nofold_loc (loc, sqrtfn, 1, arg0); + op = build_call_nofold_loc (loc, cbrtfn, 1, op); + } + } + } + + if (op) + return expand_expr (op, subtarget, mode, EXPAND_NORMAL); + } + + return NULL_RTX; +} + /* Expand a call to the pow built-in mathematical function. Return NULL_RTX if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin @@ -3016,6 +3106,13 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget) } } + /* Check whether we can do a series of sqrt or cbrt's instead of the pow + call. */ + op = expand_builtin_pow_root (EXPR_LOCATION (exp), arg0, arg1, type, + subtarget); + if (op) + return op; + /* Try if the exponent is a third of an integer. In this case we can expand to x**(n/3) * cbrt(x)**(n%3). As cbrt (x) is different from pow (x, 1./3.) due to rounding and behavior diff --git a/gcc/c-common.c b/gcc/c-common.c index afa8d423be9..bc075ad3d13 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3809,12 +3809,18 @@ pointer_int_sum (location_t loc, enum tree_code resultcode, TYPE_UNSIGNED (sizetype)), intop); /* Replace the integer argument with a suitable product by the object size. - Do this multiplication as signed, then convert to the appropriate - type for the pointer operation. */ - intop = convert (sizetype, - build_binary_op (loc, - MULT_EXPR, intop, - convert (TREE_TYPE (intop), size_exp), 1)); + Do this multiplication as signed, then convert to the appropriate type + for the pointer operation and disregard an overflow that occured only + because of the sign-extension change in the latter conversion. */ + { + tree t = build_binary_op (loc, + MULT_EXPR, intop, + convert (TREE_TYPE (intop), size_exp), 1); + intop = convert (sizetype, t); + if (TREE_OVERFLOW_P (intop) && !TREE_OVERFLOW (t)) + intop = build_int_cst_wide (TREE_TYPE (intop), TREE_INT_CST_LOW (intop), + TREE_INT_CST_HIGH (intop)); + } /* Create the sum or difference. */ if (resultcode == MINUS_EXPR) @@ -5806,6 +5812,17 @@ c_init_attributes (void) #undef DEF_ATTR_TREE_LIST } +/* Returns TRUE iff the attribute indicated by ATTR_ID takes a plain + identifier as an argument, so the front end shouldn't look it up. */ + +bool +attribute_takes_identifier_p (tree attr_id) +{ + return (is_attribute_p ("mode", attr_id) + || is_attribute_p ("format", attr_id) + || is_attribute_p ("cleanup", attr_id)); +} + /* Attribute handlers common to C front ends. */ /* Handle a "packed" attribute; arguments as in diff --git a/gcc/c-common.h b/gcc/c-common.h index 6f8d832d455..6ed38490cb6 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -822,6 +822,7 @@ extern void check_function_format (tree, int, tree *); extern void set_Wformat (int); extern tree handle_format_attribute (tree *, tree, tree, int, bool *); extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *); +extern bool attribute_takes_identifier_p (tree); extern int c_common_handle_option (size_t code, const char *arg, int value); extern bool c_common_missing_argument (const char *opt, size_t code); extern tree c_common_type_for_mode (enum machine_mode, int); diff --git a/gcc/c-pch.c b/gcc/c-pch.c index 8433f8633dd..951ab1fc303 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see #include "hosthooks.h" #include "target.h" #include "opts.h" +#include "timevar.h" /* This is a list of flag variables that must match exactly, and their names for the error message. The possible values for *flag_var must @@ -178,6 +179,8 @@ c_common_write_pch (void) long written; struct c_pch_header h; + timevar_push (TV_PCH_SAVE); + (*debug_hooks->handle_pch) (1); cpp_write_pch_deps (parse_in, pch_outfile); @@ -211,13 +214,18 @@ c_common_write_pch (void) fatal_error ("can%'t seek in %s: %m", asm_file_name); gt_pch_save (pch_outfile); + + timevar_push (TV_PCH_CPP_SAVE); cpp_write_pch_state (parse_in, pch_outfile); + timevar_pop (TV_PCH_CPP_SAVE); if (fseek (pch_outfile, 0, SEEK_SET) != 0 || fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1) fatal_error ("can%'t write %s: %m", pch_file); fclose (pch_outfile); + + timevar_pop (TV_PCH_SAVE); } /* Check the PCH file called NAME, open on FD, to see if it can be @@ -371,12 +379,14 @@ c_common_read_pch (cpp_reader *pfile, const char *name, expanded_location saved_loc; bool saved_trace_includes; + timevar_push (TV_PCH_RESTORE); + f = fdopen (fd, "rb"); if (f == NULL) { cpp_errno (pfile, CPP_DL_ERROR, "calling fdopen"); close (fd); - return; + goto end; } cpp_get_callbacks (parse_in)->valid_pch = NULL; @@ -385,7 +395,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, { cpp_errno (pfile, CPP_DL_ERROR, "reading"); fclose (f); - return; + goto end; } if (!flag_preprocess_only) @@ -417,15 +427,21 @@ c_common_read_pch (cpp_reader *pfile, const char *name, saved_loc = expand_location (line_table->highest_line); saved_trace_includes = line_table->trace_includes; + timevar_push (TV_PCH_CPP_RESTORE); cpp_prepare_state (pfile, &smd); + timevar_pop (TV_PCH_CPP_RESTORE); gt_pch_restore (f); + timevar_push (TV_PCH_CPP_RESTORE); if (cpp_read_state (pfile, name, f, smd) != 0) { fclose (f); - return; + timevar_pop (TV_PCH_CPP_RESTORE); + goto end; } + timevar_pop (TV_PCH_CPP_RESTORE); + fclose (f); @@ -437,6 +453,9 @@ c_common_read_pch (cpp_reader *pfile, const char *name, been loaded. */ if (lang_post_pch_load) (*lang_post_pch_load) (); + +end: + timevar_pop (TV_PCH_RESTORE); } /* Indicate that no more PCH files should be read. */ diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 01b165a701a..dc6c245b950 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -68,7 +68,6 @@ static bool crossjumps_occured; static bool try_crossjump_to_edge (int, edge, edge); static bool try_crossjump_bb (int, basic_block); static bool outgoing_edges_match (int, basic_block, basic_block); -static int flow_find_cross_jump (int, basic_block, basic_block, rtx *, rtx *); static bool old_insns_match_p (int, rtx, rtx); static void merge_blocks_move_predecessor_nojumps (basic_block, basic_block); @@ -972,13 +971,27 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2) be filled that clobbers a parameter expected by the subroutine. ??? We take the simple route for now and assume that if they're - equal, they were constructed identically. */ + equal, they were constructed identically. - if (CALL_P (i1) - && (!rtx_equal_p (CALL_INSN_FUNCTION_USAGE (i1), + Also check for identical exception regions. */ + + if (CALL_P (i1)) + { + /* Ensure the same EH region. */ + rtx n1 = find_reg_note (i1, REG_EH_REGION, 0); + rtx n2 = find_reg_note (i2, REG_EH_REGION, 0); + + if (!n1 && n2) + return false; + + if (n1 && (!n2 || XEXP (n1, 0) != XEXP (n2, 0))) + return false; + + if (!rtx_equal_p (CALL_INSN_FUNCTION_USAGE (i1), CALL_INSN_FUNCTION_USAGE (i2)) - || SIBLING_CALL_P (i1) != SIBLING_CALL_P (i2))) - return false; + || SIBLING_CALL_P (i1) != SIBLING_CALL_P (i2)) + return false; + } #ifdef STACK_REGS /* If cross_jump_death_matters is not 0, the insn's mode @@ -1017,6 +1030,29 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2) return false; } +/* When comparing insns I1 and I2 in flow_find_cross_jump or + flow_find_head_matching_sequence, ensure the notes match. */ + +static void +merge_notes (rtx i1, rtx i2) +{ + /* If the merged insns have different REG_EQUAL notes, then + remove them. */ + rtx equiv1 = find_reg_equal_equiv_note (i1); + rtx equiv2 = find_reg_equal_equiv_note (i2); + + if (equiv1 && !equiv2) + remove_note (i1, equiv1); + else if (!equiv1 && equiv2) + remove_note (i2, equiv2); + else if (equiv1 && equiv2 + && !rtx_equal_p (XEXP (equiv1, 0), XEXP (equiv2, 0))) + { + remove_note (i1, equiv1); + remove_note (i2, equiv2); + } +} + /* Look through the insns at the end of BB1 and BB2 and find the longest sequence that are equivalent. Store the first insns for that sequence in *F1 and *F2 and return the sequence length. @@ -1024,9 +1060,8 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2) To simplify callers of this function, if the blocks match exactly, store the head of the blocks in *F1 and *F2. */ -static int -flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, - basic_block bb2, rtx *f1, rtx *f2) +int +flow_find_cross_jump (basic_block bb1, basic_block bb2, rtx *f1, rtx *f2) { rtx i1, i2, last1, last2, afterlast1, afterlast2; int ninsns = 0; @@ -1066,7 +1101,7 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, if (i1 == BB_HEAD (bb1) || i2 == BB_HEAD (bb2)) break; - if (!old_insns_match_p (mode, i1, i2)) + if (!old_insns_match_p (0, i1, i2)) break; merge_memattrs (i1, i2); @@ -1074,21 +1109,7 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, /* Don't begin a cross-jump with a NOTE insn. */ if (INSN_P (i1)) { - /* If the merged insns have different REG_EQUAL notes, then - remove them. */ - rtx equiv1 = find_reg_equal_equiv_note (i1); - rtx equiv2 = find_reg_equal_equiv_note (i2); - - if (equiv1 && !equiv2) - remove_note (i1, equiv1); - else if (!equiv1 && equiv2) - remove_note (i2, equiv2); - else if (equiv1 && equiv2 - && !rtx_equal_p (XEXP (equiv1, 0), XEXP (equiv2, 0))) - { - remove_note (i1, equiv1); - remove_note (i2, equiv2); - } + merge_notes (i1, i2); afterlast1 = last1, afterlast2 = last2; last1 = i1, last2 = i2; @@ -1130,6 +1151,97 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, return ninsns; } +/* Like flow_find_cross_jump, except start looking for a matching sequence from + the head of the two blocks. Do not include jumps at the end. + If STOP_AFTER is nonzero, stop after finding that many matching + instructions. */ + +int +flow_find_head_matching_sequence (basic_block bb1, basic_block bb2, rtx *f1, + rtx *f2, int stop_after) +{ + rtx i1, i2, last1, last2, beforelast1, beforelast2; + int ninsns = 0; + edge e; + edge_iterator ei; + int nehedges1 = 0, nehedges2 = 0; + + FOR_EACH_EDGE (e, ei, bb1->succs) + if (e->flags & EDGE_EH) + nehedges1++; + FOR_EACH_EDGE (e, ei, bb2->succs) + if (e->flags & EDGE_EH) + nehedges2++; + + i1 = BB_HEAD (bb1); + i2 = BB_HEAD (bb2); + last1 = beforelast1 = last2 = beforelast2 = NULL_RTX; + + while (true) + { + + /* Ignore notes. */ + while (!NONDEBUG_INSN_P (i1) && i1 != BB_END (bb1)) + i1 = NEXT_INSN (i1); + + while (!NONDEBUG_INSN_P (i2) && i2 != BB_END (bb2)) + i2 = NEXT_INSN (i2); + + if (NOTE_P (i1) || NOTE_P (i2) + || JUMP_P (i1) || JUMP_P (i2)) + break; + + /* A sanity check to make sure we're not merging insns with different + effects on EH. If only one of them ends a basic block, it shouldn't + have an EH edge; if both end a basic block, there should be the same + number of EH edges. */ + if ((i1 == BB_END (bb1) && i2 != BB_END (bb2) + && nehedges1 > 0) + || (i2 == BB_END (bb2) && i1 != BB_END (bb1) + && nehedges2 > 0) + || (i1 == BB_END (bb1) && i2 == BB_END (bb2) + && nehedges1 != nehedges2)) + break; + + if (!old_insns_match_p (0, i1, i2)) + break; + + merge_memattrs (i1, i2); + + /* Don't begin a cross-jump with a NOTE insn. */ + if (INSN_P (i1)) + { + merge_notes (i1, i2); + + beforelast1 = last1, beforelast2 = last2; + last1 = i1, last2 = i2; + ninsns++; + } + + if (i1 == BB_END (bb1) || i2 == BB_END (bb2) + || (stop_after > 0 && ninsns == stop_after)) + break; + + i1 = NEXT_INSN (i1); + i2 = NEXT_INSN (i2); + } + +#ifdef HAVE_cc0 + /* Don't allow a compare to be shared by cross-jumping unless the insn + after the compare is also shared. */ + if (ninsns && reg_mentioned_p (cc0_rtx, last1) && sets_cc0_p (last1)) + last1 = beforelast1, last2 = beforelast2, ninsns--; +#endif + + if (ninsns) + { + *f1 = last1; + *f2 = last2; + } + + return ninsns; +} + /* Return true iff outgoing edges of BB1 and BB2 match, together with the branch instruction. This means that if we commonize the control flow before end of the basic block, the semantic remains unchanged. @@ -1498,7 +1610,7 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) return false; /* ... and part the second. */ - nmatch = flow_find_cross_jump (mode, src1, src2, &newpos1, &newpos2); + nmatch = flow_find_cross_jump (src1, src2, &newpos1, &newpos2); /* Don't proceed with the crossjump unless we found a sufficient number of matching instructions or the 'from' block was totally matched diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 7bc6609a74f..48173d9b992 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -500,12 +500,12 @@ update_alias_info_with_stack_vars (void) for (j = i; j != EOC; j = stack_vars[j].next) { tree decl = stack_vars[j].decl; - unsigned int uid = DECL_UID (decl); + unsigned int uid = DECL_PT_UID (decl); /* We should never end up partitioning SSA names (though they may end up on the stack). Neither should we allocate stack space to something that is unused and thus unreferenced. */ gcc_assert (DECL_P (decl) - && referenced_var_lookup (uid)); + && referenced_var_lookup (DECL_UID (decl))); bitmap_set_bit (part, uid); *((bitmap *) pointer_map_insert (decls_to_partitions, (void *)(size_t) uid)) = part; @@ -515,7 +515,7 @@ update_alias_info_with_stack_vars (void) /* Make the SSA name point to all partition members. */ pi = get_ptr_info (name); - pt_solution_set (&pi->pt, part); + pt_solution_set (&pi->pt, part, false, false); } /* Make all points-to sets that contain one member of a partition @@ -3764,10 +3764,12 @@ gimple_expand_cfg (void) { if (cfun->calls_alloca) warning (OPT_Wstack_protector, - "not protecting local variables: variable length buffer"); + "stack protector not protecting local variables: " + "variable length buffer"); if (has_short_buffer && !crtl->stack_protect_guard) warning (OPT_Wstack_protector, - "not protecting function: no buffer at least %d bytes long", + "stack protector not protecting function: " + "all local arrays are less than %d bytes long", (int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE)); } diff --git a/gcc/common.opt b/gcc/common.opt index d5f00a0bd9a..6e9e6965f22 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1539,6 +1539,10 @@ gxcoff+ Common JoinedOrMissing Negative(gcoff) Generate debug information in extended XCOFF format +iplugindir= +Common Joined Var(plugindir_string) Init(0) +-iplugindir= Set to be the default plugin directory + o Common Joined Separate -o Place output into diff --git a/gcc/config.build b/gcc/config.build index 0ed87546d80..6c837c3c32f 100644 --- a/gcc/config.build +++ b/gcc/config.build @@ -1,5 +1,5 @@ # GCC build-specific configuration file. -# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2009 +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. #This file is part of GCC. @@ -51,11 +51,6 @@ build_file_translate= # System-specific settings. case $build in - alpha*-dec-osf4*) - # Some versions of OSF4 (specifically X4.0-9 296.7) have - # a broken tar, so we use cpio instead. - build_install_headers_dir=install-headers-cpio - ;; alpha64-dec-*vms*) build_xm_file="vms/xm-vms.h vms/xm-vms64.h" build_exeext=.exe diff --git a/gcc/config.gcc b/gcc/config.gcc index 119bf0ac645..88631ff66e6 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -207,11 +207,8 @@ md_file= # Obsolete configurations. case ${target} in - alpha*-dec-osf4* \ - | alpha*-dec-osf5.0* \ - | mips-sgi-irix5* \ + mips-sgi-irix5* \ | mips-sgi-irix6.[0-4]* \ - | *-*-solaris2.7* \ ) if test "x$enable_obsolete" != xyes; then echo "*** Configuration ${target} is obsolete." >&2 @@ -238,8 +235,8 @@ case ${target} in | *-*-linux*oldld* \ | *-*-rtemsaout* \ | *-*-rtemscoff* \ - | *-*-solaris2.[0-6] \ - | *-*-solaris2.[0-6].* \ + | *-*-solaris2.[0-7] \ + | *-*-solaris2.[0-7].* \ | *-*-sysv* \ | vax-*-vms* \ ) @@ -651,7 +648,7 @@ alpha*-*-openbsd*) target_cpu_default="MASK_GAS" tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee" ;; -alpha*-dec-osf[45]*) +alpha*-dec-osf5.1*) if test x$stabs = xyes then tm_file="${tm_file} dbx.h" @@ -661,23 +658,11 @@ alpha*-dec-osf[45]*) extra_passes="mips-tfile mips-tdump" fi use_collect2=yes - tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-crtfm alpha/t-osf4" - tm_file="${tm_file} alpha/osf.h" + tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-crtfm alpha/t-osf5" + tm_file="${tm_file} alpha/osf5.h" + tm_defines="${tm_defines} TARGET_SUPPORT_ARCH=1" extra_headers=va_list.h use_gcc_stdint=provide - case ${target} in - *-*-osf4*) - # Define TARGET_SUPPORT_ARCH except on 4.0a. - case ${target} in - *-*-osf4.0a) ;; - *) tm_defines="${tm_defines} TARGET_SUPPORT_ARCH=1" - esac - ;; - *-*-osf5*) - tm_file="${tm_file} alpha/osf5.h" - tm_defines="${tm_defines} TARGET_SUPPORT_ARCH=1" - ;; - esac case ${enable_threads} in "" | yes | posix) thread_file='posix' @@ -3411,7 +3396,9 @@ case ${target} in i[34567]86-*-darwin* | x86_64-*-darwin*) tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp" ;; - i[34567]86-*-linux* | x86_64-*-linux* | i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu) + i[34567]86-*-linux* | x86_64-*-linux* | \ + i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ + i[34567]86-*-gnu*) tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp i386/t-linux" ;; i[34567]86-*-solaris2*) diff --git a/gcc/config.in b/gcc/config.in index a9e208fa4eb..9525625630f 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -814,6 +814,24 @@ #endif +/* Define to 1 if you have the `elf_getshdrstrndx' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_ELF_GETSHDRSTRNDX +#endif + + +/* Define to 1 if you have the `elf_getshstrndx' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_ELF_GETSHSTRNDX +#endif + + +/* Define if elf_getshstrndx has gABI conformant return values. */ +#ifndef USED_FOR_TARGET +#undef HAVE_ELF_GETSHSTRNDX_GABI +#endif + + /* Define to 1 if you have the header file. */ #ifndef USED_FOR_TARGET #undef HAVE_FCNTL_H diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 3eaed6afa3b..a123b117b40 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -4732,7 +4732,7 @@ alpha_split_lock_test_and_set_12 (enum machine_mode mode, rtx dest, rtx addr, static int alpha_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) { - enum attr_type insn_type, dep_insn_type; + enum attr_type dep_insn_type; /* If the dependence is an anti-dependence, there is no cost. For an output dependence, there is sometimes a cost, but it doesn't seem @@ -4744,7 +4744,6 @@ alpha_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0) return cost; - insn_type = get_attr_type (insn); dep_insn_type = get_attr_type (dep_insn); /* Bring in the user-defined memory latency. */ @@ -5855,7 +5854,7 @@ rtx function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, enum machine_mode mode) { - unsigned int regnum, dummy; + unsigned int regnum, dummy ATTRIBUTE_UNUSED; enum mode_class mclass; gcc_assert (!valtype || !alpha_return_in_memory (valtype, func)); diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf5.h similarity index 81% rename from gcc/config/alpha/osf.h rename to gcc/config/alpha/osf5.h index a384cc870f3..406eda4c4f3 100644 --- a/gcc/config/alpha/osf.h +++ b/gcc/config/alpha/osf5.h @@ -1,6 +1,8 @@ -/* Definitions of target machine for GNU compiler, for DEC Alpha on OSF/1. - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003, - 2004, 2007, 2009 Free Software Foundation, Inc. +/* Definitions of target machine for GNU compiler, for DEC Alpha on + Tru64 UNIX V5.1. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, + 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 + Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) This file is part of GCC. @@ -19,7 +21,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -/* As of OSF 4.0, as can subtract adjacent labels. */ +/* As of DEC OSF/1 V4.0, as can subtract adjacent labels. */ #undef TARGET_AS_CAN_SUBTRACT_LABELS #define TARGET_AS_CAN_SUBTRACT_LABELS 1 @@ -29,6 +31,20 @@ along with GCC; see the file COPYING3. If not see #undef TARGET_HAS_XFLOATING_LIBS #define TARGET_HAS_XFLOATING_LIBS 1 +/* Tru64 UNIX V5.1 uses IEEE QUAD format. */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_FPREGS | MASK_LONG_DOUBLE_128) + +/* The linker appears to perform invalid code optimizations that result + in the ldgp emitted for the exception_receiver pattern being incorrectly + linked. */ +#undef TARGET_LD_BUGGY_LDGP +#define TARGET_LD_BUGGY_LDGP 1 + +/* Tru64 UNIX V5.1 has the float and long double forms of math functions. */ +#undef TARGET_C99_FUNCTIONS +#define TARGET_C99_FUNCTIONS 1 + /* Names to predefine in the preprocessor for this target machine. */ #define TARGET_OS_CPP_BUILTINS() \ @@ -64,7 +80,8 @@ along with GCC; see the file COPYING3. If not see #define CPP_SPEC \ "%{pthread|threads:-D_REENTRANT} %{threads:-D_PTHREAD_USE_D4}" -/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */ +/* Under DEC OSF/1 V4, -p and -pg require -lprof1, and -lprof1 requires + -lpdf. */ #define LIB_SPEC \ "%{p|pg:-lprof1%{pthread|threads:_r} -lpdf} %{a:-lprof2} \ @@ -89,9 +106,20 @@ along with GCC; see the file COPYING3. If not see #define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/" -/* Tru64 UNIX V5.1 requires a special as flag. Empty by default. */ +/* In Tru64 UNIX V5.1, Compaq introduced a new assembler + (/usr/lib/cmplrs/cc/adu) which currently (versions between 3.04.29 and + 3.04.32) breaks mips-tfile. Passing the undocumented -oldas flag reverts + to using the old assembler (/usr/lib/cmplrs/cc/as[01]). + + It is clearly not desirable to depend on this undocumented flag, and + Compaq wants -oldas to go away soon, but until they have released a + new adu that works with mips-tfile, this is the only option. -#define ASM_OLDAS_SPEC "" + In some versions of the DTK, the assembler driver invokes ld after + assembly. This has been fixed in current versions, but adding -c + works as expected for all versions. */ + +#define ASM_OLDAS_SPEC "-oldas -c" /* In OSF/1 v3.2c, the assembler by default does not output file names which causes mips-tfile to fail. Passing -g to the assembler fixes this problem. @@ -102,9 +130,9 @@ along with GCC; see the file COPYING3. If not see optimization are broken and don't help us anyway. Pass -nocpp because there's no point in running CPP on our assembler output. */ #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0 -#define ASM_SPEC "%{malpha-as:-g %(asm_oldas) -nocpp %{pg} -O0}" +#define ASM_SPEC "%{malpha-as:-g " ASM_OLDAS_SPEC " -nocpp %{pg} -O0}" #else -#define ASM_SPEC "%{!mgas:-g %(asm_oldas) -nocpp %{pg} -O0}" +#define ASM_SPEC "%{!mgas:-g " ASM_OLDAS_SPEC " -nocpp %{pg} -O0}" #endif /* Specify to run a post-processor, mips-tfile after the assembler @@ -133,9 +161,6 @@ along with GCC; see the file COPYING3. If not see #endif -#undef EXTRA_SPECS -#define EXTRA_SPECS { "asm_oldas", ASM_OLDAS_SPEC } - /* Indicate that we have a stamp.h to use. */ #ifndef CROSS_DIRECTORY_STRUCTURE #define HAVE_STAMP_H 1 @@ -232,9 +257,12 @@ __enable_execute_stack (void *addr) \ #define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, 0) +/* The native assembler doesn't understand parenthesis. */ +#define TARGET_ASM_OPEN_PAREN "" +#define TARGET_ASM_CLOSE_PAREN "" + /* Handle #pragma weak and #pragma pack. */ #define HANDLE_SYSV_PRAGMA 1 -/* Handle #pragma extern_prefix. Technically only needed for Tru64 5.x, - but easier to manipulate preprocessor bits from here. */ +/* Handle #pragma extern_prefix. */ #define TARGET_HANDLE_PRAGMA_EXTERN_PREFIX 1 diff --git a/gcc/config/alpha/t-osf4 b/gcc/config/alpha/t-osf5 similarity index 100% rename from gcc/config/alpha/t-osf4 rename to gcc/config/alpha/t-osf5 diff --git a/gcc/config/arm/arm-generic.md b/gcc/config/arm/arm-generic.md index 5f0916a1827..cb553a06486 100644 --- a/gcc/config/arm/arm-generic.md +++ b/gcc/config/arm/arm-generic.md @@ -104,14 +104,14 @@ (and (eq_attr "generic_sched" "yes") (and (eq_attr "ldsched" "yes") (and (eq_attr "type" "load_byte,load1") - (eq_attr "is_xscale" "yes")))) + (eq_attr "tune" "xscale,iwmmxt,iwmmxt2")))) "core") (define_insn_reservation "load_ldsched" 2 (and (eq_attr "generic_sched" "yes") (and (eq_attr "ldsched" "yes") (and (eq_attr "type" "load_byte,load1") - (eq_attr "is_xscale" "no")))) + (eq_attr "tune" "!xscale,iwmmxt,iwmmxt2")))) "core") (define_insn_reservation "load_or_store" 2 @@ -128,14 +128,16 @@ (define_insn_reservation "mult_ldsched_strongarm" 3 (and (eq_attr "generic_sched" "yes") (and (eq_attr "ldsched" "yes") - (and (eq_attr "is_strongarm" "yes") + (and (eq_attr "tune" + "strongarm,strongarm110,strongarm1100,strongarm1110") (eq_attr "type" "mult")))) "core*2") (define_insn_reservation "mult_ldsched" 4 (and (eq_attr "generic_sched" "yes") (and (eq_attr "ldsched" "yes") - (and (eq_attr "is_strongarm" "no") + (and (eq_attr "tune" + "!strongarm,strongarm110,strongarm1100,strongarm1110") (eq_attr "type" "mult")))) "core*4") diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 4d6d51b204f..5a42a259df5 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -213,4 +213,16 @@ extern const char *arm_mangle_type (const_tree); extern void arm_order_regs_for_local_alloc (void); +#ifdef RTX_CODE +/* This needs to be here because we need RTX_CODE and similar. */ + +struct tune_params +{ + bool (*rtx_costs) (rtx, RTX_CODE, RTX_CODE, int *, bool); + int constant_limit; +}; + +extern const struct tune_params *current_tune; +#endif /* RTX_CODE */ + #endif /* ! GCC_ARM_PROTOS_H */ diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 1a555b8706b..8d21b8782f0 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -526,6 +526,9 @@ int making_const_table; /* The processor for which instructions should be scheduled. */ enum processor_type arm_tune = arm_none; +/* The current tuning set. */ +const struct tune_params *current_tune; + /* The default processor used if not overridden by commandline. */ static enum processor_type arm_default_cpu = arm_none; @@ -698,9 +701,6 @@ unsigned arm_pic_register = INVALID_REGNUM; the next function. */ static int after_arm_reorg = 0; -/* The maximum number of insns to be used when loading a constant. */ -static int arm_constant_limit = 3; - static enum arm_pcs arm_pcs_default; /* For an explanation of these variables, see final_prescan_insn below. */ @@ -739,7 +739,31 @@ struct processors enum processor_type core; const char *arch; const unsigned long flags; - bool (* rtx_costs) (rtx, enum rtx_code, enum rtx_code, int *, bool); + const struct tune_params *const tune; +}; + +const struct tune_params arm_slowmul_tune = +{ + arm_slowmul_rtx_costs, + 3 +}; + +const struct tune_params arm_fastmul_tune = +{ + arm_fastmul_rtx_costs, + 1 +}; + +const struct tune_params arm_xscale_tune = +{ + arm_xscale_rtx_costs, + 2 +}; + +const struct tune_params arm_9e_tune = +{ + arm_9e_rtx_costs, + 1 }; /* Not all of these give usefully different compilation alternatives, @@ -748,7 +772,7 @@ static const struct processors all_cores[] = { /* ARM Cores */ #define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ - {NAME, arm_none, #ARCH, FLAGS | FL_FOR_ARCH##ARCH, arm_##COSTS##_rtx_costs}, + {NAME, arm_none, #ARCH, FLAGS | FL_FOR_ARCH##ARCH, &arm_##COSTS##_tune}, #include "arm-cores.def" #undef ARM_CORE {NULL, arm_none, NULL, 0, NULL} @@ -757,7 +781,7 @@ static const struct processors all_cores[] = static const struct processors all_architectures[] = { /* ARM Architectures */ - /* We don't specify rtx_costs here as it will be figured out + /* We don't specify tuning costs here as it will be figured out from the core. */ {"armv2", arm2, "2", FL_CO_PROC | FL_MODE26 | FL_FOR_ARCH2, NULL}, @@ -906,6 +930,13 @@ enum tls_reloc { TLS_LE32 }; +/* The maximum number of insns to be used when loading a constant. */ +inline static int +arm_constant_limit (bool size_p) +{ + return size_p ? 1 : current_tune->constant_limit; +} + /* Emit an insn that's a simple single-set. Both the operands must be known to be valid. */ inline static rtx @@ -1446,6 +1477,7 @@ arm_override_options (void) gcc_assert (arm_tune != arm_none); tune_flags = all_cores[(int)arm_tune].flags; + current_tune = all_cores[(int)arm_tune].tune; if (target_fp16_format_name) { @@ -1842,26 +1874,12 @@ arm_override_options (void) if (optimize_size) { - arm_constant_limit = 1; - /* If optimizing for size, bump the number of instructions that we are prepared to conditionally execute (even on a StrongARM). */ max_insns_skipped = 6; } else { - /* For processors with load scheduling, it never costs more than - 2 cycles to load a constant, and the load scheduler may well - reduce that to 1. */ - if (arm_ld_sched) - arm_constant_limit = 1; - - /* On XScale the longer latency of a load makes it more difficult - to achieve a good schedule, so it's faster to synthesize - constants that can be done in two insns. */ - if (arm_tune_xscale) - arm_constant_limit = 2; - /* StrongARM has early execution of branches, so a sequence that is worth skipping is shorter. */ if (arm_tune_strongarm) @@ -2362,7 +2380,8 @@ arm_split_constant (enum rtx_code code, enum machine_mode mode, rtx insn, && !cond && (arm_gen_constant (code, mode, NULL_RTX, val, target, source, 1, 0) - > arm_constant_limit + (code != SET))) + > (arm_constant_limit (optimize_function_for_size_p (cfun)) + + (code != SET)))) { if (code == SET) { @@ -2522,7 +2541,6 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond, int can_negate = 0; int final_invert = 0; int can_negate_initial = 0; - int can_shift = 0; int i; int num_bits_set = 0; int set_sign_bit_copies = 0; @@ -2541,7 +2559,6 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond, { case SET: can_invert = 1; - can_shift = 1; can_negate = 1; break; @@ -6340,7 +6357,6 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed) enum rtx_code subcode; rtx operand; enum rtx_code code = GET_CODE (x); - int extra_cost; *total = 0; switch (code) @@ -6564,7 +6580,6 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed) /* Fall through */ case AND: case XOR: case IOR: - extra_cost = 0; /* Normally the frame registers will be spilt into reg+const during reload, so it is a bad idea to combine them with other instructions, @@ -7298,9 +7313,9 @@ arm_rtx_costs (rtx x, int code, int outer_code, int *total, return arm_size_rtx_costs (x, (enum rtx_code) code, (enum rtx_code) outer_code, total); else - return all_cores[(int)arm_tune].rtx_costs (x, (enum rtx_code) code, - (enum rtx_code) outer_code, - total, speed); + return current_tune->rtx_costs (x, (enum rtx_code) code, + (enum rtx_code) outer_code, + total, speed); } /* RTX costs for cores with a slow MUL implementation. Thumb-2 is not @@ -7445,7 +7460,8 @@ arm_fastmul_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, so it can be ignored. */ static bool -arm_xscale_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, int *total, bool speed) +arm_xscale_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, + int *total, bool speed) { enum machine_mode mode = GET_MODE (x); @@ -21121,7 +21137,7 @@ arm_unwind_emit_set (FILE * asm_out_file, rtx p) offset = INTVAL (XEXP (e1, 1)); asm_fprintf (asm_out_file, "\t.setfp %r, %r, #%wd\n", HARD_FRAME_POINTER_REGNUM, reg, - INTVAL (XEXP (e1, 1))); + offset); } else if (GET_CODE (e1) == REG) { @@ -21411,12 +21427,9 @@ const char * thumb1_output_casesi (rtx *operands) { rtx diff_vec = PATTERN (next_real_insn (operands[0])); - addr_diff_vec_flags flags; gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC); - flags = ADDR_DIFF_VEC_FLAGS (diff_vec); - switch (GET_MODE(diff_vec)) { case QImode: diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 26ffaf8dff8..ca430e94dd0 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -771,12 +771,11 @@ extern int arm_structure_size_boundary; fixed_regs[regno] = call_used_regs[regno] = 1; \ } \ \ - if (TARGET_THUMB && optimize_size) \ - { \ - /* When optimizing for size, it's better not to use \ - the HI regs, because of the overhead of stacking \ - them. */ \ - /* ??? Is this still true for thumb2? */ \ + if (TARGET_THUMB1 && optimize_size) \ + { \ + /* When optimizing for size on Thumb-1, it's better not \ + to use the HI regs, because of the overhead of \ + stacking them. */ \ for (regno = FIRST_HI_REGNUM; \ regno <= LAST_HI_REGNUM; ++regno) \ fixed_regs[regno] = call_used_regs[regno] = 1; \ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index c5e2a16e694..2d5003bcfee 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -148,13 +148,6 @@ ; patterns that share the same RTL in both ARM and Thumb code. (define_attr "is_thumb" "no,yes" (const (symbol_ref "thumb_code"))) -; IS_STRONGARM is set to 'yes' when compiling for StrongARM, it affects -; scheduling decisions for the load unit and the multiplier. -(define_attr "is_strongarm" "no,yes" (const (symbol_ref "arm_tune_strongarm"))) - -; IS_XSCALE is set to 'yes' when compiling for XScale. -(define_attr "is_xscale" "no,yes" (const (symbol_ref "arm_tune_xscale"))) - ;; Operand number of an input operand that is shifted. Zero if the ;; given instruction does not shift one of its input operands. (define_attr "shift" "" (const_int 0)) @@ -6668,6 +6661,30 @@ operands[2] = force_reg (SImode, operands[2]); ") +;; A pattern to recognize a special situation and optimize for it. +;; On the thumb, zero-extension from memory is preferrable to sign-extension +;; due to the available addressing modes. Hence, convert a signed comparison +;; with zero into an unsigned comparison with 127 if possible. +(define_expand "cbranchqi4" + [(set (pc) (if_then_else + (match_operator 0 "lt_ge_comparison_operator" + [(match_operand:QI 1 "memory_operand" "") + (match_operand:QI 2 "const0_operand" "")]) + (label_ref (match_operand 3 "" "")) + (pc)))] + "TARGET_THUMB1" +{ + rtx xops[3]; + xops[1] = gen_reg_rtx (SImode); + emit_insn (gen_zero_extendqisi2 (xops[1], operands[1])); + xops[2] = GEN_INT (127); + xops[0] = gen_rtx_fmt_ee (GET_CODE (operands[0]) == GE ? LEU : GTU, + VOIDmode, xops[1], xops[2]); + xops[3] = operands[3]; + emit_insn (gen_cbranchsi4 (xops[0], xops[1], xops[2], xops[3])); + DONE; +}) + (define_expand "cbranchsf4" [(set (pc) (if_then_else (match_operator 0 "arm_comparison_operator" @@ -6705,7 +6722,7 @@ operands[3])); DONE;" ) -(define_insn "*cbranchsi4_insn" +(define_insn "cbranchsi4_insn" [(set (pc) (if_then_else (match_operator 0 "arm_comparison_operator" [(match_operand:SI 1 "s_register_operand" "l,*h") @@ -6714,7 +6731,20 @@ (pc)))] "TARGET_THUMB1" "* - output_asm_insn (\"cmp\\t%1, %2\", operands); + rtx t = prev_nonnote_insn (insn); + if (t != NULL_RTX + && INSN_P (t) + && INSN_CODE (t) == CODE_FOR_cbranchsi4_insn) + { + t = XEXP (SET_SRC (PATTERN (t)), 0); + if (!rtx_equal_p (XEXP (t, 0), operands[1]) + || !rtx_equal_p (XEXP (t, 1), operands[2])) + t = NULL_RTX; + } + else + t = NULL_RTX; + if (t == NULL_RTX) + output_asm_insn (\"cmp\\t%1, %2\", operands); switch (get_attr_length (insn)) { @@ -7530,15 +7560,15 @@ (if_then_else (match_operator 4 "arm_comparison_operator" [(plus:SI - (match_operand:SI 2 "s_register_operand" "%l,0,*0,1,1,1") - (match_operand:SI 3 "reg_or_int_operand" "lL,IJ,*r,lIJ,lIJ,lIJ")) + (match_operand:SI 2 "s_register_operand" "%l,0,*l,1,1,1") + (match_operand:SI 3 "reg_or_int_operand" "lL,IJ,*l,lIJ,lIJ,lIJ")) (const_int 0)]) (label_ref (match_operand 5 "" "")) (pc))) (set (match_operand:SI 0 "thumb_cbrch_target_operand" "=l,l,*!h,*?h,*?m,*?m") (plus:SI (match_dup 2) (match_dup 3))) - (clobber (match_scratch:SI 1 "=X,X,X,l,&l,&l"))] + (clobber (match_scratch:SI 1 "=X,X,l,l,&l,&l"))] "TARGET_THUMB1 && (GET_CODE (operands[4]) == EQ || GET_CODE (operands[4]) == NE @@ -7548,8 +7578,7 @@ { rtx cond[3]; - - cond[0] = (which_alternative < 3) ? operands[0] : operands[1]; + cond[0] = (which_alternative < 2) ? operands[0] : operands[1]; cond[1] = operands[2]; cond[2] = operands[3]; @@ -7558,7 +7587,7 @@ else output_asm_insn (\"add\\t%0, %1, %2\", cond); - if (which_alternative >= 3 + if (which_alternative >= 2 && which_alternative < 4) output_asm_insn (\"mov\\t%0, %1\", operands); else if (which_alternative >= 4) diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md index d351f443851..a60da9a3271 100644 --- a/gcc/config/arm/predicates.md +++ b/gcc/config/arm/predicates.md @@ -94,6 +94,10 @@ (and (match_code "const_int") (match_test "const_ok_for_arm (~INTVAL (op))"))) +(define_predicate "const0_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 0"))) + ;; Something valid on the RHS of an ARM data-processing instruction (define_predicate "arm_rhs_operand" (ior (match_operand 0 "s_register_operand") @@ -203,6 +207,9 @@ && (TARGET_FPA || TARGET_VFP)") (match_code "unordered,ordered,unlt,unle,unge,ungt")))) +(define_special_predicate "lt_ge_comparison_operator" + (match_code "lt,ge")) + (define_special_predicate "minmax_operator" (and (match_code "smin,smax,umin,umax") (match_test "mode == GET_MODE (op)"))) diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md index 69a5e0683b4..3e2c3daea3b 100644 --- a/gcc/config/arm/thumb2.md +++ b/gcc/config/arm/thumb2.md @@ -223,9 +223,14 @@ (set_attr "neg_pool_range" "*,*,*,0,*")] ) +;; We have two alternatives here for memory loads (and similarly for stores) +;; to reflect the fact that the permissible constant pool ranges differ +;; between ldr instructions taking low regs and ldr instructions taking high +;; regs. The high register alternatives are not taken into account when +;; choosing register preferences in order to reflect their expense. (define_insn "*thumb2_movsi_insn" - [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m") - (match_operand:SI 1 "general_operand" "rk ,I,K,j,mi,rk"))] + [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,l ,*hk,m,*m") + (match_operand:SI 1 "general_operand" "rk ,I,K,j,mi,*mi,l,*hk"))] "TARGET_THUMB2 && ! TARGET_IWMMXT && !(TARGET_HARD_FLOAT && TARGET_VFP) && ( register_operand (operands[0], SImode) @@ -236,11 +241,13 @@ mvn%?\\t%0, #%B1 movw%?\\t%0, %1 ldr%?\\t%0, %1 + ldr%?\\t%0, %1 + str%?\\t%1, %0 str%?\\t%1, %0" - [(set_attr "type" "*,*,*,*,load1,store1") + [(set_attr "type" "*,*,*,*,load1,load1,store1,store1") (set_attr "predicable" "yes") - (set_attr "pool_range" "*,*,*,*,4096,*") - (set_attr "neg_pool_range" "*,*,*,*,0,*")] + (set_attr "pool_range" "*,*,*,*,1020,4096,*,*") + (set_attr "neg_pool_range" "*,*,*,*,0,0,*,*")] ) (define_insn "tls_load_dot_plus_four" diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md index 57c2192d1e9..02d527b79c5 100644 --- a/gcc/config/arm/vfp.md +++ b/gcc/config/arm/vfp.md @@ -86,9 +86,11 @@ (set_attr "neg_pool_range" "*,*,*,*,4084,*,*,*,*,1008,*")] ) +;; See thumb2.md:thumb2_movsi_insn for an explanation of the split +;; high/low register alternatives for loads and stores here. (define_insn "*thumb2_movsi_vfp" - [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m,*t,r, *t,*t, *Uv") - (match_operand:SI 1 "general_operand" "rk, I,K,j,mi,rk,r,*t,*t,*Uvi,*t"))] + [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r, l,*hk,m, *m,*t, r,*t,*t, *Uv") + (match_operand:SI 1 "general_operand" "rk, I,K,j,mi,*mi,l,*hk, r,*t,*t,*Uvi,*t"))] "TARGET_THUMB2 && TARGET_VFP && TARGET_HARD_FLOAT && ( s_register_operand (operands[0], SImode) || s_register_operand (operands[1], SImode))" @@ -102,25 +104,27 @@ case 3: return \"movw%?\\t%0, %1\"; case 4: - return \"ldr%?\\t%0, %1\"; case 5: - return \"str%?\\t%1, %0\"; + return \"ldr%?\\t%0, %1\"; case 6: - return \"fmsr%?\\t%0, %1\\t%@ int\"; case 7: - return \"fmrs%?\\t%0, %1\\t%@ int\"; + return \"str%?\\t%1, %0\"; case 8: + return \"fmsr%?\\t%0, %1\\t%@ int\"; + case 9: + return \"fmrs%?\\t%0, %1\\t%@ int\"; + case 10: return \"fcpys%?\\t%0, %1\\t%@ int\"; - case 9: case 10: + case 11: case 12: return output_move_vfp (operands); default: gcc_unreachable (); } " [(set_attr "predicable" "yes") - (set_attr "type" "*,*,*,*,load1,store1,r_2_f,f_2_r,fcpys,f_load,f_store") - (set_attr "pool_range" "*,*,*,*,4096,*,*,*,*,1020,*") - (set_attr "neg_pool_range" "*,*,*,*, 0,*,*,*,*,1008,*")] + (set_attr "type" "*,*,*,*,load1,load1,store1,store1,r_2_f,f_2_r,fcpys,f_load,f_store") + (set_attr "pool_range" "*,*,*,*,1020,4096,*,*,*,*,*,1020,*") + (set_attr "neg_pool_range" "*,*,*,*, 0, 0,*,*,*,*,*,1008,*")] ) diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index ade1060cad9..e53f3077a7e 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1468,12 +1468,20 @@ print_operand (FILE *file, rtx x, int code) goto def; break; case 'V': - bitint = exact_log2 (INTVAL (x) & 0xff); + bitint = (INTVAL (x) & 0xffff); + if ((exact_log2 ((bitint >> 8) & 0xff)) == -1) + bitint = exact_log2 (bitint & 0xff); + else + bitint = exact_log2 ((bitint >> 8) & 0xff); gcc_assert (bitint >= 0); fprintf (file, "#%d", bitint); break; case 'W': - bitint = exact_log2 ((~INTVAL (x)) & 0xff); + bitint = ((~INTVAL (x)) & 0xffff); + if ((exact_log2 ((bitint >> 8) & 0xff)) == -1 ) + bitint = exact_log2 (bitint & 0xff); + else + bitint = (exact_log2 ((bitint >> 8) & 0xff)); gcc_assert (bitint >= 0); fprintf (file, "#%d", bitint); break; diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 9757afc2de3..f77dfa31407 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -801,15 +801,12 @@ struct cum_arg || SYMBOL_REF_FLAG (XEXP (XEXP (XEXP (OP, 0), 0), 0)))) \ || (GET_CODE (OP) == MEM \ && h8300_eightbit_constant_address_p (XEXP (OP, 0))) \ - || (GET_CODE (OP) == MEM && TARGET_H8300S \ + || (GET_CODE (OP) == MEM && (TARGET_H8300S || TARGET_H8300SX) \ && GET_CODE (XEXP (OP, 0)) == CONST_INT)) /* Multi-letter constraints starting with W are to be used for operands that require a memory operand, i.e,. that are never used - along with register constraints (see EXTRA_MEMORY_CONSTRAINTS). - For operands that require a memory operand (or not) but that always - accept a register, a multi-letter constraint starting with Y should - be used instead. */ + along with register constraints (see EXTRA_MEMORY_CONSTRAINTS). */ #define OK_FOR_WU(OP) \ (GET_CODE (OP) == MEM && OK_FOR_U (OP)) @@ -822,15 +819,25 @@ struct cum_arg ((STR)[1] == 'U' ? 2 \ : 0) -/* We don't have any constraint starting with Y yet, but before - someone uses it for a one-letter constraint and we're left without - any upper-case constraints left, we reserve it for extensions - here. */ -#define OK_FOR_Y(OP, STR) \ - (0) +/* Multi-letter constraints starting with Y are to be used for operands + that are constant immediates and have single 1 or 0 in their binary + representation. */ + +#define OK_FOR_Y2(OP) \ + ((GET_CODE (OP) == CONST_INT) && (exact_log2 (INTVAL (OP) & 0xff) != -1)) + +#define OK_FOR_Y0(OP) \ + ((GET_CODE (OP) == CONST_INT) && (exact_log2 (~INTVAL (OP) & 0xff) != -1)) + +#define OK_FOR_Y(OP, STR) \ + ((STR)[1] == '2' ? OK_FOR_Y2 (OP) \ + : (STR)[1] == '0' ? OK_FOR_Y0 (OP) \ + : 0) #define CONSTRAINT_LEN_FOR_Y(STR) \ - (0) + ((STR)[1] == '2' ? 2 \ + : (STR)[1] == '0' ? 2 \ + : 0) #define OK_FOR_Z(OP) \ (TARGET_H8300SX \ diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 5efe2cb97b4..513ad4c3969 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -222,7 +222,7 @@ (match_operand:QI 1 "general_operand_src" "P4>X,rQi"))] "TARGET_H8300SX" "@ - mov.b %X1,%X0 + mov.b %X1:4,%X0 mov.b %X1,%X0" [(set_attr "length_table" "mov_imm4,movb") (set_attr "cc" "set_znv")]) @@ -300,8 +300,8 @@ "TARGET_H8300SX" "@ sub.w %T0,%T0 - mov.w %T1,%T0 - mov.w %T1,%T0 + mov.w %T1:3,%T0 + mov.w %T1:4,%T0 mov.w %T1,%T0 mov.w %T1,%T0" [(set_attr "length_table" "*,*,mov_imm4,short_immediate,movw") @@ -511,7 +511,7 @@ "TARGET_H8300SX" "@ sub.l %S0,%S0 - mov.l %S1,%S0 + mov.l %S1:3,%S0 mov.l %S1,%S0 mov.l %S1,%S0 clrmac @@ -1143,7 +1143,21 @@ (compare (match_operand:HI 0 "h8300_dst_operand" "rU,rQ") (match_operand:HI 1 "h8300_src_operand" "P3>X,rQi")))] "TARGET_H8300H || TARGET_H8300S" - "cmp.w %T1,%T0" + "* +{ + switch (which_alternative) + { + case 0: + if (!TARGET_H8300SX) + return \"cmp.w %T1,%T0\"; + else + return \"cmp.w %T1:3,%T0\"; + case 1: + return \"cmp.w %T1,%T0\"; + default: + gcc_unreachable (); + } +}" [(set_attr "length_table" "short_immediate,addw") (set_attr "cc" "compare,compare")]) @@ -1152,7 +1166,21 @@ (compare (match_operand:SI 0 "h8300_dst_operand" "r,rQ") (match_operand:SI 1 "h8300_src_operand" "P3>X,rQi")))] "TARGET_H8300H || TARGET_H8300S" - "cmp.l %S1,%S0" + "* +{ + switch (which_alternative) + { + case 0: + if (!TARGET_H8300SX) + return \"cmp.l %S1,%S0\"; + else + return \"cmp.l %S1:3,%S0\"; + case 1: + return \"cmp.l %S1,%S0\"; + default: + gcc_unreachable (); + } +}" [(set_attr "length" "2,*") (set_attr "length_table" "*,addl") (set_attr "cc" "compare,compare")]) @@ -1259,8 +1287,8 @@ (match_operand:HI 2 "h8300_src_operand" "P3>X,P3" ",r"))) (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (, mode, operands)" - "{}\t{%2, %0|%0, %2}" + "{}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "")]) @@ -8782,9 +8797,9 @@ (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (, QImode, operands)" "@ - {b}\t{%2, %0|%0, %2} - {b}\t{%2, %0|%0, %2} - {l}\t{%k2, %k0|%k0, %k2}" + {b}\t{%2, %0|%0, %2} + {b}\t{%2, %0|%0, %2} + {l}\t{%k2, %k0|%k0, %k2}" [(set_attr "type" "alu") (set_attr "mode" "QI,QI,SI")]) @@ -8796,7 +8811,7 @@ (match_operand:SI 2 "general_operand" "g")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (, SImode, operands)" - "{l}\t{%2, %k0|%k0, %2}" + "{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) @@ -8807,7 +8822,7 @@ (match_operand:DI 2 "x86_64_zext_immediate_operand" "Z"))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (, SImode, operands)" - "{l}\t{%2, %k0|%k0, %2}" + "{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) @@ -8818,7 +8833,7 @@ (clobber (reg:CC FLAGS_REG))] "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "{b}\t{%1, %0|%0, %1}" + "{b}\t{%1, %0|%0, %1}" [(set_attr "type" "alu1") (set_attr "mode" "QI")]) @@ -8832,7 +8847,7 @@ (any_or:SWI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCNOmode) && ix86_binary_operator_ok (, mode, operands)" - "{}\t{%2, %0|%0, %2}" + "{}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "")]) @@ -8847,7 +8862,7 @@ (zero_extend:DI (any_or:SI (match_dup 1) (match_dup 2))))] "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode) && ix86_binary_operator_ok (, SImode, operands)" - "{l}\t{%2, %k0|%k0, %2}" + "{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) @@ -8861,7 +8876,7 @@ (any_or:DI (zero_extend:DI (match_dup 1)) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode) && ix86_binary_operator_ok (, SImode, operands)" - "{l}\t{%2, %k0|%k0, %2}" + "{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) @@ -8875,7 +8890,7 @@ "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) && ix86_match_ccmode (insn, CCNOmode) && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "{b}\t{%1, %0|%0, %1}" + "{b}\t{%1, %0|%0, %1}" [(set_attr "type" "alu1") (set_attr "mode" "QI")]) @@ -8888,7 +8903,7 @@ (clobber (match_scratch:SWI 0 "="))] "ix86_match_ccmode (insn, CCNOmode) && ix86_binary_operator_ok (, mode, operands)" - "{}\t{%2, %0|%0, %2}" + "{}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "")]) @@ -8904,7 +8919,7 @@ (match_operand 2 "const_int_operand" "n"))) (clobber (reg:CC FLAGS_REG))] "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)" - "{b}\t{%2, %h0|%h0, %2}" + "{b}\t{%2, %h0|%h0, %2}" [(set_attr "type" "alu") (set_attr "length_immediate" "1") (set_attr "modrm" "1") @@ -8924,7 +8939,7 @@ (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))" - "{b}\t{%2, %h0|%h0, %2}" + "{b}\t{%2, %h0|%h0, %2}" [(set_attr "type" "alu") (set_attr "length_immediate" "0") (set_attr "mode" "QI")]) @@ -8943,7 +8958,7 @@ (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))" - "{b}\t{%2, %h0|%h0, %2}" + "{b}\t{%2, %h0|%h0, %2}" [(set_attr "type" "alu") (set_attr "length_immediate" "0") (set_attr "mode" "QI")]) @@ -8961,7 +8976,7 @@ (const_int 8)))) (clobber (reg:CC FLAGS_REG))] "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)" - "{b}\t{%h2, %h0|%h0, %h2}" + "{b}\t{%h2, %h0|%h0, %h2}" [(set_attr "type" "alu") (set_attr "length_immediate" "0") (set_attr "mode" "QI")]) @@ -9351,7 +9366,7 @@ "TARGET_80387 && (reload_completed || !(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH))" - "f" + "f" [(set_attr "type" "fsgn") (set_attr "mode" "")]) @@ -9360,7 +9375,7 @@ (absneg:DF (float_extend:DF (match_operand:SF 1 "register_operand" "0"))))] "TARGET_80387 && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)" - "f" + "f" [(set_attr "type" "fsgn") (set_attr "mode" "DF")]) @@ -9369,16 +9384,16 @@ (absneg:XF (float_extend:XF (match_operand:SF 1 "register_operand" "0"))))] "TARGET_80387" - "f" + "f" [(set_attr "type" "fsgn") (set_attr "mode" "XF")]) (define_insn "*extenddfxf2" [(set (match_operand:XF 0 "register_operand" "=f") (absneg:XF (float_extend:XF - (match_operand:DF 1 "register_operand" "0"))))] + (match_operand:DF 1 "register_operand" "0"))))] "TARGET_80387" - "f" + "f" [(set_attr "type" "fsgn") (set_attr "mode" "XF")]) @@ -9688,19 +9703,17 @@ { switch (get_attr_type (insn)) { + case TYPE_LEA: + return "#"; + case TYPE_ALU: gcc_assert (operands[2] == const1_rtx); gcc_assert (rtx_equal_p (operands[0], operands[1])); return "add{}\t%0, %0"; - case TYPE_LEA: - return "#"; - default: - if (REG_P (operands[2])) - return "sal{}\t{%b2, %0|%0, %b2}"; - else if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "sal{}\t%0"; else return "sal{}\t{%2, %0|%0, %2}"; @@ -9737,18 +9750,16 @@ { switch (get_attr_type (insn)) { + case TYPE_LEA: + return "#"; + case TYPE_ALU: gcc_assert (operands[2] == const1_rtx); return "add{l}\t%k0, %k0"; - case TYPE_LEA: - return "#"; - default: - if (REG_P (operands[2])) - return "sal{l}\t{%b2, %k0|%k0, %b2}"; - else if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "sal{l}\t%k0"; else return "sal{l}\t{%2, %k0|%k0, %2}"; @@ -9789,10 +9800,8 @@ return "add{w}\t%0, %0"; default: - if (REG_P (operands[2])) - return "sal{w}\t{%b2, %0|%0, %b2}"; - else if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "sal{w}\t%0"; else return "sal{w}\t{%2, %0|%0, %2}"; @@ -9829,15 +9838,14 @@ { case TYPE_LEA: return "#"; + case TYPE_ALU: gcc_assert (operands[2] == const1_rtx); return "add{w}\t%0, %0"; default: - if (REG_P (operands[2])) - return "sal{w}\t{%b2, %0|%0, %b2}"; - else if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "sal{w}\t%0"; else return "sal{w}\t{%2, %0|%0, %2}"; @@ -9882,18 +9890,11 @@ return "add{b}\t%0, %0"; default: - if (REG_P (operands[2])) - { - if (get_attr_mode (insn) == MODE_SI) - return "sal{l}\t{%b2, %k0|%k0, %b2}"; - else - return "sal{b}\t{%b2, %0|%0, %b2}"; - } - else if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) { if (get_attr_mode (insn) == MODE_SI) - return "sal{l}\t%0"; + return "sal{l}\t%k0"; else return "sal{b}\t%0"; } @@ -9938,6 +9939,7 @@ { case TYPE_LEA: return "#"; + case TYPE_ALU: gcc_assert (operands[2] == const1_rtx); if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1])) @@ -9946,18 +9948,11 @@ return "add{b}\t%0, %0"; default: - if (REG_P (operands[2])) - { - if (get_attr_mode (insn) == MODE_SI) - return "sal{l}\t{%b2, %k0|%k0, %b2}"; - else - return "sal{b}\t{%b2, %0|%0, %b2}"; - } - else if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) { if (get_attr_mode (insn) == MODE_SI) - return "sal{l}\t%0"; + return "sal{l}\t%k0"; else return "sal{b}\t%0"; } @@ -9991,6 +9986,50 @@ (const_string "*"))) (set_attr "mode" "QI,SI,SI")]) +(define_insn "*ashlqi3_1_slp" + [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) + (ashift:QI (match_dup 0) + (match_operand:QI 1 "nonmemory_operand" "cI"))) + (clobber (reg:CC FLAGS_REG))] + "(optimize_function_for_size_p (cfun) + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[1] == const1_rtx + && (TARGET_SHIFT1 + || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))" +{ + switch (get_attr_type (insn)) + { + case TYPE_ALU: + gcc_assert (operands[1] == const1_rtx); + return "add{b}\t%0, %0"; + + default: + if (operands[1] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + return "sal{b}\t%0"; + else + return "sal{b}\t{%1, %0|%0, %1}"; + } +} + [(set (attr "type") + (cond [(and (and (ne (symbol_ref "TARGET_DOUBLE_WITH_ADD") + (const_int 0)) + (match_operand 0 "register_operand" "")) + (match_operand 1 "const1_operand" "")) + (const_string "alu") + ] + (const_string "ishift1"))) + (set (attr "length_immediate") + (if_then_else + (ior (eq_attr "type" "alu") + (and (eq_attr "type" "ishift1") + (and (match_operand 1 "const1_operand" "") + (ne (symbol_ref "TARGET_SHIFT1 || optimize_function_for_size_p (cfun)") + (const_int 0))))) + (const_string "0") + (const_string "*"))) + (set_attr "mode" "QI")]) + ;; Convert lea to the lea pattern to avoid flags dependency. (define_split [(set (match_operand:DI 0 "register_operand" "") @@ -10370,10 +10409,8 @@ (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (, mode, operands)" { - if (REG_P (operands[2])) - return "{}\t{%b2, %0|%0, %b2}"; - else if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "{}\t%0"; else return "{}\t{%2, %0|%0, %2}"; @@ -10396,10 +10433,8 @@ (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (, SImode, operands)" { - if (REG_P (operands[2])) - return "{l}\t{%b2, %k0|%k0, %b2}"; - else if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "{l}\t%k0"; else return "{l}\t{%2, %k0|%k0, %2}"; @@ -10424,10 +10459,8 @@ || (operands[1] == const1_rtx && TARGET_SHIFT1))" { - if (REG_P (operands[1])) - return "{b}\t{%b1, %0|%0, %b1}"; - else if (operands[1] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (operands[1] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "{b}\t%0"; else return "{b}\t{%1, %0|%0, %1}"; @@ -10542,451 +10575,187 @@ ;; Rotate instructions -(define_expand "rotldi3" +(define_expand "ti3" + [(set (match_operand:TI 0 "register_operand" "") + (any_rotate:TI (match_operand:TI 1 "register_operand" "") + (match_operand:QI 2 "nonmemory_operand" "")))] + "TARGET_64BIT" +{ + if (const_1_to_63_operand (operands[2], VOIDmode)) + emit_insn (gen_ix86_ti3_doubleword + (operands[0], operands[1], operands[2])); + else + FAIL; + + DONE; +}) + +(define_expand "di3" [(set (match_operand:DI 0 "shiftdi_operand" "") - (rotate:DI (match_operand:DI 1 "shiftdi_operand" "") - (match_operand:QI 2 "nonmemory_operand" "")))] + (any_rotate:DI (match_operand:DI 1 "shiftdi_operand" "") + (match_operand:QI 2 "nonmemory_operand" "")))] "" { if (TARGET_64BIT) - { - ix86_expand_binary_operator (ROTATE, DImode, operands); - DONE; - } - if (!const_1_to_31_operand (operands[2], VOIDmode)) + ix86_expand_binary_operator (, DImode, operands); + else if (const_1_to_31_operand (operands[2], VOIDmode)) + emit_insn (gen_ix86_di3_doubleword + (operands[0], operands[1], operands[2])); + else FAIL; - emit_insn (gen_ix86_rotldi3 (operands[0], operands[1], operands[2])); + DONE; }) -;; Implement rotation using two double-precision shift instructions -;; and a scratch register. -(define_insn_and_split "ix86_rotldi3" - [(set (match_operand:DI 0 "register_operand" "=r") - (rotate:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:QI 2 "const_1_to_31_operand" "I"))) +(define_expand "3" + [(set (match_operand:SWIM124 0 "nonimmediate_operand" "") + (any_rotate:SWIM124 (match_operand:SWIM124 1 "nonimmediate_operand" "") + (match_operand:QI 2 "nonmemory_operand" "")))] + "" + "ix86_expand_binary_operator (, mode, operands); DONE;") + +;; Implement rotation using two double-precision +;; shift instructions and a scratch register. + +(define_insn_and_split "ix86_rotl3_doubleword" + [(set (match_operand: 0 "register_operand" "=r") + (rotate: (match_operand: 1 "register_operand" "0") + (match_operand:QI 2 "" ""))) (clobber (reg:CC FLAGS_REG)) - (clobber (match_scratch:SI 3 "=&r"))] - "!TARGET_64BIT" + (clobber (match_scratch:DWIH 3 "=&r"))] "" - "&& reload_completed" + "#" + "reload_completed" [(set (match_dup 3) (match_dup 4)) (parallel [(set (match_dup 4) - (ior:SI (ashift:SI (match_dup 4) (match_dup 2)) - (lshiftrt:SI (match_dup 5) - (minus:QI (const_int 32) (match_dup 2))))) + (ior:DWIH (ashift:DWIH (match_dup 4) (match_dup 2)) + (lshiftrt:DWIH (match_dup 5) + (minus:QI (match_dup 6) (match_dup 2))))) (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 5) - (ior:SI (ashift:SI (match_dup 5) (match_dup 2)) - (lshiftrt:SI (match_dup 3) - (minus:QI (const_int 32) (match_dup 2))))) + (ior:DWIH (ashift:DWIH (match_dup 5) (match_dup 2)) + (lshiftrt:DWIH (match_dup 3) + (minus:QI (match_dup 6) (match_dup 2))))) (clobber (reg:CC FLAGS_REG))])] - "split_di (&operands[0], 1, &operands[4], &operands[5]);") - -(define_insn "*rotlsi3_1_one_bit_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=rm") - (rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATE, DImode, operands)" - "rol{q}\t%0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "DI")]) - -(define_insn "*rotldi3_1_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,rm") - (rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "e,c"))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, DImode, operands)" - "@ - rol{q}\t{%2, %0|%0, %2} - rol{q}\t{%b2, %0|%0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "DI")]) - -(define_expand "rotlsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (rotate:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "nonmemory_operand" "")))] - "" - "ix86_expand_binary_operator (ROTATE, SImode, operands); DONE;") - -(define_insn "*rotlsi3_1_one_bit" - [(set (match_operand:SI 0 "nonimmediate_operand" "=rm") - (rotate:SI (match_operand:SI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATE, SImode, operands)" - "rol{l}\t%0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "SI")]) - -(define_insn "*rotlsi3_1_one_bit_zext" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI - (rotate:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:QI 2 "const1_operand" "")))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATE, SImode, operands)" - "rol{l}\t%k0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "SI")]) - -(define_insn "*rotlsi3_1" - [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm") - (rotate:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC FLAGS_REG))] - "ix86_binary_operator_ok (ROTATE, SImode, operands)" - "@ - rol{l}\t{%2, %0|%0, %2} - rol{l}\t{%b2, %0|%0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "SI")]) - -(define_insn "*rotlsi3_1_zext" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (zero_extend:DI - (rotate:SI (match_operand:SI 1 "register_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "I,c")))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, SImode, operands)" - "@ - rol{l}\t{%2, %k0|%k0, %2} - rol{l}\t{%b2, %k0|%k0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "SI")]) - -(define_expand "rotlhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (rotate:HI (match_operand:HI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "nonmemory_operand" "")))] - "TARGET_HIMODE_MATH" - "ix86_expand_binary_operator (ROTATE, HImode, operands); DONE;") - -(define_insn "*rotlhi3_1_one_bit" - [(set (match_operand:HI 0 "nonimmediate_operand" "=rm") - (rotate:HI (match_operand:HI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATE, HImode, operands)" - "rol{w}\t%0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "HI")]) - -(define_insn "*rotlhi3_1" - [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm") - (rotate:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC FLAGS_REG))] - "ix86_binary_operator_ok (ROTATE, HImode, operands)" - "@ - rol{w}\t{%2, %0|%0, %2} - rol{w}\t{%b2, %0|%0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "HI")]) - -(define_split - [(set (match_operand:HI 0 "register_operand" "") - (rotate:HI (match_dup 0) (const_int 8))) - (clobber (reg:CC FLAGS_REG))] - "reload_completed" - [(parallel [(set (strict_low_part (match_dup 0)) - (bswap:HI (match_dup 0))) - (clobber (reg:CC FLAGS_REG))])] - "") - -(define_expand "rotlqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "") - (rotate:QI (match_operand:QI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "nonmemory_operand" "")))] - "TARGET_QIMODE_MATH" - "ix86_expand_binary_operator (ROTATE, QImode, operands); DONE;") - -(define_insn "*rotlqi3_1_one_bit_slp" - [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) - (rotate:QI (match_dup 0) - (match_operand:QI 1 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))" - "rol{b}\t%0" - [(set_attr "type" "rotate1") - (set_attr "length_immediate" "0") - (set_attr "mode" "QI")]) - -(define_insn "*rotlqi3_1_one_bit" - [(set (match_operand:QI 0 "nonimmediate_operand" "=qm") - (rotate:QI (match_operand:QI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATE, QImode, operands)" - "rol{b}\t%0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "QI")]) - -(define_insn "*rotlqi3_1_slp" - [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,qm")) - (rotate:QI (match_dup 0) - (match_operand:QI 1 "nonmemory_operand" "I,c"))) - (clobber (reg:CC FLAGS_REG))] - "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) - && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "@ - rol{b}\t{%1, %0|%0, %1} - rol{b}\t{%b1, %0|%0, %b1}" - [(set_attr "type" "rotate1") - (set_attr "mode" "QI")]) - -(define_insn "*rotlqi3_1" - [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,qm") - (rotate:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC FLAGS_REG))] - "ix86_binary_operator_ok (ROTATE, QImode, operands)" - "@ - rol{b}\t{%2, %0|%0, %2} - rol{b}\t{%b2, %0|%0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "QI")]) - -(define_expand "rotrdi3" - [(set (match_operand:DI 0 "shiftdi_operand" "") - (rotate:DI (match_operand:DI 1 "shiftdi_operand" "") - (match_operand:QI 2 "nonmemory_operand" "")))] - "" { - if (TARGET_64BIT) - { - ix86_expand_binary_operator (ROTATERT, DImode, operands); - DONE; - } - if (!const_1_to_31_operand (operands[2], VOIDmode)) - FAIL; - emit_insn (gen_ix86_rotrdi3 (operands[0], operands[1], operands[2])); - DONE; + operands[6] = GEN_INT (GET_MODE_BITSIZE (mode)); + + split_ (&operands[0], 1, &operands[4], &operands[5]); }) -;; Implement rotation using two double-precision shift instructions -;; and a scratch register. -(define_insn_and_split "ix86_rotrdi3" - [(set (match_operand:DI 0 "register_operand" "=r") - (rotatert:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:QI 2 "const_1_to_31_operand" "I"))) +(define_insn_and_split "ix86_rotr3_doubleword" + [(set (match_operand: 0 "register_operand" "=r") + (rotatert: (match_operand: 1 "register_operand" "0") + (match_operand:QI 2 "" ""))) (clobber (reg:CC FLAGS_REG)) - (clobber (match_scratch:SI 3 "=&r"))] - "!TARGET_64BIT" + (clobber (match_scratch:DWIH 3 "=&r"))] "" - "&& reload_completed" + "#" + "reload_completed" [(set (match_dup 3) (match_dup 4)) (parallel [(set (match_dup 4) - (ior:SI (ashiftrt:SI (match_dup 4) (match_dup 2)) - (ashift:SI (match_dup 5) - (minus:QI (const_int 32) (match_dup 2))))) + (ior:DWIH (ashiftrt:DWIH (match_dup 4) (match_dup 2)) + (ashift:DWIH (match_dup 5) + (minus:QI (match_dup 6) (match_dup 2))))) (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 5) - (ior:SI (ashiftrt:SI (match_dup 5) (match_dup 2)) - (ashift:SI (match_dup 3) - (minus:QI (const_int 32) (match_dup 2))))) + (ior:DWIH (ashiftrt:DWIH (match_dup 5) (match_dup 2)) + (ashift:DWIH (match_dup 3) + (minus:QI (match_dup 6) (match_dup 2))))) (clobber (reg:CC FLAGS_REG))])] - "split_di (&operands[0], 1, &operands[4], &operands[5]);") - -(define_insn "*rotrdi3_1_one_bit_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=rm") - (rotatert:DI (match_operand:DI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATERT, DImode, operands)" - "ror{q}\t%0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "DI")]) - -(define_insn "*rotrdi3_1_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,rm") - (rotatert:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "J,c"))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, DImode, operands)" - "@ - ror{q}\t{%2, %0|%0, %2} - ror{q}\t{%b2, %0|%0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "DI")]) +{ + operands[6] = GEN_INT (GET_MODE_BITSIZE (mode)); -(define_expand "rotrsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (rotatert:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "nonmemory_operand" "")))] - "" - "ix86_expand_binary_operator (ROTATERT, SImode, operands); DONE;") + split_ (&operands[0], 1, &operands[4], &operands[5]); +}) -(define_insn "*rotrsi3_1_one_bit" - [(set (match_operand:SI 0 "nonimmediate_operand" "=rm") - (rotatert:SI (match_operand:SI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const1_operand" ""))) +(define_insn "*3_1" + [(set (match_operand:SWI 0 "nonimmediate_operand" "=m") + (any_rotate:SWI (match_operand:SWI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "nonmemory_operand" "c"))) (clobber (reg:CC FLAGS_REG))] - "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATERT, SImode, operands)" - "ror{l}\t%0" + "ix86_binary_operator_ok (, mode, operands)" +{ + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + return "{}\t%0"; + else + return "{}\t{%2, %0|%0, %2}"; +} [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "SI")]) + (set (attr "length_immediate") + (if_then_else + (and (match_operand 2 "const1_operand" "") + (ne (symbol_ref "TARGET_SHIFT1 || optimize_function_for_size_p (cfun)") + (const_int 0))) + (const_string "0") + (const_string "*"))) + (set_attr "mode" "")]) -(define_insn "*rotrsi3_1_one_bit_zext" +(define_insn "*si3_1_zext" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI - (rotatert:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:QI 2 "const1_operand" "")))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATERT, SImode, operands)" - "ror{l}\t%k0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "SI")]) - -(define_insn "*rotrsi3_1" - [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm") - (rotatert:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC FLAGS_REG))] - "ix86_binary_operator_ok (ROTATERT, SImode, operands)" - "@ - ror{l}\t{%2, %0|%0, %2} - ror{l}\t{%b2, %0|%0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "SI")]) - -(define_insn "*rotrsi3_1_zext" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (zero_extend:DI - (rotatert:SI (match_operand:SI 1 "register_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "I,c")))) + (any_rotate:SI (match_operand:SI 1 "register_operand" "0") + (match_operand:QI 2 "nonmemory_operand" "cI")))) (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, SImode, operands)" - "@ - ror{l}\t{%2, %k0|%k0, %2} - ror{l}\t{%b2, %k0|%k0, %b2}" + "TARGET_64BIT && ix86_binary_operator_ok (, SImode, operands)" +{ + if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + return "{l}\t%k0"; + else + return "{l}\t{%2, %k0|%k0, %2}"; +} [(set_attr "type" "rotate") + (set (attr "length_immediate") + (if_then_else + (and (match_operand 2 "const1_operand" "") + (ne (symbol_ref "TARGET_SHIFT1 || optimize_function_for_size_p (cfun)") + (const_int 0))) + (const_string "0") + (const_string "*"))) (set_attr "mode" "SI")]) -(define_expand "rotrhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (rotatert:HI (match_operand:HI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "nonmemory_operand" "")))] - "TARGET_HIMODE_MATH" - "ix86_expand_binary_operator (ROTATERT, HImode, operands); DONE;") - -(define_insn "*rotrhi3_one_bit" - [(set (match_operand:HI 0 "nonimmediate_operand" "=rm") - (rotatert:HI (match_operand:HI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATERT, HImode, operands)" - "ror{w}\t%0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "HI")]) - -(define_insn "*rotrhi3_1" - [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm") - (rotatert:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "I,c"))) +(define_insn "*qi3_1_slp" + [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) + (any_rotate:QI (match_dup 0) + (match_operand:QI 1 "nonmemory_operand" "cI"))) (clobber (reg:CC FLAGS_REG))] - "ix86_binary_operator_ok (ROTATERT, HImode, operands)" - "@ - ror{w}\t{%2, %0|%0, %2} - ror{w}\t{%b2, %0|%0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "HI")]) + "(optimize_function_for_size_p (cfun) + || !TARGET_PARTIAL_REG_STALL + || (operands[1] == const1_rtx + && TARGET_SHIFT1))" +{ + if (operands[1] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + return "{b}\t%0"; + else + return "{b}\t{%1, %0|%0, %1}"; +} + [(set_attr "type" "rotate1") + (set (attr "length_immediate") + (if_then_else + (and (match_operand 1 "const1_operand" "") + (ne (symbol_ref "TARGET_SHIFT1 || optimize_function_for_size_p (cfun)") + (const_int 0))) + (const_string "0") + (const_string "*"))) + (set_attr "mode" "QI")]) (define_split [(set (match_operand:HI 0 "register_operand" "") - (rotatert:HI (match_dup 0) (const_int 8))) + (any_rotate:HI (match_dup 0) (const_int 8))) (clobber (reg:CC FLAGS_REG))] - "reload_completed" + "reload_completed + && (TARGET_USE_XCHGB || optimize_function_for_size_p (cfun))" [(parallel [(set (strict_low_part (match_dup 0)) (bswap:HI (match_dup 0))) (clobber (reg:CC FLAGS_REG))])] "") - -(define_expand "rotrqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "") - (rotatert:QI (match_operand:QI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "nonmemory_operand" "")))] - "TARGET_QIMODE_MATH" - "ix86_expand_binary_operator (ROTATERT, QImode, operands); DONE;") - -(define_insn "*rotrqi3_1_one_bit" - [(set (match_operand:QI 0 "nonimmediate_operand" "=qm") - (rotatert:QI (match_operand:QI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun)) - && ix86_binary_operator_ok (ROTATERT, QImode, operands)" - "ror{b}\t%0" - [(set_attr "type" "rotate") - (set_attr "length_immediate" "0") - (set_attr "mode" "QI")]) - -(define_insn "*rotrqi3_1_one_bit_slp" - [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) - (rotatert:QI (match_dup 0) - (match_operand:QI 1 "const1_operand" ""))) - (clobber (reg:CC FLAGS_REG))] - "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))" - "ror{b}\t%0" - [(set_attr "type" "rotate1") - (set_attr "length_immediate" "0") - (set_attr "mode" "QI")]) - -(define_insn "*rotrqi3_1" - [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,qm") - (rotatert:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC FLAGS_REG))] - "ix86_binary_operator_ok (ROTATERT, QImode, operands)" - "@ - ror{b}\t{%2, %0|%0, %2} - ror{b}\t{%b2, %0|%0, %b2}" - [(set_attr "type" "rotate") - (set_attr "mode" "QI")]) - -(define_insn "*rotrqi3_1_slp" - [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,qm")) - (rotatert:QI (match_dup 0) - (match_operand:QI 1 "nonmemory_operand" "I,c"))) - (clobber (reg:CC FLAGS_REG))] - "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) - && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "@ - ror{b}\t{%1, %0|%0, %1} - ror{b}\t{%b1, %0|%0, %b1}" - [(set_attr "type" "rotate1") - (set_attr "mode" "QI")]) ;; Bit set / bit test instructions @@ -11196,33 +10965,19 @@ DONE; }) -(define_insn "*btdi_rex64" - [(set (reg:CCC FLAGS_REG) - (compare:CCC - (zero_extract:DI - (match_operand:DI 0 "register_operand" "r") - (const_int 1) - (match_operand:DI 1 "nonmemory_operand" "rN")) - (const_int 0)))] - "TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))" - "bt{q}\t{%1, %0|%0, %1}" - [(set_attr "type" "alu1") - (set_attr "prefix_0f" "1") - (set_attr "mode" "DI")]) - -(define_insn "*btsi" +(define_insn "*bt" [(set (reg:CCC FLAGS_REG) (compare:CCC - (zero_extract:SI - (match_operand:SI 0 "register_operand" "r") + (zero_extract:SWI48 + (match_operand:SWI48 0 "register_operand" "r") (const_int 1) - (match_operand:SI 1 "nonmemory_operand" "rN")) + (match_operand:SWI48 1 "nonmemory_operand" "rN")) (const_int 0)))] "TARGET_USE_BT || optimize_function_for_size_p (cfun)" - "bt{l}\t{%1, %0|%0, %1}" + "bt{}\t{%1, %0|%0, %1}" [(set_attr "type" "alu1") (set_attr "prefix_0f" "1") - (set_attr "mode" "SI")]) + (set_attr "mode" "")]) ;; Store-flag instructions. @@ -11479,16 +11234,16 @@ FAIL; }) -;; zero_extend in SImode is correct, since this is what combine pass -;; generates from shift insn with QImode operand. Actually, the mode of -;; operand 2 (bit offset operand) doesn't matter since bt insn takes +;; zero_extend in SImode is correct also for DImode, since this is what combine +;; pass generates from shift insn with QImode operand. Actually, the mode +;; of operand 2 (bit offset operand) doesn't matter since bt insn takes ;; appropriate modulo of the bit offset value. -(define_insn_and_split "*jcc_btdi_rex64" +(define_insn_and_split "*jcc_bt" [(set (pc) (if_then_else (match_operator 0 "bt_comparison_operator" - [(zero_extract:DI - (match_operand:DI 1 "register_operand" "r") + [(zero_extract:SWI48 + (match_operand:SWI48 1 "register_operand" "r") (const_int 1) (zero_extend:SI (match_operand:QI 2 "register_operand" "r"))) @@ -11496,12 +11251,12 @@ (label_ref (match_operand 3 "" "")) (pc))) (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))" + "TARGET_USE_BT || optimize_function_for_size_p (cfun)" "#" "&& 1" [(set (reg:CCC FLAGS_REG) (compare:CCC - (zero_extract:DI + (zero_extract:SWI48 (match_dup 1) (const_int 1) (match_dup 2)) @@ -11511,17 +11266,18 @@ (label_ref (match_dup 3)) (pc)))] { - operands[2] = simplify_gen_subreg (DImode, operands[2], QImode, 0); + operands[2] = simplify_gen_subreg (mode, operands[2], QImode, 0); PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0]))); }) -;; avoid useless masking of bit offset operand -(define_insn_and_split "*jcc_btdi_mask_rex64" +;; Avoid useless masking of bit offset operand. "and" in SImode is correct +;; also for DImode, this is what combine produces. +(define_insn_and_split "*jcc_bt_mask" [(set (pc) (if_then_else (match_operator 0 "bt_comparison_operator" - [(zero_extract:DI - (match_operand:DI 1 "register_operand" "r") + [(zero_extract:SWI48 + (match_operand:SWI48 1 "register_operand" "r") (const_int 1) (and:SI (match_operand:SI 2 "register_operand" "r") @@ -11529,13 +11285,14 @@ (label_ref (match_operand 4 "" "")) (pc))) (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun)) - && (INTVAL (operands[3]) & 0x3f) == 0x3f" + "(TARGET_USE_BT || optimize_function_for_size_p (cfun)) + && (INTVAL (operands[3]) & (GET_MODE_BITSIZE (mode)-1)) + == GET_MODE_BITSIZE (mode)-1" "#" "&& 1" [(set (reg:CCC FLAGS_REG) (compare:CCC - (zero_extract:DI + (zero_extract:SWI48 (match_dup 1) (const_int 1) (match_dup 2)) @@ -11545,73 +11302,11 @@ (label_ref (match_dup 4)) (pc)))] { - operands[2] = simplify_gen_subreg (DImode, operands[2], SImode, 0); - - PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0]))); -}) - -(define_insn_and_split "*jcc_btsi" - [(set (pc) - (if_then_else (match_operator 0 "bt_comparison_operator" - [(zero_extract:SI - (match_operand:SI 1 "register_operand" "r") - (const_int 1) - (zero_extend:SI - (match_operand:QI 2 "register_operand" "r"))) - (const_int 0)]) - (label_ref (match_operand 3 "" "")) - (pc))) - (clobber (reg:CC FLAGS_REG))] - "TARGET_USE_BT || optimize_function_for_size_p (cfun)" - "#" - "&& 1" - [(set (reg:CCC FLAGS_REG) - (compare:CCC - (zero_extract:SI - (match_dup 1) - (const_int 1) - (match_dup 2)) - (const_int 0))) - (set (pc) - (if_then_else (match_op_dup 0 [(reg:CCC FLAGS_REG) (const_int 0)]) - (label_ref (match_dup 3)) - (pc)))] -{ - operands[2] = simplify_gen_subreg (SImode, operands[2], QImode, 0); + operands[2] = simplify_gen_subreg (mode, operands[2], SImode, 0); PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0]))); }) -;; avoid useless masking of bit offset operand -(define_insn_and_split "*jcc_btsi_mask" - [(set (pc) - (if_then_else (match_operator 0 "bt_comparison_operator" - [(zero_extract:SI - (match_operand:SI 1 "register_operand" "r") - (const_int 1) - (and:SI - (match_operand:SI 2 "register_operand" "r") - (match_operand:SI 3 "const_int_operand" "n")))]) - (label_ref (match_operand 4 "" "")) - (pc))) - (clobber (reg:CC FLAGS_REG))] - "(TARGET_USE_BT || optimize_function_for_size_p (cfun)) - && (INTVAL (operands[3]) & 0x1f) == 0x1f" - "#" - "&& 1" - [(set (reg:CCC FLAGS_REG) - (compare:CCC - (zero_extract:SI - (match_dup 1) - (const_int 1) - (match_dup 2)) - (const_int 0))) - (set (pc) - (if_then_else (match_op_dup 0 [(reg:CCC FLAGS_REG) (const_int 0)]) - (label_ref (match_dup 4)) - (pc)))] - "PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0])));") - (define_insn_and_split "*jcc_btsi_1" [(set (pc) (if_then_else (match_operator 0 "bt_comparison_operator" @@ -12682,7 +12377,7 @@ #if TARGET_MACHO return "popcnt\t{%1, %0|%0, %1}"; #else - return "popcnt{}\t{%1, %0|%0, %1}"; + return "popcnt{l}\t{%1, %0|%0, %1}"; #endif } [(set_attr "prefix_rep" "1") @@ -17129,7 +16824,7 @@ (match_operand:MODEF 1 "nonimmediate_operand" "%x") (match_operand:MODEF 2 "nonimmediate_operand" "xm")))] "AVX_FLOAT_MODE_P (mode) && TARGET_SSE_MATH" - "vs\t{%2, %1, %0|%0, %1, %2}" + "vs\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sseadd") (set_attr "prefix" "vex") (set_attr "mode" "")]) @@ -17140,7 +16835,7 @@ (match_operand:MODEF 1 "nonimmediate_operand" "%0") (match_operand:MODEF 2 "nonimmediate_operand" "xm")))] "SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH" - "s\t{%2, %0|%0, %2}" + "s\t{%2, %0|%0, %2}" [(set_attr "type" "sseadd") (set_attr "mode" "")]) diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 5551bcb48f3..af19732624a 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -396,7 +396,7 @@ (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] "TARGET_3DNOW && flag_finite_math_only && ix86_binary_operator_ok (, V2SFmode, operands)" - "pf\t{%2, %0|%0, %2}" + "pf\t{%2, %0|%0, %2}" [(set_attr "type" "mmxadd") (set_attr "prefix_extra" "1") (set_attr "mode" "V2SF")]) @@ -407,7 +407,7 @@ (match_operand:V2SF 1 "register_operand" "0") (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] "TARGET_3DNOW" - "pf\t{%2, %0|%0, %2}" + "pf\t{%2, %0|%0, %2}" [(set_attr "type" "mmxadd") (set_attr "prefix_extra" "1") (set_attr "mode" "V2SF")]) @@ -970,7 +970,7 @@ (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] "(TARGET_SSE || TARGET_3DNOW_A) && ix86_binary_operator_ok (, V4HImode, operands)" - "pw\t{%2, %0|%0, %2}" + "pw\t{%2, %0|%0, %2}" [(set_attr "type" "mmxadd") (set_attr "mode" "DI")]) @@ -989,7 +989,7 @@ (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] "(TARGET_SSE || TARGET_3DNOW_A) && ix86_binary_operator_ok (, V8QImode, operands)" - "pb\t{%2, %0|%0, %2}" + "pb\t{%2, %0|%0, %2}" [(set_attr "type" "mmxadd") (set_attr "mode" "DI")]) @@ -1099,7 +1099,7 @@ (match_operand:MMXMODEI 1 "nonimmediate_operand" "%0") (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] "TARGET_MMX && ix86_binary_operator_ok (, mode, operands)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "mmxadd") (set_attr "mode" "DI")]) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index f98913697b1..0baefd84705 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -1015,7 +1015,7 @@ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))] "AVX_VEC_FLOAT_MODE_P (mode) && flag_finite_math_only && ix86_binary_operator_ok (, mode, operands)" - "vp\t{%2, %1, %0|%0, %1, %2}" + "vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sseadd") (set_attr "prefix" "vex") (set_attr "mode" "")]) @@ -1027,7 +1027,7 @@ (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm")))] "SSE_VEC_FLOAT_MODE_P (mode) && flag_finite_math_only && ix86_binary_operator_ok (, mode, operands)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "sseadd") (set_attr "mode" "")]) @@ -1037,7 +1037,7 @@ (match_operand:AVXMODEF2P 1 "nonimmediate_operand" "%x") (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))] "AVX_VEC_FLOAT_MODE_P (mode)" - "vp\t{%2, %1, %0|%0, %1, %2}" + "vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sseadd") (set_attr "prefix" "vex") (set_attr "mode" "")]) @@ -1048,7 +1048,7 @@ (match_operand:SSEMODEF2P 1 "register_operand" "0") (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm")))] "SSE_VEC_FLOAT_MODE_P (mode)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "sseadd") (set_attr "mode" "")]) @@ -1061,7 +1061,7 @@ (match_dup 1) (const_int 1)))] "AVX128_VEC_FLOAT_MODE_P (mode)" - "vs\t{%2, %1, %0|%0, %1, %2}" + "vs\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sse") (set_attr "prefix" "vex") (set_attr "mode" "")]) @@ -1075,7 +1075,7 @@ (match_dup 1) (const_int 1)))] "SSE_VEC_FLOAT_MODE_P (mode)" - "s\t{%2, %0|%0, %2}" + "s\t{%2, %0|%0, %2}" [(set_attr "type" "sseadd") (set_attr "mode" "")]) @@ -1597,7 +1597,7 @@ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))] "AVX_VEC_FLOAT_MODE_P (mode) && ix86_binary_operator_ok (, mode, operands)" - "vp\t{%2, %1, %0|%0, %1, %2}" + "vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sselog") (set_attr "prefix" "vex") (set_attr "mode" "")]) @@ -1617,7 +1617,7 @@ (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm")))] "SSE_VEC_FLOAT_MODE_P (mode) && ix86_binary_operator_ok (, mode, operands)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "sselog") (set_attr "mode" "")]) @@ -1673,7 +1673,7 @@ (match_operand:MODEF 1 "register_operand" "x") (match_operand:MODEF 2 "register_operand" "x")))] "AVX_FLOAT_MODE_P (mode)" - "vp\t{%2, %1, %0|%0, %1, %2}" + "vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sselog") (set_attr "prefix" "vex") (set_attr "mode" "")]) @@ -1684,7 +1684,7 @@ (match_operand:MODEF 1 "register_operand" "0") (match_operand:MODEF 2 "register_operand" "x")))] "SSE_FLOAT_MODE_P (mode)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "sselog") (set_attr "mode" "")]) @@ -6031,7 +6031,7 @@ (match_operand:SSEMODE124 1 "nonimmediate_operand" "%x") (match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")))] "TARGET_AVX && ix86_binary_operator_ok (, mode, operands)" - "vp\t{%2, %1, %0|%0, %1, %2}" + "vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sseiadd") (set (attr "prefix_extra") (if_then_else @@ -6056,7 +6056,7 @@ (match_operand:V16QI 1 "nonimmediate_operand" "%0") (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] "TARGET_SSE2 && ix86_binary_operator_ok (, V16QImode, operands)" - "pb\t{%2, %0|%0, %2}" + "pb\t{%2, %0|%0, %2}" [(set_attr "type" "sseiadd") (set_attr "prefix_data16" "1") (set_attr "mode" "TI")]) @@ -6075,7 +6075,7 @@ (match_operand:V8HI 1 "nonimmediate_operand" "%0") (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] "TARGET_SSE2 && ix86_binary_operator_ok (, V8HImode, operands)" - "pw\t{%2, %0|%0, %2}" + "pw\t{%2, %0|%0, %2}" [(set_attr "type" "sseiadd") (set_attr "prefix_data16" "1") (set_attr "mode" "TI")]) @@ -6130,7 +6130,7 @@ (match_operand:SSEMODE14 1 "nonimmediate_operand" "%0") (match_operand:SSEMODE14 2 "nonimmediate_operand" "xm")))] "TARGET_SSE4_1 && ix86_binary_operator_ok (, mode, operands)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "sseiadd") (set_attr "prefix_extra" "1") (set_attr "mode" "TI")]) @@ -6186,7 +6186,7 @@ (match_operand:SSEMODE24 1 "nonimmediate_operand" "%0") (match_operand:SSEMODE24 2 "nonimmediate_operand" "xm")))] "TARGET_SSE4_1 && ix86_binary_operator_ok (, mode, operands)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "sseiadd") (set_attr "prefix_extra" "1") (set_attr "mode" "TI")]) @@ -6518,7 +6518,7 @@ (match_operand:AVX256MODEI 2 "nonimmediate_operand" "xm")))] "TARGET_AVX && ix86_binary_operator_ok (, mode, operands)" - "vps\t{%2, %1, %0|%0, %1, %2}" + "vps\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sselog") (set_attr "prefix" "vex") (set_attr "mode" "")]) @@ -6530,7 +6530,7 @@ (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] "(TARGET_SSE && !TARGET_SSE2) && ix86_binary_operator_ok (, mode, operands)" - "ps\t{%2, %0|%0, %2}" + "ps\t{%2, %0|%0, %2}" [(set_attr "type" "sselog") (set_attr "mode" "V4SF")]) @@ -6541,7 +6541,7 @@ (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] "TARGET_AVX && ix86_binary_operator_ok (, mode, operands)" - "vp\t{%2, %1, %0|%0, %1, %2}" + "vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sselog") (set_attr "prefix" "vex") (set_attr "mode" "TI")]) @@ -6552,7 +6552,7 @@ (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0") (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] "TARGET_SSE2 && ix86_binary_operator_ok (, mode, operands)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "sselog") (set_attr "prefix_data16" "1") (set_attr "mode" "TI")]) @@ -6571,7 +6571,7 @@ (match_operand:TF 1 "nonimmediate_operand" "%0") (match_operand:TF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE2 && ix86_binary_operator_ok (, TFmode, operands)" - "p\t{%2, %0|%0, %2}" + "p\t{%2, %0|%0, %2}" [(set_attr "type" "sselog") (set_attr "prefix_data16" "1") (set_attr "mode" "TI")]) diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md index feea16176bf..0fb10bc972e 100644 --- a/gcc/config/i386/sync.md +++ b/gcc/config/i386/sync.md @@ -236,4 +236,4 @@ UNSPECV_LOCK)) (clobber (reg:CC FLAGS_REG))] "" - "lock{%;| }{}\t{%1, %0|%0, %1}") + "lock{%;| }{}\t{%1, %0|%0, %1}") diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 43606ca92d3..8e95a16bba0 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -1066,7 +1066,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, { /* First, try and figure out what to use as a base register. */ - rtx reg1, reg2, base, idx, orig_base; + rtx reg1, reg2, base, idx; reg1 = XEXP (XEXP (x, 0), 1); reg2 = XEXP (x, 1); @@ -1088,7 +1088,6 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, && REG_POINTER (reg1)) { base = reg1; - orig_base = XEXP (XEXP (x, 0), 1); idx = gen_rtx_PLUS (Pmode, gen_rtx_MULT (Pmode, XEXP (XEXP (XEXP (x, 0), 0), 0), @@ -1099,7 +1098,6 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, && REG_POINTER (reg2)) { base = reg2; - orig_base = XEXP (x, 1); idx = XEXP (x, 0); } @@ -1716,12 +1714,8 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) /* Set the register pointer flag and register alignment if the declaration for this memory reference is a - pointer type. Fortran indirect argument references - are ignored. */ - if (decl - && !(flag_argument_noalias > 1 - && TREE_CODE (decl) == INDIRECT_REF - && TREE_CODE (TREE_OPERAND (decl, 0)) == PARM_DECL)) + pointer type. */ + if (decl) { tree type; diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index f55a5a4eda1..bb4d46bc854 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -7232,7 +7232,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "" " { - rtx op, call_insn; + rtx op; rtx nb = operands[1]; if (TARGET_PORTABLE_RUNTIME) @@ -7297,11 +7297,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { rtx r4 = gen_rtx_REG (word_mode, 4); if (GET_CODE (op) == SYMBOL_REF) - call_insn = emit_call_insn (gen_call_symref_64bit (op, nb, r4)); + emit_call_insn (gen_call_symref_64bit (op, nb, r4)); else { op = force_reg (word_mode, op); - call_insn = emit_call_insn (gen_call_reg_64bit (op, nb, r4)); + emit_call_insn (gen_call_reg_64bit (op, nb, r4)); } } else @@ -7311,10 +7311,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" if (flag_pic) { rtx r4 = gen_rtx_REG (word_mode, 4); - call_insn = emit_call_insn (gen_call_symref_pic (op, nb, r4)); + emit_call_insn (gen_call_symref_pic (op, nb, r4)); } else - call_insn = emit_call_insn (gen_call_symref (op, nb)); + emit_call_insn (gen_call_symref (op, nb)); } else { @@ -7323,10 +7323,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" if (flag_pic) { rtx r4 = gen_rtx_REG (word_mode, 4); - call_insn = emit_call_insn (gen_call_reg_pic (nb, r4)); + emit_call_insn (gen_call_reg_pic (nb, r4)); } else - call_insn = emit_call_insn (gen_call_reg (nb)); + emit_call_insn (gen_call_reg (nb)); } } @@ -7724,7 +7724,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "" " { - rtx op, call_insn; + rtx op; rtx dst = operands[0]; rtx nb = operands[2]; @@ -7790,13 +7790,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { rtx r4 = gen_rtx_REG (word_mode, 4); if (GET_CODE (op) == SYMBOL_REF) - call_insn - = emit_call_insn (gen_call_val_symref_64bit (dst, op, nb, r4)); + emit_call_insn (gen_call_val_symref_64bit (dst, op, nb, r4)); else { op = force_reg (word_mode, op); - call_insn - = emit_call_insn (gen_call_val_reg_64bit (dst, op, nb, r4)); + emit_call_insn (gen_call_val_reg_64bit (dst, op, nb, r4)); } } else @@ -7806,11 +7804,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" if (flag_pic) { rtx r4 = gen_rtx_REG (word_mode, 4); - call_insn - = emit_call_insn (gen_call_val_symref_pic (dst, op, nb, r4)); + emit_call_insn (gen_call_val_symref_pic (dst, op, nb, r4)); } else - call_insn = emit_call_insn (gen_call_val_symref (dst, op, nb)); + emit_call_insn (gen_call_val_symref (dst, op, nb)); } else { @@ -7819,10 +7816,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" if (flag_pic) { rtx r4 = gen_rtx_REG (word_mode, 4); - call_insn = emit_call_insn (gen_call_val_reg_pic (dst, nb, r4)); + emit_call_insn (gen_call_val_reg_pic (dst, nb, r4)); } else - call_insn = emit_call_insn (gen_call_val_reg (dst, nb)); + emit_call_insn (gen_call_val_reg (dst, nb)); } } diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index fea70fb3e3b..c3820e58012 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -324,7 +324,7 @@ struct GTY(()) machine_function #define cfun_frame_layout (cfun->machine->frame_layout) #define cfun_save_high_fprs_p (!!cfun_frame_layout.high_fprs) #define cfun_gprs_save_area_size ((cfun_frame_layout.last_save_gpr_slot - \ - cfun_frame_layout.first_save_gpr_slot + 1) * UNITS_PER_WORD) + cfun_frame_layout.first_save_gpr_slot + 1) * UNITS_PER_LONG) #define cfun_set_fpr_bit(BITNUM) (cfun->machine->frame_layout.fpr_bitmap |= \ (1 << (BITNUM))) #define cfun_fpr_bit_p(BITNUM) (!!(cfun->machine->frame_layout.fpr_bitmap & \ @@ -365,14 +365,25 @@ s390_libgcc_shift_count_mode (void) return TARGET_64BIT ? DImode : SImode; } +static enum machine_mode +s390_unwind_word_mode (void) +{ + return TARGET_64BIT ? DImode : SImode; +} + /* Return true if the back end supports mode MODE. */ static bool s390_scalar_mode_supported_p (enum machine_mode mode) { + /* In contrast to the default implementation reject TImode constants on 31bit + TARGET_ZARCH for ABI compliance. */ + if (!TARGET_64BIT && TARGET_ZARCH && mode == TImode) + return false; + if (DECIMAL_FLOAT_MODE_P (mode)) return default_decimal_float_supported_p (); - else - return default_scalar_mode_supported_p (mode); + + return default_scalar_mode_supported_p (mode); } /* Set the has_landing_pad_p flag in struct machine_function to VALUE. */ @@ -2407,7 +2418,7 @@ s390_rtx_costs (rtx x, int code, int outer_code, int *total, { rtx left = XEXP (x, 0); rtx right = XEXP (x, 1); - if (TARGET_64BIT) + if (TARGET_ZARCH) { if (GET_CODE (right) == CONST_INT && CONST_OK_FOR_K (INTVAL (right))) @@ -2468,7 +2479,7 @@ s390_rtx_costs (rtx x, int code, int outer_code, int *total, { rtx right = XEXP (x, 1); if (GET_CODE (right) == ZERO_EXTEND) /* 64 by 32 bit division */ - if (TARGET_64BIT) + if (TARGET_ZARCH) *total = s390_cost->dsgfr; else *total = s390_cost->dr; @@ -2960,7 +2971,7 @@ s390_secondary_reload (bool in_p, rtx x, enum reg_class rclass, if (MEM_P (x) && s390_symref_operand_p (XEXP (x, 0), NULL, NULL) && (mode == QImode || mode == TImode || FLOAT_MODE_P (mode) - || (!TARGET_64BIT && mode == DImode) + || (!TARGET_ZARCH && mode == DImode) || ((mode == HImode || mode == SImode || mode == DImode) && (!s390_check_symref_alignment (XEXP (x, 0), GET_MODE_SIZE (mode)))))) @@ -4033,7 +4044,7 @@ s390_expand_setmem (rtx dst, rtx len, rtx val) else { - rtx dst_addr, src_addr, count, blocks, temp, dstp1 = NULL_RTX; + rtx dst_addr, count, blocks, temp, dstp1 = NULL_RTX; rtx loop_start_label = gen_label_rtx (); rtx loop_end_label = gen_label_rtx (); rtx end_label = gen_label_rtx (); @@ -4044,7 +4055,6 @@ s390_expand_setmem (rtx dst, rtx len, rtx val) mode = Pmode; dst_addr = gen_reg_rtx (Pmode); - src_addr = gen_reg_rtx (Pmode); count = gen_reg_rtx (mode); blocks = gen_reg_rtx (mode); @@ -5412,7 +5422,6 @@ s390_first_cycle_multipass_dfa_lookahead (void) return 4; } - /* Annotate every literal pool reference in X by an UNSPEC_LTREF expression. Fix up MEMs as required. */ @@ -6810,9 +6819,9 @@ s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED) } if (TARGET_PACKED_STACK) - offset = -2 * UNITS_PER_WORD; + offset = -2 * UNITS_PER_LONG; else - offset = RETURN_REGNUM * UNITS_PER_WORD; + offset = RETURN_REGNUM * UNITS_PER_LONG; addr = plus_constant (frame, offset); addr = memory_address (Pmode, addr); @@ -6831,7 +6840,7 @@ s390_back_chain_rtx (void) if (TARGET_PACKED_STACK) chain = plus_constant (stack_pointer_rtx, - STACK_POINTER_OFFSET - UNITS_PER_WORD); + STACK_POINTER_OFFSET - UNITS_PER_LONG); else chain = stack_pointer_rtx; @@ -6956,9 +6965,9 @@ s390_frame_area (int *area_bottom, int *area_top) if (cfun_frame_layout.first_restore_gpr != -1) { b = (cfun_frame_layout.gprs_offset - + cfun_frame_layout.first_restore_gpr * UNITS_PER_WORD); + + cfun_frame_layout.first_restore_gpr * UNITS_PER_LONG); t = b + (cfun_frame_layout.last_restore_gpr - - cfun_frame_layout.first_restore_gpr + 1) * UNITS_PER_WORD; + - cfun_frame_layout.first_restore_gpr + 1) * UNITS_PER_LONG; } if (TARGET_64BIT && cfun_save_high_fprs_p) @@ -7153,20 +7162,20 @@ s390_frame_info (void) if (!TARGET_PACKED_STACK) { cfun_frame_layout.backchain_offset = 0; - cfun_frame_layout.f0_offset = 16 * UNITS_PER_WORD; + cfun_frame_layout.f0_offset = 16 * UNITS_PER_LONG; cfun_frame_layout.f4_offset = cfun_frame_layout.f0_offset + 2 * 8; cfun_frame_layout.f8_offset = -cfun_frame_layout.high_fprs * 8; cfun_frame_layout.gprs_offset = (cfun_frame_layout.first_save_gpr_slot - * UNITS_PER_WORD); + * UNITS_PER_LONG); } else if (TARGET_BACKCHAIN) /* kernel stack layout */ { cfun_frame_layout.backchain_offset = (STACK_POINTER_OFFSET - - UNITS_PER_WORD); + - UNITS_PER_LONG); cfun_frame_layout.gprs_offset = (cfun_frame_layout.backchain_offset - (STACK_POINTER_REGNUM - cfun_frame_layout.first_save_gpr_slot + 1) - * UNITS_PER_WORD); + * UNITS_PER_LONG); if (TARGET_64BIT) { @@ -7221,7 +7230,7 @@ s390_frame_info (void) else { if (TARGET_BACKCHAIN) - cfun_frame_layout.frame_size += UNITS_PER_WORD; + cfun_frame_layout.frame_size += UNITS_PER_LONG; /* No alignment trouble here because f8-f15 are only saved under 64 bit. */ @@ -7340,7 +7349,7 @@ s390_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) case GENERAL_REGS: if (REGNO_PAIR_OK (regno, mode)) { - if (TARGET_64BIT + if (TARGET_ZARCH || (mode != TFmode && mode != TCmode && mode != TDmode)) return true; } @@ -7471,7 +7480,7 @@ s390_initial_elimination_offset (int from, int to) index = RETURN_REGNUM - cfun_frame_layout.first_save_gpr_slot; gcc_assert (index >= 0); offset = cfun_frame_layout.frame_size + cfun_frame_layout.gprs_offset; - offset += index * UNITS_PER_WORD; + offset += index * UNITS_PER_LONG; break; case BASE_REGNUM: @@ -7607,7 +7616,7 @@ save_gprs (rtx base, int offset, int first, int last) if (start > last) return insn; - addr = plus_constant (base, offset + (start - first) * UNITS_PER_WORD); + addr = plus_constant (base, offset + (start - first) * UNITS_PER_LONG); note = gen_store_multiple (gen_rtx_MEM (Pmode, addr), gen_rtx_REG (Pmode, start), GEN_INT (last - start + 1)); @@ -7756,7 +7765,7 @@ s390_emit_prologue (void) { insn = save_gprs (stack_pointer_rtx, cfun_frame_layout.gprs_offset + - UNITS_PER_WORD * (cfun_frame_layout.first_save_gpr + UNITS_PER_LONG * (cfun_frame_layout.first_save_gpr - cfun_frame_layout.first_save_gpr_slot), cfun_frame_layout.first_save_gpr, cfun_frame_layout.last_save_gpr); @@ -8153,7 +8162,7 @@ s390_emit_epilogue (bool sibcall) addr = plus_constant (frame_pointer, offset + cfun_frame_layout.gprs_offset + (i - cfun_frame_layout.first_save_gpr_slot) - * UNITS_PER_WORD); + * UNITS_PER_LONG); addr = gen_rtx_MEM (Pmode, addr); set_mem_alias_set (addr, get_frame_alias_set ()); emit_move_insn (addr, gen_rtx_REG (Pmode, i)); @@ -8182,7 +8191,7 @@ s390_emit_epilogue (bool sibcall) offset + cfun_frame_layout.gprs_offset + (RETURN_REGNUM - cfun_frame_layout.first_save_gpr_slot) - * UNITS_PER_WORD); + * UNITS_PER_LONG); addr = gen_rtx_MEM (Pmode, addr); set_mem_alias_set (addr, get_frame_alias_set ()); emit_move_insn (return_reg, addr); @@ -8193,7 +8202,7 @@ s390_emit_epilogue (bool sibcall) offset + cfun_frame_layout.gprs_offset + (cfun_frame_layout.first_restore_gpr - cfun_frame_layout.first_save_gpr_slot) - * UNITS_PER_WORD, + * UNITS_PER_LONG, cfun_frame_layout.first_restore_gpr, cfun_frame_layout.last_restore_gpr); insn = emit_insn (insn); @@ -8357,7 +8366,7 @@ s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, else if (s390_function_arg_integer (mode, type)) { int size = s390_function_arg_size (mode, type); - cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD); + cum->gprs += ((size + UNITS_PER_LONG - 1) / UNITS_PER_LONG); } else gcc_unreachable (); @@ -8396,12 +8405,25 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, else if (s390_function_arg_integer (mode, type)) { int size = s390_function_arg_size (mode, type); - int n_gprs = (size + UNITS_PER_WORD-1) / UNITS_PER_WORD; + int n_gprs = (size + UNITS_PER_LONG - 1) / UNITS_PER_LONG; if (cum->gprs + n_gprs > GP_ARG_NUM_REG) return 0; - else + else if (n_gprs == 1 || UNITS_PER_WORD == UNITS_PER_LONG) return gen_rtx_REG (mode, cum->gprs + 2); + else if (n_gprs == 2) + { + rtvec p = rtvec_alloc (2); + + RTVEC_ELT (p, 0) + = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, cum->gprs + 2), + const0_rtx); + RTVEC_ELT (p, 1) + = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, cum->gprs + 3), + GEN_INT (4)); + + return gen_rtx_PARALLEL (mode, p); + } } /* After the real arguments, expand_call calls us once again @@ -8451,7 +8473,7 @@ s390_promote_function_mode (const_tree type, enum machine_mode mode, int for_return ATTRIBUTE_UNUSED) { if (INTEGRAL_MODE_P (mode) - && GET_MODE_SIZE (mode) < UNITS_PER_WORD) + && GET_MODE_SIZE (mode) < UNITS_PER_LONG) { if (POINTER_TYPE_P (type)) *punsignedp = POINTERS_EXTEND_UNSIGNED; @@ -8479,8 +8501,22 @@ s390_function_value (const_tree type, const_tree fn, enum machine_mode mode) if (TARGET_HARD_FLOAT && SCALAR_FLOAT_MODE_P (mode)) return gen_rtx_REG (mode, 16); - else + else if (GET_MODE_SIZE (mode) <= UNITS_PER_LONG + || UNITS_PER_LONG == UNITS_PER_WORD) return gen_rtx_REG (mode, 2); + else if (GET_MODE_SIZE (mode) == 2 * UNITS_PER_LONG) + { + rtvec p = rtvec_alloc (2); + + RTVEC_ELT (p, 0) + = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, 2), const0_rtx); + RTVEC_ELT (p, 1) + = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, 3), GEN_INT (4)); + + return gen_rtx_PARALLEL (mode, p); + } + + gcc_unreachable (); } @@ -8628,7 +8664,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) { t = make_tree (TREE_TYPE (sav), return_address_pointer_rtx); t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t, - size_int (-RETURN_REGNUM * UNITS_PER_WORD)); + size_int (-RETURN_REGNUM * UNITS_PER_LONG)); t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t); TREE_SIDE_EFFECTS (t) = 1; @@ -8702,9 +8738,9 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, /* kernel stack layout on 31 bit: It is assumed here that no padding will be added by s390_frame_info because for va_args always an even number of gprs has to be saved r15-r2 = 14 regs. */ - sav_ofs = 2 * UNITS_PER_WORD; - sav_scale = UNITS_PER_WORD; - size = UNITS_PER_WORD; + sav_ofs = 2 * UNITS_PER_LONG; + sav_scale = UNITS_PER_LONG; + size = UNITS_PER_LONG; max_reg = GP_ARG_NUM_REG - n_reg; } else if (s390_function_arg_float (TYPE_MODE (type), type)) @@ -8719,7 +8755,7 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, indirect_p = 0; reg = fpr; n_reg = 1; - sav_ofs = 16 * UNITS_PER_WORD; + sav_ofs = 16 * UNITS_PER_LONG; sav_scale = 8; max_reg = FP_ARG_NUM_REG - n_reg; } @@ -8734,17 +8770,17 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, /* Otherwise into GP registers. */ indirect_p = 0; reg = gpr; - n_reg = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + n_reg = (size + UNITS_PER_LONG - 1) / UNITS_PER_LONG; /* kernel stack layout on 31 bit: It is assumed here that no padding will be added by s390_frame_info because for va_args always an even number of gprs has to be saved r15-r2 = 14 regs. */ - sav_ofs = 2 * UNITS_PER_WORD; + sav_ofs = 2 * UNITS_PER_LONG; - if (size < UNITS_PER_WORD) - sav_ofs += UNITS_PER_WORD - size; + if (size < UNITS_PER_LONG) + sav_ofs += UNITS_PER_LONG - size; - sav_scale = UNITS_PER_WORD; + sav_scale = UNITS_PER_LONG; max_reg = GP_ARG_NUM_REG - n_reg; } @@ -8776,9 +8812,9 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, /* ... Otherwise out of the overflow area. */ t = ovf; - if (size < UNITS_PER_WORD) + if (size < UNITS_PER_LONG) t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, - size_int (UNITS_PER_WORD - size)); + size_int (UNITS_PER_LONG - size)); gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue); @@ -9002,7 +9038,7 @@ s390_function_profiler (FILE *file, int labelno) op[0] = gen_rtx_REG (Pmode, RETURN_REGNUM); op[1] = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM); - op[1] = gen_rtx_MEM (Pmode, plus_constant (op[1], UNITS_PER_WORD)); + op[1] = gen_rtx_MEM (Pmode, plus_constant (op[1], UNITS_PER_LONG)); op[2] = gen_rtx_REG (Pmode, 1); op[3] = gen_rtx_SYMBOL_REF (Pmode, label); @@ -9408,14 +9444,36 @@ s390_call_saved_register_used (tree call_expr) s390_function_arg_advance (&cum, mode, type, 0); - if (parm_rtx && REG_P (parm_rtx)) - { + if (!parm_rtx) + continue; + + if (REG_P (parm_rtx)) + { for (reg = 0; reg < HARD_REGNO_NREGS (REGNO (parm_rtx), GET_MODE (parm_rtx)); reg++) - if (! call_used_regs[reg + REGNO (parm_rtx)]) - return true; + if (!call_used_regs[reg + REGNO (parm_rtx)]) + return true; + } + + if (GET_CODE (parm_rtx) == PARALLEL) + { + int i; + + for (i = 0; i < XVECLEN (parm_rtx, 0); i++) + { + rtx r = XEXP (XVECEXP (parm_rtx, 0, i), 0); + + gcc_assert (REG_P (r)); + + for (reg = 0; + reg < HARD_REGNO_NREGS (REGNO (r), GET_MODE (r)); + reg++) + if (!call_used_regs[reg + REGNO (r)]) + return true; + } } + } return false; } @@ -9661,7 +9719,7 @@ s390_optimize_prologue (void) { new_insn = save_gprs (base, off + (cfun_frame_layout.first_save_gpr - - first) * UNITS_PER_WORD, + - first) * UNITS_PER_LONG, cfun_frame_layout.first_save_gpr, cfun_frame_layout.last_save_gpr); new_insn = emit_insn_before (new_insn, insn); @@ -9722,7 +9780,7 @@ s390_optimize_prologue (void) { new_insn = restore_gprs (base, off + (cfun_frame_layout.first_restore_gpr - - first) * UNITS_PER_WORD, + - first) * UNITS_PER_LONG, cfun_frame_layout.first_restore_gpr, cfun_frame_layout.last_restore_gpr); new_insn = emit_insn_before (new_insn, insn); @@ -10319,12 +10377,16 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop) #undef TARGET_DEFAULT_TARGET_FLAGS #define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_FUSED_MADD) + #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION s390_handle_option #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO s390_encode_section_info +#undef TARGET_SCALAR_MODE_SUPPORTED_P +#define TARGET_SCALAR_MODE_SUPPORTED_P s390_scalar_mode_supported_p + #ifdef HAVE_AS_TLS #undef TARGET_HAVE_TLS #define TARGET_HAVE_TLS true @@ -10438,6 +10500,9 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop) #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT s390_trampoline_init +#undef TARGET_UNWIND_WORD_MODE +#define TARGET_UNWIND_WORD_MODE s390_unwind_word_mode + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-s390.h" diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index 2da8b8753e2..5acdd586058 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -108,6 +108,8 @@ extern int s390_arch_flags; builtin_assert ("cpu=s390"); \ builtin_assert ("machine=s390"); \ builtin_define ("__s390__"); \ + if (TARGET_ZARCH) \ + builtin_define ("__zarch__"); \ if (TARGET_64BIT) \ builtin_define ("__s390x__"); \ if (TARGET_LONG_DOUBLE_128) \ @@ -185,17 +187,6 @@ extern int s390_arch_flags; #define S390_TDC_INFINITY (S390_TDC_POSITIVE_INFINITY \ | S390_TDC_NEGATIVE_INFINITY ) -/* In libgcc2, determine target settings as compile-time constants. */ -#ifdef IN_LIBGCC2 -#undef TARGET_64BIT -#ifdef __s390x__ -#define TARGET_64BIT 1 -#else -#define TARGET_64BIT 0 -#endif -#endif - - /* Target machine storage layout. */ /* Everything is big-endian. */ @@ -203,12 +194,33 @@ extern int s390_arch_flags; #define BYTES_BIG_ENDIAN 1 #define WORDS_BIG_ENDIAN 1 -/* Width of a word, in units (bytes). */ -#define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4) +#define STACK_SIZE_MODE (Pmode) + #ifndef IN_LIBGCC2 -#define MIN_UNITS_PER_WORD 4 + +/* Width of a word, in units (bytes). */ + #define UNITS_PER_WORD (TARGET_ZARCH ? 8 : 4) + +/* Width of a pointer. To be used instead of UNITS_PER_WORD in + ABI-relevant contexts. This always matches + GET_MODE_SIZE (Pmode). */ + #define UNITS_PER_LONG (TARGET_64BIT ? 8 : 4) + #define MIN_UNITS_PER_WORD 4 + #define MAX_BITS_PER_WORD 64 +#else + + /* In libgcc, UNITS_PER_WORD has ABI-relevant effects, e.g. whether + the library should export TImode functions or not. Thus, we have + to redefine UNITS_PER_WORD depending on __s390x__ for libgcc. */ + #ifdef __s390x__ + #define UNITS_PER_WORD 8 + #else + #define UNITS_PER_WORD 4 + #endif #endif -#define MAX_BITS_PER_WORD 64 + +/* Width of a pointer, in bits. */ +#define POINTER_SIZE (TARGET_64BIT ? 64 : 32) /* Allocation boundary (in *bits*) for storing arguments in argument list. */ #define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32) @@ -402,6 +414,15 @@ extern int s390_arch_flags; (((MODE1) == SFmode || (MODE1) == DFmode) \ == ((MODE2) == SFmode || (MODE2) == DFmode)) +/* When generating code that runs in z/Architecture mode, + but conforms to the 31-bit ABI, GPRs can hold 8 bytes; + the ABI guarantees only that the lower 4 bytes are + saved across calls, however. */ +#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \ + (!TARGET_64BIT && TARGET_ZARCH \ + && GET_MODE_SIZE (MODE) > 4 \ + && (((REGNO) >= 6 && (REGNO) <= 15) || (REGNO) == 32)) + /* Maximum number of registers to represent a value of mode MODE in a register of class CLASS. */ #define CLASS_MAX_NREGS(CLASS, MODE) \ @@ -573,7 +594,7 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; the corresponding RETURN_REGNUM register was saved. */ #define DYNAMIC_CHAIN_ADDRESS(FRAME) \ (TARGET_PACKED_STACK ? \ - plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_WORD) : (FRAME)) + plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_LONG) : (FRAME)) /* For -mpacked-stack this adds 160 - 8 (96 - 4) to the output of builtin_frame_address. Otherwise arg pointer - @@ -609,6 +630,9 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4 \ : DW_EH_PE_absptr) +/* Register save slot alignment. */ +#define DWARF_CIE_DATA_ALIGNMENT (-UNITS_PER_LONG) + /* Frame registers. */ @@ -790,19 +814,19 @@ do { \ /* The maximum number of bytes that a single instruction can move quickly between memory and registers or between two memory locations. */ -#define MOVE_MAX (TARGET_64BIT ? 16 : 8) -#define MOVE_MAX_PIECES (TARGET_64BIT ? 8 : 4) +#define MOVE_MAX (TARGET_ZARCH ? 16 : 8) +#define MOVE_MAX_PIECES (TARGET_ZARCH ? 8 : 4) #define MAX_MOVE_MAX 16 /* Determine whether to use move_by_pieces or block move insn. */ #define MOVE_BY_PIECES_P(SIZE, ALIGN) \ ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \ - || (TARGET_64BIT && (SIZE) == 8) ) + || (TARGET_ZARCH && (SIZE) == 8) ) /* Determine whether to use clear_by_pieces or block clear insn. */ #define CLEAR_BY_PIECES_P(SIZE, ALIGN) \ ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \ - || (TARGET_64BIT && (SIZE) == 8) ) + || (TARGET_ZARCH && (SIZE) == 8) ) /* This macro is used to determine whether store_by_pieces should be called to "memcpy" storage when the source is a constant string. */ @@ -907,7 +931,7 @@ do { \ #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ do { \ char buf[32]; \ - fputs (integer_asm_op (UNITS_PER_WORD, TRUE), (FILE)); \ + fputs (integer_asm_op (UNITS_PER_LONG, TRUE), (FILE)); \ ASM_GENERATE_INTERNAL_LABEL (buf, "L", (VALUE)); \ assemble_name ((FILE), buf); \ fputc ('\n', (FILE)); \ @@ -917,7 +941,7 @@ do { \ #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ do { \ char buf[32]; \ - fputs (integer_asm_op (UNITS_PER_WORD, TRUE), (FILE)); \ + fputs (integer_asm_op (UNITS_PER_LONG, TRUE), (FILE)); \ ASM_GENERATE_INTERNAL_LABEL (buf, "L", (VALUE)); \ assemble_name ((FILE), buf); \ fputc ('-', (FILE)); \ diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 5ce6ed0ec22..40668984f02 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -337,21 +337,25 @@ ;; These mode iterators allow 31-bit and 64-bit GPR patterns to be generated ;; from the same template. -(define_mode_iterator GPR [(DI "TARGET_64BIT") SI]) +(define_mode_iterator GPR [(DI "TARGET_ZARCH") SI]) (define_mode_iterator DSI [DI SI]) ;; These mode iterators allow :P to be used for patterns that operate on ;; pointer-sized quantities. Exactly one of the two alternatives will match. -(define_mode_iterator DP [(TI "TARGET_64BIT") (DI "!TARGET_64BIT")]) (define_mode_iterator P [(DI "TARGET_64BIT") (SI "!TARGET_64BIT")]) +;; These macros refer to the actual word_mode of the configuration. This is equal +;; to Pmode except on 31-bit machines in zarch mode. +(define_mode_iterator DW [(TI "TARGET_ZARCH") (DI "!TARGET_ZARCH")]) +(define_mode_iterator W [(DI "TARGET_ZARCH") (SI "!TARGET_ZARCH")]) + ;; This mode iterator allows the QI and HI patterns to be defined from ;; the same template. (define_mode_iterator HQI [HI QI]) ;; This mode iterator allows the integer patterns to be defined from the ;; same template. -(define_mode_iterator INT [(DI "TARGET_64BIT") SI HI QI]) +(define_mode_iterator INT [(DI "TARGET_ZARCH") SI HI QI]) (define_mode_iterator INTALL [TI DI SI HI QI]) ;; This iterator allows some 'ashift' and 'lshiftrt' pattern to be defined from @@ -455,7 +459,7 @@ ;; variant for long displacements. (define_mode_attr y [(DI "g") (SI "y")]) -;; In DP templates, a string like "cds" will expand to "cdsg" in TImode +;; In DW templates, a string like "cds" will expand to "cdsg" in TImode ;; and "cds" in DImode. (define_mode_attr tg [(TI "g") (DI "")]) @@ -506,7 +510,7 @@ (match_operand:DI 1 "immediate_operand" "N0HD0,N1HD0,N2HD0,N3HD0")) (match_operand:DI 2 "immediate_operand" "n,n,n,n")))] - "TARGET_64BIT + "TARGET_ZARCH && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true)) && s390_single_part (operands[1], DImode, HImode, 0) >= 0" "@ @@ -556,7 +560,7 @@ (match_operand:DI 1 "const0_operand" ""))) (set (match_operand:DI 2 "register_operand" "=d,d") (sign_extend:DI (match_dup 0)))] - "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCSmode) && TARGET_ZARCH" "ltgfr\t%2,%0 ltgf\t%2,%0" [(set_attr "op_type" "RRE,RXY") @@ -596,7 +600,7 @@ (match_operand:DI 1 "const0_operand" ""))) (set (match_operand:DI 2 "register_operand" "=d") (match_dup 0))] - "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT && !TARGET_EXTIMM" + "s390_match_ccmode(insn, CCSmode) && TARGET_ZARCH && !TARGET_EXTIMM" "ltgr\t%2,%0" [(set_attr "op_type" "RRE") (set_attr "z10prop" "z10_fr_E1")]) @@ -632,7 +636,7 @@ [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "register_operand" "d") (match_operand:DI 1 "const0_operand" "")))] - "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT" + "s390_match_ccmode(insn, CCSmode) && !TARGET_ZARCH" "srda\t%0,0" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -720,7 +724,7 @@ [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "nonimmediate_operand" "%d,d,d,d,Q") (match_operand:DI 1 "general_operand" "d,K,Os,RT,BQ")))] - "s390_match_ccmode (insn, CCTmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCTmode) && TARGET_ZARCH" "@ cgr\t%0,%1 cghi\t%0,%h1 @@ -752,7 +756,7 @@ (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,RT,b")) (match_operand:DI 0 "register_operand" "d, d,d")))] - "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCSRmode) && TARGET_ZARCH" "@ cgfr\t%0,%1 cgf\t%0,%1 @@ -847,7 +851,7 @@ (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,RT,b")) (match_operand:DI 0 "register_operand" "d, d,d")))] - "s390_match_ccmode (insn, CCURmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCURmode) && TARGET_ZARCH" "@ clgfr\t%0,%1 clgf\t%0,%1 @@ -863,7 +867,7 @@ "d, d,d,Q, d, Q,BQ") (match_operand:DI 1 "general_operand" "d,Op,b,D,RT,BQ,Q")))] - "s390_match_ccmode (insn, CCUmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCUmode) && TARGET_ZARCH" "@ clgr\t%0,%1 clgfi\t%0,%1 @@ -1115,7 +1119,7 @@ (define_insn "movti" [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o") (match_operand:TI 1 "general_operand" "QS,d,dPRT,d"))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ lmg\t%0,%N0,%S1 stmg\t%1,%N1,%S0 @@ -1127,7 +1131,7 @@ (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") (match_operand:TI 1 "general_operand" ""))] - "TARGET_64BIT && reload_completed + "TARGET_ZARCH && reload_completed && s390_split_ok_p (operands[0], operands[1], TImode, 0)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))] @@ -1141,7 +1145,7 @@ (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") (match_operand:TI 1 "general_operand" ""))] - "TARGET_64BIT && reload_completed + "TARGET_ZARCH && reload_completed && s390_split_ok_p (operands[0], operands[1], TImode, 1)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))] @@ -1155,11 +1159,12 @@ (define_split [(set (match_operand:TI 0 "register_operand" "") (match_operand:TI 1 "memory_operand" ""))] - "TARGET_64BIT && reload_completed + "TARGET_ZARCH && reload_completed && !s_operand (operands[1], VOIDmode)" [(set (match_dup 0) (match_dup 1))] { rtx addr = operand_subword (operands[0], 1, 0, TImode); + addr = gen_lowpart (Pmode, addr); s390_load_address (addr, XEXP (operands[1], 0)); operands[1] = replace_equiv_address (operands[1], addr); }) @@ -1308,7 +1313,7 @@ (match_operand:DI 1 "general_operand" "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,d,f,L,b,d,RT, d,*f,R,T,*f,*f,d,K,t,d,t,Q"))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ lghi\t%0,%h1 llihh\t%0,%i1 @@ -1375,7 +1380,7 @@ (define_split [(set (match_operand:DI 0 "register_operand" "") (match_operand:DI 1 "register_operand" ""))] - "TARGET_64BIT && ACCESS_REG_P (operands[1])" + "TARGET_ZARCH && ACCESS_REG_P (operands[1])" [(set (match_dup 2) (match_dup 3)) (set (match_dup 0) (ashift:DI (match_dup 0) (const_int 32))) (set (strict_low_part (match_dup 2)) (match_dup 4))] @@ -1385,7 +1390,7 @@ (define_split [(set (match_operand:DI 0 "register_operand" "") (match_operand:DI 1 "register_operand" ""))] - "TARGET_64BIT && ACCESS_REG_P (operands[0]) + "TARGET_ZARCH && ACCESS_REG_P (operands[0]) && dead_or_set_p (insn, operands[1])" [(set (match_dup 3) (match_dup 2)) (set (match_dup 1) (lshiftrt:DI (match_dup 1) (const_int 32))) @@ -1396,7 +1401,7 @@ (define_split [(set (match_operand:DI 0 "register_operand" "") (match_operand:DI 1 "register_operand" ""))] - "TARGET_64BIT && ACCESS_REG_P (operands[0]) + "TARGET_ZARCH && ACCESS_REG_P (operands[0]) && !dead_or_set_p (insn, operands[1])" [(set (match_dup 3) (match_dup 2)) (set (match_dup 1) (rotate:DI (match_dup 1) (const_int 32))) @@ -1410,7 +1415,7 @@ "=d,d,Q,S,d ,o,!*f,!*f,!*f,!R,!T,d") (match_operand:DI 1 "general_operand" " Q,S,d,d,dPRT,d, *f, R, T,*f,*f,b"))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "@ lm\t%0,%N0,%S1 lmy\t%0,%N0,%S1 @@ -1433,7 +1438,7 @@ (define_split [(set (match_operand:DI 0 "register_operand" "") (match_operand:DI 1 "memory_operand" ""))] - "!TARGET_64BIT && reload_completed && TARGET_Z10 + "!TARGET_ZARCH && reload_completed && TARGET_Z10 && larl_operand (XEXP (operands[1], 0), SImode)" [(set (match_dup 2) (match_dup 3)) (set (match_dup 0) (match_dup 1))] @@ -1446,7 +1451,7 @@ (define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "general_operand" ""))] - "!TARGET_64BIT && reload_completed + "!TARGET_ZARCH && reload_completed && s390_split_ok_p (operands[0], operands[1], DImode, 0)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))] @@ -1460,7 +1465,7 @@ (define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "general_operand" ""))] - "!TARGET_64BIT && reload_completed + "!TARGET_ZARCH && reload_completed && s390_split_ok_p (operands[0], operands[1], DImode, 1)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))] @@ -1474,7 +1479,7 @@ (define_split [(set (match_operand:DI 0 "register_operand" "") (match_operand:DI 1 "memory_operand" ""))] - "!TARGET_64BIT && reload_completed + "!TARGET_ZARCH && reload_completed && !FP_REG_P (operands[0]) && !s_operand (operands[1], VOIDmode)" [(set (match_dup 0) (match_dup 1))] @@ -1487,7 +1492,7 @@ (define_peephole2 [(set (match_operand:DI 0 "register_operand" "") (mem:DI (match_operand 1 "address_operand" "")))] - "TARGET_64BIT + "TARGET_ZARCH && !FP_REG_P (operands[0]) && GET_CODE (operands[1]) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (operands[1]) @@ -1826,8 +1831,8 @@ && register_operand (operands[0], VOIDmode) && GET_CODE (operands[1]) == MEM) { - rtx tmp = gen_reg_rtx (word_mode); - rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]); + rtx tmp = gen_reg_rtx (DImode); + rtx ext = gen_rtx_ZERO_EXTEND (DImode, operands[1]); emit_insn (gen_rtx_SET (VOIDmode, tmp, ext)); operands[1] = gen_lowpart (QImode, tmp); } @@ -1905,7 +1910,7 @@ (define_insn "movstrictsi" [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d,d")) (match_operand:SI 1 "general_operand" "d,R,T,t"))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ lr\t%0,%1 l\t%0,%1 @@ -1928,7 +1933,7 @@ (define_insn "*mov_64" [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o, d,QS, d,o") (match_operand:TD_TF 1 "general_operand" " G,f,o,f,QS, d,dRT,d"))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ lzxr\t%0 lxr\t%0,%1 @@ -1944,7 +1949,7 @@ (define_insn "*mov_31" [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o") (match_operand:TD_TF 1 "general_operand" " G,f,o,f"))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "@ lzxr\t%0 lxr\t%0,%1 @@ -1958,7 +1963,7 @@ (define_split [(set (match_operand:TD_TF 0 "nonimmediate_operand" "") (match_operand:TD_TF 1 "general_operand" ""))] - "TARGET_64BIT && reload_completed + "TARGET_ZARCH && reload_completed && s390_split_ok_p (operands[0], operands[1], mode, 0)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))] @@ -1972,7 +1977,7 @@ (define_split [(set (match_operand:TD_TF 0 "nonimmediate_operand" "") (match_operand:TD_TF 1 "general_operand" ""))] - "TARGET_64BIT && reload_completed + "TARGET_ZARCH && reload_completed && s390_split_ok_p (operands[0], operands[1], mode, 1)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))] @@ -1986,7 +1991,7 @@ (define_split [(set (match_operand:TD_TF 0 "register_operand" "") (match_operand:TD_TF 1 "memory_operand" ""))] - "TARGET_64BIT && reload_completed + "TARGET_ZARCH && reload_completed && !FP_REG_P (operands[0]) && !s_operand (operands[1], VOIDmode)" [(set (match_dup 0) (match_dup 1))] @@ -2045,7 +2050,7 @@ "=f,f,f,d,f,f,R,T,d, d,RT") (match_operand:DD_DF 1 "general_operand" " G,f,d,f,R,T,f,f,d,RT, d"))] - "TARGET_64BIT && TARGET_DFP" + "TARGET_DFP" "@ lzdr\t%0 ldr\t%0,%1 @@ -2077,7 +2082,7 @@ (define_insn "*mov_64" [(set (match_operand:DD_DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d, d,RT") (match_operand:DD_DF 1 "general_operand" "G,f,R,T,f,f,d,RT, d"))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ lzdr\t%0 ldr\t%0,%1 @@ -2106,7 +2111,7 @@ "=f,f,f,f,R,T,d,d,Q,S, d,o") (match_operand:DD_DF 1 "general_operand" " G,f,R,T,f,f,Q,S,d,d,dPRT,d"))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "@ lzdr\t%0 ldr\t%0,%1 @@ -2127,7 +2132,7 @@ (define_split [(set (match_operand:DD_DF 0 "nonimmediate_operand" "") (match_operand:DD_DF 1 "general_operand" ""))] - "!TARGET_64BIT && reload_completed + "!TARGET_ZARCH && reload_completed && s390_split_ok_p (operands[0], operands[1], mode, 0)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))] @@ -2141,7 +2146,7 @@ (define_split [(set (match_operand:DD_DF 0 "nonimmediate_operand" "") (match_operand:DD_DF 1 "general_operand" ""))] - "!TARGET_64BIT && reload_completed + "!TARGET_ZARCH && reload_completed && s390_split_ok_p (operands[0], operands[1], mode, 1)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))] @@ -2155,7 +2160,7 @@ (define_split [(set (match_operand:DD_DF 0 "register_operand" "") (match_operand:DD_DF 1 "memory_operand" ""))] - "!TARGET_64BIT && reload_completed + "!TARGET_ZARCH && reload_completed && !FP_REG_P (operands[0]) && !s_operand (operands[1], VOIDmode)" [(set (match_dup 0) (match_dup 1))] @@ -2304,7 +2309,7 @@ count = INTVAL (operands[2]); regno = REGNO (operands[0]); mode = GET_MODE (operands[0]); - if (mode != SImode && mode != word_mode) + if (mode != SImode && (!TARGET_ZARCH || mode != DImode)) FAIL; operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); @@ -2342,7 +2347,7 @@ [(match_parallel 0 "load_multiple_operation" [(set (match_operand:DI 1 "register_operand" "=r") (match_operand:DI 2 "s_operand" "QS"))])] - "reload_completed && word_mode == DImode" + "reload_completed && TARGET_ZARCH" { int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1); @@ -2393,7 +2398,7 @@ count = INTVAL (operands[2]); regno = REGNO (operands[1]); mode = GET_MODE (operands[1]); - if (mode != SImode && mode != word_mode) + if (mode != SImode && (!TARGET_ZARCH || mode != DImode)) FAIL; operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); @@ -2433,7 +2438,7 @@ [(match_parallel 0 "store_multiple_operation" [(set (match_operand:DI 1 "s_operand" "=QS") (match_operand:DI 2 "register_operand" "r"))])] - "reload_completed && word_mode == DImode" + "reload_completed && TARGET_ZARCH" { int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1); @@ -2715,11 +2720,12 @@ (clobber (reg:CC CC_REGNUM))])] "" { - enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode; - rtx reg0 = gen_reg_rtx (dword_mode); - rtx reg1 = gen_reg_rtx (dword_mode); - rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0)); - rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1)); + enum machine_mode sreg_mode = TARGET_ZARCH ? DImode : SImode; + enum machine_mode dreg_mode = TARGET_ZARCH ? TImode : DImode; + rtx reg0 = gen_reg_rtx (dreg_mode); + rtx reg1 = gen_reg_rtx (dreg_mode); + rtx addr0 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg0)); + rtx addr1 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg1)); rtx len0 = gen_lowpart (Pmode, reg0); rtx len1 = gen_lowpart (Pmode, reg1); @@ -2745,7 +2751,20 @@ (use (match_dup 2)) (use (match_dup 3)) (clobber (reg:CC CC_REGNUM))] - "" + "TARGET_64BIT || !TARGET_ZARCH" + "mvcle\t%0,%1,0\;jo\t.-4" + [(set_attr "length" "8") + (set_attr "type" "vs")]) + +(define_insn "*movmem_long_31z" + [(clobber (match_operand:TI 0 "register_operand" "=d")) + (clobber (match_operand:TI 1 "register_operand" "=d")) + (set (mem:BLK (subreg:SI (match_operand:TI 2 "register_operand" "0") 4)) + (mem:BLK (subreg:SI (match_operand:TI 3 "register_operand" "1") 4))) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_64BIT && TARGET_ZARCH" "mvcle\t%0,%1,0\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) @@ -2917,10 +2936,11 @@ (clobber (reg:CC CC_REGNUM))])] "" { - enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode; - rtx reg0 = gen_reg_rtx (dword_mode); - rtx reg1 = gen_reg_rtx (dword_mode); - rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0)); + enum machine_mode sreg_mode = TARGET_ZARCH ? DImode : SImode; + enum machine_mode dreg_mode = TARGET_ZARCH ? TImode : DImode; + rtx reg0 = gen_reg_rtx (dreg_mode); + rtx reg1 = gen_reg_rtx (dreg_mode); + rtx addr0 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg0)); rtx len0 = gen_lowpart (Pmode, reg0); emit_clobber (reg0); @@ -2941,7 +2961,7 @@ (use (match_dup 3)) (use (match_operand: 1 "register_operand" "d")) (clobber (reg:CC CC_REGNUM))] - "" + "TARGET_64BIT || !TARGET_ZARCH" "mvcle\t%0,%1,%Y2\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) @@ -2954,10 +2974,24 @@ (use (match_dup 3)) (use (match_operand: 1 "register_operand" "d")) (clobber (reg:CC CC_REGNUM))] - "(INTVAL (operands[4]) & 255) == 255" + "(TARGET_64BIT || !TARGET_ZARCH) && + (INTVAL (operands[4]) & 255) == 255" + "mvcle\t%0,%1,%Y2\;jo\t.-4" + [(set_attr "length" "8") + (set_attr "type" "vs")]) + +(define_insn "*setmem_long_31z" + [(clobber (match_operand:TI 0 "register_operand" "=d")) + (set (mem:BLK (subreg:SI (match_operand:TI 3 "register_operand" "0") 4)) + (match_operand 2 "shift_count_or_setmem_operand" "Y")) + (use (match_dup 3)) + (use (match_operand:TI 1 "register_operand" "d")) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_64BIT && TARGET_ZARCH" "mvcle\t%0,%1,%Y2\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) + ; ; cmpmemM instruction pattern(s). ; @@ -3071,11 +3105,12 @@ (use (match_dup 3))])] "" { - enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode; - rtx reg0 = gen_reg_rtx (dword_mode); - rtx reg1 = gen_reg_rtx (dword_mode); - rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0)); - rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1)); + enum machine_mode sreg_mode = TARGET_ZARCH ? DImode : SImode; + enum machine_mode dreg_mode = TARGET_ZARCH ? TImode : DImode; + rtx reg0 = gen_reg_rtx (dreg_mode); + rtx reg1 = gen_reg_rtx (dreg_mode); + rtx addr0 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg0)); + rtx addr1 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg1)); rtx len0 = gen_lowpart (Pmode, reg0); rtx len1 = gen_lowpart (Pmode, reg1); @@ -3101,11 +3136,25 @@ (mem:BLK (subreg:P (match_operand: 3 "register_operand" "1") 0)))) (use (match_dup 2)) (use (match_dup 3))] - "" + "TARGET_64BIT || !TARGET_ZARCH" "clcle\t%0,%1,0\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) +(define_insn "*cmpmem_long_31z" + [(clobber (match_operand:TI 0 "register_operand" "=d")) + (clobber (match_operand:TI 1 "register_operand" "=d")) + (set (reg:CCU CC_REGNUM) + (compare:CCU (mem:BLK (subreg:SI (match_operand:TI 2 "register_operand" "0") 4)) + (mem:BLK (subreg:SI (match_operand:TI 3 "register_operand" "1") 4)))) + (use (match_dup 2)) + (use (match_dup 3))] + "!TARGET_64BIT && TARGET_ZARCH" + "clcle\t%0,%1,0\;jo\t.-4" + [(set_attr "op_type" "NN") + (set_attr "type" "vs") + (set_attr "length" "8")]) + ; Convert CCUmode condition code to integer. ; Result is zero if EQ, positive if LTU, negative if GTU. @@ -3147,7 +3196,7 @@ (sign_extend:DI (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] UNSPEC_CCU_TO_INT))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "#" "&& reload_completed" [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34))) @@ -3164,7 +3213,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d") (sign_extend:DI (unspec:SI [(match_dup 1)] UNSPEC_CCU_TO_INT)))] - "s390_match_ccmode (insn, CCSmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCSmode) && TARGET_ZARCH" "#" "&& reload_completed" [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34))) @@ -3199,7 +3248,7 @@ (unspec:DI [(match_operand:BLK 1 "s_operand" "QS") (match_operand 2 "const_int_operand" "n")] UNSPEC_ICM)) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "icmh\t%0,%2,%S1" [(set_attr "op_type" "RSY") (set_attr "z10prop" "z10_super")]) @@ -3209,7 +3258,7 @@ (unspec:DI [(match_operand:BLK 1 "s_operand" "Q,S") (match_operand 2 "const_int_operand" "n,n")] UNSPEC_ICM)) (clobber (reg:CC CC_REGNUM))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "@ icm\t%0,%2,%S1 icmy\t%0,%2,%S1" @@ -3365,10 +3414,10 @@ [(set_attr "op_type" "RIE")]) (define_insn "*insv_mem_reg" - [(set (zero_extract:P (match_operand:QI 0 "memory_operand" "+Q,S") + [(set (zero_extract:W (match_operand:QI 0 "memory_operand" "+Q,S") (match_operand 1 "const_int_operand" "n,n") (const_int 0)) - (match_operand:P 2 "register_operand" "d,d"))] + (match_operand:W 2 "register_operand" "d,d"))] "INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= GET_MODE_BITSIZE (SImode) && INTVAL (operands[1]) % BITS_PER_UNIT == 0" @@ -3388,7 +3437,7 @@ (const_int 0)) (lshiftrt:DI (match_operand:DI 2 "register_operand" "d") (const_int 32)))] - "TARGET_64BIT + "TARGET_ZARCH && INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= GET_MODE_BITSIZE (SImode) && INTVAL (operands[1]) % BITS_PER_UNIT == 0" @@ -3401,11 +3450,11 @@ [(set_attr "op_type" "RSY") (set_attr "z10prop" "z10_super")]) -(define_insn "*insv_reg_imm" - [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d") - (const_int 16) - (match_operand 1 "const_int_operand" "n")) - (match_operand:P 2 "const_int_operand" "n"))] +(define_insn "*insvdi_reg_imm" + [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+d") + (const_int 16) + (match_operand 1 "const_int_operand" "n")) + (match_operand:DI 2 "const_int_operand" "n"))] "TARGET_ZARCH && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) < BITS_PER_WORD @@ -3455,7 +3504,7 @@ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] "" { - if (!TARGET_64BIT) + if (!TARGET_ZARCH) { emit_clobber (operands[0]); emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]); @@ -3468,7 +3517,7 @@ (define_insn "*extendsidi2" [(set (match_operand:DI 0 "register_operand" "=d,d,d") (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,RT,b")))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ lgfr\t%0,%1 lgf\t%0,%1 @@ -3487,7 +3536,7 @@ (sign_extend:DSI (match_operand:HQI 1 "nonimmediate_operand" "")))] "" { - if (mode == DImode && !TARGET_64BIT) + if (mode == DImode && !TARGET_ZARCH) { rtx tmp = gen_reg_rtx (SImode); emit_insn (gen_extendsi2 (tmp, operands[1])); @@ -3513,7 +3562,7 @@ (define_insn "*extendhidi2_extimm" [(set (match_operand:DI 0 "register_operand" "=d,d,d") (sign_extend:DI (match_operand:HI 1 "general_operand" "d,RT,b")))] - "TARGET_64BIT && TARGET_EXTIMM" + "TARGET_ZARCH && TARGET_EXTIMM" "@ lghr\t%0,%1 lgh\t%0,%1 @@ -3526,7 +3575,7 @@ (define_insn "*extendhidi2" [(set (match_operand:DI 0 "register_operand" "=d") (sign_extend:DI (match_operand:HI 1 "memory_operand" "RT")))] - "TARGET_64BIT" + "TARGET_ZARCH" "lgh\t%0,%1" [(set_attr "op_type" "RXY") (set_attr "z10prop" "z10_super_E1")]) @@ -3612,7 +3661,7 @@ (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] "" { - if (!TARGET_64BIT) + if (!TARGET_ZARCH) { emit_clobber (operands[0]); emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]); @@ -3624,7 +3673,7 @@ (define_insn "*zero_extendsidi2" [(set (match_operand:DI 0 "register_operand" "=d,d,d") (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,RT,b")))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ llgfr\t%0,%1 llgf\t%0,%1 @@ -3642,7 +3691,7 @@ [(set (match_operand:DI 0 "register_operand" "=d") (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "RT") 0) (const_int 2147483647)))] - "TARGET_64BIT" + "TARGET_ZARCH" "llgt\t%0,%1" [(set_attr "op_type" "RXE") (set_attr "z10prop" "z10_super_E1")]) @@ -3652,7 +3701,7 @@ (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "RT") 0) (const_int 2147483647))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "#" "&& reload_completed" [(set (match_dup 0) @@ -3675,7 +3724,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o") (const_int 2147483647)))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ llgtr\t%0,%1 llgt\t%0,%N1" @@ -3683,13 +3732,13 @@ (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) (define_split - [(set (match_operand:GPR 0 "register_operand" "") - (and:GPR (match_operand:GPR 1 "nonimmediate_operand" "") + [(set (match_operand:DSI 0 "register_operand" "") + (and:DSI (match_operand:DSI 1 "nonimmediate_operand" "") (const_int 2147483647))) (clobber (reg:CC CC_REGNUM))] "TARGET_ZARCH && reload_completed" [(set (match_dup 0) - (and:GPR (match_dup 1) + (and:DSI (match_dup 1) (const_int 2147483647)))] "") @@ -3702,7 +3751,7 @@ (zero_extend:DI (match_operand:HQI 1 "nonimmediate_operand" "")))] "" { - if (!TARGET_64BIT) + if (!TARGET_ZARCH) { rtx tmp = gen_reg_rtx (SImode); emit_insn (gen_zero_extendsi2 (tmp, operands[1])); @@ -3954,7 +4003,7 @@ (define_expand "fix_truncdi2" [(set (match_operand:DI 0 "register_operand" "") (fix:DI (match_operand:DFP 1 "nonimmediate_operand" "")))] - "TARGET_64BIT && TARGET_HARD_DFP" + "TARGET_ZARCH && TARGET_HARD_DFP" { operands[1] = force_reg (mode, operands[1]); emit_insn (gen_fix_truncdi2_dfp (operands[0], operands[1], @@ -3968,7 +4017,7 @@ (fix:DI (match_operand:DFP 1 "register_operand" "f"))) (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT && TARGET_HARD_DFP" + "TARGET_ZARCH && TARGET_HARD_DFP" "cgtr\t%0,%h2,%1" [(set_attr "op_type" "RRF") (set_attr "type" "ftoidfp")]) @@ -3995,7 +4044,7 @@ (define_insn "floatdi2" [(set (match_operand:FP 0 "register_operand" "=f") (float:FP (match_operand:DI 1 "register_operand" "d")))] - "TARGET_64BIT && TARGET_HARD_FLOAT" + "TARGET_ZARCH && TARGET_HARD_FLOAT" "cgr\t%0,%1" [(set_attr "op_type" "RRE") (set_attr "type" "itof" )]) @@ -4237,7 +4286,7 @@ (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0") (match_operand:TI 2 "general_operand" "do") ) ) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "#" "&& reload_completed" [(parallel @@ -4275,7 +4324,7 @@ (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT")) (match_operand:DI 1 "register_operand" "0,0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ agfr\t%0,%2 agf\t%0,%2" @@ -4288,7 +4337,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d,d") (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCLmode) && TARGET_ZARCH" "@ algfr\t%0,%2 algf\t%0,%2" @@ -4301,7 +4350,7 @@ (match_operand:DI 1 "register_operand" "0,0")) (const_int 0))) (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCLmode) && TARGET_ZARCH" "@ algfr\t%0,%2 algf\t%0,%2" @@ -4313,7 +4362,7 @@ (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT")) (match_operand:DI 1 "register_operand" "0,0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ algfr\t%0,%2 algf\t%0,%2" @@ -4325,7 +4374,7 @@ (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "general_operand" "do") ) ) (clobber (reg:CC CC_REGNUM))] - "!TARGET_64BIT && TARGET_CPU_ZARCH" + "!TARGET_ZARCH && TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel @@ -4645,7 +4694,7 @@ (minus:TI (match_operand:TI 1 "register_operand" "0") (match_operand:TI 2 "general_operand" "do") ) ) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "#" "&& reload_completed" [(parallel @@ -4682,7 +4731,7 @@ (minus:DI (match_operand:DI 1 "register_operand" "0,0") (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT")))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ sgfr\t%0,%2 sgf\t%0,%2" @@ -4696,7 +4745,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d,d") (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCLmode) && TARGET_ZARCH" "@ slgfr\t%0,%2 slgf\t%0,%2" @@ -4709,7 +4758,7 @@ (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))) (const_int 0))) (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCLmode) && TARGET_ZARCH" "@ slgfr\t%0,%2 slgf\t%0,%2" @@ -4721,7 +4770,7 @@ (minus:DI (match_operand:DI 1 "register_operand" "0,0") (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT")))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ slgfr\t%0,%2 slgf\t%0,%2" @@ -4733,7 +4782,7 @@ (minus:DI (match_operand:DI 1 "register_operand" "0") (match_operand:DI 2 "general_operand" "do") ) ) (clobber (reg:CC CC_REGNUM))] - "!TARGET_64BIT && TARGET_CPU_ZARCH" + "!TARGET_ZARCH && TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel @@ -5197,7 +5246,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (mult:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT")) (match_operand:DI 1 "register_operand" "0,0")))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ msgfr\t%0,%2 msgf\t%0,%2" @@ -5208,7 +5257,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d,d,d") (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0") (match_operand:DI 2 "general_operand" "d,K,RT,Os")))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ msgr\t%0,%2 mghi\t%0,%h2 @@ -5259,7 +5308,7 @@ (match_operand:SI 1 "register_operand" "%0,0,0")) (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,R,T"))))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "@ mr\t%0,%2 m\t%0,%2 @@ -5278,7 +5327,7 @@ (match_operand:SI 1 "register_operand" "%0,0")) (zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,RT"))))] - "!TARGET_64BIT && TARGET_CPU_ZARCH" + "!TARGET_ZARCH && TARGET_CPU_ZARCH" "@ mlr\t%0,%2 ml\t%0,%2" @@ -5342,7 +5391,7 @@ (set (match_operand:DI 3 "general_operand" "") (mod:DI (match_dup 1) (match_dup 2)))]) (clobber (match_dup 4))] - "TARGET_64BIT" + "TARGET_ZARCH" { rtx insn, div_equal, mod_equal; @@ -5370,7 +5419,7 @@ (match_operand:DI 2 "general_operand" "d,RT"))) (const_int 64)) (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ dsgr\t%0,%2 dsg\t%0,%2" @@ -5388,7 +5437,7 @@ (const_int 64)) (zero_extend:TI (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ dsgfr\t%0,%2 dsgf\t%0,%2" @@ -5406,7 +5455,7 @@ (set (match_operand:DI 3 "general_operand" "") (umod:DI (match_dup 1) (match_dup 2)))]) (clobber (match_dup 4))] - "TARGET_64BIT" + "TARGET_ZARCH" { rtx insn, div_equal, mod_equal, equal; @@ -5448,7 +5497,7 @@ (zero_extend:TI (truncate:DI (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ dlgr\t%0,%2 dlg\t%0,%2" @@ -5466,7 +5515,7 @@ (set (match_operand:SI 3 "general_operand" "") (mod:SI (match_dup 1) (match_dup 2)))]) (clobber (match_dup 4))] - "!TARGET_64BIT" + "!TARGET_ZARCH" { rtx insn, div_equal, mod_equal, equal; @@ -5506,7 +5555,7 @@ (zero_extend:DI (truncate:SI (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "@ dr\t%0,%2 d\t%0,%2" @@ -5524,7 +5573,7 @@ (set (match_operand:SI 3 "general_operand" "") (umod:SI (match_dup 1) (match_dup 2)))]) (clobber (match_dup 4))] - "!TARGET_64BIT && TARGET_CPU_ZARCH" + "!TARGET_ZARCH && TARGET_CPU_ZARCH" { rtx insn, div_equal, mod_equal, equal; @@ -5566,7 +5615,7 @@ (zero_extend:DI (truncate:SI (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))] - "!TARGET_64BIT && TARGET_CPU_ZARCH" + "!TARGET_ZARCH && TARGET_CPU_ZARCH" "@ dlr\t%0,%2 dl\t%0,%2" @@ -5578,7 +5627,7 @@ (udiv:SI (match_operand:SI 1 "general_operand" "") (match_operand:SI 2 "general_operand" ""))) (clobber (match_dup 3))] - "!TARGET_64BIT && !TARGET_CPU_ZARCH" + "!TARGET_ZARCH && !TARGET_CPU_ZARCH" { rtx insn, udiv_equal, umod_equal, equal; @@ -5664,7 +5713,7 @@ (umod:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "nonimmediate_operand" ""))) (clobber (match_dup 3))] - "!TARGET_64BIT && !TARGET_CPU_ZARCH" + "!TARGET_ZARCH && !TARGET_CPU_ZARCH" { rtx insn, udiv_equal, umod_equal, equal; @@ -5785,7 +5834,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d,d") (and:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" "@ ngr\t%0,%2 ng\t%0,%2" @@ -5798,7 +5847,7 @@ (match_operand:DI 2 "general_operand" "d,RT")) (const_int 0))) (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT + "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH /* Do not steal TM patterns. */ && s390_single_part (operands[2], DImode, HImode, 0) < 0" "@ @@ -5814,7 +5863,7 @@ (match_operand:DI 2 "general_operand" "M,M,N0HDF,N1HDF,N2HDF,N3HDF,N0SDF,N1SDF,d,RT,NxQDF,Q"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT && s390_logical_operator_ok_p (operands)" + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ # # @@ -6104,7 +6153,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d,d") (ior:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" "@ ogr\t%0,%2 og\t%0,%2" @@ -6117,7 +6166,7 @@ (match_operand:DI 2 "general_operand" "d,RT")) (const_int 0))) (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" "@ ogr\t%0,%2 og\t%0,%2" @@ -6130,7 +6179,7 @@ (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,N0SD0,N1SD0,d,RT,NxQD0,Q"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT && s390_logical_operator_ok_p (operands)" + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ oihh\t%0,%i2 oihl\t%0,%i2 @@ -6404,7 +6453,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d,d") (xor:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" "@ xgr\t%0,%2 xg\t%0,%2" @@ -6417,7 +6466,7 @@ (match_operand:DI 2 "general_operand" "d,RT")) (const_int 0))) (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" "@ xgr\t%0,%2 xg\t%0,%2" @@ -6429,7 +6478,7 @@ (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0") (match_operand:DI 2 "general_operand" "N0SD0,N1SD0,d,RT,NxQD0,Q"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT && s390_logical_operator_ok_p (operands)" + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ xihf\t%0,%k2 xilf\t%0,%k2 @@ -6676,7 +6725,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d") (neg:DI (sign_extend:DI (match_dup 1))))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" + "TARGET_ZARCH && s390_match_ccmode (insn, CCAmode)" "lcgfr\t%0,%1" [(set_attr "op_type" "RRE") (set_attr "z10prop" "z10_c")]) @@ -6685,7 +6734,7 @@ [(set (match_operand:DI 0 "register_operand" "=d") (neg:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "lcgfr\t%0,%1" [(set_attr "op_type" "RRE") (set_attr "z10prop" "z10_c")]) @@ -6727,7 +6776,7 @@ [(set (match_operand:DI 0 "register_operand" "=d") (neg:DI (match_operand:DI 1 "register_operand" "d"))) (clobber (reg:CC CC_REGNUM))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "#" "&& reload_completed" [(parallel @@ -6822,7 +6871,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d") (abs:DI (sign_extend:DI (match_dup 1))))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" + "TARGET_ZARCH && s390_match_ccmode (insn, CCAmode)" "lpgfr\t%0,%1" [(set_attr "op_type" "RRE") (set_attr "z10prop" "z10_c")]) @@ -6831,7 +6880,7 @@ [(set (match_operand:DI 0 "register_operand" "=d") (abs:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "lpgfr\t%0,%1" [(set_attr "op_type" "RRE") (set_attr "z10prop" "z10_c")]) @@ -6940,7 +6989,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d") (neg:DI (abs:DI (sign_extend:DI (match_dup 1)))))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" + "TARGET_ZARCH && s390_match_ccmode (insn, CCAmode)" "lngfr\t%0,%1" [(set_attr "op_type" "RRE") (set_attr "z10prop" "z10_c")]) @@ -6950,7 +6999,7 @@ (neg:DI (abs:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))))) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" "lngfr\t%0,%1" [(set_attr "op_type" "RRE") (set_attr "z10prop" "z10_c")]) @@ -7079,7 +7128,7 @@ (define_expand "clzdi2" [(set (match_operand:DI 0 "register_operand" "=d") (clz:DI (match_operand:DI 1 "register_operand" "d")))] - "TARGET_EXTIMM && TARGET_64BIT" + "TARGET_EXTIMM && TARGET_ZARCH" { rtx insn, clz_equal; rtx wide_reg = gen_reg_rtx (TImode); @@ -7109,7 +7158,7 @@ (clobber (reg:CC CC_REGNUM))] "(unsigned HOST_WIDE_INT) INTVAL (operands[2]) == (unsigned HOST_WIDE_INT) 1 << 63 - && TARGET_EXTIMM && TARGET_64BIT" + && TARGET_EXTIMM && TARGET_ZARCH" "flogr\t%0,%1" [(set_attr "op_type" "RRE")]) @@ -7166,7 +7215,7 @@ [(set (match_operand:DI 0 "register_operand" "=d") (SHIFT:DI (match_operand:DI 1 "register_operand" "0") (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "sdl\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -7188,7 +7237,7 @@ (SHIFT:DI (match_operand:DI 1 "register_operand" "0") (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") (match_operand:SI 3 "const_int_operand" "n"))))] - "!TARGET_64BIT && (INTVAL (operands[3]) & 63) == 63" + "!TARGET_ZARCH && (INTVAL (operands[3]) & 63) == 63" "sdl\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -7225,7 +7274,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d") (ashiftrt:DI (match_dup 1) (match_dup 2)))] - "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)" + "!TARGET_ZARCH && s390_match_ccmode(insn, CCSmode)" "srda\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -7236,7 +7285,7 @@ (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")) (const_int 0))) (clobber (match_scratch:DI 0 "=d"))] - "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)" + "!TARGET_ZARCH && s390_match_ccmode(insn, CCSmode)" "srda\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -7246,7 +7295,7 @@ (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") (match_operand:SI 2 "shift_count_or_setmem_operand" "Y"))) (clobber (reg:CC CC_REGNUM))] - "!TARGET_64BIT" + "!TARGET_ZARCH" "srda\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -7301,7 +7350,7 @@ (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d") (ashiftrt:DI (match_dup 1) (and:SI (match_dup 2) (match_dup 3))))] - "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode) + "!TARGET_ZARCH && s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63" "srda\t%0,%Y2" [(set_attr "op_type" "RS") @@ -7314,7 +7363,7 @@ (match_operand:SI 3 "const_int_operand" "n"))) (const_int 0))) (clobber (match_scratch:DI 0 "=d"))] - "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode) + "!TARGET_ZARCH && s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63" "srda\t%0,%Y2" [(set_attr "op_type" "RS") @@ -7326,7 +7375,7 @@ (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") (match_operand:SI 3 "const_int_operand" "n")))) (clobber (reg:CC CC_REGNUM))] - "!TARGET_64BIT && (INTVAL (operands[3]) & 63) == 63" + "!TARGET_ZARCH && (INTVAL (operands[3]) & 63) == 63" "srda\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -7680,7 +7729,7 @@ (subreg:DI (match_dup 2) 0))) (clobber (match_scratch:DI 4 "=X,&1,&?d")) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" { if (which_alternative != 0) return "#"; @@ -7723,7 +7772,7 @@ (subreg:SI (match_dup 2) 4))) (clobber (match_scratch:SI 4 "=X,&1,&?d")) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" { if (which_alternative != 0) return "#"; @@ -7766,7 +7815,7 @@ (subreg:SI (match_dup 2) 0))) (clobber (match_scratch:SI 4 "=X,&1,&?d")) (clobber (reg:CC CC_REGNUM))] - "!TARGET_64BIT && TARGET_CPU_ZARCH" + "!TARGET_ZARCH && TARGET_CPU_ZARCH" { if (which_alternative != 0) return "#"; @@ -7808,7 +7857,7 @@ emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0])); else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH) emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0])); - else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT) + else if (GET_MODE (operands[0]) == DImode && TARGET_ZARCH) emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0])); else FAIL; @@ -7939,7 +7988,7 @@ (plus:DI (match_dup 1) (const_int -1))) (clobber (match_scratch:DI 3 "=X,&1,&?d")) (clobber (reg:CC CC_REGNUM))] - "TARGET_64BIT" + "TARGET_ZARCH" { if (which_alternative != 0) return "#"; @@ -8497,13 +8546,13 @@ ; cds, cdsg (define_insn "*sync_compare_and_swap" - [(set (match_operand:DP 0 "register_operand" "=r") - (match_operand:DP 1 "memory_operand" "+Q")) + [(set (match_operand:DW 0 "register_operand" "=r") + (match_operand:DW 1 "memory_operand" "+Q")) (set (match_dup 1) - (unspec_volatile:DP + (unspec_volatile:DW [(match_dup 1) - (match_operand:DP 2 "register_operand" "0") - (match_operand:DP 3 "register_operand" "r")] + (match_operand:DW 2 "register_operand" "0") + (match_operand:DW 3 "register_operand" "r")] UNSPECV_CAS)) (set (reg:CCZ1 CC_REGNUM) (compare:CCZ1 (match_dup 1) (match_dup 2)))] @@ -8646,20 +8695,20 @@ (match_operand 1 "register_operand" "")] "" { - enum machine_mode mode = TARGET_64BIT ? OImode : TImode; rtx base = gen_rtx_REG (Pmode, BASE_REGNUM); /* Copy the backchain to the first word, sp to the second and the literal pool base to the third. */ + rtx save_bc = adjust_address (operands[0], Pmode, 0); + rtx save_sp = adjust_address (operands[0], Pmode, GET_MODE_SIZE (Pmode)); + rtx save_bp = adjust_address (operands[0], Pmode, 2 * GET_MODE_SIZE (Pmode)); + if (TARGET_BACKCHAIN) - { - rtx temp = force_reg (Pmode, s390_back_chain_rtx ()); - emit_move_insn (operand_subword (operands[0], 0, 0, mode), temp); - } + emit_move_insn (save_bc, force_reg (Pmode, s390_back_chain_rtx ())); - emit_move_insn (operand_subword (operands[0], 1, 0, mode), operands[1]); - emit_move_insn (operand_subword (operands[0], 2, 0, mode), base); + emit_move_insn (save_sp, operands[1]); + emit_move_insn (save_bp, base); DONE; }) @@ -8669,18 +8718,21 @@ (match_operand 1 "memory_operand" "")] "" { - enum machine_mode mode = TARGET_64BIT ? OImode : TImode; rtx base = gen_rtx_REG (Pmode, BASE_REGNUM); rtx temp = NULL_RTX; /* Restore the backchain from the first word, sp from the second and the literal pool base from the third. */ + rtx save_bc = adjust_address (operands[1], Pmode, 0); + rtx save_sp = adjust_address (operands[1], Pmode, GET_MODE_SIZE (Pmode)); + rtx save_bp = adjust_address (operands[1], Pmode, 2 * GET_MODE_SIZE (Pmode)); + if (TARGET_BACKCHAIN) - temp = force_reg (Pmode, operand_subword (operands[1], 0, 0, mode)); + temp = force_reg (Pmode, save_bc); - emit_move_insn (base, operand_subword (operands[1], 2, 0, mode)); - emit_move_insn (operands[0], operand_subword (operands[1], 1, 0, mode)); + emit_move_insn (base, save_bp); + emit_move_insn (operands[0], save_sp); if (temp) emit_move_insn (s390_back_chain_rtx (), temp); diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 18491378730..04b98c1eb22 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -189,6 +189,7 @@ static void pop (int); static void push_regs (HARD_REG_SET *, int); static int calc_live_regs (HARD_REG_SET *); static HOST_WIDE_INT rounded_frame_size (int); +static bool sh_frame_pointer_required (void); static rtx mark_constant_pool_use (rtx); static tree sh_handle_interrupt_handler_attribute (tree *, tree, tree, int, bool *); static tree sh_handle_resbank_handler_attribute (tree *, tree, @@ -503,6 +504,9 @@ static const struct attribute_spec sh_attribute_table[] = #undef TARGET_DWARF_CALLING_CONVENTION #define TARGET_DWARF_CALLING_CONVENTION sh_dwarf_calling_convention +#undef TARGET_FRAME_POINTER_REQUIRED +#define TARGET_FRAME_POINTER_REQUIRED sh_frame_pointer_required + /* Return regmode weight for insn. */ #define INSN_REGMODE_WEIGHT(INSN, MODE) regmode_weight[((MODE) == SImode) ? 0 : 1][INSN_UID (INSN)] @@ -666,7 +670,6 @@ sh_optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) { if (level) { - flag_omit_frame_pointer = 2; if (!size) sh_div_str = "inv:minlat"; } @@ -856,16 +859,7 @@ sh_override_options (void) if (! VALID_REGISTER_P (ADDREGNAMES_REGNO (regno))) sh_additional_register_names[regno][0] = '\0'; - if (flag_omit_frame_pointer == 2) - { - /* The debugging information is sufficient, - but gdb doesn't implement this yet */ - if (0) - flag_omit_frame_pointer - = (PREFERRED_DEBUGGING_TYPE == DWARF2_DEBUG); - else - flag_omit_frame_pointer = 0; - } + flag_omit_frame_pointer = (PREFERRED_DEBUGGING_TYPE == DWARF2_DEBUG); if ((flag_pic && ! TARGET_PREFERGOT) || (TARGET_SHMEDIA && !TARGET_PT_FIXED)) @@ -897,6 +891,24 @@ sh_override_options (void) flag_schedule_insns = 0; } + if ((target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS) == 0) + target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; + + /* Unwind info is not correct around the CFG unless either a frame + pointer is present or M_A_O_A is set. Fixing this requires rewriting + unwind info generation to be aware of the CFG and propagating states + around edges. */ + if ((flag_unwind_tables || flag_asynchronous_unwind_tables + || flag_exceptions || flag_non_call_exceptions) + && flag_omit_frame_pointer + && !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS)) + { + if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS) + warning (0, "unwind tables currently require either a frame pointer " + "or -maccumulate-outgoing-args for correctness"); + target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; + } + /* Unwinding with -freorder-blocks-and-partition does not work on this architecture, because it requires far jumps to label crossing between hot/cold sections which are rejected on this architecture. */ @@ -6583,6 +6595,9 @@ rounded_frame_size (int pushed) HOST_WIDE_INT size = get_frame_size (); HOST_WIDE_INT align = STACK_BOUNDARY / BITS_PER_UNIT; + if (ACCUMULATE_OUTGOING_ARGS) + size += crtl->outgoing_args_size; + return ((size + pushed + align - 1) & -align) - pushed; } @@ -7431,7 +7446,11 @@ sh_set_return_address (rtx ra, rtx tmp) pr_offset = rounded_frame_size (d); emit_insn (GEN_MOV (tmp, GEN_INT (pr_offset))); - emit_insn (GEN_ADD3 (tmp, tmp, hard_frame_pointer_rtx)); + + if (frame_pointer_needed) + emit_insn (GEN_ADD3 (tmp, tmp, hard_frame_pointer_rtx)); + else + emit_insn (GEN_ADD3 (tmp, tmp, stack_pointer_rtx)); tmp = gen_frame_mem (Pmode, tmp); emit_insn (GEN_MOV (tmp, ra)); @@ -9640,7 +9659,7 @@ sh_legitimize_reload_address (rtx *p, enum machine_mode mode, int opnum, if (GET_CODE (*p) == PLUS && (GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8) && CONST_INT_P (XEXP (*p, 1)) - && BASE_REGISTER_RTX_P (XEXP (*p, 0)) + && MAYBE_BASE_REGISTER_RTX_P (XEXP (*p, 0), true) && ! TARGET_SHMEDIA && ! (TARGET_SH4 && mode == DFmode) && ! (mode == PSImode && type == RELOAD_FOR_INPUT_ADDRESS) @@ -9674,8 +9693,7 @@ sh_legitimize_reload_address (rtx *p, enum machine_mode mode, int opnum, /* Sometimes the normal form does not suit DImode. We could avoid that by using smaller ranges, but that would give less optimized code when SImode is prevalent. */ - if (offset_base != 0 - && GET_MODE_SIZE (mode) + offset - offset_base <= 64) + if (GET_MODE_SIZE (mode) + offset - offset_base <= 64) { sum = gen_rtx_PLUS (Pmode, XEXP (*p, 0), GEN_INT (offset_base)); *p = gen_rtx_PLUS (Pmode, sum, GEN_INT (offset - offset_base)); @@ -9689,7 +9707,7 @@ sh_legitimize_reload_address (rtx *p, enum machine_mode mode, int opnum, && (GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8) && GET_CODE (XEXP (*p, 0)) == PLUS && CONST_INT_P (XEXP (XEXP (*p, 0), 1)) - && BASE_REGISTER_RTX_P (XEXP (XEXP (*p, 0), 0)) + && MAYBE_BASE_REGISTER_RTX_P (XEXP (XEXP (*p, 0), 0), true) && CONST_INT_P (XEXP (*p, 1)) && ! TARGET_SHMEDIA && ! (TARGET_SH2E && mode == SFmode)) @@ -10937,6 +10955,20 @@ sh_vector_mode_supported_p (enum machine_mode mode) return false; } +bool +sh_frame_pointer_required (void) +{ +/* If needed override this in other tm.h files to cope with various OS + lossage requiring a frame pointer. */ + if (SUBTARGET_FRAME_POINTER_REQUIRED) + return true; + + if (crtl->profile) + return true; + + return false; +} + /* Implements target hook dwarf_calling_convention. Return an enum of dwarf_calling_convention. */ int diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 8b4f6c0539c..f870ba69e98 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -98,8 +98,15 @@ do { \ ? "__LITTLE_ENDIAN__" : "__BIG_ENDIAN__"); \ } while (0) -/* We can not debug without a frame pointer. */ -/* #define CAN_DEBUG_WITHOUT_FP */ +#define CAN_DEBUG_WITHOUT_FP + +/* Value should be nonzero if functions must have frame pointers. + Zero means the frame pointer need not be set up (and parms may be accessed + via the stack pointer) in functions that seem suitable. */ + +#ifndef SUBTARGET_FRAME_POINTER_REQUIRED +#define SUBTARGET_FRAME_POINTER_REQUIRED 0 +#endif #define CONDITIONAL_REGISTER_USAGE do \ { \ @@ -2633,11 +2640,9 @@ extern int current_function_interrupt; #define SIDI_OFF (TARGET_LITTLE_ENDIAN ? 0 : 4) -/* ??? Define ACCUMULATE_OUTGOING_ARGS? This is more efficient than pushing - and popping arguments. However, we do have push/pop instructions, and - rather limited offsets (4 bits) in load/store instructions, so it isn't - clear if this would give better code. If implemented, should check for - compatibility problems. */ +/* Better to allocate once the maximum space for outgoing args in the + prologue rather than duplicate around each call. */ +#define ACCUMULATE_OUTGOING_ARGS TARGET_ACCUMULATE_OUTGOING_ARGS #define SH_DYNAMIC_SHIFT_COST \ (TARGET_HARD_SH4 ? 1 : TARGET_SH3 ? (TARGET_SMALLCODE ? 1 : 2) : 20) diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index d8d6ca7fbc0..485c038775e 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -7050,22 +7050,21 @@ label: (define_insn_and_split "doloop_end_split" [(set (pc) - (if_then_else (ne:SI (match_operand:SI 0 "arith_reg_dest" "+r") + (if_then_else (ne:SI (match_operand:SI 2 "arith_reg_dest" "0") (const_int 1)) (label_ref (match_operand 1 "" "")) (pc))) - (set (match_dup 0) - (plus (match_dup 0) (const_int -1))) + (set (match_operand:SI 0 "arith_reg_dest" "=r") + (plus (match_dup 2) (const_int -1))) (clobber (reg:SI T_REG))] "TARGET_SH2" "#" "" [(parallel [(set (reg:SI T_REG) - (eq:SI (match_operand:SI 0 "arith_reg_dest" "+r") - (const_int 1))) - (set (match_dup 0) (plus:SI (match_dup 0) (const_int -1)))]) + (eq:SI (match_dup 2) (const_int 1))) + (set (match_dup 0) (plus:SI (match_dup 2) (const_int -1)))]) (set (pc) (if_then_else (eq (reg:SI T_REG) (const_int 0)) - (label_ref (match_operand 1 "" "")) + (label_ref (match_dup 1)) (pc)))] "" [(set_attr "type" "cbranch")]) @@ -8308,8 +8307,9 @@ label: (define_insn "dect" [(set (reg:SI T_REG) - (eq:SI (match_operand:SI 0 "arith_reg_dest" "+r") (const_int 1))) - (set (match_dup 0) (plus:SI (match_dup 0) (const_int -1)))] + (eq:SI (match_operand:SI 1 "arith_reg_dest" "0") (const_int 1))) + (set (match_operand:SI 0 "arith_reg_dest" "=r") + (plus:SI (match_dup 1) (const_int -1)))] "TARGET_SH2" "dt %0" [(set_attr "type" "arith")]) diff --git a/gcc/config/sh/sh.opt b/gcc/config/sh/sh.opt index dbe077ca49b..95e2ca439d5 100644 --- a/gcc/config/sh/sh.opt +++ b/gcc/config/sh/sh.opt @@ -200,6 +200,10 @@ m5-compact-nofpu Target RejectNegative Condition(SUPPORT_SH5_32MEDIA_NOFPU) Generate FPU-less SHcompact code +maccumulate-outgoing-args +Target Report Mask(ACCUMULATE_OUTGOING_ARGS) +Reserve space for outgoing arguments in the function prologue + madjust-unroll Target Report Mask(ADJUST_UNROLL) Condition(SUPPORT_ANY_SH5) Throttle unrolling to avoid thrashing target registers unless the unroll benefit outweighs this diff --git a/gcc/configure b/gcc/configure index e32454a1e72..de9cc72db7f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -8426,6 +8426,59 @@ fi done +save_CPPFLAGS="$CPPFLAGS" +save_LIBS="$LIBS" +LIBS="$LIBS $LIBELFLIBS" +for ac_func in elf_getshdrstrndx +do : + ac_fn_c_check_func "$LINENO" "elf_getshdrstrndx" "ac_cv_func_elf_getshdrstrndx" +if test "x$ac_cv_func_elf_getshdrstrndx" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ELF_GETSHDRSTRNDX 1 +_ACEOF + +else + for ac_func in elf_getshstrndx +do : + ac_fn_c_check_func "$LINENO" "elf_getshstrndx" "ac_cv_func_elf_getshstrndx" +if test "x$ac_cv_func_elf_getshstrndx" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ELF_GETSHSTRNDX 1 +_ACEOF + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int main() +{ + return elf_getshstrndx (NULL, 0) == 0; +}, +$as_echo "#define HAVE_ELF_GETSHSTRNDX_GABI 1" >>confdefs.h + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +done + + +fi +done + +LIBS="$save_LIBS" +CPPFLAGS="$save_CPPFLAGS" + if test x$ac_cv_func_mbstowcs = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbstowcs works" >&5 $as_echo_n "checking whether mbstowcs works... " >&6; } @@ -17039,7 +17092,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17042 "configure" +#line 17095 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17145,7 +17198,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17148 "configure" +#line 17201 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -22010,7 +22063,7 @@ foo: .long 25 ;; i[34567]86-*-*) case "$target" in - i[34567]86-*-solaris2.[56789]*) + i[34567]86-*-solaris2.[89]*) # TLS was introduced in the Solaris 9 4/04 release but # we do not enable it by default on Solaris 9 either. if test "x$enable_tls" = xyes ; then @@ -22235,7 +22288,7 @@ foo: .long 25 ;; sparc*-*-*) case "$target" in - sparc*-sun-solaris2.[56789]*) + sparc*-sun-solaris2.[89]*) # TLS was introduced in the Solaris 9 4/04 release but # we do not enable it by default on Solaris 9 either. if test "x$enable_tls" = xyes ; then diff --git a/gcc/configure.ac b/gcc/configure.ac index 2d7823435f4..d256b62b104 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1024,6 +1024,22 @@ AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \ gettimeofday mbstowcs wcswidth mmap mincore setlocale \ gcc_UNLOCKED_FUNCS) +save_CPPFLAGS="$CPPFLAGS" +save_LIBS="$LIBS" +LIBS="$LIBS $LIBELFLIBS" +AC_CHECK_FUNCS(elf_getshdrstrndx,, + [AC_CHECK_FUNCS(elf_getshstrndx, + [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include +#include +int main() +{ + return elf_getshstrndx (NULL, 0) == 0; +}]]), AC_DEFINE(HAVE_ELF_GETSHSTRNDX_GABI, 1, + [Define if elf_getshstrndx has gABI conformant return values.])])])] + ) +LIBS="$save_LIBS" +CPPFLAGS="$save_CPPFLAGS" + if test x$ac_cv_func_mbstowcs = xyes; then AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works, [ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include @@ -2633,7 +2649,7 @@ foo: .long 25 ;; i[34567]86-*-*) case "$target" in - i[34567]86-*-solaris2.[56789]*) + i[34567]86-*-solaris2.[89]*) # TLS was introduced in the Solaris 9 4/04 release but # we do not enable it by default on Solaris 9 either. if test "x$enable_tls" = xyes ; then @@ -2859,7 +2875,7 @@ foo: .long 25 ;; sparc*-*-*) case "$target" in - sparc*-sun-solaris2.[56789]*) + sparc*-sun-solaris2.[89]*) # TLS was introduced in the Solaris 9 4/04 release but # we do not enable it by default on Solaris 9 either. if test "x$enable_tls" = xyes ; then diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e56c77c35a5..6a11a946300 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,38 @@ +2010-04-14 Jason Merrill + + PR c++/36625 + * parser.c (cp_parser_parenthesized_expression_list): Change + is_attribute_list parm to int to indicate whether or not to + handle initial identifier specially. + (cp_parser_attribute_list): Use attribute_takes_identifier_p. + +2010-04-13 Jason Merrill + + * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of + CLASS_TYPE_P. + * parser.c (cp_parser_lambda_expression): Complain about lambda in + unevaluated context. + * pt.c (iterative_hash_template_arg): Don't crash on lambda. + +2010-04-12 Jason Merrill + + PR c++/43641 + * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak + return value directly. + + * call.c (type_decays_to): Call cv_unqualified for non-class type. + +2010-04-12 Fabien Chene + + PR c++/25811 + * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare. + * init.c (build_new_1): Check for uninitialized const members and + uninitialized reference members, when using new without + new-initializer. Call diagnose_uninitialized_cst_or_ref_member. + (diagnose_uninitialized_cst_or_ref_member): Define, call + diagnose_uninitialized_cst_or_ref_member_1. + (diagnose_uninitialized_cst_or_ref_member_1): New function. + 2010-04-12 Richard Guenther PR c++/43611 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index e704f293b88..73f65c991db 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2268,6 +2268,8 @@ type_decays_to (tree type) return build_pointer_type (TREE_TYPE (type)); if (TREE_CODE (type) == FUNCTION_TYPE) return build_pointer_type (type); + if (!MAYBE_CLASS_TYPE_P (type)) + type = cv_unqualified (type); return type; } diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index d24724a1074..8f74a29e072 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1,6 +1,6 @@ /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) @@ -4858,6 +4858,7 @@ extern tree create_temporary_var (tree); extern void initialize_vtbl_ptrs (tree); extern tree build_java_class_ref (tree); extern tree integral_constant_value (tree); +extern void diagnose_uninitialized_cst_or_ref_member (tree, bool); /* in lex.c */ extern void cxx_dup_lang_specific_decl (tree); diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 1bd80ffa0f8..c1f1cbf4a38 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1,6 +1,6 @@ /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) @@ -54,6 +54,7 @@ static tree dfs_initialize_vtbl_ptrs (tree, void *); static tree build_dtor_call (tree, special_function_kind, int); static tree build_field_list (tree, tree, int *); static tree build_vtbl_address (tree); +static void diagnose_uninitialized_cst_or_ref_member_1 (tree, tree, bool); /* We are about to generate some complex initialization code. Conceptually, it is all a single expression. However, we may want @@ -1753,6 +1754,59 @@ build_raw_new_expr (VEC(tree,gc) *placement, tree type, tree nelts, return new_expr; } +/* Diagnose uninitialized const members or reference members of type + TYPE. USING_NEW is used to disambiguate the diagnostic between a + new expression without a new-initializer and a declaration */ + +static void +diagnose_uninitialized_cst_or_ref_member_1 (tree type, tree origin, + bool using_new) +{ + tree field; + + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + { + tree field_type; + + if (TREE_CODE (field) != FIELD_DECL) + continue; + + field_type = strip_array_types (TREE_TYPE (field)); + + if (TREE_CODE (field_type) == REFERENCE_TYPE) + { + if (using_new) + error ("uninitialized reference member in %q#T using %", + origin); + else + error ("uninitialized reference member in %q#T", origin); + inform (DECL_SOURCE_LOCATION (field), + "%qD should be initialized", field); + } + + if (CP_TYPE_CONST_P (field_type)) + { + if (using_new) + error ("uninitialized const member in %q#T using %", + origin); + else + error ("uninitialized const member in %q#T", origin); + inform (DECL_SOURCE_LOCATION (field), + "%qD should be initialized", field); + } + + if (CLASS_TYPE_P (field_type)) + diagnose_uninitialized_cst_or_ref_member_1 (field_type, + origin, using_new); + } +} + +void +diagnose_uninitialized_cst_or_ref_member (tree type, bool using_new) +{ + diagnose_uninitialized_cst_or_ref_member_1 (type, type, using_new); +} + /* Generate code for a new-expression, including calling the "operator new" function, initializing the object, and, if an exception occurs during construction, cleaning up. The arguments are as for @@ -1839,6 +1893,38 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts, is_initialized = (TYPE_NEEDS_CONSTRUCTING (elt_type) || *init != NULL); + if (*init == NULL && !type_has_user_provided_constructor (elt_type)) + { + bool uninitialized_error = false; + /* A program that calls for default-initialization [...] of an + entity of reference type is ill-formed. */ + if (CLASSTYPE_REF_FIELDS_NEED_INIT (elt_type)) + uninitialized_error = true; + + /* A new-expression that creates an object of type T initializes + that object as follows: + - If the new-initializer is omitted: + -- If T is a (possibly cv-qualified) non-POD class type + (or array thereof), the object is default-initialized (8.5). + [...] + -- Otherwise, the object created has indeterminate + value. If T is a const-qualified type, or a (possibly + cv-qualified) POD class type (or array thereof) + containing (directly or indirectly) a member of + const-qualified type, the program is ill-formed; */ + + if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (elt_type)) + uninitialized_error = true; + + if (uninitialized_error) + { + if (complain & tf_error) + diagnose_uninitialized_cst_or_ref_member (elt_type, + /*using_new*/true); + return error_mark_node; + } + } + if (CP_TYPE_CONST_P (elt_type) && *init == NULL && !type_has_user_provided_default_constructor (elt_type)) { diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index e25c280f486..720a632ed75 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1596,7 +1596,9 @@ static tree cp_parser_postfix_open_square_expression static tree cp_parser_postfix_dot_deref_expression (cp_parser *, enum cpp_ttype, tree, bool, cp_id_kind *, location_t); static VEC(tree,gc) *cp_parser_parenthesized_expression_list - (cp_parser *, bool, bool, bool, bool *); + (cp_parser *, int, bool, bool, bool *); +/* Values for the second parameter of cp_parser_parenthesized_expression_list. */ +enum { non_attr = 0, normal_attr = 1, id_attr = 2 }; static void cp_parser_pseudo_destructor_name (cp_parser *, tree *, tree *); static tree cp_parser_unary_expression @@ -4806,7 +4808,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, parser->integral_constant_expression_p = false; } args = (cp_parser_parenthesized_expression_list - (parser, /*is_attribute_list=*/false, + (parser, non_attr, /*cast_p=*/false, /*allow_expansion_p=*/true, /*non_constant_p=*/NULL)); if (is_builtin_constant_p) @@ -5244,20 +5246,22 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser, Returns a vector of trees. Each element is a representation of an assignment-expression. NULL is returned if the ( and or ) are missing. An empty, but allocated, vector is returned on no - expressions. The parentheses are eaten. IS_ATTRIBUTE_LIST is true - if this is really an attribute list being parsed. If + expressions. The parentheses are eaten. IS_ATTRIBUTE_LIST is id_attr + if we are parsing an attribute list for an attribute that wants a + plain identifier argument, normal_attr for an attribute that wants + an expression, or non_attr if we aren't parsing an attribute list. If NON_CONSTANT_P is non-NULL, *NON_CONSTANT_P indicates whether or not all of the expressions in the list were constant. */ static VEC(tree,gc) * cp_parser_parenthesized_expression_list (cp_parser* parser, - bool is_attribute_list, + int is_attribute_list, bool cast_p, bool allow_expansion_p, bool *non_constant_p) { VEC(tree,gc) *expression_list; - bool fold_expr_p = is_attribute_list; + bool fold_expr_p = is_attribute_list != non_attr; tree identifier = NULL_TREE; bool saved_greater_than_is_operator_p; @@ -5284,7 +5288,7 @@ cp_parser_parenthesized_expression_list (cp_parser* parser, /* At the beginning of attribute lists, check to see if the next token is an identifier. */ - if (is_attribute_list + if (is_attribute_list == id_attr && cp_lexer_peek_token (parser->lexer)->type == CPP_NAME) { cp_token *token; @@ -5345,7 +5349,7 @@ cp_parser_parenthesized_expression_list (cp_parser* parser, /* After the first item, attribute lists look the same as expression lists. */ - is_attribute_list = false; + is_attribute_list = non_attr; get_comma:; /* If the next token isn't a `,', then we are done. */ @@ -5820,7 +5824,8 @@ cp_parser_new_placement (cp_parser* parser) /* Parse the expression-list. */ expression_list = (cp_parser_parenthesized_expression_list - (parser, false, /*cast_p=*/false, /*allow_expansion_p=*/true, + (parser, non_attr, /*cast_p=*/false, + /*allow_expansion_p=*/true, /*non_constant_p=*/NULL)); return expression_list; @@ -6026,7 +6031,8 @@ cp_parser_new_initializer (cp_parser* parser) } else expression_list = (cp_parser_parenthesized_expression_list - (parser, false, /*cast_p=*/false, /*allow_expansion_p=*/true, + (parser, non_attr, /*cast_p=*/false, + /*allow_expansion_p=*/true, /*non_constant_p=*/NULL)); return expression_list; @@ -7081,6 +7087,10 @@ cp_parser_lambda_expression (cp_parser* parser) LAMBDA_EXPR_LOCATION (lambda_expr) = cp_lexer_peek_token (parser->lexer)->location; + if (cp_unevaluated_operand) + error_at (LAMBDA_EXPR_LOCATION (lambda_expr), + "lambda-expression in unevaluated context"); + /* We may be in the middle of deferred access check. Disable it now. */ push_deferring_access_checks (dk_no_deferred); @@ -9963,7 +9973,7 @@ cp_parser_mem_initializer (cp_parser* parser) else { VEC(tree,gc)* vec; - vec = cp_parser_parenthesized_expression_list (parser, false, + vec = cp_parser_parenthesized_expression_list (parser, non_attr, /*cast_p=*/false, /*allow_expansion_p=*/true, /*non_constant_p=*/NULL); @@ -15449,7 +15459,7 @@ cp_parser_initializer (cp_parser* parser, bool* is_direct_init, else if (token->type == CPP_OPEN_PAREN) { VEC(tree,gc) *vec; - vec = cp_parser_parenthesized_expression_list (parser, false, + vec = cp_parser_parenthesized_expression_list (parser, non_attr, /*cast_p=*/false, /*allow_expansion_p=*/true, non_constant_p); @@ -17764,8 +17774,10 @@ cp_parser_attribute_list (cp_parser* parser) if (token->type == CPP_OPEN_PAREN) { VEC(tree,gc) *vec; + int attr_flag = (attribute_takes_identifier_p (identifier) + ? id_attr : normal_attr); vec = cp_parser_parenthesized_expression_list - (parser, true, /*cast_p=*/false, + (parser, attr_flag, /*cast_p=*/false, /*allow_expansion_p=*/false, /*non_constant_p=*/NULL); if (vec == NULL) @@ -18967,7 +18979,7 @@ cp_parser_functional_cast (cp_parser* parser, tree type) } - vec = cp_parser_parenthesized_expression_list (parser, false, + vec = cp_parser_parenthesized_expression_list (parser, non_attr, /*cast_p=*/true, /*allow_expansion_p=*/true, /*non_constant_p=*/NULL); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 367608fb908..29489b6337c 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1563,6 +1563,12 @@ iterative_hash_template_arg (tree arg, hashval_t val) val = iterative_hash_template_arg (TREE_TYPE (arg), val); return iterative_hash_template_arg (TYPE_DOMAIN (arg), val); + case LAMBDA_EXPR: + /* A lambda can't appear in a template arg, but don't crash on + erroneous input. */ + gcc_assert (errorcount > 0); + return val; + default: switch (tclass) { diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 66d152de8b8..ea01eb31378 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5968,9 +5968,12 @@ maybe_add_lambda_conv_op (tree type) VEC_quick_push (tree, argvec, arg); for (arg = DECL_ARGUMENTS (statfn); arg; arg = TREE_CHAIN (arg)) VEC_safe_push (tree, gc, argvec, arg); - call = build_cxx_call (callop, VEC_length (tree, argvec), - VEC_address (tree, argvec)); + call = build_call_a (callop, VEC_length (tree, argvec), + VEC_address (tree, argvec)); CALL_FROM_THUNK_P (call) = 1; + if (MAYBE_CLASS_TYPE_P (TREE_TYPE (call))) + call = build_cplus_new (TREE_TYPE (call), call); + call = convert_from_reference (call); finish_return_stmt (call); finish_compound_stmt (compound_stmt); diff --git a/gcc/df-core.c b/gcc/df-core.c index 678508d4a80..758e40e8eb7 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -2137,7 +2137,7 @@ df_ref_debug (df_ref ref, FILE *file) fprintf (file, "%c%d ", DF_REF_REG_DEF_P (ref) ? 'd' : 'u', DF_REF_ID (ref)); - fprintf (file, "reg %d bb %d insn %d flag 0x%x type 0x%x ", + fprintf (file, "reg %d bb %d insn %d flag %#x type %#x ", DF_REF_REGNO (ref), DF_REF_BBNO (ref), DF_REF_IS_ARTIFICIAL (ref) ? -1 : DF_REF_INSN_UID (ref), diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 5df458b465e..ed14a213933 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -426,11 +426,41 @@ diagnostic_report_diagnostic (diagnostic_context *context, ++diagnostic_kind_count (context, diagnostic->kind); saved_format_spec = diagnostic->message.format_spec; - if (context->show_option_requested && diagnostic->option_index) - diagnostic->message.format_spec - = ACONCAT ((diagnostic->message.format_spec, - " [", cl_options[diagnostic->option_index].opt_text, "]", NULL)); + if (context->show_option_requested) + { + const char * option_text = NULL; + if (diagnostic->option_index) + { + /* A warning classified as an error. */ + if ((orig_diag_kind == DK_WARNING || orig_diag_kind == DK_PEDWARN) + && diagnostic->kind == DK_ERROR) + option_text + = ACONCAT ((cl_options[OPT_Werror_].opt_text, + /* Skip over "-W". */ + cl_options[diagnostic->option_index].opt_text + 2, + NULL)); + /* A warning with option. */ + else + option_text = cl_options[diagnostic->option_index].opt_text; + } + /* A warning without option classified as an error. */ + else if (orig_diag_kind == DK_WARNING || orig_diag_kind == DK_PEDWARN + || diagnostic->kind == DK_WARNING) + { + if (context->warning_as_error_requested) + option_text = cl_options[OPT_Werror].opt_text; + else + option_text = _("enabled by default"); + } + + if (option_text) + diagnostic->message.format_spec + = ACONCAT ((diagnostic->message.format_spec, + " ", + "[", option_text, "]", + NULL)); + } diagnostic->message.locus = &diagnostic->location; diagnostic->message.abstract_origin = &diagnostic->abstract_origin; diagnostic->abstract_origin = NULL; diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi index 1515b5c876d..a01da5acb4d 100644 --- a/gcc/doc/contrib.texi +++ b/gcc/doc/contrib.texi @@ -1,5 +1,6 @@ @c Copyright (C) 1988,1989,1992,1993,1994,1995,1996,1997,1998,1999,2000, -@c 2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. +@c 2001,2002,2003,2004,2005,2006,2007,2008,2009, 2010 +@c Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -695,7 +696,8 @@ Melissa O'Neill for various NeXT fixes. @item Rainer Orth for random MIPS work, including improvements to GCC's o32 ABI support, improvements to dejagnu's MIPS support, Java configuration -clean-ups and porting work, etc. +clean-ups and porting work, and maintaining the IRIX, Solaris 2, and +Tru64 UNIX ports. @item Hartmut Penner for work on the s390 port. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index c2468dc9e8f..f65b29fc24a 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -361,7 +361,7 @@ Necessary to build link-time optimization (LTO) support. It can be downloaded from @uref{http://www.mr511.de/software/libelf-0.8.12.tar.gz}, though it is commonly available in several systems. The versions in IRIX 5 and 6 don't work since they lack @file{gelf.h}. The version in -recent releases of Solaris 11 does work, previous ones don't yet. +Solaris 2 does work. The @option{--with-libelf} configure option should be used if libelf is not installed in your default library search patch. @@ -2862,7 +2862,7 @@ information are. @item @uref{#alpha-x-x,,alpha*-*-*} @item -@uref{#alpha-dec-osf,,alpha*-dec-osf*} +@uref{#alpha-dec-osf51,,alpha*-dec-osf5.1} @item @uref{#arc-x-elf,,arc-*-elf} @item @@ -2952,8 +2952,6 @@ information are. @item @uref{#sparc-sun-solaris2,,sparc-sun-solaris2*} @item -@uref{#sparc-sun-solaris27,,sparc-sun-solaris2.7} -@item @uref{#sparc-sun-solaris210,,sparc-sun-solaris2.10} @item @uref{#sparc-x-linux,,sparc-*-linux*} @@ -3009,16 +3007,15 @@ shared libraries. @html
@end html -@heading @anchor{alpha-dec-osf}alpha*-dec-osf* +@heading @anchor{alpha-dec-osf51}alpha*-dec-osf5.1 Systems using processors that implement the DEC Alpha architecture and are running the DEC/Compaq/HP Unix (DEC OSF/1, Digital UNIX, or Compaq/HP Tru64 UNIX) operating system, for example the DEC Alpha AXP systems. As of GCC 3.2, versions before @code{alpha*-dec-osf4} are no longer supported. (These are the versions which identify themselves as DEC -OSF/1.) As of GCC 4.5, support for Tru64 UNIX V4.0 and V5.0 has been -obsoleted, but can still be enabled by configuring with -@option{--enable-obsolete}. Support will be removed in GCC 4.6. +OSF/1.) As of GCC 4.6, support for Tru64 UNIX V4.0 and V5.0 has been +removed. On Tru64 UNIX, virtual memory exhausted bootstrap failures may be fixed by reconfiguring Kernel Virtual Memory and Swap parameters @@ -4086,9 +4083,7 @@ supported as cross-compilation target only. @c alone is too unspecific and must be avoided. @heading @anchor{x-x-solaris2}*-*-solaris2* -Support for Solaris 7 has been obsoleted in GCC 4.5, but can still be -enabled by configuring with @option{--enable-obsolete}. Support will be -removed in GCC 4.6. +Support for Solaris 7 has been removed in GCC 4.6. Sun does not ship a C compiler with Solaris 2, though you can download the Sun Studio compilers for free from @@ -4156,8 +4151,7 @@ C90 but is wrong for C++, and is now wrong for C99 also. @option{-fpermissive}; it will assume that any missing type is @code{int} (as defined by C90). -There are patches for Solaris 7 (108376-21 or newer for SPARC, -108377-20 for Intel), and Solaris 8 (108652-24 or newer for SPARC, +There are patches for Solaris 8 (108652-24 or newer for SPARC, 108653-22 for Intel) that fix this bug. Sun bug 4927647 sometimes causes random spurious testsuite failures @@ -4228,79 +4222,12 @@ library on a Solaris 7 or later system, the canonical target triplet must be specified as the @command{build} parameter on the configure line. This triplet can be obtained by invoking @command{./config.guess} in the toplevel source directory of GCC (and not that of GMP or MPFR). -For example on a Solaris 7 system: - -@smallexample - % ./configure --build=sparc-sun-solaris2.7 --prefix=xxx -@end smallexample - -@html -
-@end html -@heading @anchor{sparc-sun-solaris27}sparc-sun-solaris2.7 - -@emph{Note} that this configuration has been obsoleted in GCC 4.5, and will be -removed in GCC 4.6. - -Sun patch 107058-01 (1999-01-13) for Solaris 7/SPARC triggers a bug in -the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8 -and later, including all EGCS releases. Sun formerly recommended -107058-01 for all Solaris 7 users, but around 1999-09-01 it started to -recommend it only for people who use Sun's compilers. - -Here are some workarounds to this problem: -@itemize @bullet -@item -Do not install Sun patch 107058-01 until after Sun releases a -complete patch for bug 4210064. This is the simplest course to take, -unless you must also use Sun's C compiler. Unfortunately 107058-01 -is preinstalled on some new Solaris 7-based hosts, so you may have to -back it out. - -@item -Copy the original, unpatched Solaris 7 -@command{/usr/ccs/bin/as} into -@command{/usr/local/libexec/gcc/sparc-sun-solaris2.7/3.4/as}, -adjusting the latter name to fit your local conventions and software -version numbers. - -@item -Install Sun patch 106950-03 (1999-05-25) or later. Nobody with -both 107058-01 and 106950-03 installed has reported the bug with GCC -and Sun's dynamic linker. This last course of action is riskiest, -for two reasons. First, you must install 106950 on all hosts that -run code generated by GCC; it doesn't suffice to install it only on -the hosts that run GCC itself. Second, Sun says that 106950-03 is -only a partial fix for bug 4210064, but Sun doesn't know whether the -partial fix is adequate for GCC@. Revision -08 or later should fix -the bug. The current (as of 2004-05-23) revision is -24, and is included in -the Solaris 7 Recommended Patch Cluster. -@end itemize - -GCC 3.3 triggers a bug in version 5.0 Alpha 03/27/98 of the Sun assembler, -which causes a bootstrap failure when linking the 64-bit shared version of -@samp{libgcc}. A typical error message is: +For example on a Solaris 9 system: @smallexample -ld: fatal: relocation error: R_SPARC_32: file libgcc/sparcv9/_muldi3.o: - symbol : offset 0xffffffff7ec133e7 is non-aligned. + % ./configure --build=sparc-sun-solaris2.9 --prefix=xxx @end smallexample -@noindent -This bug has been fixed in the final 5.0 version of the assembler. - -A similar problem was reported for version Sun WorkShop 6 99/08/18 of the -Sun assembler, which causes a bootstrap failure with GCC 4.0.0: - -@smallexample -ld: fatal: relocation error: R_SPARC_DISP32: - file .libs/libstdc++.lax/libsupc++convenience.a/vterminate.o: - symbol : offset 0xfccd33ad is non-aligned -@end smallexample - -@noindent -This bug has been fixed in more recent revisions of the assembler. - @html
@end html @@ -4335,10 +4262,10 @@ releases mishandled unaligned relocations on @code{sparc-*-*} targets. When configuring the GNU Multiple Precision Library (GMP) or the MPFR library, the canonical target triplet must be specified as the @command{build} parameter on the configure line. For example -on a Solaris 7 system: +on a Solaris 9 system: @smallexample - % ./configure --build=sparc64-sun-solaris2.7 --prefix=xxx + % ./configure --build=sparc64-sun-solaris2.9 --prefix=xxx @end smallexample The following compiler flags must be specified in the configure diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ad7d097990f..0e39234b3b4 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -425,8 +425,9 @@ Objective-C and Objective-C++ Dialects}. @item Directory Options @xref{Directory Options,,Options for Directory Search}. -@gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} -L@var{dir} --specs=@var{file} -I- --sysroot=@var{dir}} +@gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir}} +-iquote@var{dir} -L@var{dir} -specs=@var{file} -I- +--sysroot=@var{dir} @item Machine Dependent Options @xref{Submodel Options,,Hardware Models and Configurations}. @@ -825,7 +826,7 @@ See RS/6000 and PowerPC Options. -mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol --minvalid-symbols} +-maccumulate-outgoing-args -minvalid-symbols} @emph{SPARC Options} @gccoptlist{-mcpu=@var{cpu-type} @gol @@ -2806,6 +2807,15 @@ two forms, whichever is not the default. For further, language-specific options also refer to @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect Options}. +When an unrecognized warning label is requested (e.g., +@option{-Wunknown-warning}), GCC will emit a diagnostic stating +that the option is not recognized. However, if the @samp{-Wno-} form +is used, the behavior is slightly different: No diagnostic will be +produced for @option{-Wno-unknown-warning} unless other diagnostics +are being produced. This allows the use of new @option{-Wno-} options +with old compilers, but if something goes wrong, the compiler will +warn that an unrecognized option was used. + @table @gcctabopt @item -pedantic @opindex pedantic @@ -6576,8 +6586,10 @@ With this flag, the program debug info reflects a new structure layout. @item -fipa-pta @opindex fipa-pta -Perform interprocedural pointer analysis. This option is experimental -and does not affect generated code. +Perform interprocedural pointer analysis and interprocedural modification +and reference analysis. This option can cause excessive memory and +compile-time usage on large compilation units. It is not enabled by +default at any optimization level. @item -fipa-cp @opindex fipa-cp @@ -8892,6 +8904,12 @@ the ordering for the include_next directive are not inadvertently changed. If you really need to change the search order for system directories, use the @option{-nostdinc} and/or @option{-isystem} options. +@item -iplugindir=@var{dir} +Set the directory to search for plugins which are passed +by @option{-fplugin=@var{name}} instead of +@option{-fplugin=@var{path}/@var{name}.so}. This option is not meant +to be used by the user, but only passed by the driver. + @item -iquote@var{dir} @opindex iquote Add the directory @var{dir} to the head of the list of directories to @@ -16128,6 +16146,12 @@ by inserting a test to skip a number of operations in this case; this test slows down the case of larger dividends. inv20u assumes the case of a such a small dividend to be unlikely, and inv20l assumes it to be likely. +@item -maccumulate-outgoing-args +@opindex maccumulate-outgoing-args +Reserve space once for outgoing arguments in the function prologue rather +than around each call. Generally beneficial for performance and size. Also +needed for unwinding to avoid changing the stack frame around conditional code. + @item -mdivsi3_libfunc=@var{name} @opindex mdivsi3_libfunc=@var{name} Set the name of the library function used for 32 bit signed division to diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi index a938e02bb61..77000fee646 100644 --- a/gcc/doc/plugins.texi +++ b/gcc/doc/plugins.texi @@ -22,6 +22,11 @@ The plugin arguments are parsed by GCC and passed to respective plugins as key-value pairs. Multiple plugins can be invoked by specifying multiple @option{-fplugin} arguments. +A plugin can be simply given by its short name (no dots or +slashes). When simply passing @option{-fplugin=NAME}, the plugin is +loaded from the @file{plugin} directory, so @option{-fplugin=NAME} is +the same as @option{-fplugin=`gcc -print-file-name=plugin`/NAME.so}, +using backquote shell syntax to query the @file{plugin} directory. @section Plugin API @@ -407,6 +412,9 @@ On most systems, you can query this @code{plugin} directory by invoking @command{gcc -print-file-name=plugin} (replace if needed @command{gcc} with the appropriate program path). +Inside plugins, this @code{plugin} directory name can be queried by +calling @code{default_plugin_dir_name ()}. + The following GNU Makefile excerpt shows how to build a simple plugin: @smallexample diff --git a/gcc/double-int.c b/gcc/double-int.c index a49ce473a7e..2af97ba0c62 100644 --- a/gcc/double-int.c +++ b/gcc/double-int.c @@ -1,5 +1,5 @@ /* Operations with long integers. - Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -23,6 +23,741 @@ along with GCC; see the file COPYING3. If not see #include "tm.h" #include "tree.h" +/* We know that A1 + B1 = SUM1, using 2's complement arithmetic and ignoring + overflow. Suppose A, B and SUM have the same respective signs as A1, B1, + and SUM1. Then this yields nonzero if overflow occurred during the + addition. + + Overflow occurs if A and B have the same sign, but A and SUM differ in + sign. Use `^' to test whether signs differ, and `< 0' to isolate the + sign. */ +#define OVERFLOW_SUM_SIGN(a, b, sum) ((~((a) ^ (b)) & ((a) ^ (sum))) < 0) + +/* To do constant folding on INTEGER_CST nodes requires two-word arithmetic. + We do that by representing the two-word integer in 4 words, with only + HOST_BITS_PER_WIDE_INT / 2 bits stored in each word, as a positive + number. The value of the word is LOWPART + HIGHPART * BASE. */ + +#define LOWPART(x) \ + ((x) & (((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) - 1)) +#define HIGHPART(x) \ + ((unsigned HOST_WIDE_INT) (x) >> HOST_BITS_PER_WIDE_INT / 2) +#define BASE ((unsigned HOST_WIDE_INT) 1 << HOST_BITS_PER_WIDE_INT / 2) + +/* Unpack a two-word integer into 4 words. + LOW and HI are the integer, as two `HOST_WIDE_INT' pieces. + WORDS points to the array of HOST_WIDE_INTs. */ + +static void +encode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi) +{ + words[0] = LOWPART (low); + words[1] = HIGHPART (low); + words[2] = LOWPART (hi); + words[3] = HIGHPART (hi); +} + +/* Pack an array of 4 words into a two-word integer. + WORDS points to the array of words. + The integer is stored into *LOW and *HI as two `HOST_WIDE_INT' pieces. */ + +static void +decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low, + HOST_WIDE_INT *hi) +{ + *low = words[0] + words[1] * BASE; + *hi = words[2] + words[3] * BASE; +} + +/* Force the double-word integer L1, H1 to be within the range of the + integer type TYPE. Stores the properly truncated and sign-extended + double-word integer in *LV, *HV. Returns true if the operation + overflows, that is, argument and result are different. */ + +int +fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, + unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, const_tree type) +{ + unsigned HOST_WIDE_INT low0 = l1; + HOST_WIDE_INT high0 = h1; + unsigned int prec = TYPE_PRECISION (type); + int sign_extended_type; + + /* Size types *are* sign extended. */ + sign_extended_type = (!TYPE_UNSIGNED (type) + || (TREE_CODE (type) == INTEGER_TYPE + && TYPE_IS_SIZETYPE (type))); + + /* First clear all bits that are beyond the type's precision. */ + if (prec >= 2 * HOST_BITS_PER_WIDE_INT) + ; + else if (prec > HOST_BITS_PER_WIDE_INT) + h1 &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT)); + else + { + h1 = 0; + if (prec < HOST_BITS_PER_WIDE_INT) + l1 &= ~((HOST_WIDE_INT) (-1) << prec); + } + + /* Then do sign extension if necessary. */ + if (!sign_extended_type) + /* No sign extension */; + else if (prec >= 2 * HOST_BITS_PER_WIDE_INT) + /* Correct width already. */; + else if (prec > HOST_BITS_PER_WIDE_INT) + { + /* Sign extend top half? */ + if (h1 & ((unsigned HOST_WIDE_INT)1 + << (prec - HOST_BITS_PER_WIDE_INT - 1))) + h1 |= (HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT); + } + else if (prec == HOST_BITS_PER_WIDE_INT) + { + if ((HOST_WIDE_INT)l1 < 0) + h1 = -1; + } + else + { + /* Sign extend bottom half? */ + if (l1 & ((unsigned HOST_WIDE_INT)1 << (prec - 1))) + { + h1 = -1; + l1 |= (HOST_WIDE_INT)(-1) << prec; + } + } + + *lv = l1; + *hv = h1; + + /* If the value didn't fit, signal overflow. */ + return l1 != low0 || h1 != high0; +} + +/* We force the double-int HIGH:LOW to the range of the type TYPE by + sign or zero extending it. + OVERFLOWABLE indicates if we are interested + in overflow of the value, when >0 we are only interested in signed + overflow, for <0 we are interested in any overflow. OVERFLOWED + indicates whether overflow has already occurred. CONST_OVERFLOWED + indicates whether constant overflow has already occurred. We force + T's value to be within range of T's type (by setting to 0 or 1 all + the bits outside the type's range). We set TREE_OVERFLOWED if, + OVERFLOWED is nonzero, + or OVERFLOWABLE is >0 and signed overflow occurs + or OVERFLOWABLE is <0 and any overflow occurs + We return a new tree node for the extended double-int. The node + is shared if no overflow flags are set. */ + +tree +force_fit_type_double (tree type, unsigned HOST_WIDE_INT low, + HOST_WIDE_INT high, int overflowable, + bool overflowed) +{ + int sign_extended_type; + bool overflow; + + /* Size types *are* sign extended. */ + sign_extended_type = (!TYPE_UNSIGNED (type) + || (TREE_CODE (type) == INTEGER_TYPE + && TYPE_IS_SIZETYPE (type))); + + overflow = fit_double_type (low, high, &low, &high, type); + + /* If we need to set overflow flags, return a new unshared node. */ + if (overflowed || overflow) + { + if (overflowed + || overflowable < 0 + || (overflowable > 0 && sign_extended_type)) + { + tree t = make_node (INTEGER_CST); + TREE_INT_CST_LOW (t) = low; + TREE_INT_CST_HIGH (t) = high; + TREE_TYPE (t) = type; + TREE_OVERFLOW (t) = 1; + return t; + } + } + + /* Else build a shared node. */ + return build_int_cst_wide (type, low, high); +} + +/* Add two doubleword integers with doubleword result. + Return nonzero if the operation overflows according to UNSIGNED_P. + Each argument is given as two `HOST_WIDE_INT' pieces. + One argument is L1 and H1; the other, L2 and H2. + The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */ + +int +add_double_with_sign (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, + unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2, + unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, + bool unsigned_p) +{ + unsigned HOST_WIDE_INT l; + HOST_WIDE_INT h; + + l = l1 + l2; + h = (HOST_WIDE_INT) ((unsigned HOST_WIDE_INT) h1 + + (unsigned HOST_WIDE_INT) h2 + + (l < l1)); + + *lv = l; + *hv = h; + + if (unsigned_p) + return ((unsigned HOST_WIDE_INT) h < (unsigned HOST_WIDE_INT) h1 + || (h == h1 + && l < l1)); + else + return OVERFLOW_SUM_SIGN (h1, h2, h); +} + +/* Negate a doubleword integer with doubleword result. + Return nonzero if the operation overflows, assuming it's signed. + The argument is given as two `HOST_WIDE_INT' pieces in L1 and H1. + The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */ + +int +neg_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, + unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv) +{ + if (l1 == 0) + { + *lv = 0; + *hv = - h1; + return (*hv & h1) < 0; + } + else + { + *lv = -l1; + *hv = ~h1; + return 0; + } +} + +/* Multiply two doubleword integers with doubleword result. + Return nonzero if the operation overflows according to UNSIGNED_P. + Each argument is given as two `HOST_WIDE_INT' pieces. + One argument is L1 and H1; the other, L2 and H2. + The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */ + +int +mul_double_with_sign (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, + unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2, + unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, + bool unsigned_p) +{ + HOST_WIDE_INT arg1[4]; + HOST_WIDE_INT arg2[4]; + HOST_WIDE_INT prod[4 * 2]; + unsigned HOST_WIDE_INT carry; + int i, j, k; + unsigned HOST_WIDE_INT toplow, neglow; + HOST_WIDE_INT tophigh, neghigh; + + encode (arg1, l1, h1); + encode (arg2, l2, h2); + + memset (prod, 0, sizeof prod); + + for (i = 0; i < 4; i++) + { + carry = 0; + for (j = 0; j < 4; j++) + { + k = i + j; + /* This product is <= 0xFFFE0001, the sum <= 0xFFFF0000. */ + carry += arg1[i] * arg2[j]; + /* Since prod[p] < 0xFFFF, this sum <= 0xFFFFFFFF. */ + carry += prod[k]; + prod[k] = LOWPART (carry); + carry = HIGHPART (carry); + } + prod[i + 4] = carry; + } + + decode (prod, lv, hv); + decode (prod + 4, &toplow, &tophigh); + + /* Unsigned overflow is immediate. */ + if (unsigned_p) + return (toplow | tophigh) != 0; + + /* Check for signed overflow by calculating the signed representation of the + top half of the result; it should agree with the low half's sign bit. */ + if (h1 < 0) + { + neg_double (l2, h2, &neglow, &neghigh); + add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh); + } + if (h2 < 0) + { + neg_double (l1, h1, &neglow, &neghigh); + add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh); + } + return (*hv < 0 ? ~(toplow & tophigh) : toplow | tophigh) != 0; +} + +/* Shift the doubleword integer in L1, H1 left by COUNT places + keeping only PREC bits of result. + Shift right if COUNT is negative. + ARITH nonzero specifies arithmetic shifting; otherwise use logical shift. + Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ + +void +lshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, + HOST_WIDE_INT count, unsigned int prec, + unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, bool arith) +{ + unsigned HOST_WIDE_INT signmask; + + if (count < 0) + { + rshift_double (l1, h1, -count, prec, lv, hv, arith); + return; + } + + if (SHIFT_COUNT_TRUNCATED) + count %= prec; + + if (count >= 2 * HOST_BITS_PER_WIDE_INT) + { + /* Shifting by the host word size is undefined according to the + ANSI standard, so we must handle this as a special case. */ + *hv = 0; + *lv = 0; + } + else if (count >= HOST_BITS_PER_WIDE_INT) + { + *hv = l1 << (count - HOST_BITS_PER_WIDE_INT); + *lv = 0; + } + else + { + *hv = (((unsigned HOST_WIDE_INT) h1 << count) + | (l1 >> (HOST_BITS_PER_WIDE_INT - count - 1) >> 1)); + *lv = l1 << count; + } + + /* Sign extend all bits that are beyond the precision. */ + + signmask = -((prec > HOST_BITS_PER_WIDE_INT + ? ((unsigned HOST_WIDE_INT) *hv + >> (prec - HOST_BITS_PER_WIDE_INT - 1)) + : (*lv >> (prec - 1))) & 1); + + if (prec >= 2 * HOST_BITS_PER_WIDE_INT) + ; + else if (prec >= HOST_BITS_PER_WIDE_INT) + { + *hv &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT)); + *hv |= signmask << (prec - HOST_BITS_PER_WIDE_INT); + } + else + { + *hv = signmask; + *lv &= ~((unsigned HOST_WIDE_INT) (-1) << prec); + *lv |= signmask << prec; + } +} + +/* Shift the doubleword integer in L1, H1 right by COUNT places + keeping only PREC bits of result. Shift left if COUNT is negative. + ARITH nonzero specifies arithmetic shifting; otherwise use logical shift. + Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ + +void +rshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, + HOST_WIDE_INT count, unsigned int prec, + unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, + bool arith) +{ + unsigned HOST_WIDE_INT signmask; + + if (count < 0) + { + lshift_double (l1, h1, -count, prec, lv, hv, arith); + return; + } + + signmask = (arith + ? -((unsigned HOST_WIDE_INT) h1 >> (HOST_BITS_PER_WIDE_INT - 1)) + : 0); + + if (SHIFT_COUNT_TRUNCATED) + count %= prec; + + if (count >= 2 * HOST_BITS_PER_WIDE_INT) + { + /* Shifting by the host word size is undefined according to the + ANSI standard, so we must handle this as a special case. */ + *hv = 0; + *lv = 0; + } + else if (count >= HOST_BITS_PER_WIDE_INT) + { + *hv = 0; + *lv = (unsigned HOST_WIDE_INT) h1 >> (count - HOST_BITS_PER_WIDE_INT); + } + else + { + *hv = (unsigned HOST_WIDE_INT) h1 >> count; + *lv = ((l1 >> count) + | ((unsigned HOST_WIDE_INT) h1 + << (HOST_BITS_PER_WIDE_INT - count - 1) << 1)); + } + + /* Zero / sign extend all bits that are beyond the precision. */ + + if (count >= (HOST_WIDE_INT)prec) + { + *hv = signmask; + *lv = signmask; + } + else if ((prec - count) >= 2 * HOST_BITS_PER_WIDE_INT) + ; + else if ((prec - count) >= HOST_BITS_PER_WIDE_INT) + { + *hv &= ~((HOST_WIDE_INT) (-1) << (prec - count - HOST_BITS_PER_WIDE_INT)); + *hv |= signmask << (prec - count - HOST_BITS_PER_WIDE_INT); + } + else + { + *hv = signmask; + *lv &= ~((unsigned HOST_WIDE_INT) (-1) << (prec - count)); + *lv |= signmask << (prec - count); + } +} + +/* Rotate the doubleword integer in L1, H1 left by COUNT places + keeping only PREC bits of result. + Rotate right if COUNT is negative. + Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ + +void +lrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, + HOST_WIDE_INT count, unsigned int prec, + unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv) +{ + unsigned HOST_WIDE_INT s1l, s2l; + HOST_WIDE_INT s1h, s2h; + + count %= prec; + if (count < 0) + count += prec; + + lshift_double (l1, h1, count, prec, &s1l, &s1h, 0); + rshift_double (l1, h1, prec - count, prec, &s2l, &s2h, 0); + *lv = s1l | s2l; + *hv = s1h | s2h; +} + +/* Rotate the doubleword integer in L1, H1 left by COUNT places + keeping only PREC bits of result. COUNT must be positive. + Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ + +void +rrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, + HOST_WIDE_INT count, unsigned int prec, + unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv) +{ + unsigned HOST_WIDE_INT s1l, s2l; + HOST_WIDE_INT s1h, s2h; + + count %= prec; + if (count < 0) + count += prec; + + rshift_double (l1, h1, count, prec, &s1l, &s1h, 0); + lshift_double (l1, h1, prec - count, prec, &s2l, &s2h, 0); + *lv = s1l | s2l; + *hv = s1h | s2h; +} + +/* Divide doubleword integer LNUM, HNUM by doubleword integer LDEN, HDEN + for a quotient (stored in *LQUO, *HQUO) and remainder (in *LREM, *HREM). + CODE is a tree code for a kind of division, one of + TRUNC_DIV_EXPR, FLOOR_DIV_EXPR, CEIL_DIV_EXPR, ROUND_DIV_EXPR + or EXACT_DIV_EXPR + It controls how the quotient is rounded to an integer. + Return nonzero if the operation overflows. + UNS nonzero says do unsigned division. */ + +int +div_and_round_double (unsigned code, int uns, + /* num == numerator == dividend */ + unsigned HOST_WIDE_INT lnum_orig, + HOST_WIDE_INT hnum_orig, + /* den == denominator == divisor */ + unsigned HOST_WIDE_INT lden_orig, + HOST_WIDE_INT hden_orig, + unsigned HOST_WIDE_INT *lquo, + HOST_WIDE_INT *hquo, unsigned HOST_WIDE_INT *lrem, + HOST_WIDE_INT *hrem) +{ + int quo_neg = 0; + HOST_WIDE_INT num[4 + 1]; /* extra element for scaling. */ + HOST_WIDE_INT den[4], quo[4]; + int i, j; + unsigned HOST_WIDE_INT work; + unsigned HOST_WIDE_INT carry = 0; + unsigned HOST_WIDE_INT lnum = lnum_orig; + HOST_WIDE_INT hnum = hnum_orig; + unsigned HOST_WIDE_INT lden = lden_orig; + HOST_WIDE_INT hden = hden_orig; + int overflow = 0; + + if (hden == 0 && lden == 0) + overflow = 1, lden = 1; + + /* Calculate quotient sign and convert operands to unsigned. */ + if (!uns) + { + if (hnum < 0) + { + quo_neg = ~ quo_neg; + /* (minimum integer) / (-1) is the only overflow case. */ + if (neg_double (lnum, hnum, &lnum, &hnum) + && ((HOST_WIDE_INT) lden & hden) == -1) + overflow = 1; + } + if (hden < 0) + { + quo_neg = ~ quo_neg; + neg_double (lden, hden, &lden, &hden); + } + } + + if (hnum == 0 && hden == 0) + { /* single precision */ + *hquo = *hrem = 0; + /* This unsigned division rounds toward zero. */ + *lquo = lnum / lden; + goto finish_up; + } + + if (hnum == 0) + { /* trivial case: dividend < divisor */ + /* hden != 0 already checked. */ + *hquo = *lquo = 0; + *hrem = hnum; + *lrem = lnum; + goto finish_up; + } + + memset (quo, 0, sizeof quo); + + memset (num, 0, sizeof num); /* to zero 9th element */ + memset (den, 0, sizeof den); + + encode (num, lnum, hnum); + encode (den, lden, hden); + + /* Special code for when the divisor < BASE. */ + if (hden == 0 && lden < (unsigned HOST_WIDE_INT) BASE) + { + /* hnum != 0 already checked. */ + for (i = 4 - 1; i >= 0; i--) + { + work = num[i] + carry * BASE; + quo[i] = work / lden; + carry = work % lden; + } + } + else + { + /* Full double precision division, + with thanks to Don Knuth's "Seminumerical Algorithms". */ + int num_hi_sig, den_hi_sig; + unsigned HOST_WIDE_INT quo_est, scale; + + /* Find the highest nonzero divisor digit. */ + for (i = 4 - 1;; i--) + if (den[i] != 0) + { + den_hi_sig = i; + break; + } + + /* Insure that the first digit of the divisor is at least BASE/2. + This is required by the quotient digit estimation algorithm. */ + + scale = BASE / (den[den_hi_sig] + 1); + if (scale > 1) + { /* scale divisor and dividend */ + carry = 0; + for (i = 0; i <= 4 - 1; i++) + { + work = (num[i] * scale) + carry; + num[i] = LOWPART (work); + carry = HIGHPART (work); + } + + num[4] = carry; + carry = 0; + for (i = 0; i <= 4 - 1; i++) + { + work = (den[i] * scale) + carry; + den[i] = LOWPART (work); + carry = HIGHPART (work); + if (den[i] != 0) den_hi_sig = i; + } + } + + num_hi_sig = 4; + + /* Main loop */ + for (i = num_hi_sig - den_hi_sig - 1; i >= 0; i--) + { + /* Guess the next quotient digit, quo_est, by dividing the first + two remaining dividend digits by the high order quotient digit. + quo_est is never low and is at most 2 high. */ + unsigned HOST_WIDE_INT tmp; + + num_hi_sig = i + den_hi_sig + 1; + work = num[num_hi_sig] * BASE + num[num_hi_sig - 1]; + if (num[num_hi_sig] != den[den_hi_sig]) + quo_est = work / den[den_hi_sig]; + else + quo_est = BASE - 1; + + /* Refine quo_est so it's usually correct, and at most one high. */ + tmp = work - quo_est * den[den_hi_sig]; + if (tmp < BASE + && (den[den_hi_sig - 1] * quo_est + > (tmp * BASE + num[num_hi_sig - 2]))) + quo_est--; + + /* Try QUO_EST as the quotient digit, by multiplying the + divisor by QUO_EST and subtracting from the remaining dividend. + Keep in mind that QUO_EST is the I - 1st digit. */ + + carry = 0; + for (j = 0; j <= den_hi_sig; j++) + { + work = quo_est * den[j] + carry; + carry = HIGHPART (work); + work = num[i + j] - LOWPART (work); + num[i + j] = LOWPART (work); + carry += HIGHPART (work) != 0; + } + + /* If quo_est was high by one, then num[i] went negative and + we need to correct things. */ + if (num[num_hi_sig] < (HOST_WIDE_INT) carry) + { + quo_est--; + carry = 0; /* add divisor back in */ + for (j = 0; j <= den_hi_sig; j++) + { + work = num[i + j] + den[j] + carry; + carry = HIGHPART (work); + num[i + j] = LOWPART (work); + } + + num [num_hi_sig] += carry; + } + + /* Store the quotient digit. */ + quo[i] = quo_est; + } + } + + decode (quo, lquo, hquo); + + finish_up: + /* If result is negative, make it so. */ + if (quo_neg) + neg_double (*lquo, *hquo, lquo, hquo); + + /* Compute trial remainder: rem = num - (quo * den) */ + mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem); + neg_double (*lrem, *hrem, lrem, hrem); + add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem); + + switch (code) + { + case TRUNC_DIV_EXPR: + case TRUNC_MOD_EXPR: /* round toward zero */ + case EXACT_DIV_EXPR: /* for this one, it shouldn't matter */ + return overflow; + + case FLOOR_DIV_EXPR: + case FLOOR_MOD_EXPR: /* round toward negative infinity */ + if (quo_neg && (*lrem != 0 || *hrem != 0)) /* ratio < 0 && rem != 0 */ + { + /* quo = quo - 1; */ + add_double (*lquo, *hquo, (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, + lquo, hquo); + } + else + return overflow; + break; + + case CEIL_DIV_EXPR: + case CEIL_MOD_EXPR: /* round toward positive infinity */ + if (!quo_neg && (*lrem != 0 || *hrem != 0)) /* ratio > 0 && rem != 0 */ + { + add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0, + lquo, hquo); + } + else + return overflow; + break; + + case ROUND_DIV_EXPR: + case ROUND_MOD_EXPR: /* round to closest integer */ + { + unsigned HOST_WIDE_INT labs_rem = *lrem; + HOST_WIDE_INT habs_rem = *hrem; + unsigned HOST_WIDE_INT labs_den = lden, ltwice; + HOST_WIDE_INT habs_den = hden, htwice; + + /* Get absolute values. */ + if (*hrem < 0) + neg_double (*lrem, *hrem, &labs_rem, &habs_rem); + if (hden < 0) + neg_double (lden, hden, &labs_den, &habs_den); + + /* If (2 * abs (lrem) >= abs (lden)), adjust the quotient. */ + mul_double ((HOST_WIDE_INT) 2, (HOST_WIDE_INT) 0, + labs_rem, habs_rem, <wice, &htwice); + + if (((unsigned HOST_WIDE_INT) habs_den + < (unsigned HOST_WIDE_INT) htwice) + || (((unsigned HOST_WIDE_INT) habs_den + == (unsigned HOST_WIDE_INT) htwice) + && (labs_den <= ltwice))) + { + if (*hquo < 0) + /* quo = quo - 1; */ + add_double (*lquo, *hquo, + (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo); + else + /* quo = quo + 1; */ + add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0, + lquo, hquo); + } + else + return overflow; + } + break; + + default: + gcc_unreachable (); + } + + /* Compute true remainder: rem = num - (quo * den) */ + mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem); + neg_double (*lrem, *hrem, lrem, hrem); + add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem); + return overflow; +} + + /* Returns mask for PREC bits. */ double_int @@ -107,18 +842,6 @@ double_int_sext (double_int cst, unsigned prec) return r; } -/* Constructs long integer from tree CST. The extra bits over the precision of - the number are filled with sign bit if CST is signed, and with zeros if it - is unsigned. */ - -double_int -tree_to_double_int (const_tree cst) -{ - /* We do not need to call double_int_restrict here to ensure the semantics as - described, as this is the default one for trees. */ - return TREE_INT_CST (cst); -} - /* Returns true if CST fits in unsigned HOST_WIDE_INT. */ bool @@ -211,7 +934,7 @@ double_int_divmod (double_int a, double_int b, bool uns, unsigned code, { double_int ret; - div_and_round_double ((enum tree_code) code, uns, a.low, a.high, + div_and_round_double (code, uns, a.low, a.high, b.low, b.high, &ret.low, &ret.high, &mod->low, &mod->high); return ret; @@ -290,6 +1013,30 @@ double_int_umod (double_int a, double_int b, unsigned code) return double_int_mod (a, b, true, code); } +/* Shift A left by COUNT places keeping only PREC bits of result. Shift + right if COUNT is negative. ARITH true specifies arithmetic shifting; + otherwise use logical shift. */ + +double_int +double_int_lshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool arith) +{ + double_int ret; + lshift_double (a.low, a.high, count, prec, &ret.low, &ret.high, arith); + return ret; +} + +/* Shift A rigth by COUNT places keeping only PREC bits of result. Shift + left if COUNT is negative. ARITH true specifies arithmetic shifting; + otherwise use logical shift. */ + +double_int +double_int_rshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool arith) +{ + double_int ret; + rshift_double (a.low, a.high, count, prec, &ret.low, &ret.high, arith); + return ret; +} + /* Constructs tree in type TYPE from with value given by CST. Signedness of CST is assumed to be the same as the signedness of TYPE. */ @@ -314,15 +1061,6 @@ double_int_fits_to_tree_p (const_tree type, double_int cst) return double_int_equal_p (cst, ext); } -/* Returns true if CST is negative. Of course, CST is considered to - be signed. */ - -bool -double_int_negative_p (double_int cst) -{ - return cst.high < 0; -} - /* Returns -1 if A < B, 0 if A == B and 1 if A > B. Signedness of the comparison is given by UNS. */ diff --git a/gcc/double-int.h b/gcc/double-int.h index 84185890e29..682034859b9 100644 --- a/gcc/double-int.h +++ b/gcc/double-int.h @@ -1,5 +1,5 @@ /* Operations with long integers. - Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -57,13 +57,16 @@ typedef struct HOST_WIDE_INT high; } double_int; -union tree_node; +#define HOST_BITS_PER_DOUBLE_INT (2 * HOST_BITS_PER_WIDE_INT) /* Constructors and conversions. */ -union tree_node *double_int_to_tree (union tree_node *, double_int); -bool double_int_fits_to_tree_p (const union tree_node *, double_int); -double_int tree_to_double_int (const union tree_node *); +tree double_int_to_tree (tree, double_int); +bool double_int_fits_to_tree_p (const_tree, double_int); + +/* Constructs double_int from tree CST. */ + +#define tree_to_double_int(cst) (TREE_INT_CST (cst)) /* Constructs double_int from integer CST. The bits over the precision of HOST_WIDE_INT are filled with the sign bit. */ @@ -127,7 +130,29 @@ double_int double_int_umod (double_int, double_int, unsigned); double_int double_int_divmod (double_int, double_int, bool, unsigned, double_int *); double_int double_int_sdivmod (double_int, double_int, unsigned, double_int *); double_int double_int_udivmod (double_int, double_int, unsigned, double_int *); -bool double_int_negative_p (double_int); + +/* Logical operations. */ +static inline double_int +double_int_not (double_int a) +{ + a.low = ~a.low; + a.high = ~ a.high; + return a; +} + +/* Shift operations. */ +double_int double_int_lshift (double_int, HOST_WIDE_INT, unsigned int, bool); +double_int double_int_rshift (double_int, HOST_WIDE_INT, unsigned int, bool); + +/* Returns true if CST is negative. Of course, CST is considered to + be signed. */ + +static inline bool +double_int_negative_p (double_int cst) +{ + return cst.high < 0; +} + int double_int_cmp (double_int, double_int, bool); int double_int_scmp (double_int, double_int); int double_int_ucmp (double_int, double_int); @@ -178,6 +203,47 @@ double_int_equal_p (double_int cst1, double_int cst2) return cst1.low == cst2.low && cst1.high == cst2.high; } + +/* Legacy interface with decomposed high/low parts. */ + +extern tree force_fit_type_double (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT, + int, bool); +extern int fit_double_type (unsigned HOST_WIDE_INT, HOST_WIDE_INT, + unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, + const_tree); +extern int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT, + unsigned HOST_WIDE_INT, HOST_WIDE_INT, + unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, + bool); +#define add_double(l1,h1,l2,h2,lv,hv) \ + add_double_with_sign (l1, h1, l2, h2, lv, hv, false) +extern int neg_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT, + unsigned HOST_WIDE_INT *, HOST_WIDE_INT *); +extern int mul_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT, + unsigned HOST_WIDE_INT, HOST_WIDE_INT, + unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, + bool); +#define mul_double(l1,h1,l2,h2,lv,hv) \ + mul_double_with_sign (l1, h1, l2, h2, lv, hv, false) +extern void lshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT, + HOST_WIDE_INT, unsigned int, + unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, bool); +extern void rshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT, + HOST_WIDE_INT, unsigned int, + unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, bool); +extern void lrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT, + HOST_WIDE_INT, unsigned int, + unsigned HOST_WIDE_INT *, HOST_WIDE_INT *); +extern void rrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT, + HOST_WIDE_INT, unsigned int, + unsigned HOST_WIDE_INT *, HOST_WIDE_INT *); +extern int div_and_round_double (unsigned, int, unsigned HOST_WIDE_INT, + HOST_WIDE_INT, unsigned HOST_WIDE_INT, + HOST_WIDE_INT, unsigned HOST_WIDE_INT *, + HOST_WIDE_INT *, unsigned HOST_WIDE_INT *, + HOST_WIDE_INT *); + + #ifndef GENERATOR_FILE /* Conversion to and from GMP integer representations. */ diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index 3657d0be89b..0770607c615 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -80,14 +80,14 @@ dw2_asm_output_data_raw (int size, unsigned HOST_WIDE_INT value) if (BYTES_BIG_ENDIAN) { for (i = size - 1; i > 0; --i) - fprintf (asm_out_file, "0x%x,", bytes[i]); - fprintf (asm_out_file, "0x%x", bytes[0]); + fprintf (asm_out_file, "%#x,", bytes[i]); + fprintf (asm_out_file, "%#x", bytes[0]); } else { for (i = 0; i < size - 1; ++i) - fprintf (asm_out_file, "0x%x,", bytes[i]); - fprintf (asm_out_file, "0x%x", bytes[i]); + fprintf (asm_out_file, "%#x,", bytes[i]); + fprintf (asm_out_file, "%#x", bytes[i]); } } @@ -549,7 +549,7 @@ dw2_asm_output_data_uleb128_raw (unsigned HOST_WIDE_INT value) /* More bytes to follow. */ byte |= 0x80; - fprintf (asm_out_file, "0x%x", byte); + fprintf (asm_out_file, "%#x", byte); if (value == 0) break; fputc (',', asm_out_file); @@ -591,7 +591,7 @@ dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value, if (byte_op) { - fprintf (asm_out_file, "0x%x", byte); + fprintf (asm_out_file, "%#x", byte); if (work != 0) fputc (',', asm_out_file); } @@ -633,7 +633,7 @@ dw2_asm_output_data_sleb128_raw (HOST_WIDE_INT value) if (more) byte |= 0x80; - fprintf (asm_out_file, "0x%x", byte); + fprintf (asm_out_file, "%#x", byte); if (!more) break; fputc (',', asm_out_file); @@ -678,7 +678,7 @@ dw2_asm_output_data_sleb128 (HOST_WIDE_INT value, if (byte_op) { - fprintf (asm_out_file, "0x%x", byte); + fprintf (asm_out_file, "%#x", byte); if (more) fputc (',', asm_out_file); } diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 5fd0ec6b990..5a9a3b89dc0 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3051,7 +3051,7 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh) { r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh); dw2_asm_output_data (1, (cfi->dw_cfi_opc | (r & 0x3f)), - "DW_CFA_offset, column 0x%lx", r); + "DW_CFA_offset, column %#lx", r); off = div_data_align (cfi->dw_cfi_oprnd2.dw_cfi_offset); dw2_asm_output_data_uleb128 (off, NULL); } @@ -3059,7 +3059,7 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh) { r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh); dw2_asm_output_data (1, (cfi->dw_cfi_opc | (r & 0x3f)), - "DW_CFA_restore, column 0x%lx", r); + "DW_CFA_restore, column %#lx", r); } else { @@ -3251,7 +3251,7 @@ output_cfi_directive (dw_cfi_ref cfi) break; case DW_CFA_GNU_args_size: - fprintf (asm_out_file, "\t.cfi_escape 0x%x,", DW_CFA_GNU_args_size); + fprintf (asm_out_file, "\t.cfi_escape %#x,", DW_CFA_GNU_args_size); dw2_asm_output_data_uleb128_raw (cfi->dw_cfi_oprnd1.dw_cfi_offset); if (flag_debug_asm) fprintf (asm_out_file, "\t%s args_size "HOST_WIDE_INT_PRINT_DEC, @@ -3265,7 +3265,7 @@ output_cfi_directive (dw_cfi_ref cfi) case DW_CFA_def_cfa_expression: case DW_CFA_expression: - fprintf (asm_out_file, "\t.cfi_escape 0x%x,", cfi->dw_cfi_opc); + fprintf (asm_out_file, "\t.cfi_escape %#x,", cfi->dw_cfi_opc); output_cfa_loc_raw (cfi); fputc ('\n', asm_out_file); break; @@ -3863,7 +3863,7 @@ dwarf2out_do_cfi_startproc (bool second) if (enc & DW_EH_PE_indirect) ref = dw2_force_const_mem (ref, true); - fprintf (asm_out_file, "\t.cfi_personality 0x%x,", enc); + fprintf (asm_out_file, "\t.cfi_personality %#x,", enc); output_addr_const (asm_out_file, ref); fputc ('\n', asm_out_file); } @@ -3881,7 +3881,7 @@ dwarf2out_do_cfi_startproc (bool second) if (enc & DW_EH_PE_indirect) ref = dw2_force_const_mem (ref, true); - fprintf (asm_out_file, "\t.cfi_lsda 0x%x,", enc); + fprintf (asm_out_file, "\t.cfi_lsda %#x,", enc); output_addr_const (asm_out_file, ref); fputc ('\n', asm_out_file); } @@ -5175,7 +5175,7 @@ output_loc_sequence_raw (dw_loc_descr_ref loc) while (1) { /* Output the opcode. */ - fprintf (asm_out_file, "0x%x", loc->dw_loc_opc); + fprintf (asm_out_file, "%#x", loc->dw_loc_opc); output_loc_operands_raw (loc); if (!loc->dw_loc_next) @@ -5221,7 +5221,7 @@ output_cfa_loc_raw (dw_cfi_ref cfi) if (cfi->dw_cfi_opc == DW_CFA_expression) { - fprintf (asm_out_file, "0x%x,", cfi->dw_cfi_oprnd1.dw_cfi_reg_num); + fprintf (asm_out_file, "%#x,", cfi->dw_cfi_oprnd1.dw_cfi_reg_num); loc = cfi->dw_cfi_oprnd2.dw_cfi_loc; } else @@ -10424,7 +10424,7 @@ output_die (dw_die_ref die) if (dwarf_version < 4 && die->die_id.die_symbol) output_die_symbol (die); - dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (0x%lx) %s)", + dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (%#lx) %s)", (unsigned long)die->die_offset, dwarf_tag_name (die->die_tag)); @@ -10656,7 +10656,7 @@ output_die (dw_die_ref die) /* Add null byte to terminate sibling list. */ if (die->die_child != NULL) - dw2_asm_output_data (1, 0, "end of children of DIE 0x%lx", + dw2_asm_output_data (1, 0, "end of children of DIE %#lx", (unsigned long) die->die_offset); } @@ -11082,7 +11082,7 @@ static void output_ranges (void) { unsigned i; - static const char *const start_fmt = "Offset 0x%x"; + static const char *const start_fmt = "Offset %#x"; const char *fmt = start_fmt; for (i = 0; i < ranges_table_in_use; i++) @@ -11424,7 +11424,7 @@ output_file_names (void) dw2_asm_output_nstring (dirs[i].path, dirs[i].length - !DWARF2_DIR_SHOULD_END_WITH_SEPARATOR, - "Directory Entry: 0x%x", i + idx_offset); + "Directory Entry: %#x", i + idx_offset); dw2_asm_output_data (1, 0, "End directory table"); @@ -11460,7 +11460,7 @@ output_file_names (void) files[file_idx].path + dirs[dir_idx].length, ver); dw2_asm_output_nstring - (filebuf, -1, "File Entry: 0x%x", (unsigned) i + 1); + (filebuf, -1, "File Entry: %#x", (unsigned) i + 1); /* Include directory index. */ dw2_asm_output_data_uleb128 (dir_idx + idx_offset, NULL); @@ -11478,7 +11478,7 @@ output_file_names (void) NULL); #else dw2_asm_output_nstring (files[file_idx].path + dirs[dir_idx].length, -1, - "File Entry: 0x%x", (unsigned) i + 1); + "File Entry: %#x", (unsigned) i + 1); /* Include directory index. */ dw2_asm_output_data_uleb128 (dir_idx + idx_offset, NULL); @@ -11569,7 +11569,7 @@ output_line_info (void) break; } - dw2_asm_output_data (1, n_op_args, "opcode: 0x%x has %d args", + dw2_asm_output_data (1, n_op_args, "opcode: %#x has %d args", opc, n_op_args); } @@ -16355,8 +16355,6 @@ lower_bound_default (void) static void add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree bound) { - int want_address = 2; - switch (TREE_CODE (bound)) { case ERROR_MARK: @@ -16419,7 +16417,6 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b add_AT_die_ref (subrange_die, bound_attr, decl_die); break; } - want_address = 0; } /* FALLTHRU */ @@ -16431,15 +16428,23 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b dw_die_ref ctx, decl_die; dw_loc_list_ref list; - list = loc_list_from_tree (bound, want_address); - if (list == NULL) - break; - - if (single_element_loc_list_p (list)) + list = loc_list_from_tree (bound, 2); + if (list == NULL || single_element_loc_list_p (list)) { - add_AT_loc (subrange_die, bound_attr, list->expr); - break; + /* If DW_AT_*bound is not a reference nor constant, it is + a DWARF expression rather than location description. + For that loc_list_from_tree (bound, 0) is needed. + If that fails to give a single element list, + fall back to outputting this as a reference anyway. */ + dw_loc_list_ref list2 = loc_list_from_tree (bound, 0); + if (list2 && single_element_loc_list_p (list2)) + { + add_AT_loc (subrange_die, bound_attr, list2->expr); + break; + } } + if (list == NULL) + break; if (current_function_decl == 0) ctx = comp_unit_die; diff --git a/gcc/except.c b/gcc/except.c index bdf98ef4c02..fccfb735d6a 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -153,9 +153,6 @@ along with GCC; see the file COPYING3. If not see to the given failure handler. */ tree (*lang_protect_cleanup_actions) (void); -/* Return true if type A catches type B. */ -int (*lang_eh_type_covers) (tree a, tree b); - static GTY(()) int call_site_base; static GTY ((param_is (union tree_node))) htab_t type_to_runtime_map; diff --git a/gcc/except.h b/gcc/except.h index 99f620be0d6..59214e0e764 100644 --- a/gcc/except.h +++ b/gcc/except.h @@ -294,9 +294,6 @@ extern eh_landing_pad get_eh_landing_pad_from_rtx (const_rtx); FUNCTION_DECL for `std::terminate'. */ extern tree (*lang_protect_cleanup_actions) (void); -/* Return true if type A catches type B. */ -extern int (*lang_eh_type_covers) (tree a, tree b); - /* Just because the user configured --with-sjlj-exceptions=no doesn't mean that we can use call frame exceptions. Detect that the target diff --git a/gcc/expmed.c b/gcc/expmed.c index aa2409942d9..44de4a6512e 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1839,39 +1839,15 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, static rtx mask_rtx (enum machine_mode mode, int bitpos, int bitsize, int complement) { - HOST_WIDE_INT masklow, maskhigh; + double_int mask; - if (bitsize == 0) - masklow = 0; - else if (bitpos < HOST_BITS_PER_WIDE_INT) - masklow = (HOST_WIDE_INT) -1 << bitpos; - else - masklow = 0; - - if (bitpos + bitsize < HOST_BITS_PER_WIDE_INT) - masklow &= ((unsigned HOST_WIDE_INT) -1 - >> (HOST_BITS_PER_WIDE_INT - bitpos - bitsize)); - - if (bitpos <= HOST_BITS_PER_WIDE_INT) - maskhigh = -1; - else - maskhigh = (HOST_WIDE_INT) -1 << (bitpos - HOST_BITS_PER_WIDE_INT); - - if (bitsize == 0) - maskhigh = 0; - else if (bitpos + bitsize > HOST_BITS_PER_WIDE_INT) - maskhigh &= ((unsigned HOST_WIDE_INT) -1 - >> (2 * HOST_BITS_PER_WIDE_INT - bitpos - bitsize)); - else - maskhigh = 0; + mask = double_int_mask (bitsize); + mask = double_int_lshift (mask, bitpos, HOST_BITS_PER_DOUBLE_INT, false); if (complement) - { - maskhigh = ~maskhigh; - masklow = ~masklow; - } + mask = double_int_not (mask); - return immed_double_const (masklow, maskhigh, mode); + return immed_double_const (mask.low, mask.high, mode); } /* Return a constant integer (CONST_INT or CONST_DOUBLE) rtx with the value @@ -1880,24 +1856,12 @@ mask_rtx (enum machine_mode mode, int bitpos, int bitsize, int complement) static rtx lshift_value (enum machine_mode mode, rtx value, int bitpos, int bitsize) { - unsigned HOST_WIDE_INT v = INTVAL (value); - HOST_WIDE_INT low, high; - - if (bitsize < HOST_BITS_PER_WIDE_INT) - v &= ~((HOST_WIDE_INT) -1 << bitsize); - - if (bitpos < HOST_BITS_PER_WIDE_INT) - { - low = v << bitpos; - high = (bitpos > 0 ? (v >> (HOST_BITS_PER_WIDE_INT - bitpos)) : 0); - } - else - { - low = 0; - high = v << (bitpos - HOST_BITS_PER_WIDE_INT); - } + double_int val; + + val = double_int_zext (uhwi_to_double_int (INTVAL (value)), bitsize); + val = double_int_lshift (val, bitpos, HOST_BITS_PER_DOUBLE_INT, false); - return immed_double_const (low, high, mode); + return immed_double_const (val.low, val.high, mode); } /* Extract a bit field that is split across two words diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 03598a59a6f..c1af8248a39 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -93,8 +93,6 @@ enum comparison_code { COMPCODE_TRUE = 15 }; -static void encode (HOST_WIDE_INT *, unsigned HOST_WIDE_INT, HOST_WIDE_INT); -static void decode (HOST_WIDE_INT *, unsigned HOST_WIDE_INT *, HOST_WIDE_INT *); static bool negate_mathfn_p (enum built_in_function); static bool negate_expr_p (tree); static tree negate_expr (tree); @@ -159,721 +157,6 @@ static tree fold_convert_const (enum tree_code, tree, tree); sign. */ #define OVERFLOW_SUM_SIGN(a, b, sum) ((~((a) ^ (b)) & ((a) ^ (sum))) < 0) -/* To do constant folding on INTEGER_CST nodes requires two-word arithmetic. - We do that by representing the two-word integer in 4 words, with only - HOST_BITS_PER_WIDE_INT / 2 bits stored in each word, as a positive - number. The value of the word is LOWPART + HIGHPART * BASE. */ - -#define LOWPART(x) \ - ((x) & (((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) - 1)) -#define HIGHPART(x) \ - ((unsigned HOST_WIDE_INT) (x) >> HOST_BITS_PER_WIDE_INT / 2) -#define BASE ((unsigned HOST_WIDE_INT) 1 << HOST_BITS_PER_WIDE_INT / 2) - -/* Unpack a two-word integer into 4 words. - LOW and HI are the integer, as two `HOST_WIDE_INT' pieces. - WORDS points to the array of HOST_WIDE_INTs. */ - -static void -encode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi) -{ - words[0] = LOWPART (low); - words[1] = HIGHPART (low); - words[2] = LOWPART (hi); - words[3] = HIGHPART (hi); -} - -/* Pack an array of 4 words into a two-word integer. - WORDS points to the array of words. - The integer is stored into *LOW and *HI as two `HOST_WIDE_INT' pieces. */ - -static void -decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low, - HOST_WIDE_INT *hi) -{ - *low = words[0] + words[1] * BASE; - *hi = words[2] + words[3] * BASE; -} - -/* Force the double-word integer L1, H1 to be within the range of the - integer type TYPE. Stores the properly truncated and sign-extended - double-word integer in *LV, *HV. Returns true if the operation - overflows, that is, argument and result are different. */ - -int -fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, const_tree type) -{ - unsigned HOST_WIDE_INT low0 = l1; - HOST_WIDE_INT high0 = h1; - unsigned int prec = TYPE_PRECISION (type); - int sign_extended_type; - - /* Size types *are* sign extended. */ - sign_extended_type = (!TYPE_UNSIGNED (type) - || (TREE_CODE (type) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (type))); - - /* First clear all bits that are beyond the type's precision. */ - if (prec >= 2 * HOST_BITS_PER_WIDE_INT) - ; - else if (prec > HOST_BITS_PER_WIDE_INT) - h1 &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT)); - else - { - h1 = 0; - if (prec < HOST_BITS_PER_WIDE_INT) - l1 &= ~((HOST_WIDE_INT) (-1) << prec); - } - - /* Then do sign extension if necessary. */ - if (!sign_extended_type) - /* No sign extension */; - else if (prec >= 2 * HOST_BITS_PER_WIDE_INT) - /* Correct width already. */; - else if (prec > HOST_BITS_PER_WIDE_INT) - { - /* Sign extend top half? */ - if (h1 & ((unsigned HOST_WIDE_INT)1 - << (prec - HOST_BITS_PER_WIDE_INT - 1))) - h1 |= (HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT); - } - else if (prec == HOST_BITS_PER_WIDE_INT) - { - if ((HOST_WIDE_INT)l1 < 0) - h1 = -1; - } - else - { - /* Sign extend bottom half? */ - if (l1 & ((unsigned HOST_WIDE_INT)1 << (prec - 1))) - { - h1 = -1; - l1 |= (HOST_WIDE_INT)(-1) << prec; - } - } - - *lv = l1; - *hv = h1; - - /* If the value didn't fit, signal overflow. */ - return l1 != low0 || h1 != high0; -} - -/* We force the double-int HIGH:LOW to the range of the type TYPE by - sign or zero extending it. - OVERFLOWABLE indicates if we are interested - in overflow of the value, when >0 we are only interested in signed - overflow, for <0 we are interested in any overflow. OVERFLOWED - indicates whether overflow has already occurred. CONST_OVERFLOWED - indicates whether constant overflow has already occurred. We force - T's value to be within range of T's type (by setting to 0 or 1 all - the bits outside the type's range). We set TREE_OVERFLOWED if, - OVERFLOWED is nonzero, - or OVERFLOWABLE is >0 and signed overflow occurs - or OVERFLOWABLE is <0 and any overflow occurs - We return a new tree node for the extended double-int. The node - is shared if no overflow flags are set. */ - -tree -force_fit_type_double (tree type, unsigned HOST_WIDE_INT low, - HOST_WIDE_INT high, int overflowable, - bool overflowed) -{ - int sign_extended_type; - bool overflow; - - /* Size types *are* sign extended. */ - sign_extended_type = (!TYPE_UNSIGNED (type) - || (TREE_CODE (type) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (type))); - - overflow = fit_double_type (low, high, &low, &high, type); - - /* If we need to set overflow flags, return a new unshared node. */ - if (overflowed || overflow) - { - if (overflowed - || overflowable < 0 - || (overflowable > 0 && sign_extended_type)) - { - tree t = make_node (INTEGER_CST); - TREE_INT_CST_LOW (t) = low; - TREE_INT_CST_HIGH (t) = high; - TREE_TYPE (t) = type; - TREE_OVERFLOW (t) = 1; - return t; - } - } - - /* Else build a shared node. */ - return build_int_cst_wide (type, low, high); -} - -/* Add two doubleword integers with doubleword result. - Return nonzero if the operation overflows according to UNSIGNED_P. - Each argument is given as two `HOST_WIDE_INT' pieces. - One argument is L1 and H1; the other, L2 and H2. - The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */ - -int -add_double_with_sign (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, - bool unsigned_p) -{ - unsigned HOST_WIDE_INT l; - HOST_WIDE_INT h; - - l = l1 + l2; - h = (HOST_WIDE_INT) ((unsigned HOST_WIDE_INT) h1 - + (unsigned HOST_WIDE_INT) h2 - + (l < l1)); - - *lv = l; - *hv = h; - - if (unsigned_p) - return ((unsigned HOST_WIDE_INT) h < (unsigned HOST_WIDE_INT) h1 - || (h == h1 - && l < l1)); - else - return OVERFLOW_SUM_SIGN (h1, h2, h); -} - -/* Negate a doubleword integer with doubleword result. - Return nonzero if the operation overflows, assuming it's signed. - The argument is given as two `HOST_WIDE_INT' pieces in L1 and H1. - The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */ - -int -neg_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv) -{ - if (l1 == 0) - { - *lv = 0; - *hv = - h1; - return (*hv & h1) < 0; - } - else - { - *lv = -l1; - *hv = ~h1; - return 0; - } -} - -/* Multiply two doubleword integers with doubleword result. - Return nonzero if the operation overflows according to UNSIGNED_P. - Each argument is given as two `HOST_WIDE_INT' pieces. - One argument is L1 and H1; the other, L2 and H2. - The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */ - -int -mul_double_with_sign (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, - bool unsigned_p) -{ - HOST_WIDE_INT arg1[4]; - HOST_WIDE_INT arg2[4]; - HOST_WIDE_INT prod[4 * 2]; - unsigned HOST_WIDE_INT carry; - int i, j, k; - unsigned HOST_WIDE_INT toplow, neglow; - HOST_WIDE_INT tophigh, neghigh; - - encode (arg1, l1, h1); - encode (arg2, l2, h2); - - memset (prod, 0, sizeof prod); - - for (i = 0; i < 4; i++) - { - carry = 0; - for (j = 0; j < 4; j++) - { - k = i + j; - /* This product is <= 0xFFFE0001, the sum <= 0xFFFF0000. */ - carry += arg1[i] * arg2[j]; - /* Since prod[p] < 0xFFFF, this sum <= 0xFFFFFFFF. */ - carry += prod[k]; - prod[k] = LOWPART (carry); - carry = HIGHPART (carry); - } - prod[i + 4] = carry; - } - - decode (prod, lv, hv); - decode (prod + 4, &toplow, &tophigh); - - /* Unsigned overflow is immediate. */ - if (unsigned_p) - return (toplow | tophigh) != 0; - - /* Check for signed overflow by calculating the signed representation of the - top half of the result; it should agree with the low half's sign bit. */ - if (h1 < 0) - { - neg_double (l2, h2, &neglow, &neghigh); - add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh); - } - if (h2 < 0) - { - neg_double (l1, h1, &neglow, &neghigh); - add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh); - } - return (*hv < 0 ? ~(toplow & tophigh) : toplow | tophigh) != 0; -} - -/* Shift the doubleword integer in L1, H1 left by COUNT places - keeping only PREC bits of result. - Shift right if COUNT is negative. - ARITH nonzero specifies arithmetic shifting; otherwise use logical shift. - Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ - -void -lshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - HOST_WIDE_INT count, unsigned int prec, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, int arith) -{ - unsigned HOST_WIDE_INT signmask; - - if (count < 0) - { - rshift_double (l1, h1, -count, prec, lv, hv, arith); - return; - } - - if (SHIFT_COUNT_TRUNCATED) - count %= prec; - - if (count >= 2 * HOST_BITS_PER_WIDE_INT) - { - /* Shifting by the host word size is undefined according to the - ANSI standard, so we must handle this as a special case. */ - *hv = 0; - *lv = 0; - } - else if (count >= HOST_BITS_PER_WIDE_INT) - { - *hv = l1 << (count - HOST_BITS_PER_WIDE_INT); - *lv = 0; - } - else - { - *hv = (((unsigned HOST_WIDE_INT) h1 << count) - | (l1 >> (HOST_BITS_PER_WIDE_INT - count - 1) >> 1)); - *lv = l1 << count; - } - - /* Sign extend all bits that are beyond the precision. */ - - signmask = -((prec > HOST_BITS_PER_WIDE_INT - ? ((unsigned HOST_WIDE_INT) *hv - >> (prec - HOST_BITS_PER_WIDE_INT - 1)) - : (*lv >> (prec - 1))) & 1); - - if (prec >= 2 * HOST_BITS_PER_WIDE_INT) - ; - else if (prec >= HOST_BITS_PER_WIDE_INT) - { - *hv &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT)); - *hv |= signmask << (prec - HOST_BITS_PER_WIDE_INT); - } - else - { - *hv = signmask; - *lv &= ~((unsigned HOST_WIDE_INT) (-1) << prec); - *lv |= signmask << prec; - } -} - -/* Shift the doubleword integer in L1, H1 right by COUNT places - keeping only PREC bits of result. COUNT must be positive. - ARITH nonzero specifies arithmetic shifting; otherwise use logical shift. - Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ - -void -rshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - HOST_WIDE_INT count, unsigned int prec, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, - int arith) -{ - unsigned HOST_WIDE_INT signmask; - - signmask = (arith - ? -((unsigned HOST_WIDE_INT) h1 >> (HOST_BITS_PER_WIDE_INT - 1)) - : 0); - - if (SHIFT_COUNT_TRUNCATED) - count %= prec; - - if (count >= 2 * HOST_BITS_PER_WIDE_INT) - { - /* Shifting by the host word size is undefined according to the - ANSI standard, so we must handle this as a special case. */ - *hv = 0; - *lv = 0; - } - else if (count >= HOST_BITS_PER_WIDE_INT) - { - *hv = 0; - *lv = (unsigned HOST_WIDE_INT) h1 >> (count - HOST_BITS_PER_WIDE_INT); - } - else - { - *hv = (unsigned HOST_WIDE_INT) h1 >> count; - *lv = ((l1 >> count) - | ((unsigned HOST_WIDE_INT) h1 << (HOST_BITS_PER_WIDE_INT - count - 1) << 1)); - } - - /* Zero / sign extend all bits that are beyond the precision. */ - - if (count >= (HOST_WIDE_INT)prec) - { - *hv = signmask; - *lv = signmask; - } - else if ((prec - count) >= 2 * HOST_BITS_PER_WIDE_INT) - ; - else if ((prec - count) >= HOST_BITS_PER_WIDE_INT) - { - *hv &= ~((HOST_WIDE_INT) (-1) << (prec - count - HOST_BITS_PER_WIDE_INT)); - *hv |= signmask << (prec - count - HOST_BITS_PER_WIDE_INT); - } - else - { - *hv = signmask; - *lv &= ~((unsigned HOST_WIDE_INT) (-1) << (prec - count)); - *lv |= signmask << (prec - count); - } -} - -/* Rotate the doubleword integer in L1, H1 left by COUNT places - keeping only PREC bits of result. - Rotate right if COUNT is negative. - Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ - -void -lrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - HOST_WIDE_INT count, unsigned int prec, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv) -{ - unsigned HOST_WIDE_INT s1l, s2l; - HOST_WIDE_INT s1h, s2h; - - count %= prec; - if (count < 0) - count += prec; - - lshift_double (l1, h1, count, prec, &s1l, &s1h, 0); - rshift_double (l1, h1, prec - count, prec, &s2l, &s2h, 0); - *lv = s1l | s2l; - *hv = s1h | s2h; -} - -/* Rotate the doubleword integer in L1, H1 left by COUNT places - keeping only PREC bits of result. COUNT must be positive. - Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ - -void -rrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - HOST_WIDE_INT count, unsigned int prec, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv) -{ - unsigned HOST_WIDE_INT s1l, s2l; - HOST_WIDE_INT s1h, s2h; - - count %= prec; - if (count < 0) - count += prec; - - rshift_double (l1, h1, count, prec, &s1l, &s1h, 0); - lshift_double (l1, h1, prec - count, prec, &s2l, &s2h, 0); - *lv = s1l | s2l; - *hv = s1h | s2h; -} - -/* Divide doubleword integer LNUM, HNUM by doubleword integer LDEN, HDEN - for a quotient (stored in *LQUO, *HQUO) and remainder (in *LREM, *HREM). - CODE is a tree code for a kind of division, one of - TRUNC_DIV_EXPR, FLOOR_DIV_EXPR, CEIL_DIV_EXPR, ROUND_DIV_EXPR - or EXACT_DIV_EXPR - It controls how the quotient is rounded to an integer. - Return nonzero if the operation overflows. - UNS nonzero says do unsigned division. */ - -int -div_and_round_double (enum tree_code code, int uns, - unsigned HOST_WIDE_INT lnum_orig, /* num == numerator == dividend */ - HOST_WIDE_INT hnum_orig, - unsigned HOST_WIDE_INT lden_orig, /* den == denominator == divisor */ - HOST_WIDE_INT hden_orig, - unsigned HOST_WIDE_INT *lquo, - HOST_WIDE_INT *hquo, unsigned HOST_WIDE_INT *lrem, - HOST_WIDE_INT *hrem) -{ - int quo_neg = 0; - HOST_WIDE_INT num[4 + 1]; /* extra element for scaling. */ - HOST_WIDE_INT den[4], quo[4]; - int i, j; - unsigned HOST_WIDE_INT work; - unsigned HOST_WIDE_INT carry = 0; - unsigned HOST_WIDE_INT lnum = lnum_orig; - HOST_WIDE_INT hnum = hnum_orig; - unsigned HOST_WIDE_INT lden = lden_orig; - HOST_WIDE_INT hden = hden_orig; - int overflow = 0; - - if (hden == 0 && lden == 0) - overflow = 1, lden = 1; - - /* Calculate quotient sign and convert operands to unsigned. */ - if (!uns) - { - if (hnum < 0) - { - quo_neg = ~ quo_neg; - /* (minimum integer) / (-1) is the only overflow case. */ - if (neg_double (lnum, hnum, &lnum, &hnum) - && ((HOST_WIDE_INT) lden & hden) == -1) - overflow = 1; - } - if (hden < 0) - { - quo_neg = ~ quo_neg; - neg_double (lden, hden, &lden, &hden); - } - } - - if (hnum == 0 && hden == 0) - { /* single precision */ - *hquo = *hrem = 0; - /* This unsigned division rounds toward zero. */ - *lquo = lnum / lden; - goto finish_up; - } - - if (hnum == 0) - { /* trivial case: dividend < divisor */ - /* hden != 0 already checked. */ - *hquo = *lquo = 0; - *hrem = hnum; - *lrem = lnum; - goto finish_up; - } - - memset (quo, 0, sizeof quo); - - memset (num, 0, sizeof num); /* to zero 9th element */ - memset (den, 0, sizeof den); - - encode (num, lnum, hnum); - encode (den, lden, hden); - - /* Special code for when the divisor < BASE. */ - if (hden == 0 && lden < (unsigned HOST_WIDE_INT) BASE) - { - /* hnum != 0 already checked. */ - for (i = 4 - 1; i >= 0; i--) - { - work = num[i] + carry * BASE; - quo[i] = work / lden; - carry = work % lden; - } - } - else - { - /* Full double precision division, - with thanks to Don Knuth's "Seminumerical Algorithms". */ - int num_hi_sig, den_hi_sig; - unsigned HOST_WIDE_INT quo_est, scale; - - /* Find the highest nonzero divisor digit. */ - for (i = 4 - 1;; i--) - if (den[i] != 0) - { - den_hi_sig = i; - break; - } - - /* Insure that the first digit of the divisor is at least BASE/2. - This is required by the quotient digit estimation algorithm. */ - - scale = BASE / (den[den_hi_sig] + 1); - if (scale > 1) - { /* scale divisor and dividend */ - carry = 0; - for (i = 0; i <= 4 - 1; i++) - { - work = (num[i] * scale) + carry; - num[i] = LOWPART (work); - carry = HIGHPART (work); - } - - num[4] = carry; - carry = 0; - for (i = 0; i <= 4 - 1; i++) - { - work = (den[i] * scale) + carry; - den[i] = LOWPART (work); - carry = HIGHPART (work); - if (den[i] != 0) den_hi_sig = i; - } - } - - num_hi_sig = 4; - - /* Main loop */ - for (i = num_hi_sig - den_hi_sig - 1; i >= 0; i--) - { - /* Guess the next quotient digit, quo_est, by dividing the first - two remaining dividend digits by the high order quotient digit. - quo_est is never low and is at most 2 high. */ - unsigned HOST_WIDE_INT tmp; - - num_hi_sig = i + den_hi_sig + 1; - work = num[num_hi_sig] * BASE + num[num_hi_sig - 1]; - if (num[num_hi_sig] != den[den_hi_sig]) - quo_est = work / den[den_hi_sig]; - else - quo_est = BASE - 1; - - /* Refine quo_est so it's usually correct, and at most one high. */ - tmp = work - quo_est * den[den_hi_sig]; - if (tmp < BASE - && (den[den_hi_sig - 1] * quo_est - > (tmp * BASE + num[num_hi_sig - 2]))) - quo_est--; - - /* Try QUO_EST as the quotient digit, by multiplying the - divisor by QUO_EST and subtracting from the remaining dividend. - Keep in mind that QUO_EST is the I - 1st digit. */ - - carry = 0; - for (j = 0; j <= den_hi_sig; j++) - { - work = quo_est * den[j] + carry; - carry = HIGHPART (work); - work = num[i + j] - LOWPART (work); - num[i + j] = LOWPART (work); - carry += HIGHPART (work) != 0; - } - - /* If quo_est was high by one, then num[i] went negative and - we need to correct things. */ - if (num[num_hi_sig] < (HOST_WIDE_INT) carry) - { - quo_est--; - carry = 0; /* add divisor back in */ - for (j = 0; j <= den_hi_sig; j++) - { - work = num[i + j] + den[j] + carry; - carry = HIGHPART (work); - num[i + j] = LOWPART (work); - } - - num [num_hi_sig] += carry; - } - - /* Store the quotient digit. */ - quo[i] = quo_est; - } - } - - decode (quo, lquo, hquo); - - finish_up: - /* If result is negative, make it so. */ - if (quo_neg) - neg_double (*lquo, *hquo, lquo, hquo); - - /* Compute trial remainder: rem = num - (quo * den) */ - mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem); - neg_double (*lrem, *hrem, lrem, hrem); - add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem); - - switch (code) - { - case TRUNC_DIV_EXPR: - case TRUNC_MOD_EXPR: /* round toward zero */ - case EXACT_DIV_EXPR: /* for this one, it shouldn't matter */ - return overflow; - - case FLOOR_DIV_EXPR: - case FLOOR_MOD_EXPR: /* round toward negative infinity */ - if (quo_neg && (*lrem != 0 || *hrem != 0)) /* ratio < 0 && rem != 0 */ - { - /* quo = quo - 1; */ - add_double (*lquo, *hquo, (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, - lquo, hquo); - } - else - return overflow; - break; - - case CEIL_DIV_EXPR: - case CEIL_MOD_EXPR: /* round toward positive infinity */ - if (!quo_neg && (*lrem != 0 || *hrem != 0)) /* ratio > 0 && rem != 0 */ - { - add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0, - lquo, hquo); - } - else - return overflow; - break; - - case ROUND_DIV_EXPR: - case ROUND_MOD_EXPR: /* round to closest integer */ - { - unsigned HOST_WIDE_INT labs_rem = *lrem; - HOST_WIDE_INT habs_rem = *hrem; - unsigned HOST_WIDE_INT labs_den = lden, ltwice; - HOST_WIDE_INT habs_den = hden, htwice; - - /* Get absolute values. */ - if (*hrem < 0) - neg_double (*lrem, *hrem, &labs_rem, &habs_rem); - if (hden < 0) - neg_double (lden, hden, &labs_den, &habs_den); - - /* If (2 * abs (lrem) >= abs (lden)), adjust the quotient. */ - mul_double ((HOST_WIDE_INT) 2, (HOST_WIDE_INT) 0, - labs_rem, habs_rem, <wice, &htwice); - - if (((unsigned HOST_WIDE_INT) habs_den - < (unsigned HOST_WIDE_INT) htwice) - || (((unsigned HOST_WIDE_INT) habs_den - == (unsigned HOST_WIDE_INT) htwice) - && (labs_den <= ltwice))) - { - if (*hquo < 0) - /* quo = quo - 1; */ - add_double (*lquo, *hquo, - (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo); - else - /* quo = quo + 1; */ - add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0, - lquo, hquo); - } - else - return overflow; - } - break; - - default: - gcc_unreachable (); - } - - /* Compute true remainder: rem = num - (quo * den) */ - mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem); - neg_double (*lrem, *hrem, lrem, hrem); - add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem); - return overflow; -} - /* If ARG2 divides ARG1 with zero remainder, carries out the division of type CODE and returns the quotient. Otherwise returns NULL_TREE. */ @@ -881,10 +164,7 @@ div_and_round_double (enum tree_code code, int uns, tree div_if_zero_remainder (enum tree_code code, const_tree arg1, const_tree arg2) { - unsigned HOST_WIDE_INT int1l, int2l; - HOST_WIDE_INT int1h, int2h; - unsigned HOST_WIDE_INT quol, reml; - HOST_WIDE_INT quoh, remh; + double_int quo, rem; int uns; /* The sign of the division is according to operand two, that @@ -895,17 +175,14 @@ div_if_zero_remainder (enum tree_code code, const_tree arg1, const_tree arg2) && TYPE_IS_SIZETYPE (TREE_TYPE (arg2))) uns = false; - int1l = TREE_INT_CST_LOW (arg1); - int1h = TREE_INT_CST_HIGH (arg1); - int2l = TREE_INT_CST_LOW (arg2); - int2h = TREE_INT_CST_HIGH (arg2); + quo = double_int_divmod (tree_to_double_int (arg1), + tree_to_double_int (arg2), + uns, code, &rem); - div_and_round_double (code, uns, int1l, int1h, int2l, int2h, - &quol, &quoh, &reml, &remh); - if (remh != 0 || reml != 0) - return NULL_TREE; + if (double_int_zero_p (rem)) + return build_int_cst_wide (TREE_TYPE (arg1), quo.low, quo.high); - return build_int_cst_wide (TREE_TYPE (arg1), quol, quoh); + return NULL_TREE; } /* This is nonzero if we should defer warnings about undefined @@ -2252,23 +1529,7 @@ fold_convert_const_int_from_int (tree type, const_tree arg1) appropriately sign-extended or truncated. */ t = force_fit_type_double (type, TREE_INT_CST_LOW (arg1), TREE_INT_CST_HIGH (arg1), - /* Don't set the overflow when - converting from a pointer, */ - !POINTER_TYPE_P (TREE_TYPE (arg1)) - /* or to a sizetype with same signedness - and the precision is unchanged. - ??? sizetype is always sign-extended, - but its signedness depends on the - frontend. Thus we see spurious overflows - here if we do not check this. */ - && !((TYPE_PRECISION (TREE_TYPE (arg1)) - == TYPE_PRECISION (type)) - && (TYPE_UNSIGNED (TREE_TYPE (arg1)) - == TYPE_UNSIGNED (type)) - && ((TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (TREE_TYPE (arg1))) - || (TREE_CODE (type) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (type)))), + !POINTER_TYPE_P (TREE_TYPE (arg1)), (TREE_INT_CST_HIGH (arg1) < 0 && (TYPE_UNSIGNED (type) < TYPE_UNSIGNED (TREE_TYPE (arg1)))) @@ -2295,7 +1556,7 @@ fold_convert_const_int_from_real (enum tree_code code, tree type, const_tree arg C and C++ standards that simply state that the behavior of FP-to-integer conversion is unspecified upon overflow. */ - HOST_WIDE_INT high, low; + double_int val; REAL_VALUE_TYPE r; REAL_VALUE_TYPE x = TREE_REAL_CST (arg1); @@ -2313,8 +1574,7 @@ fold_convert_const_int_from_real (enum tree_code code, tree type, const_tree arg if (REAL_VALUE_ISNAN (r)) { overflow = 1; - high = 0; - low = 0; + val = double_int_zero; } /* See if R is less than the lower bound or greater than the @@ -2327,8 +1587,7 @@ fold_convert_const_int_from_real (enum tree_code code, tree type, const_tree arg if (REAL_VALUES_LESS (r, l)) { overflow = 1; - high = TREE_INT_CST_HIGH (lt); - low = TREE_INT_CST_LOW (lt); + val = tree_to_double_int (lt); } } @@ -2341,16 +1600,15 @@ fold_convert_const_int_from_real (enum tree_code code, tree type, const_tree arg if (REAL_VALUES_LESS (u, r)) { overflow = 1; - high = TREE_INT_CST_HIGH (ut); - low = TREE_INT_CST_LOW (ut); + val = tree_to_double_int (ut); } } } if (! overflow) - REAL_VALUE_TO_INT (&low, &high, r); + real_to_integer2 ((HOST_WIDE_INT *) &val.low, &val.high, &r); - t = force_fit_type_double (type, low, high, -1, + t = force_fit_type_double (type, val.low, val.high, -1, overflow | TREE_OVERFLOW (arg1)); return t; } @@ -2370,39 +1628,32 @@ fold_convert_const_int_from_fixed (tree type, const_tree arg1) mode = TREE_FIXED_CST (arg1).mode; if (GET_MODE_FBIT (mode) < 2 * HOST_BITS_PER_WIDE_INT) { - lshift_double (temp.low, temp.high, - - GET_MODE_FBIT (mode), 2 * HOST_BITS_PER_WIDE_INT, - &temp.low, &temp.high, SIGNED_FIXED_POINT_MODE_P (mode)); + temp = double_int_rshift (temp, GET_MODE_FBIT (mode), + HOST_BITS_PER_DOUBLE_INT, + SIGNED_FIXED_POINT_MODE_P (mode)); /* Left shift temp to temp_trunc by fbit. */ - lshift_double (temp.low, temp.high, - GET_MODE_FBIT (mode), 2 * HOST_BITS_PER_WIDE_INT, - &temp_trunc.low, &temp_trunc.high, - SIGNED_FIXED_POINT_MODE_P (mode)); + temp_trunc = double_int_lshift (temp, GET_MODE_FBIT (mode), + HOST_BITS_PER_DOUBLE_INT, + SIGNED_FIXED_POINT_MODE_P (mode)); } else { - temp.low = 0; - temp.high = 0; - temp_trunc.low = 0; - temp_trunc.high = 0; + temp = double_int_zero; + temp_trunc = double_int_zero; } /* If FIXED_CST is negative, we need to round the value toward 0. By checking if the fractional bits are not zero to add 1 to temp. */ - if (SIGNED_FIXED_POINT_MODE_P (mode) && temp_trunc.high < 0 + if (SIGNED_FIXED_POINT_MODE_P (mode) + && double_int_negative_p (temp_trunc) && !double_int_equal_p (TREE_FIXED_CST (arg1).data, temp_trunc)) - { - double_int one; - one.low = 1; - one.high = 0; - temp = double_int_add (temp, one); - } + temp = double_int_add (temp, double_int_one); /* Given a fixed-point constant, make new constant with new type, appropriately sign-extended or truncated. */ t = force_fit_type_double (type, temp.low, temp.high, -1, - (temp.high < 0 + (double_int_negative_p (temp) && (TYPE_UNSIGNED (type) < TYPE_UNSIGNED (TREE_TYPE (arg1)))) | TREE_OVERFLOW (arg1)); @@ -6731,12 +5982,6 @@ fold_binary_op_with_conditional_arg (location_t loc, tree lhs = NULL_TREE; tree rhs = NULL_TREE; - /* This transformation is only worthwhile if we don't have to wrap - arg in a SAVE_EXPR, and the operation can be simplified on at least - one of the branches once its pushed inside the COND_EXPR. */ - if (!TREE_CONSTANT (arg)) - return NULL_TREE; - if (TREE_CODE (cond) == COND_EXPR) { test = TREE_OPERAND (cond, 0); @@ -6758,6 +6003,14 @@ fold_binary_op_with_conditional_arg (location_t loc, false_value = constant_boolean_node (false, testtype); } + /* This transformation is only worthwhile if we don't have to wrap ARG + in a SAVE_EXPR and the operation can be simplified on at least one + of the branches once its pushed inside the COND_EXPR. */ + if (!TREE_CONSTANT (arg) + && (TREE_SIDE_EFFECTS (arg) + || TREE_CONSTANT (true_value) || TREE_CONSTANT (false_value))) + return NULL_TREE; + arg = fold_convert_loc (loc, arg_type, arg); if (lhs == 0) { @@ -6776,8 +6029,11 @@ fold_binary_op_with_conditional_arg (location_t loc, rhs = fold_build2_loc (loc, code, type, arg, false_value); } - test = fold_build3_loc (loc, COND_EXPR, type, test, lhs, rhs); - return fold_convert_loc (loc, type, test); + /* Check that we have simplified at least one of the branches. */ + if (!TREE_CONSTANT (arg) && !TREE_CONSTANT (lhs) && !TREE_CONSTANT (rhs)) + return NULL_TREE; + + return fold_build3_loc (loc, COND_EXPR, type, test, lhs, rhs); } @@ -10628,23 +9884,39 @@ fold_binary_loc (location_t loc, var1 = split_tree (arg1, code, &con1, &lit1, &minus_lit1, code == MINUS_EXPR); - /* With undefined overflow we can only associate constants - with one variable. */ - if (((POINTER_TYPE_P (type) && POINTER_TYPE_OVERFLOW_UNDEFINED) - || (INTEGRAL_TYPE_P (type) && !TYPE_OVERFLOW_WRAPS (type))) - && var0 && var1) + /* Recombine MINUS_EXPR operands by using PLUS_EXPR. */ + if (code == MINUS_EXPR) + code = PLUS_EXPR; + + /* With undefined overflow we can only associate constants with one + variable, and constants whose association doesn't overflow. */ + if ((POINTER_TYPE_P (type) && POINTER_TYPE_OVERFLOW_UNDEFINED) + || (INTEGRAL_TYPE_P (type) && !TYPE_OVERFLOW_WRAPS (type))) { - tree tmp0 = var0; - tree tmp1 = var1; - - if (TREE_CODE (tmp0) == NEGATE_EXPR) - tmp0 = TREE_OPERAND (tmp0, 0); - if (TREE_CODE (tmp1) == NEGATE_EXPR) - tmp1 = TREE_OPERAND (tmp1, 0); - /* The only case we can still associate with two variables - is if they are the same, modulo negation. */ - if (!operand_equal_p (tmp0, tmp1, 0)) - ok = false; + if (var0 && var1) + { + tree tmp0 = var0; + tree tmp1 = var1; + + if (TREE_CODE (tmp0) == NEGATE_EXPR) + tmp0 = TREE_OPERAND (tmp0, 0); + if (TREE_CODE (tmp1) == NEGATE_EXPR) + tmp1 = TREE_OPERAND (tmp1, 0); + /* The only case we can still associate with two variables + is if they are the same, modulo negation. */ + if (!operand_equal_p (tmp0, tmp1, 0)) + ok = false; + } + + if (ok && lit0 && lit1) + { + tree tmp0 = fold_convert (type, lit0); + tree tmp1 = fold_convert (type, lit1); + + if (!TREE_OVERFLOW (tmp0) && !TREE_OVERFLOW (tmp1) + && TREE_OVERFLOW (fold_build2 (code, type, tmp0, tmp1))) + ok = false; + } } /* Only do something if we found more than two objects. Otherwise, @@ -10655,10 +9927,6 @@ fold_binary_loc (location_t loc, + (lit0 != 0) + (lit1 != 0) + (minus_lit0 != 0) + (minus_lit1 != 0)))) { - /* Recombine MINUS_EXPR operands by using PLUS_EXPR. */ - if (code == MINUS_EXPR) - code = PLUS_EXPR; - var0 = associate_trees (loc, var0, var1, code, type); con0 = associate_trees (loc, con0, con1, code, type); lit0 = associate_trees (loc, lit0, lit1, code, type); @@ -12222,34 +11490,6 @@ fold_binary_loc (location_t loc, && TREE_INT_CST_HIGH (arg1) == -1) return omit_one_operand_loc (loc, type, integer_zero_node, arg0); - /* Optimize TRUNC_MOD_EXPR by a power of two into a BIT_AND_EXPR, - i.e. "X % C" into "X & (C - 1)", if X and C are positive. */ - strict_overflow_p = false; - if ((code == TRUNC_MOD_EXPR || code == FLOOR_MOD_EXPR) - && (TYPE_UNSIGNED (type) - || tree_expr_nonnegative_warnv_p (op0, &strict_overflow_p))) - { - tree c = arg1; - /* Also optimize A % (C << N) where C is a power of 2, - to A & ((C << N) - 1). */ - if (TREE_CODE (arg1) == LSHIFT_EXPR) - c = TREE_OPERAND (arg1, 0); - - if (integer_pow2p (c) && tree_int_cst_sgn (c) > 0) - { - tree mask = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (arg1), arg1, - build_int_cst (TREE_TYPE (arg1), 1)); - if (strict_overflow_p) - fold_overflow_warning (("assuming signed overflow does not " - "occur when simplifying " - "X % (power of two)"), - WARN_STRICT_OVERFLOW_MISC); - return fold_build2_loc (loc, BIT_AND_EXPR, type, - fold_convert_loc (loc, type, arg0), - fold_convert_loc (loc, type, mask)); - } - } - /* X % -C is the same as X % C. */ if (code == TRUNC_MOD_EXPR && !TYPE_UNSIGNED (type) @@ -12273,6 +11513,7 @@ fold_binary_loc (location_t loc, fold_convert_loc (loc, type, TREE_OPERAND (arg1, 0))); + strict_overflow_p = false; if (TREE_CODE (arg1) == INTEGER_CST && 0 != (tem = extract_muldiv (op0, arg1, code, NULL_TREE, &strict_overflow_p))) @@ -12284,6 +11525,34 @@ fold_binary_loc (location_t loc, return fold_convert_loc (loc, type, tem); } + /* Optimize TRUNC_MOD_EXPR by a power of two into a BIT_AND_EXPR, + i.e. "X % C" into "X & (C - 1)", if X and C are positive. */ + if ((code == TRUNC_MOD_EXPR || code == FLOOR_MOD_EXPR) + && (TYPE_UNSIGNED (type) + || tree_expr_nonnegative_warnv_p (op0, &strict_overflow_p))) + { + tree c = arg1; + /* Also optimize A % (C << N) where C is a power of 2, + to A & ((C << N) - 1). */ + if (TREE_CODE (arg1) == LSHIFT_EXPR) + c = TREE_OPERAND (arg1, 0); + + if (integer_pow2p (c) && tree_int_cst_sgn (c) > 0) + { + tree mask + = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (arg1), arg1, + build_int_cst (TREE_TYPE (arg1), 1)); + if (strict_overflow_p) + fold_overflow_warning (("assuming signed overflow does not " + "occur when simplifying " + "X % (power of two)"), + WARN_STRICT_OVERFLOW_MISC); + return fold_build2_loc (loc, BIT_AND_EXPR, type, + fold_convert_loc (loc, type, arg0), + fold_convert_loc (loc, type, mask)); + } + } + return NULL_TREE; case LROTATE_EXPR: @@ -14820,6 +14089,10 @@ multiple_of_p (tree type, const_tree top, const_tree bottom) case SAVE_EXPR: return multiple_of_p (type, TREE_OPERAND (top, 0), bottom); + case COND_EXPR: + return (multiple_of_p (type, TREE_OPERAND (top, 1), bottom) + && multiple_of_p (type, TREE_OPERAND (top, 2), bottom)); + case INTEGER_CST: if (TREE_CODE (bottom) != INTEGER_CST || integer_zerop (bottom) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 17933ff71c8..b53aff9b83b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,385 @@ +2010-04-16 Jakub Jelinek + + * trans-decl.c (gfc_build_qualified_array): Ensure + ubound.N and lbound.N artificial variable names don't appear + in debug info. + +2010-04-15 Steven G. Kargl + + PR fortran/30073 + * trans-array.c (gfc_trans_array_bound_check): Eliminate a redundant + block of code. Set name to the variable associated with the descriptor. + +2010-04-15 Jakub Jelinek + + * trans-decl.c (gfc_build_qualified_array): Clear DECL_IGNORED_P + on VAR_DECL LBOUND and/or UBOUND, even for -O1. + +2010-04-14 Steven G. Kargl + + * intrinsic.texi: Add the missing specific name of intrinsic + procedure where the specific name is identical to the generic name. + Fix inconsistent or mismatch in the argument names in intrinsic + procedure descriptions. Add the SCALAR allocatable description to + ALLOCATED. + +2010-04-14 Tobias Burnus + + PR fortran/18918 + * array.c (gfc_find_array_ref): Handle codimensions. + (gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error. + * check.c (is_coarray, dim_corank_check, gfc_check_lcobound, + gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound): + New functions. + * gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX, + GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE, + GFC_ISYM_UCOBOUND. + * intrinsic.h (add_functions): Add this_image, image_index, + lcobound and ucobound intrinsics. + * intrinsic.c (gfc_check_lcobound,gfc_check_ucobound, + gfc_check_image_index, gfc_check_this_image, + gfc_simplify_image_index, gfc_simplify_lcobound, + gfc_simplify_this_image, gfc_simplify_ucobound): + New function prototypes. + * intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE + IMAGE_INDEX): Document new intrinsic functions. + * match.c (gfc_match_critical, sync_statement): Make -fcoarray=none + error fatal. + * simplify.c (simplify_bound_dim): Handle coarrays. + (simplify_bound): Update simplify_bound_dim call. + (gfc_simplify_num_images): Add -fcoarray=none check. + (simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound, + gfc_simplify_ucobound, gfc_simplify_ucobound): New functions. + +2010-04-14 Jerry DeLisle + + PR fortran/43747 + * constructor.c: Fix typo in comment. + * expr.c (find_array_section): Add check for max array limit. + +2010-04-13 Iain Sandoe + + PR bootstrap/31400 + * gfortranspec.c (lookup_option): Check for -static and return + OPTION_static. + (lang_specific_driver): Break when OPTION_static is discovered. + +2010-04-12 Jerry DeLisle + + * array.c (extract_element): Restore function from trunk. + (gfc_get_array_element): Restore function from trunk. + (gfc_expand_constructor): Restore check against + flag_max_array_constructor. + * constructor.c (node_copy_and_append): Delete unused. + * gfortran.h: Delete comment and extra include. + * constructor.h: Bump copyright and clean up TODO comments. + * resolve.c: Whitespace. + +2010-04-12 Daniel Franke + + * simplify.c (compute_dot_product): Replaced usage of ADVANCE macro + with direct access access to elements. Adjusted prototype, fixed all + callers. + (gfc_simplify_dot_product): Removed duplicate check for zero-sized + array. + (gfc_simplify_matmul): Removed usage of ADVANCE macro. + (gfc_simplify_spread): Removed workaround, directly insert elements + at a given array position. + (gfc_simplify_transpose): Likewise. + (gfc_simplify_pack): Replaced usage of ADVANCE macro with corresponding + function calls. + (gfc_simplify_unpack): Likewise. + +2010-04-12 Daniel Franke + + * simplify.c (only_convert_cmplx_boz): Renamed to ... + (convert_boz): ... this and moved to start of file. + (gfc_simplify_abs): Whitespace fix. + (gfc_simplify_acos): Whitespace fix. + (gfc_simplify_acosh): Whitespace fix. + (gfc_simplify_aint): Whitespace fix. + (gfc_simplify_dint): Whitespace fix. + (gfc_simplify_anint): Whitespace fix. + (gfc_simplify_and): Replaced if-gate by more common switch-over-type. + (gfc_simplify_dnint): Whitespace fix. + (gfc_simplify_asin): Whitespace fix. + (gfc_simplify_asinh): Moved creation of result-expr out of switch. + (gfc_simplify_atan): Likewise. + (gfc_simplify_atanh): Whitespace fix. + (gfc_simplify_atan2): Whitespace fix. + (gfc_simplify_bessel_j0): Removed ATTRIBUTE_UNUSED. + (gfc_simplify_bessel_j1): Likewise. + (gfc_simplify_bessel_jn): Likewise. + (gfc_simplify_bessel_y0): Likewise. + (gfc_simplify_bessel_y1): Likewise. + (gfc_simplify_bessel_yn): Likewise. + (gfc_simplify_ceiling): Reorderd statements. + (simplify_cmplx): Use convert_boz(), check for constant arguments. + Whitespace fix. + (gfc_simplify_cmplx): Use correct default kind. Removed check for + constant arguments. + (gfc_simplify_complex): Replaced if-gate. Removed check for + constant arguments. + (gfc_simplify_conjg): Whitespace fix. + (gfc_simplify_cos): Whitespace fix. + (gfc_simplify_cosh): Replaced if-gate by more common switch-over-type. + (gfc_simplify_dcmplx): Removed check for constant arguments. + (gfc_simplify_dble): Use convert_boz() and gfc_convert_constant(). + (gfc_simplify_digits): Whitespace fix. + (gfc_simplify_dim): Whitespace fix. + (gfc_simplify_dprod): Reordered statements. + (gfc_simplify_erf): Whitespace fix. + (gfc_simplify_erfc): Whitespace fix. + (gfc_simplify_epsilon): Whitespace fix. + (gfc_simplify_exp): Whitespace fix. + (gfc_simplify_exponent): Use convert_boz(). + (gfc_simplify_floor): Reorderd statements. + (gfc_simplify_gamma): Whitespace fix. + (gfc_simplify_huge): Whitespace fix. + (gfc_simplify_iand): Whitespace fix. + (gfc_simplify_ieor): Whitespace fix. + (simplify_intconv): Use gfc_convert_constant(). + (gfc_simplify_int): Use simplify_intconv(). + (gfc_simplify_int2): Reorderd statements. + (gfc_simplify_idint): Reorderd statements. + (gfc_simplify_ior): Whitespace fix. + (gfc_simplify_ishftc): Removed duplicate type check. + (gfc_simplify_len): Use range_check() instead of manual range check. + (gfc_simplify_lgamma): Removed ATTRIBUTE_UNUSED. Whitespace fix. + (gfc_simplify_log): Whitespace fix. + (gfc_simplify_log10): Whitespace fix. + (gfc_simplify_minval): Whitespace fix. + (gfc_simplify_maxval): Whitespace fix. + (gfc_simplify_mod): Whitespace fix. + (gfc_simplify_modulo): Whitespace fix. + (simplify_nint): Reorderd statements. + (gfc_simplify_not): Whitespace fix. + (gfc_simplify_or): Replaced if-gate by more common switch-over-type. + (gfc_simplify_radix): Removed unused result-variable. Whitespace fix. + (gfc_simplify_range): Removed unused result-variable. Whitespace fix. + (gfc_simplify_real): Use convert_boz() and gfc_convert_constant(). + (gfc_simplify_realpart): Whitespace fix. + (gfc_simplify_selected_char_kind): Removed unused result-variable. + (gfc_simplify_selected_int_kind): Removed unused result-variable. + (gfc_simplify_selected_real_kind): Removed unused result-variable. + (gfc_simplify_sign): Whitespace fix. + (gfc_simplify_sin): Whitespace fix. + (gfc_simplify_sinh): Replaced if-gate by more common switch-over-type. + (gfc_simplify_sqrt): Avoided goto by inlining check. Whitespace fix. + (gfc_simplify_tan): Replaced if-gate by more common switch-over-type. + (gfc_simplify_tanh): Replaced if-gate by more common switch-over-type. + (gfc_simplify_xor): Replaced if-gate by more common switch-over-type. + +2010-04-12 Daniel Franke + + * gfortran.h (gfc_start_constructor): Removed. + (gfc_get_array_element): Removed. + * array.c (gfc_start_constructor): Removed, use gfc_get_array_expr + instead. Fixed all callers. + (extract_element): Removed. + (gfc_expand_constructor): Temporarily removed check for + max-array-constructor. Will be re-introduced later if still required. + (gfc_get_array_element): Removed, use gfc_constructor_lookup_expr + instead. Fixed all callers. + * expr.c (find_array_section): Replaced manual lookup of elements + by gfc_constructor_lookup. + +2010-04-12 Daniel Franke + + * gfortran.h (gfc_get_null_expr): New prototype. + (gfc_get_operator_expr): New prototype. + (gfc_get_character_expr): New prototype. + (gfc_get_iokind_expr): New prototype. + * expr.c (gfc_get_null_expr): New. + (gfc_get_character_expr): New. + (gfc_get_iokind_expr): New. + (gfc_get_operator_expr): Moved here from matchexp.c (build_node). + * matchexp.c (build_node): Renamed and moved to + expr.c (gfc_get_operator_expr). Reordered arguments to match + other functions. Fixed all callers. + (gfc_get_parentheses): Use specific function to build expr. + * array.c (gfc_match_array_constructor): Likewise. + * arith.c (eval_intrinsic): Likewise. + (gfc_hollerith2int): Likewise. + (gfc_hollerith2real): Likewise. + (gfc_hollerith2complex): Likewise. + (gfc_hollerith2logical): Likewise. + * data.c (create_character_intializer): Likewise. + * decl.c (gfc_match_null): Likewise. + (enum_initializer): Likewise. + * io.c (gfc_match_format): Likewise. + (match_io): Likewise. + * match.c (gfc_match_nullify): Likewise. + * primary.c (match_string_constant): Likewise. + (match_logical_constant): Likewise. + (build_actual_constructor): Likewise. + * resolve.c (build_default_init_expr): Likewise. + * symbol.c (generate_isocbinding_symbol): Likewise. + (gfc_build_class_symbol): Likewise. + (gfc_find_derived_vtab): Likewise. + * simplify.c (simplify_achar_char): Likewise. + (gfc_simplify_adjustl): Likewise. + (gfc_simplify_adjustr): Likewise. + (gfc_simplify_and): Likewise. + (gfc_simplify_bit_size): Likewise. + (gfc_simplify_is_iostat_end): Likewise. + (gfc_simplify_is_iostat_eor): Likewise. + (gfc_simplify_isnan): Likewise. + (simplify_bound): Likewise. + (gfc_simplify_leadz): Likewise. + (gfc_simplify_len_trim): Likewise. + (gfc_simplify_logical): Likewise. + (gfc_simplify_maxexponent): Likewise. + (gfc_simplify_minexponent): Likewise. + (gfc_simplify_new_line): Likewise. + (gfc_simplify_null): Likewise. + (gfc_simplify_or): Likewise. + (gfc_simplify_precision): Likewise. + (gfc_simplify_repeat): Likewise. + (gfc_simplify_scan): Likewise. + (gfc_simplify_size): Likewise. + (gfc_simplify_trailz): Likewise. + (gfc_simplify_trim): Likewise. + (gfc_simplify_verify): Likewise. + (gfc_simplify_xor): Likewise. + * trans-io.c (build_dt): Likewise. + (gfc_new_nml_name_expr): Removed. + +2010-04-12 Daniel Franke + + * arith.h (gfc_constant_result): Removed prototype. + * constructor.h (gfc_build_array_expr): Removed prototype. + (gfc_build_structure_constructor_expr): Removed prototype. + * gfortran.h (gfc_int_expr): Removed prototype. + (gfc_logical_expr): Removed prototype. + (gfc_get_array_expr): New prototype. + (gfc_get_structure_constructor_expr): New prototype. + (gfc_get_constant_expr): New prototype. + (gfc_get_int_expr): New prototype. + (gfc_get_logical_expr): New prototype. + * arith.c (gfc_constant_result): Moved and renamed to + expr.c (gfc_get_constant_expr). Fixed all callers. + * constructor.c (gfc_build_array_expr): Moved and renamed to + expr.c (gfc_get_array_expr). Split gfc_typespec argument to type + and kind. Fixed all callers. + (gfc_build_structure_constructor_expr): Moved and renamed to + expr.c (gfc_get_structure_constructor_expr). Split gfc_typespec argument + to type and kind. Fixed all callers. + * expr.c (gfc_logical_expr): Renamed to ... + (gfc_get_logical_expr): ... this. Added kind argument. Fixed all callers. + (gfc_int_expr): Renamed to ... + (gfc_get_int_expr): ... this. Added kind and where arguments. Fixed all + callers. + (gfc_get_constant_expr): New. + (gfc_get_array_expr): New. + (gfc_get_structure_constructor_expr): New. + * simplify.c (int_expr_with_kind): Removed, callers use gfc_get_int_expr + instead. + +2010-04-12 Daniel Franke + + * constructor.h: New. + * constructor.c: New. + * Make-lang.in: Add new files to F95_PARSER_OBJS. + * arith.c (reducy_unary): Use constructor API. + (reduce_binary_ac): Likewise. + (reduce_binary_ca): Likewise. + (reduce_binary_aa): Likewise. + * check.c (gfc_check_pack): Likewise. + (gfc_check_reshape): Likewise. + (gfc_check_unpack): Likewise. + * decl.c (add_init_expr_to_sym): Likewise. + (build_struct): Likewise. + * dependency.c (gfc_check_dependency): Likewise. + (contains_forall_index_p): Likewise. + * dump-parse-tree.c (show_constructor): Likewise. + * expr.c (free_expr0): Likewise. + (gfc_copy_expr): Likewise. + (gfc_is_constant_expr): Likewise. + (simplify_constructor): Likewise. + (find_array_element): Likewise. + (find_component_ref): Likewise. + (find_array_section): Likewise. + (find_substring_ref): Likewise. + (simplify_const_ref): Likewise. + (scalarize_intrinsic_call): Likewise. + (check_alloc_comp_init): Likewise. + (gfc_default_initializer): Likewise. + (gfc_traverse_expr): Likewise. + * iresolve.c (check_charlen_present): Likewise. + (gfc_resolve_reshape): Likewise. + (gfc_resolve_transfer): Likewise. + * module.c (mio_constructor): Likewise. + * primary.c (build_actual_constructor): Likewise. + (gfc_match_structure_constructor): Likewise. + * resolve.c (resolve_structure_cons): Likewise. + * simplify.c (is_constant_array_expr): Likewise. + (init_result_expr): Likewise. + (transformational_result): Likewise. + (simplify_transformation_to_scalar): Likewise. + (simplify_transformation_to_array): Likewise. + (gfc_simplify_dot_product): Likewise. + (simplify_bound): Likewise. + (simplify_matmul): Likewise. + (simplify_minval_maxval): Likewise. + (gfc_simplify_pack): Likewise. + (gfc_simplify_reshape): Likewise. + (gfc_simplify_shape): Likewise. + (gfc_simplify_spread): Likewise. + (gfc_simplify_transpose): Likewise. + (gfc_simplify_unpack): Likewise.q + (gfc_convert_constant): Likewise. + (gfc_convert_char_constant): Likewise. + * target-memory.c (size_array): Likewise. + (encode_array): Likewise. + (encode_derived): Likewise. + (interpret_array): Likewise. + (gfc_interpret_derived): Likewise. + (expr_to_char): Likewise. + (gfc_merge_initializers): Likewise. + * trans-array.c (gfc_get_array_constructor_size): Likewise. + (gfc_trans_array_constructor_value): Likewise. + (get_array_ctor_strlen): Likewise. + (gfc_constant_array_constructor_p): Likewise. + (gfc_build_constant_array_constructor): Likewise. + (gfc_trans_array_constructor): Likewise. + (gfc_conv_array_initializer): Likewise. + * trans-decl.c (check_constant_initializer): Likewise. + * trans-expr.c (flatten_array_ctors_without_strlen): Likewise. + (gfc_apply_interface_mapping_to_cons): Likewise. + (gfc_trans_structure_assign): Likewise. + (gfc_conv_structure): Likewise. + * array.c (check_duplicate_iterator): Likewise. + (match_array_list): Likewise. + (match_array_cons_element): Likewise. + (gfc_match_array_constructor): Likewise. + (check_constructor_type): Likewise. + (check_constructor): Likewise. + (expand): Likewise. + (expand_constructor): Likewise. + (extract_element): Likewise. + (gfc_expanded_ac): Likewise. + (resolve_array_list): Likewise. + (gfc_resolve_character_array_constructor): Likewise. + (copy_iterator): Renamed to ... + (gfc_copy_iterator): ... this. + (gfc_append_constructor): Removed. + (gfc_insert_constructor): Removed unused function. + (gfc_get_constructor): Removed. + (gfc_free_constructor): Removed. + (qgfc_copy_constructor): Removed. + * gfortran.h (struct gfc_expr): Removed member 'con_by_offset'. + Removed all references. Replaced constructor list by splay-tree. + (struct gfc_constructor): Removed member 'next', moved 'offset' from + the inner struct, added member 'base'. + (gfc_append_constructor): Removed prototype. + (gfc_insert_constructor): Removed prototype. + (gfc_get_constructor): Removed prototype. + (gfc_free_constructor): Removed prototype. + (qgfc_copy_constructor): Removed prototype. + (gfc_copy_iterator): New prototype. + * trans-array.h (gfc_constant_array_constructor_p): Adjusted prototype. + 2010-04-10 Tobias Burnus PR fortran/43591 diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index b2bf52e70d3..d9544a4e06e 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -53,8 +53,8 @@ fortran-warn = $(STRICT_WARN) # from the parse tree to GENERIC F95_PARSER_OBJS = fortran/arith.o fortran/array.o fortran/bbt.o \ - fortran/check.o fortran/cpp.o fortran/data.o fortran/decl.o \ - fortran/dump-parse-tree.o fortran/error.o fortran/expr.o \ + fortran/check.o fortran/constructor.o fortran/cpp.o fortran/data.o \ + fortran/decl.o fortran/dump-parse-tree.o fortran/error.o fortran/expr.o \ fortran/interface.o fortran/intrinsic.o fortran/io.o fortran/iresolve.o \ fortran/match.o fortran/matchexp.o fortran/misc.o fortran/module.o \ fortran/openmp.o fortran/options.o fortran/parse.o fortran/primary.o \ @@ -320,7 +320,7 @@ fortran.stagefeedback: stageprofile-start # TODO: Add dependencies on the backend/tree header files $(F95_PARSER_OBJS): fortran/gfortran.h fortran/libgfortran.h \ - fortran/intrinsic.h fortran/match.h \ + fortran/intrinsic.h fortran/match.h fortran/constructor.h \ fortran/parse.h fortran/arith.h fortran/target-memory.h \ $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TM_P_H) coretypes.h \ $(RTL_H) $(TREE_H) $(TREE_DUMP_H) $(GGC_H) $(EXPR_H) \ diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 674b2462a49..7a9741b0cdd 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -1,5 +1,6 @@ /* Compiler arithmetic - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010 Free Software Foundation, Inc. Contributed by Andy Vaught @@ -30,6 +31,7 @@ along with GCC; see the file COPYING3. If not see #include "gfortran.h" #include "arith.h" #include "target-memory.h" +#include "constructor.h" /* MPFR does not have a direct replacement for mpz_set_f() from GMP. It's easily implemented with a few calls though. */ @@ -399,47 +401,6 @@ gfc_check_real_range (mpfr_t p, int kind) } -/* Function to return a constant expression node of a given type and kind. */ - -gfc_expr * -gfc_constant_result (bt type, int kind, locus *where) -{ - gfc_expr *result; - - if (!where) - gfc_internal_error ("gfc_constant_result(): locus 'where' cannot be NULL"); - - result = gfc_get_expr (); - - result->expr_type = EXPR_CONSTANT; - result->ts.type = type; - result->ts.kind = kind; - result->where = *where; - - switch (type) - { - case BT_INTEGER: - mpz_init (result->value.integer); - break; - - case BT_REAL: - gfc_set_model_kind (kind); - mpfr_init (result->value.real); - break; - - case BT_COMPLEX: - gfc_set_model_kind (kind); - mpc_init2 (result->value.complex, mpfr_get_default_prec()); - break; - - default: - break; - } - - return result; -} - - /* Low-level arithmetic functions. All of these subroutines assume that all operands are of the same type and return an operand of the same type. The other thing about these subroutines is that they @@ -451,7 +412,7 @@ gfc_arith_not (gfc_expr *op1, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, op1->ts.kind, &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, op1->ts.kind, &op1->where); result->value.logical = !op1->value.logical; *resultp = result; @@ -464,8 +425,8 @@ gfc_arith_and (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_kind_max (op1, op2), - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_kind_max (op1, op2), + &op1->where); result->value.logical = op1->value.logical && op2->value.logical; *resultp = result; @@ -478,8 +439,8 @@ gfc_arith_or (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_kind_max (op1, op2), - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_kind_max (op1, op2), + &op1->where); result->value.logical = op1->value.logical || op2->value.logical; *resultp = result; @@ -492,8 +453,8 @@ gfc_arith_eqv (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_kind_max (op1, op2), - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_kind_max (op1, op2), + &op1->where); result->value.logical = op1->value.logical == op2->value.logical; *resultp = result; @@ -506,8 +467,8 @@ gfc_arith_neqv (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_kind_max (op1, op2), - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_kind_max (op1, op2), + &op1->where); result->value.logical = op1->value.logical != op2->value.logical; *resultp = result; @@ -621,7 +582,7 @@ gfc_arith_uminus (gfc_expr *op1, gfc_expr **resultp) gfc_expr *result; arith rc; - result = gfc_constant_result (op1->ts.type, op1->ts.kind, &op1->where); + result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where); switch (op1->ts.type) { @@ -653,7 +614,7 @@ gfc_arith_plus (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) gfc_expr *result; arith rc; - result = gfc_constant_result (op1->ts.type, op1->ts.kind, &op1->where); + result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where); switch (op1->ts.type) { @@ -687,7 +648,7 @@ gfc_arith_minus (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) gfc_expr *result; arith rc; - result = gfc_constant_result (op1->ts.type, op1->ts.kind, &op1->where); + result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where); switch (op1->ts.type) { @@ -721,7 +682,7 @@ gfc_arith_times (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) gfc_expr *result; arith rc; - result = gfc_constant_result (op1->ts.type, op1->ts.kind, &op1->where); + result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where); switch (op1->ts.type) { @@ -758,7 +719,7 @@ gfc_arith_divide (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) rc = ARITH_OK; - result = gfc_constant_result (op1->ts.type, op1->ts.kind, &op1->where); + result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where); switch (op1->ts.type) { @@ -826,7 +787,7 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) extern bool init_flag; rc = ARITH_OK; - result = gfc_constant_result (op1->ts.type, op1->ts.kind, &op1->where); + result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where); switch (op2->ts.type) { @@ -992,8 +953,8 @@ gfc_arith_concat (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) int len; gcc_assert (op1->ts.kind == op2->ts.kind); - result = gfc_constant_result (BT_CHARACTER, op1->ts.kind, - &op1->where); + result = gfc_get_constant_expr (BT_CHARACTER, op1->ts.kind, + &op1->where); len = op1->value.character.length + op2->value.character.length; @@ -1162,8 +1123,8 @@ gfc_arith_eq (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind, + &op1->where); result->value.logical = (op1->ts.type == BT_COMPLEX) ? compare_complex (op1, op2) : (gfc_compare_expr (op1, op2, INTRINSIC_EQ) == 0); @@ -1178,8 +1139,8 @@ gfc_arith_ne (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind, + &op1->where); result->value.logical = (op1->ts.type == BT_COMPLEX) ? !compare_complex (op1, op2) : (gfc_compare_expr (op1, op2, INTRINSIC_EQ) != 0); @@ -1194,8 +1155,8 @@ gfc_arith_gt (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind, + &op1->where); result->value.logical = (gfc_compare_expr (op1, op2, INTRINSIC_GT) > 0); *resultp = result; @@ -1208,8 +1169,8 @@ gfc_arith_ge (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind, + &op1->where); result->value.logical = (gfc_compare_expr (op1, op2, INTRINSIC_GE) >= 0); *resultp = result; @@ -1222,8 +1183,8 @@ gfc_arith_lt (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind, + &op1->where); result->value.logical = (gfc_compare_expr (op1, op2, INTRINSIC_LT) < 0); *resultp = result; @@ -1236,8 +1197,8 @@ gfc_arith_le (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &op1->where); + result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind, + &op1->where); result->value.logical = (gfc_compare_expr (op1, op2, INTRINSIC_LE) <= 0); *resultp = result; @@ -1249,7 +1210,8 @@ static arith reduce_unary (arith (*eval) (gfc_expr *, gfc_expr **), gfc_expr *op, gfc_expr **result) { - gfc_constructor *c, *head; + gfc_constructor_base head; + gfc_constructor *c; gfc_expr *r; arith rc; @@ -1257,9 +1219,8 @@ reduce_unary (arith (*eval) (gfc_expr *, gfc_expr **), gfc_expr *op, return eval (op, result); rc = ARITH_OK; - head = gfc_copy_constructor (op->value.constructor); - - for (c = head; c; c = c->next) + head = gfc_constructor_copy (op->value.constructor); + for (c = gfc_constructor_first (head); c; c = gfc_constructor_next (c)) { rc = reduce_unary (eval, c->expr, &r); @@ -1270,18 +1231,15 @@ reduce_unary (arith (*eval) (gfc_expr *, gfc_expr **), gfc_expr *op, } if (rc != ARITH_OK) - gfc_free_constructor (head); + gfc_constructor_free (head); else { - r = gfc_get_expr (); - r->expr_type = EXPR_ARRAY; - r->value.constructor = head; + gfc_constructor *c = gfc_constructor_first (head); + r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind, + &op->where); r->shape = gfc_copy_shape (op->shape, op->rank); - - r->ts = head->expr->ts; - r->where = op->where; r->rank = op->rank; - + r->value.constructor = head; *result = r; } @@ -1293,14 +1251,13 @@ static arith reduce_binary_ac (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), gfc_expr *op1, gfc_expr *op2, gfc_expr **result) { - gfc_constructor *c, *head; + gfc_constructor_base head; + gfc_constructor *c; gfc_expr *r; - arith rc; + arith rc = ARITH_OK; - head = gfc_copy_constructor (op1->value.constructor); - rc = ARITH_OK; - - for (c = head; c; c = c->next) + head = gfc_constructor_copy (op1->value.constructor); + for (c = gfc_constructor_first (head); c; c = gfc_constructor_next (c)) { if (c->expr->expr_type == EXPR_CONSTANT) rc = eval (c->expr, op2, &r); @@ -1314,18 +1271,15 @@ reduce_binary_ac (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), } if (rc != ARITH_OK) - gfc_free_constructor (head); + gfc_constructor_free (head); else { - r = gfc_get_expr (); - r->expr_type = EXPR_ARRAY; - r->value.constructor = head; + gfc_constructor *c = gfc_constructor_first (head); + r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind, + &op1->where); r->shape = gfc_copy_shape (op1->shape, op1->rank); - - r->ts = head->expr->ts; - r->where = op1->where; r->rank = op1->rank; - + r->value.constructor = head; *result = r; } @@ -1337,14 +1291,13 @@ static arith reduce_binary_ca (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), gfc_expr *op1, gfc_expr *op2, gfc_expr **result) { - gfc_constructor *c, *head; + gfc_constructor_base head; + gfc_constructor *c; gfc_expr *r; - arith rc; + arith rc = ARITH_OK; - head = gfc_copy_constructor (op2->value.constructor); - rc = ARITH_OK; - - for (c = head; c; c = c->next) + head = gfc_constructor_copy (op2->value.constructor); + for (c = gfc_constructor_first (head); c; c = gfc_constructor_next (c)) { if (c->expr->expr_type == EXPR_CONSTANT) rc = eval (op1, c->expr, &r); @@ -1358,18 +1311,15 @@ reduce_binary_ca (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), } if (rc != ARITH_OK) - gfc_free_constructor (head); + gfc_constructor_free (head); else { - r = gfc_get_expr (); - r->expr_type = EXPR_ARRAY; - r->value.constructor = head; + gfc_constructor *c = gfc_constructor_first (head); + r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind, + &op2->where); r->shape = gfc_copy_shape (op2->shape, op2->rank); - - r->ts = head->expr->ts; - r->where = op2->where; r->rank = op2->rank; - + r->value.constructor = head; *result = r; } @@ -1386,52 +1336,41 @@ static arith reduce_binary_aa (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), gfc_expr *op1, gfc_expr *op2, gfc_expr **result) { - gfc_constructor *c, *d, *head; + gfc_constructor_base head; + gfc_constructor *c, *d; gfc_expr *r; - arith rc; + arith rc = ARITH_OK; - head = gfc_copy_constructor (op1->value.constructor); + if (gfc_check_conformance (op1, op2, + "elemental binary operation") != SUCCESS) + return ARITH_INCOMMENSURATE; - rc = ARITH_OK; - d = op2->value.constructor; - - if (gfc_check_conformance (op1, op2, "elemental binary operation") - != SUCCESS) - rc = ARITH_INCOMMENSURATE; - else + head = gfc_constructor_copy (op1->value.constructor); + for (c = gfc_constructor_first (head), + d = gfc_constructor_first (op2->value.constructor); + c && d; + c = gfc_constructor_next (c), d = gfc_constructor_next (d)) { - for (c = head; c; c = c->next, d = d->next) - { - if (d == NULL) - { - rc = ARITH_INCOMMENSURATE; - break; - } - - rc = reduce_binary (eval, c->expr, d->expr, &r); - if (rc != ARITH_OK) - break; - - gfc_replace_expr (c->expr, r); - } + rc = reduce_binary (eval, c->expr, d->expr, &r); + if (rc != ARITH_OK) + break; - if (d != NULL) - rc = ARITH_INCOMMENSURATE; + gfc_replace_expr (c->expr, r); } + if (c || d) + rc = ARITH_INCOMMENSURATE; + if (rc != ARITH_OK) - gfc_free_constructor (head); + gfc_constructor_free (head); else { - r = gfc_get_expr (); - r->expr_type = EXPR_ARRAY; - r->value.constructor = head; + gfc_constructor *c = gfc_constructor_first (head); + r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind, + &op1->where); r->shape = gfc_copy_shape (op1->shape, op1->rank); - - r->ts = head->expr->ts; - r->where = op1->where; r->rank = op1->rank; - + r->value.constructor = head; *result = r; } @@ -1644,17 +1583,9 @@ eval_intrinsic (gfc_intrinsic_op op, runtime: /* Create a run-time expression. */ - result = gfc_get_expr (); + result = gfc_get_operator_expr (&op1->where, op, op1, op2); result->ts = temp.ts; - result->expr_type = EXPR_OP; - result->value.op.op = op; - - result->value.op.op1 = op1; - result->value.op.op2 = op2; - - result->where = op1->where; - return result; } @@ -1921,7 +1852,7 @@ gfc_convert_integer (const char *buffer, int kind, int radix, locus *where) gfc_expr *e; const char *t; - e = gfc_constant_result (BT_INTEGER, kind, where); + e = gfc_get_constant_expr (BT_INTEGER, kind, where); /* A leading plus is allowed, but not by mpz_set_str. */ if (buffer[0] == '+') t = buffer + 1; @@ -1940,7 +1871,7 @@ gfc_convert_real (const char *buffer, int kind, locus *where) { gfc_expr *e; - e = gfc_constant_result (BT_REAL, kind, where); + e = gfc_get_constant_expr (BT_REAL, kind, where); mpfr_set_str (e->value.real, buffer, 10, GFC_RND_MODE); return e; @@ -1955,7 +1886,7 @@ gfc_convert_complex (gfc_expr *real, gfc_expr *imag, int kind) { gfc_expr *e; - e = gfc_constant_result (BT_COMPLEX, kind, &real->where); + e = gfc_get_constant_expr (BT_COMPLEX, kind, &real->where); mpc_set_fr_fr (e->value.complex, real->value.real, imag->value.real, GFC_MPC_RND_MODE); @@ -2022,7 +1953,7 @@ gfc_int2int (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_INTEGER, kind, &src->where); + result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where); mpz_set (result->value.integer, src->value.integer); @@ -2052,7 +1983,7 @@ gfc_int2real (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_REAL, kind, &src->where); + result = gfc_get_constant_expr (BT_REAL, kind, &src->where); mpfr_set_z (result->value.real, src->value.integer, GFC_RND_MODE); @@ -2075,7 +2006,7 @@ gfc_int2complex (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_COMPLEX, kind, &src->where); + result = gfc_get_constant_expr (BT_COMPLEX, kind, &src->where); mpc_set_z (result->value.complex, src->value.integer, GFC_MPC_RND_MODE); @@ -2099,7 +2030,7 @@ gfc_real2int (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_INTEGER, kind, &src->where); + result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where); gfc_mpfr_to_mpz (result->value.integer, src->value.real, &src->where); @@ -2122,7 +2053,7 @@ gfc_real2real (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_REAL, kind, &src->where); + result = gfc_get_constant_expr (BT_REAL, kind, &src->where); mpfr_set (result->value.real, src->value.real, GFC_RND_MODE); @@ -2153,7 +2084,7 @@ gfc_real2complex (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_COMPLEX, kind, &src->where); + result = gfc_get_constant_expr (BT_COMPLEX, kind, &src->where); mpc_set_fr (result->value.complex, src->value.real, GFC_MPC_RND_MODE); @@ -2184,7 +2115,7 @@ gfc_complex2int (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_INTEGER, kind, &src->where); + result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where); gfc_mpfr_to_mpz (result->value.integer, mpc_realref (src->value.complex), &src->where); @@ -2208,7 +2139,7 @@ gfc_complex2real (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_REAL, kind, &src->where); + result = gfc_get_constant_expr (BT_REAL, kind, &src->where); mpc_real (result->value.real, src->value.complex, GFC_RND_MODE); @@ -2239,7 +2170,7 @@ gfc_complex2complex (gfc_expr *src, int kind) gfc_expr *result; arith rc; - result = gfc_constant_result (BT_COMPLEX, kind, &src->where); + result = gfc_get_constant_expr (BT_COMPLEX, kind, &src->where); mpc_set (result->value.complex, src->value.complex, GFC_MPC_RND_MODE); @@ -2284,7 +2215,7 @@ gfc_log2log (gfc_expr *src, int kind) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, kind, &src->where); + result = gfc_get_constant_expr (BT_LOGICAL, kind, &src->where); result->value.logical = src->value.logical; return result; @@ -2298,7 +2229,7 @@ gfc_log2int (gfc_expr *src, int kind) { gfc_expr *result; - result = gfc_constant_result (BT_INTEGER, kind, &src->where); + result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where); mpz_set_si (result->value.integer, src->value.logical); return result; @@ -2312,7 +2243,7 @@ gfc_int2log (gfc_expr *src, int kind) { gfc_expr *result; - result = gfc_constant_result (BT_LOGICAL, kind, &src->where); + result = gfc_get_constant_expr (BT_LOGICAL, kind, &src->where); result->value.logical = (mpz_cmp_si (src->value.integer, 0) != 0); return result; @@ -2355,12 +2286,7 @@ gfc_expr * gfc_hollerith2int (gfc_expr *src, int kind) { gfc_expr *result; - - result = gfc_get_expr (); - result->expr_type = EXPR_CONSTANT; - result->ts.type = BT_INTEGER; - result->ts.kind = kind; - result->where = src->where; + result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where); hollerith2representation (result, src); gfc_interpret_integer (kind, (unsigned char *) result->representation.string, @@ -2376,12 +2302,7 @@ gfc_expr * gfc_hollerith2real (gfc_expr *src, int kind) { gfc_expr *result; - - result = gfc_get_expr (); - result->expr_type = EXPR_CONSTANT; - result->ts.type = BT_REAL; - result->ts.kind = kind; - result->where = src->where; + result = gfc_get_constant_expr (BT_REAL, kind, &src->where); hollerith2representation (result, src); gfc_interpret_float (kind, (unsigned char *) result->representation.string, @@ -2397,12 +2318,7 @@ gfc_expr * gfc_hollerith2complex (gfc_expr *src, int kind) { gfc_expr *result; - - result = gfc_get_expr (); - result->expr_type = EXPR_CONSTANT; - result->ts.type = BT_COMPLEX; - result->ts.kind = kind; - result->where = src->where; + result = gfc_get_constant_expr (BT_COMPLEX, kind, &src->where); hollerith2representation (result, src); gfc_interpret_complex (kind, (unsigned char *) result->representation.string, @@ -2437,12 +2353,7 @@ gfc_expr * gfc_hollerith2logical (gfc_expr *src, int kind) { gfc_expr *result; - - result = gfc_get_expr (); - result->expr_type = EXPR_CONSTANT; - result->ts.type = BT_LOGICAL; - result->ts.kind = kind; - result->where = src->where; + result = gfc_get_constant_expr (BT_LOGICAL, kind, &src->where); hollerith2representation (result, src); gfc_interpret_logical (kind, (unsigned char *) result->representation.string, diff --git a/gcc/fortran/arith.h b/gcc/fortran/arith.h index 344bc78d481..7066bb07949 100644 --- a/gcc/fortran/arith.h +++ b/gcc/fortran/arith.h @@ -31,9 +31,6 @@ void gfc_mpfr_to_mpz (mpz_t, mpfr_t, locus *); void gfc_set_model_kind (int); void gfc_set_model (mpfr_t); -/* Return a constant result of a given type and kind, with locus. */ -gfc_expr *gfc_constant_result (bt, int, locus *); - /* Make sure a gfc_expr expression is within its allowed range. Checks for overflow and underflow. */ arith gfc_range_check (gfc_expr *); diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 5ceca4bfa85..5487be7aa4f 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "gfortran.h" #include "match.h" +#include "constructor.h" /**************** Array reference matching subroutines *****************/ @@ -209,7 +210,7 @@ coarray: if (gfc_option.coarray == GFC_FCOARRAY_NONE) { - gfc_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); return MATCH_ERROR; } @@ -365,7 +366,7 @@ match_array_element_spec (gfc_array_spec *as) if (gfc_match_char ('*') == MATCH_YES) { - *lower = gfc_int_expr (1); + *lower = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); return AS_ASSUMED_SIZE; } @@ -382,7 +383,7 @@ match_array_element_spec (gfc_array_spec *as) if (gfc_match_char (':') == MATCH_NO) { - *lower = gfc_int_expr (1); + *lower = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); return AS_EXPLICIT; } @@ -530,7 +531,7 @@ coarray: if (gfc_option.coarray == GFC_FCOARRAY_NONE) { - gfc_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); goto cleanup; } @@ -635,7 +636,7 @@ done: for (i = 0; i < as->rank + as->corank; i++) { if (as->lower[i] == NULL) - as->lower[i] = gfc_int_expr (1); + as->lower[i] = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); } } @@ -806,151 +807,6 @@ gfc_compare_array_spec (gfc_array_spec *as1, gfc_array_spec *as2) /****************** Array constructor functions ******************/ -/* Start an array constructor. The constructor starts with zero - elements and should be appended to by gfc_append_constructor(). */ - -gfc_expr * -gfc_start_constructor (bt type, int kind, locus *where) -{ - gfc_expr *result; - - result = gfc_get_expr (); - - result->expr_type = EXPR_ARRAY; - result->rank = 1; - - result->ts.type = type; - result->ts.kind = kind; - result->where = *where; - return result; -} - - -/* Given an array constructor expression, append the new expression - node onto the constructor. */ - -void -gfc_append_constructor (gfc_expr *base, gfc_expr *new_expr) -{ - gfc_constructor *c; - - if (base->value.constructor == NULL) - base->value.constructor = c = gfc_get_constructor (); - else - { - c = base->value.constructor; - while (c->next) - c = c->next; - - c->next = gfc_get_constructor (); - c = c->next; - } - - c->expr = new_expr; - - if (new_expr - && (new_expr->ts.type != base->ts.type || new_expr->ts.kind != base->ts.kind)) - gfc_internal_error ("gfc_append_constructor(): New node has wrong kind"); -} - - -/* Given an array constructor expression, insert the new expression's - constructor onto the base's one according to the offset. */ - -void -gfc_insert_constructor (gfc_expr *base, gfc_constructor *c1) -{ - gfc_constructor *c, *pre; - expr_t type; - int t; - - type = base->expr_type; - - if (base->value.constructor == NULL) - base->value.constructor = c1; - else - { - c = pre = base->value.constructor; - while (c) - { - if (type == EXPR_ARRAY) - { - t = mpz_cmp (c->n.offset, c1->n.offset); - if (t < 0) - { - pre = c; - c = c->next; - } - else if (t == 0) - { - gfc_error ("duplicated initializer"); - break; - } - else - break; - } - else - { - pre = c; - c = c->next; - } - } - - if (pre != c) - { - pre->next = c1; - c1->next = c; - } - else - { - c1->next = c; - base->value.constructor = c1; - } - } -} - - -/* Get a new constructor. */ - -gfc_constructor * -gfc_get_constructor (void) -{ - gfc_constructor *c; - - c = XCNEW (gfc_constructor); - c->expr = NULL; - c->iterator = NULL; - c->next = NULL; - mpz_init_set_si (c->n.offset, 0); - mpz_init_set_si (c->repeat, 0); - return c; -} - - -/* Free chains of gfc_constructor structures. */ - -void -gfc_free_constructor (gfc_constructor *p) -{ - gfc_constructor *next; - - if (p == NULL) - return; - - for (; p; p = next) - { - next = p->next; - - if (p->expr) - gfc_free_expr (p->expr); - if (p->iterator != NULL) - gfc_free_iterator (p->iterator, 1); - mpz_clear (p->n.offset); - mpz_clear (p->repeat); - gfc_free (p); - } -} - /* Given an expression node that might be an array constructor and a symbol, make sure that no iterators in this or child constructors @@ -958,11 +814,12 @@ gfc_free_constructor (gfc_constructor *p) duplicate was found. */ static int -check_duplicate_iterator (gfc_constructor *c, gfc_symbol *master) +check_duplicate_iterator (gfc_constructor_base base, gfc_symbol *master) { + gfc_constructor *c; gfc_expr *e; - for (; c; c = c->next) + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) { e = c->expr; @@ -987,14 +844,15 @@ check_duplicate_iterator (gfc_constructor *c, gfc_symbol *master) /* Forward declaration because these functions are mutually recursive. */ -static match match_array_cons_element (gfc_constructor **); +static match match_array_cons_element (gfc_constructor_base *); /* Match a list of array elements. */ static match -match_array_list (gfc_constructor **result) +match_array_list (gfc_constructor_base *result) { - gfc_constructor *p, *head, *tail, *new_cons; + gfc_constructor_base head; + gfc_constructor *p; gfc_iterator iter; locus old_loc; gfc_expr *e; @@ -1013,8 +871,6 @@ match_array_list (gfc_constructor **result) if (m != MATCH_YES) goto cleanup; - tail = head; - if (gfc_match_char (',') != MATCH_YES) { m = MATCH_NO; @@ -1029,7 +885,7 @@ match_array_list (gfc_constructor **result) if (m == MATCH_ERROR) goto cleanup; - m = match_array_cons_element (&new_cons); + m = match_array_cons_element (&head); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_NO) @@ -1040,9 +896,6 @@ match_array_list (gfc_constructor **result) goto cleanup; /* Could be a complex constant */ } - tail->next = new_cons; - tail = new_cons; - if (gfc_match_char (',') != MATCH_YES) { if (n > 2) @@ -1061,19 +914,13 @@ match_array_list (gfc_constructor **result) goto cleanup; } - e = gfc_get_expr (); - e->expr_type = EXPR_ARRAY; - e->where = old_loc; + e = gfc_get_array_expr (BT_UNKNOWN, 0, &old_loc); e->value.constructor = head; - p = gfc_get_constructor (); - p->where = gfc_current_locus; + p = gfc_constructor_append_expr (result, e, &gfc_current_locus); p->iterator = gfc_get_iterator (); *p->iterator = iter; - p->expr = e; - *result = p; - return MATCH_YES; syntax: @@ -1081,7 +928,7 @@ syntax: m = MATCH_ERROR; cleanup: - gfc_free_constructor (head); + gfc_constructor_free (head); gfc_free_iterator (&iter, 0); gfc_current_locus = old_loc; return m; @@ -1092,9 +939,8 @@ cleanup: single expression or a list of elements. */ static match -match_array_cons_element (gfc_constructor **result) +match_array_cons_element (gfc_constructor_base *result) { - gfc_constructor *p; gfc_expr *expr; match m; @@ -1106,11 +952,7 @@ match_array_cons_element (gfc_constructor **result) if (m != MATCH_YES) return m; - p = gfc_get_constructor (); - p->where = gfc_current_locus; - p->expr = expr; - - *result = p; + gfc_constructor_append_expr (result, expr, &gfc_current_locus); return MATCH_YES; } @@ -1120,7 +962,7 @@ match_array_cons_element (gfc_constructor **result) match gfc_match_array_constructor (gfc_expr **result) { - gfc_constructor *head, *tail, *new_cons; + gfc_constructor_base head, new_cons; gfc_expr *expr; gfc_typespec ts; locus where; @@ -1144,7 +986,7 @@ gfc_match_array_constructor (gfc_expr **result) end_delim = " /)"; where = gfc_current_locus; - head = tail = NULL; + head = new_cons = NULL; seen_ts = false; /* Try to match an optional "type-spec ::" */ @@ -1176,19 +1018,12 @@ gfc_match_array_constructor (gfc_expr **result) for (;;) { - m = match_array_cons_element (&new_cons); + m = match_array_cons_element (&head); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_NO) goto syntax; - if (head == NULL) - head = new_cons; - else - tail->next = new_cons; - - tail = new_cons; - if (gfc_match_char (',') == MATCH_NO) break; } @@ -1197,24 +1032,19 @@ gfc_match_array_constructor (gfc_expr **result) goto syntax; done: - expr = gfc_get_expr (); - - expr->expr_type = EXPR_ARRAY; - - expr->value.constructor = head; /* Size must be calculated at resolution time. */ - if (seen_ts) - expr->ts = ts; + { + expr = gfc_get_array_expr (ts.type, ts.kind, &where); + expr->ts = ts; + } else - expr->ts.type = BT_UNKNOWN; - + expr = gfc_get_array_expr (BT_UNKNOWN, 0, &where); + + expr->value.constructor = head; if (expr->ts.u.cl) expr->ts.u.cl->length_from_typespec = seen_ts; - expr->where = where; - expr->rank = 1; - *result = expr; return MATCH_YES; @@ -1222,7 +1052,7 @@ syntax: gfc_error ("Syntax error in array constructor at %C"); cleanup: - gfc_free_constructor (head); + gfc_constructor_free (head); return MATCH_ERROR; } @@ -1278,11 +1108,12 @@ check_element_type (gfc_expr *expr, bool convert) /* Recursive work function for gfc_check_constructor_type(). */ static gfc_try -check_constructor_type (gfc_constructor *c, bool convert) +check_constructor_type (gfc_constructor_base base, bool convert) { + gfc_constructor *c; gfc_expr *e; - for (; c; c = c->next) + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) { e = c->expr; @@ -1341,7 +1172,7 @@ cons_stack; static cons_stack *base; -static gfc_try check_constructor (gfc_constructor *, gfc_try (*) (gfc_expr *)); +static gfc_try check_constructor (gfc_constructor_base, gfc_try (*) (gfc_expr *)); /* Check an EXPR_VARIABLE expression in a constructor to make sure that that variable is an iteration variables. */ @@ -1367,13 +1198,14 @@ gfc_check_iter_variable (gfc_expr *expr) constructor, giving variables with the names of iterators a pass. */ static gfc_try -check_constructor (gfc_constructor *c, gfc_try (*check_function) (gfc_expr *)) +check_constructor (gfc_constructor_base ctor, gfc_try (*check_function) (gfc_expr *)) { cons_stack element; gfc_expr *e; gfc_try t; + gfc_constructor *c; - for (; c; c = c->next) + for (c = gfc_constructor_first (ctor); c; c = gfc_constructor_next (c)) { e = c->expr; @@ -1427,7 +1259,7 @@ iterator_stack *iter_stack; typedef struct { - gfc_constructor *new_head, *new_tail; + gfc_constructor_base base; int extract_count, extract_n; gfc_expr *extracted; mpz_t *count; @@ -1442,7 +1274,7 @@ expand_info; static expand_info current_expand; -static gfc_try expand_constructor (gfc_constructor *); +static gfc_try expand_constructor (gfc_constructor_base); /* Work function that counts the number of elements present in a @@ -1501,21 +1333,10 @@ extract_element (gfc_expr *e) static gfc_try expand (gfc_expr *e) { - if (current_expand.new_head == NULL) - current_expand.new_head = current_expand.new_tail = - gfc_get_constructor (); - else - { - current_expand.new_tail->next = gfc_get_constructor (); - current_expand.new_tail = current_expand.new_tail->next; - } + gfc_constructor *c = gfc_constructor_append_expr (¤t_expand.base, + e, &e->where); - current_expand.new_tail->where = e->where; - current_expand.new_tail->expr = e; - - mpz_set (current_expand.new_tail->n.offset, *current_expand.offset); - current_expand.new_tail->n.component = current_expand.component; - mpz_set (current_expand.new_tail->repeat, *current_expand.repeat); + c->n.component = current_expand.component; return SUCCESS; } @@ -1535,7 +1356,7 @@ gfc_simplify_iterator_var (gfc_expr *e) if (p == NULL) return; /* Variable not found */ - gfc_replace_expr (e, gfc_int_expr (0)); + gfc_replace_expr (e, gfc_get_int_expr (gfc_default_integer_kind, NULL, 0)); mpz_set (e->value.integer, p->value); @@ -1649,11 +1470,12 @@ cleanup: passed expression. */ static gfc_try -expand_constructor (gfc_constructor *c) +expand_constructor (gfc_constructor_base base) { + gfc_constructor *c; gfc_expr *e; - for (; c; c = c->next) + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next(c)) { if (c->iterator != NULL) { @@ -1678,9 +1500,9 @@ expand_constructor (gfc_constructor *c) gfc_free_expr (e); return FAILURE; } - current_expand.offset = &c->n.offset; - current_expand.component = c->n.component; + current_expand.offset = &c->offset; current_expand.repeat = &c->repeat; + current_expand.component = c->n.component; if (current_expand.expand_work_function (e) == FAILURE) return FAILURE; } @@ -1688,6 +1510,39 @@ expand_constructor (gfc_constructor *c) } +/* Given an array expression and an element number (starting at zero), + return a pointer to the array element. NULL is returned if the + size of the array has been exceeded. The expression node returned + remains a part of the array and should not be freed. Access is not + efficient at all, but this is another place where things do not + have to be particularly fast. */ + +static gfc_expr * +gfc_get_array_element (gfc_expr *array, int element) +{ + expand_info expand_save; + gfc_expr *e; + gfc_try rc; + + expand_save = current_expand; + current_expand.extract_n = element; + current_expand.expand_work_function = extract_element; + current_expand.extracted = NULL; + current_expand.extract_count = 0; + + iter_stack = NULL; + + rc = expand_constructor (array->value.constructor); + e = current_expand.extracted; + current_expand = expand_save; + + if (rc == FAILURE) + return NULL; + + return e; +} + + /* Top level subroutine for expanding constructors. We only expand constructor if they are small enough. */ @@ -1698,6 +1553,8 @@ gfc_expand_constructor (gfc_expr *e) gfc_expr *f; gfc_try rc; + /* If we can successfully get an array element at the max array size then + the array is too big to expand, so we just return. */ f = gfc_get_array_element (e, gfc_option.flag_max_array_constructor); if (f != NULL) { @@ -1705,8 +1562,9 @@ gfc_expand_constructor (gfc_expr *e) return SUCCESS; } + /* We now know the array is not too big so go ahead and try to expand it. */ expand_save = current_expand; - current_expand.new_head = current_expand.new_tail = NULL; + current_expand.base = NULL; iter_stack = NULL; @@ -1714,13 +1572,13 @@ gfc_expand_constructor (gfc_expr *e) if (expand_constructor (e->value.constructor) == FAILURE) { - gfc_free_constructor (current_expand.new_head); + gfc_constructor_free (current_expand.base); rc = FAILURE; goto done; } - gfc_free_constructor (e->value.constructor); - e->value.constructor = current_expand.new_head; + gfc_constructor_free (e->value.constructor); + e->value.constructor = current_expand.base; rc = SUCCESS; @@ -1758,37 +1616,14 @@ gfc_constant_ac (gfc_expr *e) { expand_info expand_save; gfc_try rc; - gfc_constructor * con; - - rc = SUCCESS; - if (e->value.constructor - && e->value.constructor->expr->expr_type == EXPR_ARRAY) - { - /* Expand the constructor. */ - iter_stack = NULL; - expand_save = current_expand; - current_expand.expand_work_function = is_constant_element; + iter_stack = NULL; + expand_save = current_expand; + current_expand.expand_work_function = is_constant_element; - rc = expand_constructor (e->value.constructor); - - current_expand = expand_save; - } - else - { - /* No need to expand this further. */ - for (con = e->value.constructor; con; con = con->next) - { - if (con->expr->expr_type == EXPR_CONSTANT) - continue; - else - { - if (!gfc_is_constant_expr (con->expr)) - rc = FAILURE; - } - } - } + rc = expand_constructor (e->value.constructor); + current_expand = expand_save; if (rc == FAILURE) return 0; @@ -1802,11 +1637,12 @@ gfc_constant_ac (gfc_expr *e) int gfc_expanded_ac (gfc_expr *e) { - gfc_constructor *p; + gfc_constructor *c; if (e->expr_type == EXPR_ARRAY) - for (p = e->value.constructor; p; p = p->next) - if (p->iterator != NULL || !gfc_expanded_ac (p->expr)) + for (c = gfc_constructor_first (e->value.constructor); + c; c = gfc_constructor_next (c)) + if (c->iterator != NULL || !gfc_expanded_ac (c->expr)) return 0; return 1; @@ -1819,19 +1655,20 @@ gfc_expanded_ac (gfc_expr *e) be of the same type. */ static gfc_try -resolve_array_list (gfc_constructor *p) +resolve_array_list (gfc_constructor_base base) { gfc_try t; + gfc_constructor *c; t = SUCCESS; - for (; p; p = p->next) + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) { - if (p->iterator != NULL - && gfc_resolve_iterator (p->iterator, false) == FAILURE) + if (c->iterator != NULL + && gfc_resolve_iterator (c->iterator, false) == FAILURE) t = FAILURE; - if (gfc_resolve_expr (p->expr) == FAILURE) + if (gfc_resolve_expr (c->expr) == FAILURE) t = FAILURE; } @@ -1854,7 +1691,8 @@ gfc_resolve_character_array_constructor (gfc_expr *expr) if (expr->ts.u.cl == NULL) { - for (p = expr->value.constructor; p; p = p->next) + for (p = gfc_constructor_first (expr->value.constructor); + p; p = gfc_constructor_next (p)) if (p->expr->ts.u.cl != NULL) { /* Ensure that if there is a char_len around that it is @@ -1875,7 +1713,8 @@ got_charlen: /* Check that all constant string elements have the same length until we reach the end or find a variable-length one. */ - for (p = expr->value.constructor; p; p = p->next) + for (p = gfc_constructor_first (expr->value.constructor); + p; p = gfc_constructor_next (p)) { int current_length = -1; gfc_ref *ref; @@ -1922,7 +1761,8 @@ got_charlen: gcc_assert (found_length != -1); /* Update the character length of the array constructor. */ - expr->ts.u.cl->length = gfc_int_expr (found_length); + expr->ts.u.cl->length = gfc_get_int_expr (gfc_default_integer_kind, + NULL, found_length); } else { @@ -1940,7 +1780,8 @@ got_charlen: (without typespec) all elements are verified to have the same length anyway. */ if (found_length != -1) - for (p = expr->value.constructor; p; p = p->next) + for (p = gfc_constructor_first (expr->value.constructor); + p; p = gfc_constructor_next (p)) if (p->expr->expr_type == EXPR_CONSTANT) { gfc_expr *cl = NULL; @@ -1990,8 +1831,8 @@ gfc_resolve_array_constructor (gfc_expr *expr) /* Copy an iterator structure. */ -static gfc_iterator * -copy_iterator (gfc_iterator *src) +gfc_iterator * +gfc_copy_iterator (gfc_iterator *src) { gfc_iterator *dest; @@ -2009,73 +1850,6 @@ copy_iterator (gfc_iterator *src) } -/* Copy a constructor structure. */ - -gfc_constructor * -gfc_copy_constructor (gfc_constructor *src) -{ - gfc_constructor *dest; - gfc_constructor *tail; - - if (src == NULL) - return NULL; - - dest = tail = NULL; - while (src) - { - if (dest == NULL) - dest = tail = gfc_get_constructor (); - else - { - tail->next = gfc_get_constructor (); - tail = tail->next; - } - tail->where = src->where; - tail->expr = gfc_copy_expr (src->expr); - tail->iterator = copy_iterator (src->iterator); - mpz_set (tail->n.offset, src->n.offset); - tail->n.component = src->n.component; - mpz_set (tail->repeat, src->repeat); - src = src->next; - } - - return dest; -} - - -/* Given an array expression and an element number (starting at zero), - return a pointer to the array element. NULL is returned if the - size of the array has been exceeded. The expression node returned - remains a part of the array and should not be freed. Access is not - efficient at all, but this is another place where things do not - have to be particularly fast. */ - -gfc_expr * -gfc_get_array_element (gfc_expr *array, int element) -{ - expand_info expand_save; - gfc_expr *e; - gfc_try rc; - - expand_save = current_expand; - current_expand.extract_n = element; - current_expand.expand_work_function = extract_element; - current_expand.extracted = NULL; - current_expand.extract_count = 0; - - iter_stack = NULL; - - rc = expand_constructor (array->value.constructor); - e = current_expand.extracted; - current_expand = expand_save; - - if (rc == FAILURE) - return NULL; - - return e; -} - - /********* Subroutines for determining the size of an array *********/ /* These are needed just to accommodate RESHAPE(). There are no @@ -2449,7 +2223,8 @@ gfc_find_array_ref (gfc_expr *e) for (ref = e->ref; ref; ref = ref->next) if (ref->type == REF_ARRAY - && (ref->u.ar.type == AR_FULL || ref->u.ar.type == AR_SECTION)) + && (ref->u.ar.type == AR_FULL || ref->u.ar.type == AR_SECTION + || (ref->u.ar.type == AR_ELEMENT && ref->u.ar.dimen == 0))) break; if (ref == NULL) diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 9b6f8ea0a4f..799b8c9feea 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -1,5 +1,5 @@ /* Check functions - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Andy Vaught & Katherine Holcomb @@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see #include "flags.h" #include "gfortran.h" #include "intrinsic.h" +#include "constructor.h" /* Make sure an expression is a scalar. */ @@ -182,6 +183,32 @@ double_check (gfc_expr *d, int n) } +/* Check whether an expression is a coarray (without array designator). */ + +static bool +is_coarray (gfc_expr *e) +{ + bool coarray = false; + gfc_ref *ref; + + if (e->expr_type != EXPR_VARIABLE) + return false; + + coarray = e->symtree->n.sym->attr.codimension; + + for (ref = e->ref; ref; ref = ref->next) + { + if (ref->type == REF_COMPONENT) + coarray = ref->u.c.component->attr.codimension; + else if (ref->type != REF_ARRAY || ref->u.ar.dimen != 0 + || ref->u.ar.codimen != 0) + coarray = false; + } + + return coarray; +} + + /* Make sure the expression is a logical array. */ static gfc_try @@ -328,6 +355,36 @@ dim_check (gfc_expr *dim, int n, bool optional) } +/* If a coarray DIM parameter is a constant, make sure that it is greater than + zero and less than or equal to the corank of the given array. */ + +static gfc_try +dim_corank_check (gfc_expr *dim, gfc_expr *array) +{ + gfc_array_ref *ar; + int corank; + + gcc_assert (array->expr_type == EXPR_VARIABLE); + + if (dim->expr_type != EXPR_CONSTANT) + return SUCCESS; + + ar = gfc_find_array_ref (array); + corank = ar->as->corank; + + if (mpz_cmp_ui (dim->value.integer, 1) < 0 + || mpz_cmp_ui (dim->value.integer, corank) > 0) + { + gfc_error ("'dim' argument of '%s' intrinsic at %L is not a valid " + "codimension index", gfc_current_intrinsic, &dim->where); + + return FAILURE; + } + + return SUCCESS; +} + + /* If a DIM parameter is a constant, make sure that it is greater than zero and less than or equal to the rank of the given array. If allow_assumed is zero then dim must be less than the rank of the array @@ -1640,6 +1697,38 @@ gfc_check_lbound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) gfc_try +gfc_check_lcobound (gfc_expr *coarray, gfc_expr *dim, gfc_expr *kind) +{ + if (gfc_option.coarray == GFC_FCOARRAY_NONE) + { + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + return FAILURE; + } + + if (!is_coarray (coarray)) + { + gfc_error ("Expected coarray variable as '%s' argument to the LCOBOUND " + "intrinsic at %L", gfc_current_intrinsic_arg[0], &coarray->where); + return FAILURE; + } + + if (dim != NULL) + { + if (dim_check (dim, 1, false) == FAILURE) + return FAILURE; + + if (dim_corank_check (dim, coarray) == FAILURE) + return FAILURE; + } + + if (kind_check (kind, 2, BT_INTEGER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +gfc_try gfc_check_len_lentrim (gfc_expr *s, gfc_expr *kind) { if (type_check (s, 0, BT_CHARACTER) == FAILURE) @@ -2266,7 +2355,8 @@ gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector) if (mask->expr_type == EXPR_ARRAY) { - gfc_constructor *mask_ctor = mask->value.constructor; + gfc_constructor *mask_ctor; + mask_ctor = gfc_constructor_first (mask->value.constructor); while (mask_ctor) { if (mask_ctor->expr->expr_type != EXPR_CONSTANT) @@ -2278,7 +2368,7 @@ gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector) if (mask_ctor->expr->value.logical) mask_true_values++; - mask_ctor = mask_ctor->next; + mask_ctor = gfc_constructor_next (mask_ctor); } } else if (mask->expr_type == EXPR_CONSTANT && mask->value.logical) @@ -2508,12 +2598,9 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape, int i, extent; for (i = 0; i < shape_size; ++i) { - e = gfc_get_array_element (shape, i); + e = gfc_constructor_lookup_expr (shape->value.constructor, i); if (e->expr_type != EXPR_CONSTANT) - { - gfc_free_expr (e); - continue; - } + continue; gfc_extract_int (e, &extent); if (extent < 0) @@ -2523,8 +2610,6 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape, gfc_current_intrinsic, &e->where, extent); return FAILURE; } - - gfc_free_expr (e); } } @@ -2569,12 +2654,9 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape, for (i = 1; i <= order_size; ++i) { - e = gfc_get_array_element (order, i-1); + e = gfc_constructor_lookup_expr (order->value.constructor, i-1); if (e->expr_type != EXPR_CONSTANT) - { - gfc_free_expr (e); - continue; - } + continue; gfc_extract_int (e, &dim); @@ -2597,7 +2679,6 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape, } perm[dim-1] = 1; - gfc_free_expr (e); } } } @@ -2613,9 +2694,10 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape, gfc_constructor *c; bool test; - c = shape->value.constructor; + mpz_init_set_ui (size, 1); - for (; c; c = c->next) + for (c = gfc_constructor_first (shape->value.constructor); + c; c = gfc_constructor_next (c)) mpz_mul (size, size, c->expr->value.integer); test = mpz_cmp (nelems, size) < 0 && mpz_cmp_ui (size, 0) > 0; @@ -3144,6 +3226,72 @@ gfc_check_stat_sub (gfc_expr *name, gfc_expr *array, gfc_expr *status) gfc_try +gfc_check_image_index (gfc_expr *coarray, gfc_expr *sub) +{ + if (gfc_option.coarray == GFC_FCOARRAY_NONE) + { + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + return FAILURE; + } + + if (!is_coarray (coarray)) + { + gfc_error ("Expected coarray variable as '%s' argument to IMAGE_INDEX " + "intrinsic at %L", gfc_current_intrinsic_arg[0], &coarray->where); + return FAILURE; + } + + if (sub->rank != 1) + { + gfc_error ("%s argument to IMAGE_INDEX must be a rank one array at %L", + gfc_current_intrinsic_arg[1], &sub->where); + return FAILURE; + } + + return SUCCESS; +} + + +gfc_try +gfc_check_this_image (gfc_expr *coarray, gfc_expr *dim) +{ + if (gfc_option.coarray == GFC_FCOARRAY_NONE) + { + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + return FAILURE; + } + + if (dim != NULL && coarray == NULL) + { + gfc_error ("DIM argument without ARRAY argument not allowed for THIS_IMAGE " + "intrinsic at %L", &dim->where); + return FAILURE; + } + + if (coarray == NULL) + return SUCCESS; + + if (!is_coarray (coarray)) + { + gfc_error ("Expected coarray variable as '%s' argument to THIS_IMAGE " + "intrinsic at %L", gfc_current_intrinsic_arg[0], &coarray->where); + return FAILURE; + } + + if (dim != NULL) + { + if (dim_check (dim, 1, false) == FAILURE) + return FAILURE; + + if (dim_corank_check (dim, coarray) == FAILURE) + return FAILURE; + } + + return SUCCESS; +} + + +gfc_try gfc_check_transfer (gfc_expr *source ATTRIBUTE_UNUSED, gfc_expr *mold ATTRIBUTE_UNUSED, gfc_expr *size) { @@ -3204,6 +3352,38 @@ gfc_check_ubound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) gfc_try +gfc_check_ucobound (gfc_expr *coarray, gfc_expr *dim, gfc_expr *kind) +{ + if (gfc_option.coarray == GFC_FCOARRAY_NONE) + { + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + return FAILURE; + } + + if (!is_coarray (coarray)) + { + gfc_error ("Expected coarray variable as '%s' argument to the UCOBOUND " + "intrinsic at %L", gfc_current_intrinsic_arg[0], &coarray->where); + return FAILURE; + } + + if (dim != NULL) + { + if (dim_check (dim, 1, false) == FAILURE) + return FAILURE; + + if (dim_corank_check (dim, coarray) == FAILURE) + return FAILURE; + } + + if (kind_check (kind, 2, BT_INTEGER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +gfc_try gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field) { mpz_t vector_size; @@ -3224,7 +3404,8 @@ gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field) && gfc_array_size (vector, &vector_size) == SUCCESS) { int mask_true_count = 0; - gfc_constructor *mask_ctor = mask->value.constructor; + gfc_constructor *mask_ctor; + mask_ctor = gfc_constructor_first (mask->value.constructor); while (mask_ctor) { if (mask_ctor->expr->expr_type != EXPR_CONSTANT) @@ -3236,7 +3417,7 @@ gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field) if (mask_ctor->expr->value.logical) mask_true_count++; - mask_ctor = mask_ctor->next; + mask_ctor = gfc_constructor_next (mask_ctor); } if (mpz_get_si (vector_size) < mask_true_count) diff --git a/gcc/fortran/constructor.c b/gcc/fortran/constructor.c new file mode 100644 index 00000000000..12bbdc4a5cb --- /dev/null +++ b/gcc/fortran/constructor.c @@ -0,0 +1,253 @@ +/* Array and structure constructors + Copyright (C) 2009, 2010 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "gfortran.h" +#include "constructor.h" + + +static void +node_free (splay_tree_value value) +{ + gfc_constructor *c = (gfc_constructor*)value; + + if (c->expr) + gfc_free_expr (c->expr); + + if (c->iterator) + gfc_free_iterator (c->iterator, 1); + + mpz_clear (c->offset); + mpz_clear (c->repeat); + + gfc_free (c); +} + + +static gfc_constructor * +node_copy (splay_tree_node node, void *base) +{ + gfc_constructor *c, *src = (gfc_constructor*)node->value; + + c = XCNEW (gfc_constructor); + c->base = (gfc_constructor_base)base; + c->expr = gfc_copy_expr (src->expr); + c->iterator = gfc_copy_iterator (src->iterator); + c->where = src->where; + c->n.component = src->n.component; + + mpz_init_set (c->offset, src->offset); + mpz_init_set (c->repeat, src->repeat); + + return c; +} + + +static int +node_copy_and_insert (splay_tree_node node, void *base) +{ + int n = mpz_get_si (((gfc_constructor*)node->value)->offset); + gfc_constructor_insert ((gfc_constructor_base*)base, + node_copy (node, base), n); + return 0; +} + + +gfc_constructor * +gfc_constructor_get (void) +{ + gfc_constructor *c = XCNEW (gfc_constructor); + c->base = NULL; + c->expr = NULL; + c->iterator = NULL; + + mpz_init_set_si (c->offset, 0); + mpz_init_set_si (c->repeat, 0); + + return c; +} + +gfc_constructor_base gfc_constructor_get_base (void) +{ + return splay_tree_new (splay_tree_compare_ints, NULL, node_free); +} + + +gfc_constructor_base +gfc_constructor_copy (gfc_constructor_base base) +{ + gfc_constructor_base new_base; + + if (!base) + return NULL; + + new_base = gfc_constructor_get_base (); + splay_tree_foreach (base, node_copy_and_insert, &new_base); + + return new_base; +} + + +void +gfc_constructor_free (gfc_constructor_base base) +{ + if (base) + splay_tree_delete (base); +} + + +gfc_constructor * +gfc_constructor_append (gfc_constructor_base *base, gfc_constructor *c) +{ + int offset = 0; + if (*base) + offset = (int)(splay_tree_max (*base)->key) + 1; + + return gfc_constructor_insert (base, c, offset); +} + + +gfc_constructor * +gfc_constructor_append_expr (gfc_constructor_base *base, + gfc_expr *e, locus *where) +{ + gfc_constructor *c = gfc_constructor_get (); + c->expr = e; + if (where) + c->where = *where; + + return gfc_constructor_append (base, c); +} + + +gfc_constructor * +gfc_constructor_insert (gfc_constructor_base *base, gfc_constructor *c, int n) +{ + splay_tree_node node; + + if (*base == NULL) + *base = splay_tree_new (splay_tree_compare_ints, NULL, node_free); + + c->base = *base; + mpz_set_si (c->offset, n); + + node = splay_tree_insert (*base, (splay_tree_key) n, (splay_tree_value) c); + gcc_assert (node); + + return (gfc_constructor*)node->value; +} + + +gfc_constructor * +gfc_constructor_insert_expr (gfc_constructor_base *base, + gfc_expr *e, locus *where, int n) +{ + gfc_constructor *c = gfc_constructor_get (); + c->expr = e; + if (where) + c->where = *where; + + return gfc_constructor_insert (base, c, n); +} + + +gfc_constructor * +gfc_constructor_lookup (gfc_constructor_base base, int offset) +{ + gfc_constructor *c; + splay_tree_node node; + + if (!base) + return NULL; + + node = splay_tree_lookup (base, (splay_tree_key) offset); + if (node) + return (gfc_constructor*) node->value; + + /* Check if the previous node has a repeat count big enough to + cover the offset looked for. */ + node = splay_tree_predecessor (base, offset); + if (!node) + return NULL; + + c = (gfc_constructor*) node->value; + if (mpz_cmp_si (c->repeat, 1) > 0) + { + if (mpz_get_si (c->offset) + mpz_get_si (c->repeat) <= offset) + c = NULL; + } + else + c = NULL; + + return c; +} + + +gfc_expr * +gfc_constructor_lookup_expr (gfc_constructor_base base, int offset) +{ + gfc_constructor *c = gfc_constructor_lookup (base, offset); + return c ? c->expr : NULL; +} + + +int +gfc_constructor_expr_foreach (gfc_constructor *ctor ATTRIBUTE_UNUSED, + int(*f)(gfc_expr *) ATTRIBUTE_UNUSED) +{ + gcc_assert (0); + return 0; +} + +void +gfc_constructor_swap (gfc_constructor *ctor ATTRIBUTE_UNUSED, + int n ATTRIBUTE_UNUSED, int m ATTRIBUTE_UNUSED) +{ + gcc_assert (0); +} + + + +gfc_constructor * +gfc_constructor_first (gfc_constructor_base base) +{ + if (base) + { + splay_tree_node node = splay_tree_min (base); + return node ? (gfc_constructor*) node->value : NULL; + } + else + return NULL; +} + + +gfc_constructor * +gfc_constructor_next (gfc_constructor *ctor) +{ + if (ctor) + { + splay_tree_node node = splay_tree_successor (ctor->base, + mpz_get_si (ctor->offset)); + return node ? (gfc_constructor*) node->value : NULL; + } + else + return NULL; +} diff --git a/gcc/fortran/constructor.h b/gcc/fortran/constructor.h new file mode 100644 index 00000000000..1f7d78388f8 --- /dev/null +++ b/gcc/fortran/constructor.h @@ -0,0 +1,90 @@ +/* Array and structure constructors + Copyright (C) 2009, 2010 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef GFC_CONSTRUCTOR_H +#define GFC_CONSTRUCTOR_H + +#include "gfortran.h" +#include "splay-tree.h" + + +/* Get a new constructor structure. */ +gfc_constructor *gfc_constructor_get (void); + +gfc_constructor_base gfc_constructor_get_base (void); + +/* Copy a constructor structure. */ +gfc_constructor_base gfc_constructor_copy (gfc_constructor_base base); + + +/* Free a gfc_constructor structure. */ +void gfc_constructor_free (gfc_constructor_base base); + + +/* Given an constructor structure, append the expression node onto + the constructor. Returns the constructor node appended. */ +gfc_constructor *gfc_constructor_append (gfc_constructor_base *base, + gfc_constructor *c); + +gfc_constructor *gfc_constructor_append_expr (gfc_constructor_base *base, + gfc_expr *e, locus *where); + + +/* Given an constructor structure, place the expression node at position. + Returns the constructor node inserted. */ +gfc_constructor *gfc_constructor_insert (gfc_constructor_base *base, + gfc_constructor *c, int n); + +gfc_constructor *gfc_constructor_insert_expr (gfc_constructor_base *base, + gfc_expr *e, locus *where, + int n); + +/* Given an array constructor expression and an element number (starting + at zero), return a pointer to the array element. NULL is returned if + the size of the array has been exceeded. The expression node returned + remains a part of the array and should not be freed. */ + +gfc_constructor *gfc_constructor_lookup (gfc_constructor_base base, int n); + +/* Convenience function. Same as ... + gfc_constructor *c = gfc_constructor_lookup (base, n); + gfc_expr *e = c ? c->expr : NULL; +*/ +gfc_expr *gfc_constructor_lookup_expr (gfc_constructor_base base, int n); + + +int gfc_constructor_expr_foreach (gfc_constructor *ctor, int(*)(gfc_expr *)); + + +void gfc_constructor_swap (gfc_constructor *ctor, int n, int m); + + + +/* Get the first constructor node in the constructure structure. + Returns NULL if there is no such expression. */ +gfc_constructor *gfc_constructor_first (gfc_constructor_base base); + +/* Get the next constructor node in the constructure structure. + Returns NULL if there is no next expression. */ +gfc_constructor *gfc_constructor_next (gfc_constructor *ctor); + +gfc_constructor *gfc_constructor_advance (gfc_constructor *ctor, int n); + +#endif /* GFC_CONSTRUCTOR_H */ diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c index 16cd8998a3d..fca251cb660 100644 --- a/gcc/fortran/data.c +++ b/gcc/fortran/data.c @@ -1,5 +1,5 @@ /* Supporting functions for resolving DATA statement. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Lifang Zeng @@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "gfortran.h" #include "data.h" +#include "constructor.h" static void formalize_init_expr (gfc_expr *); @@ -76,67 +77,18 @@ get_array_index (gfc_array_ref *ar, mpz_t *offset) mpz_clear (tmp); } - -/* Find if there is a constructor which offset is equal to OFFSET. */ +/* Find if there is a constructor which component is equal to COM. + TODO: remove this, use symbol.c(gfc_find_component) instead. */ static gfc_constructor * -find_con_by_offset (splay_tree spt, mpz_t offset) +find_con_by_component (gfc_component *com, gfc_constructor_base base) { - mpz_t tmp; - gfc_constructor *ret = NULL; - gfc_constructor *con; - splay_tree_node sptn; - - /* The complexity is due to needing quick access to the linked list of - constructors. Both a linked list and a splay tree are used, and both - are kept up to date if they are array elements (which is the only time - that a specific constructor has to be found). */ - - gcc_assert (spt != NULL); - mpz_init (tmp); - - sptn = splay_tree_lookup (spt, (splay_tree_key) mpz_get_si (offset)); - - if (sptn) - ret = (gfc_constructor*) sptn->value; - else - { - /* Need to check and see if we match a range, so we will pull - the next lowest index and see if the range matches. */ - sptn = splay_tree_predecessor (spt, - (splay_tree_key) mpz_get_si (offset)); - if (sptn) - { - con = (gfc_constructor*) sptn->value; - if (mpz_cmp_ui (con->repeat, 1) > 0) - { - mpz_init (tmp); - mpz_add (tmp, con->n.offset, con->repeat); - if (mpz_cmp (offset, tmp) < 0) - ret = con; - mpz_clear (tmp); - } - else - ret = NULL; /* The range did not match. */ - } - else - ret = NULL; /* No pred, so no match. */ - } - - return ret; -} - + gfc_constructor *c; -/* Find if there is a constructor which component is equal to COM. */ + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) + if (com == c->n.component) + return c; -static gfc_constructor * -find_con_by_component (gfc_component *com, gfc_constructor *con) -{ - for (; con; con = con->next) - { - if (com == con->n.component) - return con; - } return NULL; } @@ -158,20 +110,11 @@ create_character_intializer (gfc_expr *init, gfc_typespec *ts, if (init == NULL) { /* Create a new initializer. */ - init = gfc_get_expr (); - init->expr_type = EXPR_CONSTANT; + init = gfc_get_character_expr (ts->kind, NULL, NULL, len); init->ts = *ts; - - dest = gfc_get_wide_string (len + 1); - dest[len] = '\0'; - init->value.character.length = len; - init->value.character.string = dest; - /* Blank the string if we're only setting a substring. */ - if (ref != NULL) - gfc_wide_memset (dest, ' ', len); } - else - dest = init->value.character.string; + + dest = init->value.character.string; if (ref) { @@ -254,12 +197,9 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index) gfc_expr *expr; gfc_constructor *con; gfc_constructor *last_con; - gfc_constructor *pred; gfc_symbol *symbol; gfc_typespec *last_ts; mpz_t offset; - splay_tree spt; - splay_tree_node sptn; symbol = lvalue->symtree->n.sym; init = symbol->value; @@ -343,40 +283,13 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index) } } - /* Splay tree containing offset and gfc_constructor. */ - spt = expr->con_by_offset; - - if (spt == NULL) + con = gfc_constructor_lookup (expr->value.constructor, + mpz_get_si (offset)); + if (!con) { - spt = splay_tree_new (splay_tree_compare_ints, NULL, NULL); - expr->con_by_offset = spt; - con = NULL; - } - else - con = find_con_by_offset (spt, offset); - - if (con == NULL) - { - splay_tree_key j; - - /* Create a new constructor. */ - con = gfc_get_constructor (); - mpz_set (con->n.offset, offset); - j = (splay_tree_key) mpz_get_si (offset); - sptn = splay_tree_insert (spt, j, (splay_tree_value) con); - /* Fix up the linked list. */ - sptn = splay_tree_predecessor (spt, j); - if (sptn == NULL) - { /* Insert at the head. */ - con->next = expr->value.constructor; - expr->value.constructor = con; - } - else - { /* Insert in the chain. */ - pred = (gfc_constructor*) sptn->value; - con->next = pred->next; - pred->next = con; - } + con = gfc_constructor_insert_expr (&expr->value.constructor, + NULL, NULL, + mpz_get_si (offset)); } break; @@ -393,16 +306,15 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index) last_ts = &ref->u.c.component->ts; /* Find the same element in the existing constructor. */ - con = expr->value.constructor; - con = find_con_by_component (ref->u.c.component, con); + con = find_con_by_component (ref->u.c.component, + expr->value.constructor); if (con == NULL) { /* Create a new constructor. */ - con = gfc_get_constructor (); + con = gfc_constructor_append_expr (&expr->value.constructor, + NULL, NULL); con->n.component = ref->u.c.component; - con->next = expr->value.constructor; - expr->value.constructor = con; } break; @@ -469,12 +381,9 @@ gfc_assign_data_value_range (gfc_expr *lvalue, gfc_expr *rvalue, gfc_ref *ref; gfc_expr *init, *expr; gfc_constructor *con, *last_con; - gfc_constructor *pred; gfc_symbol *symbol; gfc_typespec *last_ts; mpz_t offset; - splay_tree spt; - splay_tree_node sptn; symbol = lvalue->symtree->n.sym; init = symbol->value; @@ -527,44 +436,15 @@ gfc_assign_data_value_range (gfc_expr *lvalue, gfc_expr *rvalue, gcc_assert (ref->next == NULL); } - /* Find the same element in the existing constructor. */ - - /* Splay tree containing offset and gfc_constructor. */ - spt = expr->con_by_offset; - - if (spt == NULL) - { - spt = splay_tree_new (splay_tree_compare_ints, NULL, NULL); - expr->con_by_offset = spt; - con = NULL; - } - else - con = find_con_by_offset (spt, offset); - + con = gfc_constructor_lookup (expr->value.constructor, + mpz_get_si (offset)); if (con == NULL) { - splay_tree_key j; - /* Create a new constructor. */ - con = gfc_get_constructor (); - mpz_set (con->n.offset, offset); - j = (splay_tree_key) mpz_get_si (offset); - + con = gfc_constructor_insert_expr (&expr->value.constructor, + NULL, NULL, + mpz_get_si (offset)); if (ref->next == NULL) mpz_set (con->repeat, repeat); - sptn = splay_tree_insert (spt, j, (splay_tree_value) con); - /* Fix up the linked list. */ - sptn = splay_tree_predecessor (spt, j); - if (sptn == NULL) - { /* Insert at the head. */ - con->next = expr->value.constructor; - expr->value.constructor = con; - } - else - { /* Insert in the chain. */ - pred = (gfc_constructor*) sptn->value; - con->next = pred->next; - pred->next = con; - } } else gcc_assert (ref->next != NULL); @@ -582,17 +462,16 @@ gfc_assign_data_value_range (gfc_expr *lvalue, gfc_expr *rvalue, gcc_assert (expr->expr_type == EXPR_STRUCTURE); last_ts = &ref->u.c.component->ts; - /* Find the same element in the existing constructor. */ - con = expr->value.constructor; - con = find_con_by_component (ref->u.c.component, con); + /* Find the same element in the existing constructor. */ + con = find_con_by_component (ref->u.c.component, + expr->value.constructor); if (con == NULL) { /* Create a new constructor. */ - con = gfc_get_constructor (); + con = gfc_constructor_append_expr (&expr->value.constructor, + NULL, NULL); con->n.component = ref->u.c.component; - con->next = expr->value.constructor; - expr->value.constructor = con; } /* Since we're only intending to initialize arrays here, @@ -709,59 +588,30 @@ gfc_advance_section (mpz_t *section_index, gfc_array_ref *ar, static void formalize_structure_cons (gfc_expr *expr) { - gfc_constructor *head; - gfc_constructor *tail; + gfc_constructor_base base = NULL; gfc_constructor *cur; - gfc_constructor *last; - gfc_constructor *c; gfc_component *order; - c = expr->value.constructor; - /* Constructor is already formalized. */ - if (!c || c->n.component == NULL) + cur = gfc_constructor_first (expr->value.constructor); + if (!cur || cur->n.component == NULL) return; - head = tail = NULL; for (order = expr->ts.u.derived->components; order; order = order->next) { - /* Find the next component. */ - last = NULL; - cur = c; - while (cur != NULL && cur->n.component != order) - { - last = cur; - cur = cur->next; - } - - if (cur == NULL) - { - /* Create a new one. */ - cur = gfc_get_constructor (); - } + cur = find_con_by_component (order, expr->value.constructor); + if (cur) + gfc_constructor_append_expr (&base, cur->expr, &cur->expr->where); else - { - /* Remove it from the chain. */ - if (last == NULL) - c = cur->next; - else - last->next = cur->next; - cur->next = NULL; + gfc_constructor_append_expr (&base, NULL, NULL); + } - formalize_init_expr (cur->expr); - } + /* For all what it's worth, one would expect + gfc_constructor_free (expr->value.constructor); + here. However, if the constructor is actually free'd, + hell breaks loose in the testsuite?! */ - /* Add it to the new constructor. */ - if (head == NULL) - head = tail = cur; - else - { - tail->next = cur; - tail = tail->next; - } - } - gcc_assert (c == NULL); - expr->value.constructor = head; + expr->value.constructor = base; } @@ -781,13 +631,11 @@ formalize_init_expr (gfc_expr *expr) switch (type) { case EXPR_ARRAY: - c = expr->value.constructor; - while (c) - { - formalize_init_expr (c->expr); - c = c->next; - } - break; + for (c = gfc_constructor_first (expr->value.constructor); + c; c = gfc_constructor_next (c)) + formalize_init_expr (c->expr); + + break; case EXPR_STRUCTURE: formalize_structure_cons (expr); diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index a9cd98429d4..88513983261 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "match.h" #include "parse.h" #include "flags.h" - +#include "constructor.h" /* Macros to access allocate memory for gfc_data_variable, gfc_data_value and gfc_data. */ @@ -714,7 +714,7 @@ match_char_length (gfc_expr **expr) if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: " "Old-style character length at %C") == FAILURE) return MATCH_ERROR; - *expr = gfc_int_expr (length); + *expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, length); return m; } @@ -1339,13 +1339,18 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus) if (init->expr_type == EXPR_CONSTANT) { clen = init->value.character.length; - sym->ts.u.cl->length = gfc_int_expr (clen); + sym->ts.u.cl->length + = gfc_get_int_expr (gfc_default_integer_kind, + NULL, clen); } else if (init->expr_type == EXPR_ARRAY) { - gfc_expr *p = init->value.constructor->expr; - clen = p->value.character.length; - sym->ts.u.cl->length = gfc_int_expr (clen); + gfc_constructor *c; + c = gfc_constructor_first (init->value.constructor); + clen = c->expr->value.character.length; + sym->ts.u.cl->length + = gfc_get_int_expr (gfc_default_integer_kind, + NULL, clen); } else if (init->ts.u.cl && init->ts.u.cl->length) sym->ts.u.cl->length = @@ -1356,19 +1361,21 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus) else if (sym->ts.u.cl->length->expr_type == EXPR_CONSTANT) { int len = mpz_get_si (sym->ts.u.cl->length->value.integer); - gfc_constructor * p; if (init->expr_type == EXPR_CONSTANT) gfc_set_constant_character_len (len, init, -1); else if (init->expr_type == EXPR_ARRAY) { + gfc_constructor *c; + /* Build a new charlen to prevent simplification from deleting the length before it is resolved. */ init->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); init->ts.u.cl->length = gfc_copy_expr (sym->ts.u.cl->length); - for (p = init->value.constructor; p; p = p->next) - gfc_set_constant_character_len (len, p->expr, -1); + for (c = gfc_constructor_first (init->value.constructor); + c; c = gfc_constructor_next (c)) + gfc_set_constant_character_len (len, c->expr, -1); } } } @@ -1392,38 +1399,27 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus) if (init->ts.is_iso_c) sym->ts.f90_type = init->ts.f90_type; } - + /* Add initializer. Make sure we keep the ranks sane. */ if (sym->attr.dimension && init->rank == 0) { mpz_t size; gfc_expr *array; - gfc_constructor *c; int n; if (sym->attr.flavor == FL_PARAMETER && init->expr_type == EXPR_CONSTANT && spec_size (sym->as, &size) == SUCCESS && mpz_cmp_si (size, 0) > 0) { - array = gfc_start_constructor (init->ts.type, init->ts.kind, - &init->where); - - array->value.constructor = c = NULL; + array = gfc_get_array_expr (init->ts.type, init->ts.kind, + &init->where); for (n = 0; n < (int)mpz_get_si (size); n++) - { - if (array->value.constructor == NULL) - { - array->value.constructor = c = gfc_get_constructor (); - c->expr = init; - } - else - { - c->next = gfc_get_constructor (); - c = c->next; - c->expr = gfc_copy_expr (init); - } - } - + gfc_constructor_append_expr (&array->value.constructor, + n == 0 + ? init + : gfc_copy_expr (init), + &init->where); + array->shape = gfc_get_shape (sym->as->rank); for (n = 0; n < sym->as->rank; n++) spec_dimen_size (sym->as, n, &array->shape[n]); @@ -1513,15 +1509,14 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init, else if (mpz_cmp (c->ts.u.cl->length->value.integer, c->initializer->ts.u.cl->length->value.integer)) { - bool has_ts; - gfc_constructor *ctor = c->initializer->value.constructor; - - has_ts = (c->initializer->ts.u.cl - && c->initializer->ts.u.cl->length_from_typespec); + gfc_constructor *ctor; + ctor = gfc_constructor_first (c->initializer->value.constructor); if (ctor) { int first_len; + bool has_ts = (c->initializer->ts.u.cl + && c->initializer->ts.u.cl->length_from_typespec); /* Remember the length of the first element for checking that all elements *in the constructor* have the same @@ -1530,11 +1525,12 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init, gcc_assert (ctor->expr->ts.type == BT_CHARACTER); first_len = ctor->expr->value.character.length; - for (; ctor; ctor = ctor->next) + for ( ; ctor; ctor = gfc_constructor_next (ctor)) + if (ctor->expr->expr_type == EXPR_CONSTANT) { - if (ctor->expr->expr_type == EXPR_CONSTANT) - gfc_set_constant_character_len (len, ctor->expr, - has_ts ? -1 : first_len); + gfc_set_constant_character_len (len, ctor->expr, + has_ts ? -1 : first_len); + ctor->expr->ts.u.cl->length = gfc_copy_expr (c->ts.u.cl->length); } } } @@ -1586,7 +1582,6 @@ match gfc_match_null (gfc_expr **result) { gfc_symbol *sym; - gfc_expr *e; match m; m = gfc_match (" null ( )"); @@ -1608,12 +1603,7 @@ gfc_match_null (gfc_expr **result) || gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)) return MATCH_ERROR; - e = gfc_get_expr (); - e->where = gfc_current_locus; - e->expr_type = EXPR_NULL; - e->ts.type = BT_UNKNOWN; - - *result = e; + *result = gfc_get_null_expr (&gfc_current_locus); return MATCH_YES; } @@ -2309,7 +2299,7 @@ done: cl = gfc_new_charlen (gfc_current_ns, NULL); if (seen_length == 0) - cl->length = gfc_int_expr (1); + cl->length = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); else cl->length = len; @@ -2690,7 +2680,8 @@ gfc_match_implicit (void) { ts.kind = gfc_default_character_kind; ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); - ts.u.cl->length = gfc_int_expr (1); + ts.u.cl->length = gfc_get_int_expr (gfc_default_integer_kind, + NULL, 1); } /* Record the Successful match. */ @@ -7147,12 +7138,7 @@ static gfc_expr * enum_initializer (gfc_expr *last_initializer, locus where) { gfc_expr *result; - - result = gfc_get_expr (); - result->expr_type = EXPR_CONSTANT; - result->ts.type = BT_INTEGER; - result->ts.kind = gfc_c_int_kind; - result->where = where; + result = gfc_get_constant_expr (BT_INTEGER, gfc_c_int_kind, &where); mpz_init (result->value.integer); diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index e64b61c3be1..adeea6ab25d 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "gfortran.h" #include "dependency.h" +#include "constructor.h" /* static declarations */ /* Enums */ @@ -843,7 +844,8 @@ gfc_check_dependency (gfc_expr *expr1, gfc_expr *expr2, bool identical) case EXPR_ARRAY: /* Loop through the array constructor's elements. */ - for (c = expr2->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (expr2->value.constructor); + c; c = gfc_constructor_next (c)) { /* If this is an iterator, assume the worst. */ if (c->iterator) @@ -1190,7 +1192,8 @@ contains_forall_index_p (gfc_expr *expr) case EXPR_STRUCTURE: case EXPR_ARRAY: - for (c = expr->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (expr->value.constructor); + c; gfc_constructor_next (c)) if (contains_forall_index_p (c->expr)) return true; break; diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c index e722ff045a2..967a0a543ff 100644 --- a/gcc/fortran/dump-parse-tree.c +++ b/gcc/fortran/dump-parse-tree.c @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "gfortran.h" +#include "constructor.h" /* Keep track of indentation for symbol tree dumps. */ static int show_level = 0; @@ -271,9 +272,10 @@ show_ref (gfc_ref *p) /* Display a constructor. Works recursively for array constructors. */ static void -show_constructor (gfc_constructor *c) +show_constructor (gfc_constructor_base base) { - for (; c; c = c->next) + gfc_constructor *c; + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) { if (c->iterator == NULL) show_expr (c->expr); @@ -294,7 +296,7 @@ show_constructor (gfc_constructor *c) fputc (')', dumpfile); } - if (c->next != NULL) + if (gfc_constructor_next (c) != NULL) fputs (" , ", dumpfile); } } diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 9e2beb6a539..92454f6536f 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -26,8 +26,19 @@ along with GCC; see the file COPYING3. If not see #include "arith.h" #include "match.h" #include "target-memory.h" /* for gfc_convert_boz */ +#include "constructor.h" -/* Get a new expr node. */ + +/* The following set of functions provide access to gfc_expr* of + various types - actual all but EXPR_FUNCTION and EXPR_VARIABLE. + + There are two functions available elsewhere that provide + slightly different flavours of variables. Namely: + expr.c (gfc_get_variable_expr) + symbol.c (gfc_lval_expr_from_sym) + TODO: Merge these functions, if possible. */ + +/* Get a new expression node. */ gfc_expr * gfc_get_expr (void) @@ -39,92 +50,349 @@ gfc_get_expr (void) e->shape = NULL; e->ref = NULL; e->symtree = NULL; - e->con_by_offset = NULL; return e; } -/* Free an argument list and everything below it. */ +/* Get a new expression node that is an array constructor + of given type and kind. */ -void -gfc_free_actual_arglist (gfc_actual_arglist *a1) +gfc_expr * +gfc_get_array_expr (bt type, int kind, locus *where) { - gfc_actual_arglist *a2; + gfc_expr *e; - while (a1) - { - a2 = a1->next; - gfc_free_expr (a1->expr); - gfc_free (a1); - a1 = a2; - } + e = gfc_get_expr (); + e->expr_type = EXPR_ARRAY; + e->value.constructor = NULL; + e->rank = 1; + e->shape = NULL; + + e->ts.type = type; + e->ts.kind = kind; + if (where) + e->where = *where; + + return e; } -/* Copy an arglist structure and all of the arguments. */ +/* Get a new expression node that is the NULL expression. */ -gfc_actual_arglist * -gfc_copy_actual_arglist (gfc_actual_arglist *p) +gfc_expr * +gfc_get_null_expr (locus *where) { - gfc_actual_arglist *head, *tail, *new_arg; + gfc_expr *e; - head = tail = NULL; + e = gfc_get_expr (); + e->expr_type = EXPR_NULL; + e->ts.type = BT_UNKNOWN; - for (; p; p = p->next) + if (where) + e->where = *where; + + return e; +} + + +/* Get a new expression node that is an operator expression node. */ + +gfc_expr * +gfc_get_operator_expr (locus *where, gfc_intrinsic_op op, + gfc_expr *op1, gfc_expr *op2) +{ + gfc_expr *e; + + e = gfc_get_expr (); + e->expr_type = EXPR_OP; + e->value.op.op = op; + e->value.op.op1 = op1; + e->value.op.op2 = op2; + + if (where) + e->where = *where; + + return e; +} + + +/* Get a new expression node that is an structure constructor + of given type and kind. */ + +gfc_expr * +gfc_get_structure_constructor_expr (bt type, int kind, locus *where) +{ + gfc_expr *e; + + e = gfc_get_expr (); + e->expr_type = EXPR_STRUCTURE; + e->value.constructor = NULL; + + e->ts.type = type; + e->ts.kind = kind; + if (where) + e->where = *where; + + return e; +} + + +/* Get a new expression node that is an constant of given type and kind. */ + +gfc_expr * +gfc_get_constant_expr (bt type, int kind, locus *where) +{ + gfc_expr *e; + + if (!where) + gfc_internal_error ("gfc_get_constant_expr(): locus 'where' cannot be NULL"); + + e = gfc_get_expr (); + + e->expr_type = EXPR_CONSTANT; + e->ts.type = type; + e->ts.kind = kind; + e->where = *where; + + switch (type) { - new_arg = gfc_get_actual_arglist (); - *new_arg = *p; + case BT_INTEGER: + mpz_init (e->value.integer); + break; - new_arg->expr = gfc_copy_expr (p->expr); - new_arg->next = NULL; + case BT_REAL: + gfc_set_model_kind (kind); + mpfr_init (e->value.real); + break; - if (head == NULL) - head = new_arg; - else - tail->next = new_arg; + case BT_COMPLEX: + gfc_set_model_kind (kind); + mpc_init2 (e->value.complex, mpfr_get_default_prec()); + break; - tail = new_arg; + default: + break; } - return head; + return e; } -/* Free a list of reference structures. */ +/* Get a new expression node that is an string constant. + If no string is passed, a string of len is allocated, + blanked and null-terminated. */ -void -gfc_free_ref_list (gfc_ref *p) +gfc_expr * +gfc_get_character_expr (int kind, locus *where, const char *src, int len) { - gfc_ref *q; - int i; + gfc_expr *e; + gfc_char_t *dest; - for (; p; p = q) + if (!src) { - q = p->next; + dest = gfc_get_wide_string (len + 1); + gfc_wide_memset (dest, ' ', len); + dest[len] = '\0'; + } + else + dest = gfc_char_to_widechar (src); - switch (p->type) + e = gfc_get_constant_expr (BT_CHARACTER, kind, + where ? where : &gfc_current_locus); + e->value.character.string = dest; + e->value.character.length = len; + + return e; +} + + +/* Get a new expression node that is an integer constant. */ + +gfc_expr * +gfc_get_int_expr (int kind, locus *where, int value) +{ + gfc_expr *p; + p = gfc_get_constant_expr (BT_INTEGER, kind, + where ? where : &gfc_current_locus); + + mpz_init_set_si (p->value.integer, value); + + return p; +} + + +/* Get a new expression node that is a logical constant. */ + +gfc_expr * +gfc_get_logical_expr (int kind, locus *where, bool value) +{ + gfc_expr *p; + p = gfc_get_constant_expr (BT_LOGICAL, kind, + where ? where : &gfc_current_locus); + + p->value.logical = value; + + return p; +} + + +gfc_expr * +gfc_get_iokind_expr (locus *where, io_kind k) +{ + gfc_expr *e; + + /* Set the types to something compatible with iokind. This is needed to + get through gfc_free_expr later since iokind really has no Basic Type, + BT, of its own. */ + + e = gfc_get_expr (); + e->expr_type = EXPR_CONSTANT; + e->ts.type = BT_LOGICAL; + e->value.iokind = k; + e->where = *where; + + return e; +} + + +/* Given an expression pointer, return a copy of the expression. This + subroutine is recursive. */ + +gfc_expr * +gfc_copy_expr (gfc_expr *p) +{ + gfc_expr *q; + gfc_char_t *s; + char *c; + + if (p == NULL) + return NULL; + + q = gfc_get_expr (); + *q = *p; + + switch (q->expr_type) + { + case EXPR_SUBSTRING: + s = gfc_get_wide_string (p->value.character.length + 1); + q->value.character.string = s; + memcpy (s, p->value.character.string, + (p->value.character.length + 1) * sizeof (gfc_char_t)); + break; + + case EXPR_CONSTANT: + /* Copy target representation, if it exists. */ + if (p->representation.string) { - case REF_ARRAY: - for (i = 0; i < GFC_MAX_DIMENSIONS; i++) + c = XCNEWVEC (char, p->representation.length + 1); + q->representation.string = c; + memcpy (c, p->representation.string, (p->representation.length + 1)); + } + + /* Copy the values of any pointer components of p->value. */ + switch (q->ts.type) + { + case BT_INTEGER: + mpz_init_set (q->value.integer, p->value.integer); + break; + + case BT_REAL: + gfc_set_model_kind (q->ts.kind); + mpfr_init (q->value.real); + mpfr_set (q->value.real, p->value.real, GFC_RND_MODE); + break; + + case BT_COMPLEX: + gfc_set_model_kind (q->ts.kind); + mpc_init2 (q->value.complex, mpfr_get_default_prec()); + mpc_set (q->value.complex, p->value.complex, GFC_MPC_RND_MODE); + break; + + case BT_CHARACTER: + if (p->representation.string) + q->value.character.string + = gfc_char_to_widechar (q->representation.string); + else { - gfc_free_expr (p->u.ar.start[i]); - gfc_free_expr (p->u.ar.end[i]); - gfc_free_expr (p->u.ar.stride[i]); - } + s = gfc_get_wide_string (p->value.character.length + 1); + q->value.character.string = s; + /* This is the case for the C_NULL_CHAR named constant. */ + if (p->value.character.length == 0 + && (p->ts.is_c_interop || p->ts.is_iso_c)) + { + *s = '\0'; + /* Need to set the length to 1 to make sure the NUL + terminator is copied. */ + q->value.character.length = 1; + } + else + memcpy (s, p->value.character.string, + (p->value.character.length + 1) * sizeof (gfc_char_t)); + } break; - case REF_SUBSTRING: - gfc_free_expr (p->u.ss.start); - gfc_free_expr (p->u.ss.end); + case BT_HOLLERITH: + case BT_LOGICAL: + case BT_DERIVED: + case BT_CLASS: + break; /* Already done. */ + + case BT_PROCEDURE: + case BT_VOID: + /* Should never be reached. */ + case BT_UNKNOWN: + gfc_internal_error ("gfc_copy_expr(): Bad expr node"); + /* Not reached. */ + } + + break; + + case EXPR_OP: + switch (q->value.op.op) + { + case INTRINSIC_NOT: + case INTRINSIC_PARENTHESES: + case INTRINSIC_UPLUS: + case INTRINSIC_UMINUS: + q->value.op.op1 = gfc_copy_expr (p->value.op.op1); break; - case REF_COMPONENT: + default: /* Binary operators. */ + q->value.op.op1 = gfc_copy_expr (p->value.op.op1); + q->value.op.op2 = gfc_copy_expr (p->value.op.op2); break; } - gfc_free (p); + break; + + case EXPR_FUNCTION: + q->value.function.actual = + gfc_copy_actual_arglist (p->value.function.actual); + break; + + case EXPR_COMPCALL: + case EXPR_PPC: + q->value.compcall.actual = + gfc_copy_actual_arglist (p->value.compcall.actual); + q->value.compcall.tbp = p->value.compcall.tbp; + break; + + case EXPR_STRUCTURE: + case EXPR_ARRAY: + q->value.constructor = gfc_constructor_copy (p->value.constructor); + break; + + case EXPR_VARIABLE: + case EXPR_NULL: + break; } + + q->shape = gfc_copy_shape (p->shape, p->rank); + + q->ref = gfc_copy_ref (p->ref); + + return q; } @@ -191,7 +459,7 @@ free_expr0 (gfc_expr *e) case EXPR_ARRAY: case EXPR_STRUCTURE: - gfc_free_constructor (e->value.constructor); + gfc_constructor_free (e->value.constructor); break; case EXPR_SUBSTRING: @@ -211,26 +479,108 @@ free_expr0 (gfc_expr *e) for (n = 0; n < e->rank; n++) mpz_clear (e->shape[n]); - gfc_free (e->shape); - } + gfc_free (e->shape); + } + + gfc_free_ref_list (e->ref); + + memset (e, '\0', sizeof (gfc_expr)); +} + + +/* Free an expression node and everything beneath it. */ + +void +gfc_free_expr (gfc_expr *e) +{ + if (e == NULL) + return; + free_expr0 (e); + gfc_free (e); +} + + +/* Free an argument list and everything below it. */ + +void +gfc_free_actual_arglist (gfc_actual_arglist *a1) +{ + gfc_actual_arglist *a2; + + while (a1) + { + a2 = a1->next; + gfc_free_expr (a1->expr); + gfc_free (a1); + a1 = a2; + } +} + + +/* Copy an arglist structure and all of the arguments. */ + +gfc_actual_arglist * +gfc_copy_actual_arglist (gfc_actual_arglist *p) +{ + gfc_actual_arglist *head, *tail, *new_arg; + + head = tail = NULL; + + for (; p; p = p->next) + { + new_arg = gfc_get_actual_arglist (); + *new_arg = *p; + + new_arg->expr = gfc_copy_expr (p->expr); + new_arg->next = NULL; + + if (head == NULL) + head = new_arg; + else + tail->next = new_arg; + + tail = new_arg; + } + + return head; +} + + +/* Free a list of reference structures. */ + +void +gfc_free_ref_list (gfc_ref *p) +{ + gfc_ref *q; + int i; + + for (; p; p = q) + { + q = p->next; - gfc_free_ref_list (e->ref); + switch (p->type) + { + case REF_ARRAY: + for (i = 0; i < GFC_MAX_DIMENSIONS; i++) + { + gfc_free_expr (p->u.ar.start[i]); + gfc_free_expr (p->u.ar.end[i]); + gfc_free_expr (p->u.ar.stride[i]); + } - memset (e, '\0', sizeof (gfc_expr)); -} + break; + case REF_SUBSTRING: + gfc_free_expr (p->u.ss.start); + gfc_free_expr (p->u.ss.end); + break; -/* Free an expression node and everything beneath it. */ + case REF_COMPONENT: + break; + } -void -gfc_free_expr (gfc_expr *e) -{ - if (e == NULL) - return; - if (e->con_by_offset) - splay_tree_delete (e->con_by_offset); - free_expr0 (e); - gfc_free (e); + gfc_free (p); + } } @@ -420,147 +770,6 @@ gfc_copy_shape_excluding (mpz_t *shape, int rank, gfc_expr *dim) } -/* Given an expression pointer, return a copy of the expression. This - subroutine is recursive. */ - -gfc_expr * -gfc_copy_expr (gfc_expr *p) -{ - gfc_expr *q; - gfc_char_t *s; - char *c; - - if (p == NULL) - return NULL; - - q = gfc_get_expr (); - *q = *p; - - switch (q->expr_type) - { - case EXPR_SUBSTRING: - s = gfc_get_wide_string (p->value.character.length + 1); - q->value.character.string = s; - memcpy (s, p->value.character.string, - (p->value.character.length + 1) * sizeof (gfc_char_t)); - break; - - case EXPR_CONSTANT: - /* Copy target representation, if it exists. */ - if (p->representation.string) - { - c = XCNEWVEC (char, p->representation.length + 1); - q->representation.string = c; - memcpy (c, p->representation.string, (p->representation.length + 1)); - } - - /* Copy the values of any pointer components of p->value. */ - switch (q->ts.type) - { - case BT_INTEGER: - mpz_init_set (q->value.integer, p->value.integer); - break; - - case BT_REAL: - gfc_set_model_kind (q->ts.kind); - mpfr_init (q->value.real); - mpfr_set (q->value.real, p->value.real, GFC_RND_MODE); - break; - - case BT_COMPLEX: - gfc_set_model_kind (q->ts.kind); - mpc_init2 (q->value.complex, mpfr_get_default_prec()); - mpc_set (q->value.complex, p->value.complex, GFC_MPC_RND_MODE); - break; - - case BT_CHARACTER: - if (p->representation.string) - q->value.character.string - = gfc_char_to_widechar (q->representation.string); - else - { - s = gfc_get_wide_string (p->value.character.length + 1); - q->value.character.string = s; - - /* This is the case for the C_NULL_CHAR named constant. */ - if (p->value.character.length == 0 - && (p->ts.is_c_interop || p->ts.is_iso_c)) - { - *s = '\0'; - /* Need to set the length to 1 to make sure the NUL - terminator is copied. */ - q->value.character.length = 1; - } - else - memcpy (s, p->value.character.string, - (p->value.character.length + 1) * sizeof (gfc_char_t)); - } - break; - - case BT_HOLLERITH: - case BT_LOGICAL: - case BT_DERIVED: - case BT_CLASS: - break; /* Already done. */ - - case BT_PROCEDURE: - case BT_VOID: - /* Should never be reached. */ - case BT_UNKNOWN: - gfc_internal_error ("gfc_copy_expr(): Bad expr node"); - /* Not reached. */ - } - - break; - - case EXPR_OP: - switch (q->value.op.op) - { - case INTRINSIC_NOT: - case INTRINSIC_PARENTHESES: - case INTRINSIC_UPLUS: - case INTRINSIC_UMINUS: - q->value.op.op1 = gfc_copy_expr (p->value.op.op1); - break; - - default: /* Binary operators. */ - q->value.op.op1 = gfc_copy_expr (p->value.op.op1); - q->value.op.op2 = gfc_copy_expr (p->value.op.op2); - break; - } - - break; - - case EXPR_FUNCTION: - q->value.function.actual = - gfc_copy_actual_arglist (p->value.function.actual); - break; - - case EXPR_COMPCALL: - case EXPR_PPC: - q->value.compcall.actual = - gfc_copy_actual_arglist (p->value.compcall.actual); - q->value.compcall.tbp = p->value.compcall.tbp; - break; - - case EXPR_STRUCTURE: - case EXPR_ARRAY: - q->value.constructor = gfc_copy_constructor (p->value.constructor); - break; - - case EXPR_VARIABLE: - case EXPR_NULL: - break; - } - - q->shape = gfc_copy_shape (p->shape, p->rank); - - q->ref = gfc_copy_ref (p->ref); - - return q; -} - - /* Return the maximum kind of two expressions. In general, higher kind numbers mean more precision for numeric types. */ @@ -589,48 +798,6 @@ gfc_numeric_ts (gfc_typespec *ts) } -/* Returns an expression node that is an integer constant. */ - -gfc_expr * -gfc_int_expr (int i) -{ - gfc_expr *p; - - p = gfc_get_expr (); - - p->expr_type = EXPR_CONSTANT; - p->ts.type = BT_INTEGER; - p->ts.kind = gfc_default_integer_kind; - - p->where = gfc_current_locus; - mpz_init_set_si (p->value.integer, i); - - return p; -} - - -/* Returns an expression node that is a logical constant. */ - -gfc_expr * -gfc_logical_expr (int i, locus *where) -{ - gfc_expr *p; - - p = gfc_get_expr (); - - p->expr_type = EXPR_CONSTANT; - p->ts.type = BT_LOGICAL; - p->ts.kind = gfc_default_logical_kind; - - if (where == NULL) - where = &gfc_current_locus; - p->where = *where; - p->value.logical = i; - - return p; -} - - /* Return an expression node with an optional argument list attached. A variable number of gfc_expr pointers are strung together in an argument list with a NULL pointer terminating the list. */ @@ -764,7 +931,6 @@ gfc_is_constant_expr (gfc_expr *e) { gfc_constructor *c; gfc_actual_arglist *arg; - int rv; if (e == NULL) return 1; @@ -772,68 +938,55 @@ gfc_is_constant_expr (gfc_expr *e) switch (e->expr_type) { case EXPR_OP: - rv = (gfc_is_constant_expr (e->value.op.op1) - && (e->value.op.op2 == NULL - || gfc_is_constant_expr (e->value.op.op2))); - break; + return (gfc_is_constant_expr (e->value.op.op1) + && (e->value.op.op2 == NULL + || gfc_is_constant_expr (e->value.op.op2))); case EXPR_VARIABLE: - rv = 0; - break; + return 0; case EXPR_FUNCTION: case EXPR_PPC: case EXPR_COMPCALL: /* Specification functions are constant. */ if (check_specification_function (e) == MATCH_YES) - { - rv = 1; - break; - } + return 1; /* Call to intrinsic with at least one argument. */ - rv = 0; if (e->value.function.isym && e->value.function.actual) { for (arg = e->value.function.actual; arg; arg = arg->next) - { - if (!gfc_is_constant_expr (arg->expr)) - break; - } - if (arg == NULL) - rv = 1; + if (!gfc_is_constant_expr (arg->expr)) + return 0; + + return 1; } - break; + else + return 0; case EXPR_CONSTANT: case EXPR_NULL: - rv = 1; - break; + return 1; case EXPR_SUBSTRING: - rv = e->ref == NULL || (gfc_is_constant_expr (e->ref->u.ss.start) - && gfc_is_constant_expr (e->ref->u.ss.end)); - break; + return e->ref == NULL || (gfc_is_constant_expr (e->ref->u.ss.start) + && gfc_is_constant_expr (e->ref->u.ss.end)); case EXPR_STRUCTURE: - rv = 0; - for (c = e->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (e->value.constructor); + c; c = gfc_constructor_next (c)) if (!gfc_is_constant_expr (c->expr)) - break; + return 0; - if (c == NULL) - rv = 1; - break; + return 1; case EXPR_ARRAY: - rv = gfc_constant_ac (e); - break; + return gfc_constant_ac (e); default: gfc_internal_error ("gfc_is_constant_expr(): Unknown expression type"); + return 0; } - - return rv; } @@ -1005,11 +1158,12 @@ simplify_intrinsic_op (gfc_expr *p, int type) with gfc_simplify_expr(). */ static gfc_try -simplify_constructor (gfc_constructor *c, int type) +simplify_constructor (gfc_constructor_base base, int type) { + gfc_constructor *c; gfc_expr *p; - for (; c; c = c->next) + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) { if (c->iterator && (gfc_simplify_expr (c->iterator->start, type) == FAILURE @@ -1041,7 +1195,7 @@ simplify_constructor (gfc_constructor *c, int type) /* Pull a single array element out of an array constructor. */ static gfc_try -find_array_element (gfc_constructor *cons, gfc_array_ref *ar, +find_array_element (gfc_constructor_base base, gfc_array_ref *ar, gfc_constructor **rval) { unsigned long nelemen; @@ -1050,6 +1204,7 @@ find_array_element (gfc_constructor *cons, gfc_array_ref *ar, mpz_t offset; mpz_t span; mpz_t tmp; + gfc_constructor *cons; gfc_expr *e; gfc_try t; @@ -1104,16 +1259,13 @@ find_array_element (gfc_constructor *cons, gfc_array_ref *ar, mpz_mul (span, span, tmp); } - for (nelemen = mpz_get_ui (offset); nelemen > 0; nelemen--) + for (cons = gfc_constructor_first (base), nelemen = mpz_get_ui (offset); + cons && nelemen > 0; cons = gfc_constructor_next (cons), nelemen--) { - if (cons) + if (cons->iterator) { - if (cons->iterator) - { - cons = NULL; - goto depart; - } - cons = cons->next; + cons = NULL; + goto depart; } } @@ -1132,20 +1284,21 @@ depart: /* Find a component of a structure constructor. */ static gfc_constructor * -find_component_ref (gfc_constructor *cons, gfc_ref *ref) +find_component_ref (gfc_constructor_base base, gfc_ref *ref) { gfc_component *comp; gfc_component *pick; + gfc_constructor *c = gfc_constructor_first (base); comp = ref->u.c.sym->components; pick = ref->u.c.component; while (comp != pick) { comp = comp->next; - cons = cons->next; + c = gfc_constructor_next (c); } - return cons; + return c; } @@ -1179,6 +1332,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) int rank; int d; int shape_i; + int limit; long unsigned one = 1; bool incr_ctr; mpz_t start[GFC_MAX_DIMENSIONS]; @@ -1190,15 +1344,13 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) mpz_t tmp_mpz; mpz_t nelts; mpz_t ptr; - mpz_t index; - gfc_constructor *cons; - gfc_constructor *base; + gfc_constructor_base base; + gfc_constructor *cons, *vecsub[GFC_MAX_DIMENSIONS]; gfc_expr *begin; gfc_expr *finish; gfc_expr *step; gfc_expr *upper; gfc_expr *lower; - gfc_constructor *vecsub[GFC_MAX_DIMENSIONS], *c; gfc_try t; t = SUCCESS; @@ -1240,6 +1392,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) if (ref->u.ar.dimen_type[d] == DIMEN_VECTOR) /* Vector subscript. */ { + gfc_constructor *ci; gcc_assert (begin); if (begin->expr_type != EXPR_ARRAY || !gfc_is_constant_expr (begin)) @@ -1256,16 +1409,16 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) break; } - vecsub[d] = begin->value.constructor; + vecsub[d] = gfc_constructor_first (begin->value.constructor); mpz_set (ctr[d], vecsub[d]->expr->value.integer); mpz_mul (nelts, nelts, begin->shape[0]); mpz_set (expr->shape[shape_i++], begin->shape[0]); /* Check bounds. */ - for (c = vecsub[d]; c; c = c->next) + for (ci = vecsub[d]; ci; ci = gfc_constructor_next (ci)) { - if (mpz_cmp (c->expr->value.integer, upper->value.integer) > 0 - || mpz_cmp (c->expr->value.integer, + if (mpz_cmp (ci->expr->value.integer, upper->value.integer) > 0 + || mpz_cmp (ci->expr->value.integer, lower->value.integer) < 0) { gfc_error ("index in dimension %d is out of bounds " @@ -1346,9 +1499,8 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) mpz_mul (delta_mpz, delta_mpz, tmp_mpz); } - mpz_init (index); mpz_init (ptr); - cons = base; + cons = gfc_constructor_first (base); /* Now clock through the array reference, calculating the index in the source constructor and transferring the elements to the new @@ -1374,11 +1526,11 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) { gcc_assert(vecsub[d]); - if (!vecsub[d]->next) - vecsub[d] = ref->u.ar.start[d]->value.constructor; + if (!gfc_constructor_next (vecsub[d])) + vecsub[d] = gfc_constructor_first (ref->u.ar.start[d]->value.constructor); else { - vecsub[d] = vecsub[d]->next; + vecsub[d] = gfc_constructor_next (vecsub[d]); incr_ctr = false; } mpz_set (ctr[d], vecsub[d]->expr->value.integer); @@ -1396,25 +1548,24 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) } } - /* There must be a better way of dealing with negative strides - than resetting the index and the constructor pointer! */ - if (mpz_cmp (ptr, index) < 0) - { - mpz_set_ui (index, 0); - cons = base; - } - - while (cons && cons->next && mpz_cmp (ptr, index) > 0) - { - mpz_add_ui (index, index, one); - cons = cons->next; + limit = mpz_get_ui (ptr); + if (limit >= gfc_option.flag_max_array_constructor) + { + gfc_error ("The number of elements in the array constructor " + "at %L requires an increase of the allowed %d " + "upper limit. See -fmax-array-constructor " + "option", &expr->where, + gfc_option.flag_max_array_constructor); + return FAILURE; } - gfc_append_constructor (expr, gfc_copy_expr (cons->expr)); + cons = gfc_constructor_lookup (base, limit); + gcc_assert (cons); + gfc_constructor_append_expr (&expr->value.constructor, + gfc_copy_expr (cons->expr), NULL); } mpz_clear (ptr); - mpz_clear (index); cleanup: @@ -1429,7 +1580,7 @@ cleanup: mpz_clear (ctr[d]); mpz_clear (stride[d]); } - gfc_free_constructor (base); + gfc_constructor_free (base); return t; } @@ -1470,7 +1621,7 @@ find_substring_ref (gfc_expr *p, gfc_expr **newp) static gfc_try simplify_const_ref (gfc_expr *p) { - gfc_constructor *cons; + gfc_constructor *cons, *c; gfc_expr *newp; gfc_ref *last_ref; @@ -1510,20 +1661,20 @@ simplify_const_ref (gfc_expr *p) if (p->ref->next != NULL && (p->ts.type == BT_CHARACTER || p->ts.type == BT_DERIVED)) { - cons = p->value.constructor; - for (; cons; cons = cons->next) + for (c = gfc_constructor_first (p->value.constructor); + c; c = gfc_constructor_next (c)) { - cons->expr->ref = gfc_copy_ref (p->ref->next); - if (simplify_const_ref (cons->expr) == FAILURE) + c->expr->ref = gfc_copy_ref (p->ref->next); + if (simplify_const_ref (c->expr) == FAILURE) return FAILURE; } if (p->ts.type == BT_DERIVED && p->ref->next - && p->value.constructor) + && (c = gfc_constructor_first (p->value.constructor))) { /* There may have been component references. */ - p->ts = p->value.constructor->expr->ts; + p->ts = c->expr->ts; } last_ref = p->ref; @@ -1537,9 +1688,9 @@ simplify_const_ref (gfc_expr *p) character length according to the first element (as all should have the same length). */ int string_len; - if (p->value.constructor) + if ((c = gfc_constructor_first (p->value.constructor))) { - const gfc_expr* first = p->value.constructor->expr; + const gfc_expr* first = c->expr; gcc_assert (first->expr_type == EXPR_CONSTANT); gcc_assert (first->ts.type == BT_CHARACTER); string_len = first->value.character.length; @@ -1553,7 +1704,9 @@ simplify_const_ref (gfc_expr *p) else gfc_free_expr (p->ts.u.cl->length); - p->ts.u.cl->length = gfc_int_expr (string_len); + p->ts.u.cl->length + = gfc_get_int_expr (gfc_default_integer_kind, + NULL, string_len); } } gfc_free_ref_list (p->ref); @@ -1724,7 +1877,9 @@ gfc_simplify_expr (gfc_expr *p, int type) p->value.character.string = s; p->value.character.length = end - start; p->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); - p->ts.u.cl->length = gfc_int_expr (p->value.character.length); + p->ts.u.cl->length = gfc_get_int_expr (gfc_default_integer_kind, + NULL, + p->value.character.length); gfc_free_ref_list (p->ref); p->ref = NULL; p->expr_type = EXPR_CONSTANT; @@ -1812,10 +1967,12 @@ static gfc_try scalarize_intrinsic_call (gfc_expr *e) { gfc_actual_arglist *a, *b; - gfc_constructor *args[5], *ctor, *new_ctor; + gfc_constructor_base ctor; + gfc_constructor *args[5]; + gfc_constructor *ci, *new_ctor; gfc_expr *expr, *old; int n, i, rank[5], array_arg; - + /* Find which, if any, arguments are arrays. Assume that the old expression carries the type information and that the first arg that is an array expression carries all the shape information.*/ @@ -1836,9 +1993,8 @@ scalarize_intrinsic_call (gfc_expr *e) old = gfc_copy_expr (e); - gfc_free_constructor (expr->value.constructor); + gfc_constructor_free (expr->value.constructor); expr->value.constructor = NULL; - expr->ts = old->ts; expr->where = old->where; expr->expr_type = EXPR_ARRAY; @@ -1858,7 +2014,7 @@ scalarize_intrinsic_call (gfc_expr *e) { rank[n] = a->expr->rank; ctor = a->expr->symtree->n.sym->value->value.constructor; - args[n] = gfc_copy_constructor (ctor); + args[n] = gfc_constructor_first (ctor); } else if (a->expr && a->expr->expr_type == EXPR_ARRAY) { @@ -1866,10 +2022,12 @@ scalarize_intrinsic_call (gfc_expr *e) rank[n] = a->expr->rank; else rank[n] = 1; - args[n] = gfc_copy_constructor (a->expr->value.constructor); + ctor = gfc_constructor_copy (a->expr->value.constructor); + args[n] = gfc_constructor_first (ctor); } else args[n] = NULL; + n++; } @@ -1877,53 +2035,46 @@ scalarize_intrinsic_call (gfc_expr *e) /* Using the array argument as the master, step through the array calling the function for each element and advancing the array constructors together. */ - ctor = args[array_arg - 1]; - new_ctor = NULL; - for (; ctor; ctor = ctor->next) + for (ci = args[array_arg - 1]; ci; ci = gfc_constructor_next (ci)) { - if (expr->value.constructor == NULL) - expr->value.constructor - = new_ctor = gfc_get_constructor (); + new_ctor = gfc_constructor_append_expr (&expr->value.constructor, + gfc_copy_expr (old), NULL); + + gfc_free_actual_arglist (new_ctor->expr->value.function.actual); + a = NULL; + b = old->value.function.actual; + for (i = 0; i < n; i++) + { + if (a == NULL) + new_ctor->expr->value.function.actual + = a = gfc_get_actual_arglist (); else { - new_ctor->next = gfc_get_constructor (); - new_ctor = new_ctor->next; + a->next = gfc_get_actual_arglist (); + a = a->next; } - new_ctor->expr = gfc_copy_expr (old); - gfc_free_actual_arglist (new_ctor->expr->value.function.actual); - a = NULL; - b = old->value.function.actual; - for (i = 0; i < n; i++) - { - if (a == NULL) - new_ctor->expr->value.function.actual - = a = gfc_get_actual_arglist (); - else - { - a->next = gfc_get_actual_arglist (); - a = a->next; - } - if (args[i]) - a->expr = gfc_copy_expr (args[i]->expr); - else - a->expr = gfc_copy_expr (b->expr); - b = b->next; - } + if (args[i]) + a->expr = gfc_copy_expr (args[i]->expr); + else + a->expr = gfc_copy_expr (b->expr); + + b = b->next; + } - /* Simplify the function calls. If the simplification fails, the - error will be flagged up down-stream or the library will deal - with it. */ - gfc_simplify_expr (new_ctor->expr, 0); + /* Simplify the function calls. If the simplification fails, the + error will be flagged up down-stream or the library will deal + with it. */ + gfc_simplify_expr (new_ctor->expr, 0); - for (i = 0; i < n; i++) - if (args[i]) - args[i] = args[i]->next; + for (i = 0; i < n; i++) + if (args[i]) + args[i] = gfc_constructor_next (args[i]); - for (i = 1; i < n; i++) - if (rank[i] && ((args[i] != NULL && args[array_arg - 1] == NULL) - || (args[i] == NULL && args[array_arg - 1] != NULL))) - goto compliance; + for (i = 1; i < n; i++) + if (rank[i] && ((args[i] != NULL && args[array_arg - 1] == NULL) + || (args[i] == NULL && args[array_arg - 1] != NULL))) + goto compliance; } free_expr0 (e); @@ -2063,21 +2214,22 @@ not_numeric: static gfc_try check_alloc_comp_init (gfc_expr *e) { - gfc_component *c; + gfc_component *comp; gfc_constructor *ctor; gcc_assert (e->expr_type == EXPR_STRUCTURE); gcc_assert (e->ts.type == BT_DERIVED); - for (c = e->ts.u.derived->components, ctor = e->value.constructor; - c; c = c->next, ctor = ctor->next) + for (comp = e->ts.u.derived->components, + ctor = gfc_constructor_first (e->value.constructor); + comp; comp = comp->next, ctor = gfc_constructor_next (ctor)) { - if (c->attr.allocatable + if (comp->attr.allocatable && ctor->expr->expr_type != EXPR_NULL) { gfc_error("Invalid initialization expression for ALLOCATABLE " "component '%s' in structure constructor at %L", - c->name, &ctor->expr->where); + comp->name, &ctor->expr->where); return FAILURE; } } @@ -3444,45 +3596,38 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_expr *rvalue) gfc_expr * gfc_default_initializer (gfc_typespec *ts) { - gfc_constructor *tail; gfc_expr *init; - gfc_component *c; + gfc_component *comp; /* See if we have a default initializer. */ - for (c = ts->u.derived->components; c; c = c->next) - if (c->initializer || c->attr.allocatable) + for (comp = ts->u.derived->components; comp; comp = comp->next) + if (comp->initializer || comp->attr.allocatable) break; - if (!c) + if (!comp) return NULL; - /* Build the constructor. */ - init = gfc_get_expr (); - init->expr_type = EXPR_STRUCTURE; + init = gfc_get_structure_constructor_expr (ts->type, ts->kind, + &ts->u.derived->declared_at); init->ts = *ts; - init->where = ts->u.derived->declared_at; - tail = NULL; - for (c = ts->u.derived->components; c; c = c->next) + for (comp = ts->u.derived->components; comp; comp = comp->next) { - if (tail == NULL) - init->value.constructor = tail = gfc_get_constructor (); - else - { - tail->next = gfc_get_constructor (); - tail = tail->next; - } + gfc_constructor *ctor = gfc_constructor_get(); - if (c->initializer) - tail->expr = gfc_copy_expr (c->initializer); + if (comp->initializer) + ctor->expr = gfc_copy_expr (comp->initializer); - if (c->attr.allocatable) + if (comp->attr.allocatable) { - tail->expr = gfc_get_expr (); - tail->expr->expr_type = EXPR_NULL; - tail->expr->ts = c->ts; + ctor->expr = gfc_get_expr (); + ctor->expr->expr_type = EXPR_NULL; + ctor->expr->ts = comp->ts; } + + gfc_constructor_append (&init->value.constructor, ctor); } + return init; } @@ -3611,7 +3756,8 @@ gfc_traverse_expr (gfc_expr *expr, gfc_symbol *sym, case EXPR_STRUCTURE: case EXPR_ARRAY: - for (c = expr->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (expr->value.constructor); + c; c = gfc_constructor_next (c)) { if (gfc_traverse_expr (c->expr, sym, func, f)) return true; diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 3668df4a396..48e80f637ee 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -404,6 +404,7 @@ enum gfc_isym_id GFC_ISYM_IDATE, GFC_ISYM_IEOR, GFC_ISYM_IERRNO, + GFC_ISYM_IMAGE_INDEX, GFC_ISYM_INDEX, GFC_ISYM_INT, GFC_ISYM_INT2, @@ -423,6 +424,7 @@ enum gfc_isym_id GFC_ISYM_KILL, GFC_ISYM_KIND, GFC_ISYM_LBOUND, + GFC_ISYM_LCOBOUND, GFC_ISYM_LEADZ, GFC_ISYM_LEN, GFC_ISYM_LEN_TRIM, @@ -509,6 +511,7 @@ enum gfc_isym_id GFC_ISYM_SYSTEM_CLOCK, GFC_ISYM_TAN, GFC_ISYM_TANH, + GFC_ISYM_THIS_IMAGE, GFC_ISYM_TIME, GFC_ISYM_TIME8, GFC_ISYM_TINY, @@ -518,6 +521,7 @@ enum gfc_isym_id GFC_ISYM_TRIM, GFC_ISYM_TTYNAM, GFC_ISYM_UBOUND, + GFC_ISYM_UCOBOUND, GFC_ISYM_UMASK, GFC_ISYM_UNLINK, GFC_ISYM_UNPACK, @@ -1643,6 +1647,8 @@ gfc_class_esym_list; #define GFC_RND_MODE GMP_RNDN #define GFC_MPC_RND_MODE MPC_RNDNN +typedef splay_tree gfc_constructor_base; + typedef struct gfc_expr { expr_t expr_type; @@ -1674,9 +1680,6 @@ typedef struct gfc_expr a function call in interface.c(gfc_extend_expr). */ unsigned int user_operator : 1; - /* Used to quickly find a given constructor by its offset. */ - splay_tree con_by_offset; - /* If an expression comes from a Hollerith constant or compile-time evaluation of a transfer statement, it may have a prescribed target- memory representation, and these cannot always be backformed from @@ -1745,7 +1748,7 @@ typedef struct gfc_expr } character; - struct gfc_constructor *constructor; + gfc_constructor_base constructor; } value; @@ -2182,19 +2185,21 @@ extern gfc_option_t gfc_option; /* Constructor nodes for array and structure constructors. */ typedef struct gfc_constructor { + gfc_constructor_base base; + mpz_t offset; /* Offset within a constructor, used as + key within base. */ + gfc_expr *expr; gfc_iterator *iterator; locus where; - struct gfc_constructor *next; - struct + + union { - mpz_t offset; /* Record the offset of array element which appears in - data statement like "data a(5)/4/". */ - gfc_component *component; /* Record the component being initialized. */ + gfc_component *component; /* Record the component being initialized. */ } n; mpz_t repeat; /* Record the repeat number of initial values in data - statement like "data a/5*10/". */ + statement like "data a/5*10/". */ } gfc_constructor; @@ -2610,10 +2615,18 @@ gfc_try gfc_simplify_expr (gfc_expr *, int); int gfc_has_vector_index (gfc_expr *); gfc_expr *gfc_get_expr (void); +gfc_expr *gfc_get_array_expr (bt type, int kind, locus *); +gfc_expr *gfc_get_null_expr (locus *); +gfc_expr *gfc_get_operator_expr (locus *, gfc_intrinsic_op,gfc_expr *, gfc_expr *); +gfc_expr *gfc_get_structure_constructor_expr (bt, int, locus *); +gfc_expr *gfc_get_constant_expr (bt, int, locus *); +gfc_expr *gfc_get_character_expr (int, locus *, const char *, int len); +gfc_expr *gfc_get_int_expr (int, locus *, int); +gfc_expr *gfc_get_logical_expr (int, locus *, bool); +gfc_expr *gfc_get_iokind_expr (locus *, io_kind); + void gfc_free_expr (gfc_expr *); void gfc_replace_expr (gfc_expr *, gfc_expr *); -gfc_expr *gfc_int_expr (int); -gfc_expr *gfc_logical_expr (int, locus *); mpz_t *gfc_copy_shape (mpz_t *, int); mpz_t *gfc_copy_shape_excluding (mpz_t *, int, gfc_expr *); gfc_expr *gfc_copy_expr (gfc_expr *); @@ -2677,6 +2690,8 @@ bool gfc_type_is_extensible (gfc_symbol *sym); /* array.c */ +gfc_iterator *gfc_copy_iterator (gfc_iterator *); + void gfc_free_array_spec (gfc_array_spec *); gfc_array_ref *gfc_copy_array_ref (gfc_array_ref *); @@ -2686,9 +2701,6 @@ gfc_try gfc_resolve_array_spec (gfc_array_spec *, int); int gfc_compare_array_spec (gfc_array_spec *, gfc_array_spec *); -gfc_expr *gfc_start_constructor (bt, int, locus *); -void gfc_append_constructor (gfc_expr *, gfc_expr *); -void gfc_free_constructor (gfc_constructor *); void gfc_simplify_iterator_var (gfc_expr *); gfc_try gfc_expand_constructor (gfc_expr *); int gfc_constant_ac (gfc_expr *); @@ -2698,14 +2710,10 @@ gfc_try gfc_resolve_array_constructor (gfc_expr *); gfc_try gfc_check_constructor_type (gfc_expr *); gfc_try gfc_check_iter_variable (gfc_expr *); gfc_try gfc_check_constructor (gfc_expr *, gfc_try (*)(gfc_expr *)); -gfc_constructor *gfc_copy_constructor (gfc_constructor *); -gfc_expr *gfc_get_array_element (gfc_expr *, int); gfc_try gfc_array_size (gfc_expr *, mpz_t *); gfc_try gfc_array_dimen_size (gfc_expr *, int, mpz_t *); gfc_try gfc_array_ref_shape (gfc_array_ref *, mpz_t *); gfc_array_ref *gfc_find_array_ref (gfc_expr *); -void gfc_insert_constructor (gfc_expr *, gfc_constructor *); -gfc_constructor *gfc_get_constructor (void); tree gfc_conv_array_initializer (tree type, gfc_expr *); gfc_try spec_size (gfc_array_spec *, mpz_t *); gfc_try spec_dimen_size (gfc_array_spec *, int, mpz_t *); diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c index b7eccc335fd..413da7b606a 100644 --- a/gcc/fortran/gfortranspec.c +++ b/gcc/fortran/gfortranspec.c @@ -186,6 +186,8 @@ lookup_option (Option *xopt, int *xskip, const char **xarg, const char *text) opt = OPTION_syntax_only; else if (!strcmp (text, "-static-libgfortran")) opt = OPTION_static_libgfortran; + else if (!strcmp (text, "-static")) + opt = OPTION_static; else if (!strcmp (text, "-fversion")) /* Really --version!! */ opt = OPTION_version; else if (!strcmp (text, "-Xlinker") || !strcmp (text, "-specs")) @@ -351,8 +353,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, #ifdef HAVE_LD_STATIC_DYNAMIC static_linking = 1; #endif - /* Fall through, count OPTION_static as an item included in - the rewritten command line. */ + break; case OPTION_l: ++n_infiles; diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index fbfc47af12c..470839af104 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -1081,7 +1081,8 @@ add_functions (void) *y = "y", *sz = "size", *sta = "string_a", *stb = "string_b", *z = "z", *ln = "len", *ut = "unit", *han = "handler", *num = "number", *tm = "time", *nm = "name", *md = "mode", - *vl = "values", *p1 = "path1", *p2 = "path2", *com = "command"; + *vl = "values", *p1 = "path1", *p2 = "path2", *com = "command", + *ca = "coarray", *sub = "sub"; int di, dr, dd, dl, dc, dz, ii; @@ -1784,6 +1785,10 @@ add_functions (void) make_generic ("ierrno", GFC_ISYM_IERRNO, GFC_STD_GNU); + add_sym_2 ("image_index", GFC_ISYM_IMAGE_INDEX, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F2008, + gfc_check_image_index, gfc_simplify_image_index, NULL, + ca, BT_REAL, dr, REQUIRED, sub, BT_INTEGER, ii, REQUIRED); + /* The resolution function for INDEX is called gfc_resolve_index_func because the name gfc_resolve_index is already used in resolve.c. */ add_sym_4 ("index", GFC_ISYM_INDEX, CLASS_ELEMENTAL, ACTUAL_YES, @@ -1919,6 +1924,14 @@ add_functions (void) make_generic ("lbound", GFC_ISYM_LBOUND, GFC_STD_F95); + add_sym_3 ("lcobound", GFC_ISYM_LCOBOUND, CLASS_INQUIRY, ACTUAL_NO, + BT_INTEGER, di, GFC_STD_F95, + gfc_check_lcobound, gfc_simplify_lcobound, NULL, + ca, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL, + kind, BT_INTEGER, di, OPTIONAL); + + make_generic ("lcobound", GFC_ISYM_LCOBOUND, GFC_STD_F95); + add_sym_1 ("leadz", GFC_ISYM_LEADZ, CLASS_ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F2008, gfc_check_i, gfc_simplify_leadz, NULL, @@ -2526,6 +2539,10 @@ add_functions (void) make_generic ("tanh", GFC_ISYM_TANH, GFC_STD_F77); + add_sym_2 ("this_image", GFC_ISYM_THIS_IMAGE, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F2008, + gfc_check_this_image, gfc_simplify_this_image, NULL, + ca, BT_REAL, dr, OPTIONAL, dm, BT_INTEGER, ii, OPTIONAL); + add_sym_0 ("time", GFC_ISYM_TIME, NO_CLASS, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU, NULL, NULL, gfc_resolve_time); @@ -2582,6 +2599,14 @@ add_functions (void) make_generic ("ubound", GFC_ISYM_UBOUND, GFC_STD_F95); + add_sym_3 ("ucobound", GFC_ISYM_UCOBOUND, CLASS_INQUIRY, ACTUAL_NO, + BT_INTEGER, di, GFC_STD_F95, + gfc_check_ucobound, gfc_simplify_ucobound, NULL, + ca, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL, + kind, BT_INTEGER, di, OPTIONAL); + + make_generic ("ucobound", GFC_ISYM_UCOBOUND, GFC_STD_F95); + /* g77 compatibility for UMASK. */ add_sym_1 ("umask", GFC_ISYM_UMASK, NO_CLASS, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU, gfc_check_umask, NULL, gfc_resolve_umask, diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h index b675de25091..de33a4f7dc2 100644 --- a/gcc/fortran/intrinsic.h +++ b/gcc/fortran/intrinsic.h @@ -91,6 +91,7 @@ gfc_try gfc_check_ishftc (gfc_expr *, gfc_expr *, gfc_expr *); gfc_try gfc_check_kill (gfc_expr *, gfc_expr *); gfc_try gfc_check_kind (gfc_expr *); gfc_try gfc_check_lbound (gfc_expr *, gfc_expr *, gfc_expr *); +gfc_try gfc_check_lcobound (gfc_expr *, gfc_expr *, gfc_expr *); gfc_try gfc_check_len_lentrim (gfc_expr *, gfc_expr *); gfc_try gfc_check_link (gfc_expr *, gfc_expr *); gfc_try gfc_check_lge_lgt_lle_llt (gfc_expr *, gfc_expr *); @@ -143,6 +144,7 @@ gfc_try gfc_check_transpose (gfc_expr *); gfc_try gfc_check_trim (gfc_expr *); gfc_try gfc_check_ttynam (gfc_expr *); gfc_try gfc_check_ubound (gfc_expr *, gfc_expr *, gfc_expr *); +gfc_try gfc_check_ucobound (gfc_expr *, gfc_expr *, gfc_expr *); gfc_try gfc_check_umask (gfc_expr *); gfc_try gfc_check_unlink (gfc_expr *); gfc_try gfc_check_unpack (gfc_expr *, gfc_expr *, gfc_expr *); @@ -178,6 +180,7 @@ gfc_try gfc_check_fseek_sub (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); gfc_try gfc_check_ftell_sub (gfc_expr *, gfc_expr *); gfc_try gfc_check_getcwd_sub (gfc_expr *, gfc_expr *); gfc_try gfc_check_hostnm_sub (gfc_expr *, gfc_expr *); +gfc_try gfc_check_image_index (gfc_expr *, gfc_expr *); gfc_try gfc_check_itime_idate (gfc_expr *); gfc_try gfc_check_kill_sub (gfc_expr *, gfc_expr *, gfc_expr *); gfc_try gfc_check_ltime_gmtime (gfc_expr *, gfc_expr *); @@ -189,6 +192,7 @@ gfc_try gfc_check_signal_sub (gfc_expr *, gfc_expr *, gfc_expr *); gfc_try gfc_check_sleep_sub (gfc_expr *); gfc_try gfc_check_stat_sub (gfc_expr *, gfc_expr *, gfc_expr *); gfc_try gfc_check_system_sub (gfc_expr *, gfc_expr *); +gfc_try gfc_check_this_image (gfc_expr *, gfc_expr *); gfc_try gfc_check_ttynam_sub (gfc_expr *, gfc_expr *); gfc_try gfc_check_umask_sub (gfc_expr *, gfc_expr *); gfc_try gfc_check_unlink_sub (gfc_expr *, gfc_expr *); @@ -255,6 +259,7 @@ gfc_expr *gfc_simplify_ibits (gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_ibset (gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_ichar (gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_ieor (gfc_expr *, gfc_expr *); +gfc_expr *gfc_simplify_image_index (gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_index (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_int (gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_int2 (gfc_expr *); @@ -270,6 +275,7 @@ gfc_expr *gfc_simplify_ishft (gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_ishftc (gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_kind (gfc_expr *); gfc_expr *gfc_simplify_lbound (gfc_expr *, gfc_expr *, gfc_expr *); +gfc_expr *gfc_simplify_lcobound (gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_leadz (gfc_expr *); gfc_expr *gfc_simplify_len (gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_len_trim (gfc_expr *, gfc_expr *); @@ -330,12 +336,14 @@ gfc_expr *gfc_simplify_sqrt (gfc_expr *); gfc_expr *gfc_simplify_sum (gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_tan (gfc_expr *); gfc_expr *gfc_simplify_tanh (gfc_expr *); +gfc_expr *gfc_simplify_this_image (gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_tiny (gfc_expr *); gfc_expr *gfc_simplify_trailz (gfc_expr *); gfc_expr *gfc_simplify_transfer (gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_transpose (gfc_expr *); gfc_expr *gfc_simplify_trim (gfc_expr *); gfc_expr *gfc_simplify_ubound (gfc_expr *, gfc_expr *, gfc_expr *); +gfc_expr *gfc_simplify_ucobound (gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_unpack (gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_verify (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); gfc_expr *gfc_simplify_xor (gfc_expr *, gfc_expr *); diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 4439464c401..d8456e827e9 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -154,6 +154,7 @@ Some basic guidelines for editing this document: * @code{INT8}: INT8, Convert to 64-bit integer type * @code{IOR}: IOR, Bitwise logical or * @code{IRAND}: IRAND, Integer pseudo-random number +* @code{IMAGE_INDEX}: IMAGE_INDEX, Cosubscript to image index convertion * @code{IS_IOSTAT_END}: IS_IOSTAT_END, Test for end-of-file value * @code{IS_IOSTAT_EOR}: IS_IOSTAT_EOR, Test for end-of-record value * @code{ISATTY}: ISATTY, Whether a unit is a terminal device @@ -164,6 +165,7 @@ Some basic guidelines for editing this document: * @code{KILL}: KILL, Send a signal to a process * @code{KIND}: KIND, Kind of an entity * @code{LBOUND}: LBOUND, Lower dimension bounds of an array +* @code{LCOBOUND}: LCOBOUND, Lower codimension bounds of an array * @code{LEADZ}: LEADZ, Number of leading zero bits of an integer * @code{LEN}: LEN, Length of a character entity * @code{LEN_TRIM}: LEN_TRIM, Length of a character entity without trailing blank characters @@ -251,6 +253,7 @@ Some basic guidelines for editing this document: * @code{SYSTEM_CLOCK}: SYSTEM_CLOCK, Time function * @code{TAN}: TAN, Tangent function * @code{TANH}: TANH, Hyperbolic tangent function +* @code{THIS_IMAGE}: THIS_IMAGE, Cosubscript index of this image * @code{TIME}: TIME, Time function * @code{TIME8}: TIME8, Time function (64-bit) * @code{TINY}: TINY, Smallest positive number of a real kind @@ -260,6 +263,7 @@ Some basic guidelines for editing this document: * @code{TRIM}: TRIM, Remove trailing blank characters of a string * @code{TTYNAM}: TTYNAM, Get the name of a terminal device. * @code{UBOUND}: UBOUND, Upper dimension bounds of an array +* @code{UCOBOUND}: UCOBOUND, Upper codimension bounds of an array * @code{UMASK}: UMASK, Set the file creation mask * @code{UNLINK}: UNLINK, Remove a file from the file system * @code{UNPACK}: UNPACK, Unpack an array of rank one into an array @@ -400,11 +404,12 @@ end program test_abs @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard -@item @code{CABS(A)} @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)} @tab Fortran 77 and later -@item @code{DABS(A)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later -@item @code{IABS(A)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab Fortran 77 and later -@item @code{ZABS(A)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension -@item @code{CDABS(A)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension +@item @code{ABS(A)} @tab @code{REAL(4) A} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{CABS(A)} @tab @code{COMPLEX(4) A} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{DABS(A)} @tab @code{REAL(8) A} @tab @code{REAL(8)} @tab Fortran 77 and later +@item @code{IABS(A)} @tab @code{INTEGER(4) A} @tab @code{INTEGER(4)} @tab Fortran 77 and later +@item @code{ZABS(A)} @tab @code{COMPLEX(8) A} @tab @code{COMPLEX(8)} @tab GNU extension +@item @code{CDABS(A)} @tab @code{COMPLEX(8) A} @tab @code{COMPLEX(8)} @tab GNU extension @end multitable @end table @@ -561,8 +566,9 @@ end program test_acos @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{DACOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later +@item Name @tab Argument @tab Return type @tab Standard +@item @code{ACOS(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{DACOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @item @emph{See also}: @@ -761,10 +767,11 @@ end program test_aimag @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab GNU extension -@item @code{IMAG(Z)} @tab @code{COMPLEX Z} @tab @code{REAL} @tab GNU extension -@item @code{IMAGPART(Z)} @tab @code{COMPLEX Z} @tab @code{REAL} @tab GNU extension +@item Name @tab Argument @tab Return type @tab Standard +@item @code{AIMAG(Z)} @tab @code{COMPLEX Z} @tab @code{REAL} @tab GNU extension +@item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab GNU extension +@item @code{IMAG(Z)} @tab @code{COMPLEX Z} @tab @code{REAL} @tab GNU extension +@item @code{IMAGPART(Z)} @tab @code{COMPLEX Z} @tab @code{REAL} @tab GNU extension @end multitable @end table @@ -821,7 +828,8 @@ end program test_aint @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard -@item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later +@item @code{AINT(A)} @tab @code{REAL(4) A} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{DINT(A)} @tab @code{REAL(8) A} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @end table @@ -952,26 +960,29 @@ end program test_all @table @asis @item @emph{Description}: -@code{ALLOCATED(ARRAY)} checks the status of whether @var{X} is allocated. +@code{ALLOCATED(ARRAY)} and @code{ALLOCATED(SCALAR)} check the allocation +status of @var{ARRAY} and @var{SCALAR}, respectively. @item @emph{Standard}: -Fortran 95 and later +Fortran 95 and later. Note, the @code{SCALAR=} keyword and allocatable +scalar entities are available in Fortran 2003 and later. @item @emph{Class}: Inquiry function @item @emph{Syntax}: -@code{RESULT = ALLOCATED(ARRAY)} +@code{RESULT = ALLOCATED(ARRAY)} or @code{RESULT = ALLOCATED(SCALAR)} @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{ARRAY} @tab The argument shall be an @code{ALLOCATABLE} array. +@item @var{SCALAR} @tab The argument shall be an @code{ALLOCATABLE} scalar. @end multitable @item @emph{Return value}: The return value is a scalar @code{LOGICAL} with the default logical -kind type parameter. If @var{ARRAY} is allocated, @code{ALLOCATED(ARRAY)} -is @code{.TRUE.}; otherwise, it returns @code{.FALSE.} +kind type parameter. If the argument is allocated, then the result is +@code{.TRUE.}; otherwise, it returns @code{.FALSE.} @item @emph{Example}: @smallexample @@ -1088,6 +1099,7 @@ end program test_anint @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{AINT(A)} @tab @code{REAL(4) A} @tab @code{REAL(4)} @tab Fortran 77 and later @item @code{DNINT(A)} @tab @code{REAL(8) A} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @end table @@ -1203,6 +1215,7 @@ end program test_asin @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{ASIN(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 77 and later @item @code{DASIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @@ -1389,6 +1402,7 @@ end program test_atan @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{ATAN(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 77 and later @item @code{DATAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @@ -1448,8 +1462,9 @@ end program test_atan2 @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{DATAN2(X, Y)} @tab @code{REAL(8) X}, @code{REAL(8) Y} @tab @code{REAL(8)} @tab Fortran 77 and later +@item Name @tab Argument @tab Return type @tab Standard +@item @code{ATAN2(X, Y)} @tab @code{REAL(4) X, Y} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{DATAN2(X, Y)} @tab @code{REAL(8) X, Y} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @end table @@ -1599,8 +1614,8 @@ end program test_besj1 @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{DBESJ1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension +@item Name @tab Argument @tab Return type @tab Standard +@item @code{DBESJ1(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension @end multitable @end table @@ -1800,7 +1815,7 @@ end program test_besyn @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard @item @code{DBESYN(N,X)} @tab @code{INTEGER N} @tab @code{REAL(8)} @tab GNU extension -@item @tab @code{REAL(8) X} @tab @tab +@item @tab @code{REAL(8) X} @tab @tab @end multitable @end table @@ -2288,6 +2303,12 @@ program test_char end program test_char @end smallexample +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{CHAR(I)} @tab @code{INTEGER I} @tab @code{CHARACTER(LEN=1)} @tab F77 and later +@end multitable + @item @emph{Note}: See @ref{ICHAR} for a discussion of converting between numerical values and formatted string representations. @@ -2611,8 +2632,9 @@ end program test_conjg @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension +@item Name @tab Argument @tab Return type @tab Standard +@item @code{CONJG(Z)} @tab @code{COMPLEX Z} @tab @code{COMPLEX} @tab GNU extension +@item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension @end multitable @end table @@ -2663,6 +2685,7 @@ end program test_cos @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{COS(X)} n@tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 77 and later @item @code{DCOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later @item @code{CCOS(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab Fortran 77 and later @item @code{ZCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension @@ -2719,6 +2742,7 @@ end program test_cosh @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{COSH(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 77 and later @item @code{DCOSH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @@ -3260,9 +3284,10 @@ end program test_dim @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab Fortran 77 and later -@item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y} @tab @code{REAL(8)} @tab Fortran 77 and later +@item Name @tab Argument @tab Return type @tab Standard +@item @code{DIM(X,Y)} @tab @code{REAL(4) X, Y} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X, Y} @tab @code{INTEGER(4)} @tab Fortran 77 and later +@item @code{DDIM(X,Y)} @tab @code{REAL(8) X, Y} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @end table @@ -3359,8 +3384,14 @@ program test_dprod print *, d end program test_dprod @end smallexample -@end table +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{DPROD(X,Y)} @tab @code{REAL(4) X, Y} @tab @code{REAL(4)} @tab Fortran 77 and later +@end multitable + +@end table @node DREAL @@ -3888,6 +3919,7 @@ end program test_exp @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{EXP(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 77 and later @item @code{DEXP(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later @item @code{CEXP(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab Fortran 77 and later @item @code{ZEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension @@ -5697,6 +5729,12 @@ program test_ichar end program test_ichar @end smallexample +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{ICHAR(C)} @tab @code{CHARACTER C} @tab @code{INTEGER(4)} @tab Fortran 77 and later +@end multitable + @item @emph{Note}: No intrinsic exists to convert between a numeric value and a formatted character string representation -- for instance, given the @@ -5882,6 +5920,12 @@ expression indicating the kind parameter of the result. The return value is of type @code{INTEGER} and of kind @var{KIND}. If @var{KIND} is absent, the return value is of default integer kind. +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{INDEX(STRING, SUBSTRING)} @tab @code{CHARACTER} @tab @code{INTEGER(4)} @tab Fortran 77 and later +@end multitable + @item @emph{See also}: @ref{SCAN}, @ref{VERIFY} @end table @@ -5943,15 +5987,15 @@ end program @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{IFIX(A)} @tab @code{REAL(4) A} @tab @code{INTEGER} @tab Fortran 77 and later -@item @code{IDINT(A)} @tab @code{REAL(8) A} @tab @code{INTEGER} @tab Fortran 77 and later +@item Name @tab Argument @tab Return type @tab Standard +@item @code{INT(A)} @tab @code{REAL(4) A} @tab @code{INTEGER} @tab Fortran 77 and later +@item @code{IFIX(A)} @tab @code{REAL(4) A} @tab @code{INTEGER} @tab Fortran 77 and later +@item @code{IDINT(A)} @tab @code{REAL(8) A} @tab @code{INTEGER} @tab Fortran 77 and later @end multitable @end table - @node INT2 @section @code{INT2} --- Convert to 16-bit integer type @fnindex INT2 @@ -6115,6 +6159,50 @@ end program test_irand +@node IMAGE_INDEX +@section @code{IMAGE_INDEX} --- Function that converts a cosubscript to an image index +@fnindex IMAGE_INDEX +@cindex coarray, IMAGE_INDEX +@cindex images, cosubscript to image index conversion + +@table @asis +@item @emph{Description}: +Returns the image index belonging to a cosubscript. + +@item @emph{Standard}: +Fortran 2008 and later + +@item @emph{Class}: +Inquiry function. + +@item @emph{Syntax}: +@code{RESULT = IMAGE_INDEX(COARRAY, SUB)} + +@item @emph{Arguments}: None. +@multitable @columnfractions .15 .70 +@item @var{COARRAY} @tab Coarray of any type. +@item @var{SUB} @tab default integer rank-1 array of a size equal to +the corank of @var{COARRAY}. +@end multitable + + +@item @emph{Return value}: +Scalar default integer with the value of the image index which corresponds +to the cosubscripts. For invalid cosubscripts the result is zero. + +@item @emph{Example}: +@smallexample +INTEGER :: array[2,-1:4,8,*] +! Writes 28 (or 0 if there are fewer than 28 images) +WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1]) +@end smallexample + +@item @emph{See also}: +@ref{THIS_IMAGE}, @ref{NUM_IMAGES} +@end table + + + @node IS_IOSTAT_END @section @code{IS_IOSTAT_END} --- Test for end-of-file value @fnindex IS_IOSTAT_END @@ -6535,7 +6623,46 @@ structure component, or if it has a zero extent along the relevant dimension, the lower bound is taken to be 1. @item @emph{See also}: -@ref{UBOUND} +@ref{UBOUND}, @ref{LCOBOUND} +@end table + + + +@node LCOBOUND +@section @code{LCOBOUND} --- Lower codimension bounds of an array +@fnindex LCOBOUND +@cindex coarray, lower bound + +@table @asis +@item @emph{Description}: +Returns the lower bounds of a coarray, or a single lower cobound +along the @var{DIM} codimension. +@item @emph{Standard}: +Fortran 2008 and later + +@item @emph{Class}: +Inquiry function + +@item @emph{Syntax}: +@code{RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{ARRAY} @tab Shall be an coarray, of any type. +@item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}. +@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization +expression indicating the kind parameter of the result. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{INTEGER} and of kind @var{KIND}. If +@var{KIND} is absent, the return value is of default integer kind. +If @var{DIM} is absent, the result is an array of the lower cobounds of +@var{COARRAY}. If @var{DIM} is present, the result is a scalar +corresponding to the lower cobound of the array along that codimension. + +@item @emph{See also}: +@ref{UCOBOUND}, @ref{LBOUND} @end table @@ -6613,6 +6740,14 @@ expression indicating the kind parameter of the result. The return value is of type @code{INTEGER} and of kind @var{KIND}. If @var{KIND} is absent, the return value is of default integer kind. + +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{LEN(STRING)} @tab @code{CHARACTER} @tab @code{INTEGER} @tab Fortran 77 and later +@end multitable + + @item @emph{See also}: @ref{LEN_TRIM}, @ref{ADJUSTL}, @ref{ADJUSTR} @end table @@ -6695,6 +6830,12 @@ Elemental function Returns @code{.TRUE.} if @code{STRING_A >= STRING_B}, and @code{.FALSE.} otherwise, based on the ASCII ordering. +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{LGE(STRING_A, STRING_B)} @tab @code{CHARACTER} @tab @code{LOGICAL} @tab Fortran 77 and later +@end multitable + @item @emph{See also}: @ref{LGT}, @ref{LLE}, @ref{LLT} @end table @@ -6741,6 +6882,12 @@ Elemental function Returns @code{.TRUE.} if @code{STRING_A > STRING_B}, and @code{.FALSE.} otherwise, based on the ASCII ordering. +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{LGT(STRING_A, STRING_B)} @tab @code{CHARACTER} @tab @code{LOGICAL} @tab Fortran 77 and later +@end multitable + @item @emph{See also}: @ref{LGE}, @ref{LLE}, @ref{LLT} @end table @@ -6830,6 +6977,12 @@ Elemental function Returns @code{.TRUE.} if @code{STRING_A <= STRING_B}, and @code{.FALSE.} otherwise, based on the ASCII ordering. +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{LLE(STRING_A, STRING_B)} @tab @code{CHARACTER} @tab @code{LOGICAL} @tab Fortran 77 and later +@end multitable + @item @emph{See also}: @ref{LGE}, @ref{LGT}, @ref{LLT} @end table @@ -6876,6 +7029,12 @@ Elemental function Returns @code{.TRUE.} if @code{STRING_A < STRING_B}, and @code{.FALSE.} otherwise, based on the ASCII ordering. +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{LLT(STRING_A, STRING_B)} @tab @code{CHARACTER} @tab @code{LOGICAL} @tab Fortran 77 and later +@end multitable + @item @emph{See also}: @ref{LGE}, @ref{LGT}, @ref{LLE} @end table @@ -7469,12 +7628,12 @@ and has the same type and kind as the first argument. @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{MAX0(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab Fortran 77 and later -@item @code{AMAX0(I)} @tab @code{INTEGER(4) I} @tab @code{REAL(MAX(X))} @tab Fortran 77 and later -@item @code{MAX1(X)} @tab @code{REAL X} @tab @code{INT(MAX(X))} @tab Fortran 77 and later -@item @code{AMAX1(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 77 and later -@item @code{DMAX1(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later +@item Name @tab Argument @tab Return type @tab Standard +@item @code{MAX0(A1)} @tab @code{INTEGER(4) A1} @tab @code{INTEGER(4)} @tab Fortran 77 and later +@item @code{AMAX0(A1)} @tab @code{INTEGER(4) A1} @tab @code{REAL(MAX(X))} @tab Fortran 77 and later +@item @code{MAX1(A1)} @tab @code{REAL A1} @tab @code{INT(MAX(X))} @tab Fortran 77 and later +@item @code{AMAX1(A1)} @tab @code{REAL(4) A1} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{DMAX1(A1)} @tab @code{REAL(8) A1} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @item @emph{See also}: @@ -7789,12 +7948,12 @@ and has the same type and kind as the first argument. @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{MIN0(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab Fortran 77 and later -@item @code{AMIN0(I)} @tab @code{INTEGER(4) I} @tab @code{REAL(MIN(X))} @tab Fortran 77 and later -@item @code{MIN1(X)} @tab @code{REAL X} @tab @code{INT(MIN(X))} @tab Fortran 77 and later -@item @code{AMIN1(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 77 and later -@item @code{DMIN1(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 77 and later +@item Name @tab Argument @tab Return type @tab Standard +@item @code{MIN0(A1)} @tab @code{INTEGER(4) A1} @tab @code{INTEGER(4)} @tab Fortran 77 and later +@item @code{AMIN0(A1)} @tab @code{INTEGER(4) A1} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{MIN1(A1)} @tab @code{REAL A1} @tab @code{INTEGER(4)} @tab Fortran 77 and later +@item @code{AMIN1(A1)} @tab @code{REAL(4) A1} @tab @code{REAL(4)} @tab Fortran 77 and later +@item @code{DMIN1(A1)} @tab @code{REAL(8) A1} @tab @code{REAL(8)} @tab Fortran 77 and later @end multitable @item @emph{See also}: @@ -8004,9 +8163,10 @@ end program test_mod @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Arguments @tab Return type @tab Standard -@item @code{AMOD(A,P)} @tab @code{REAL(4)} @tab @code{REAL(4)} @tab Fortran 95 and later -@item @code{DMOD(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab Fortran 95 and later +@item Name @tab Arguments @tab Return type @tab Standard +@item @code{MOD(A,P)} @tab @code{INTEGER A,P} @tab @code{INTEGER} @tab Fortran 95 and later +@item @code{AMOD(A,P)} @tab @code{REAL(4) A,P} @tab @code{REAL(4)} @tab Fortran 95 and later +@item @code{DMOD(A,P)} @tab @code{REAL(8) A,P} @tab @code{REAL(8)} @tab Fortran 95 and later @end multitable @end table @@ -8283,9 +8443,10 @@ end program test_nint @end smallexample @item @emph{Specific names}: -@multitable @columnfractions .25 .25 .25 -@item Name @tab Argument @tab Standard -@item @code{IDNINT(X)} @tab @code{REAL(8)} @tab Fortran 95 and later +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return Type @tab Standard +@item @code{NINT(A)} @tab @code{REAL(4) A} @tab @code{INTEGER} @tab Fortran 95 and later +@item @code{IDNINT(A)} @tab @code{REAL(8) A} @tab @code{INTEGER} @tab Fortran 95 and later @end multitable @item @emph{See also}: @@ -8414,7 +8575,7 @@ END IF @end smallexample @item @emph{See also}: -@c FIXME: ref{THIS_IMAGE} +@ref{THIS_IMAGE}, @ref{IMAGE_INDEX} @end table @@ -9047,6 +9208,13 @@ program test_real end program test_real @end smallexample +@item @emph{Specific names}: +@multitable @columnfractions .20 .20 .20 .25 +@item Name @tab Argument @tab Return type @tab Standard +@item @code{REAL(A)} @tab @code{INTEGER(4)} @tab @code{REAL(4)} @tab Fortran 77 and later +@end multitable + + @item @emph{See also}: @ref{DBLE}, @ref{DFLOAT}, @ref{FLOAT} @@ -9744,9 +9912,10 @@ end program test_sign @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Arguments @tab Return type @tab Standard -@item @code{ISIGN(A,P)} @tab @code{INTEGER(4)} @tab @code{INTEGER(4)} @tab f95, gnu -@item @code{DSIGN(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab f95, gnu +@item Name @tab Arguments @tab Return type @tab Standard +@item @code{SIGN(A,B)} @tab @code{REAL(4) A, B} @tab @code{REAL(4)} @tab f77, gnu +@item @code{ISIGN(A,B)} @tab @code{INTEGER(4) A, B} @tab @code{INTEGER(4)} @tab f77, gnu +@item @code{DSIGN(A,B)} @tab @code{REAL(8) A, B} @tab @code{REAL(8)} @tab f77, gnu @end multitable @end table @@ -9852,11 +10021,12 @@ end program test_sin @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{DSIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu -@item @code{CSIN(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu -@item @code{ZSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu -@item @code{CDSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@item Name @tab Argument @tab Return type @tab Standard +@item @code{SIN(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f77, gnu +@item @code{DSIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@item @code{CSIN(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu +@item @code{ZSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@item @code{CDSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu @end multitable @item @emph{See also}: @@ -9905,6 +10075,7 @@ end program test_sinh @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{SINH(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 95 and later @item @code{DSINH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 95 and later @end multitable @@ -10218,6 +10389,7 @@ end program test_sqrt @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{SQRT(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 95 and later @item @code{DSQRT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 95 and later @item @code{CSQRT(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab Fortran 95 and later @item @code{ZSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension @@ -10592,8 +10764,9 @@ end program test_tan @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 -@item Name @tab Argument @tab Return type @tab Standard -@item @code{DTAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 95 and later +@item Name @tab Argument @tab Return type @tab Standard +@item @code{TAN(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 95 and later +@item @code{DTAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 95 and later @end multitable @item @emph{See also}: @@ -10645,6 +10818,7 @@ end program test_tanh @item @emph{Specific names}: @multitable @columnfractions .20 .20 .20 .25 @item Name @tab Argument @tab Return type @tab Standard +@item @code{TANH(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab Fortran 95 and later @item @code{DTANH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab Fortran 95 and later @end multitable @@ -10654,6 +10828,64 @@ end program test_tanh +@node THIS_IMAGE +@section @code{THIS_IMAGE} --- Function that returns the cosubscript index of this image +@fnindex THIS_IMAGE +@cindex coarray, THIS_IMAGE +@cindex images, index of this image + +@table @asis +@item @emph{Description}: +Returns the cosubscript for this image. + +@item @emph{Standard}: +Fortran 2008 and later + +@item @emph{Class}: +Transformational function + +@item @emph{Syntax}: +@multitable @columnfractions .80 +@item @code{RESULT = THIS_IMAGE()} +@item @code{RESULT = THIS_IMAGE(COARRAY [, DIM])} +@end multitable + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{COARRAY} @tab Coarray of any type (optional; if @var{DIM} +present, required). +@item @var{DIM} @tab default integer scalar (optional). If present, +@var{DIM} shall be between one and the corank of @var{COARRAY}. +@end multitable + + +@item @emph{Return value}: +Default integer. If @var{COARRAY} is not present, it is scalar and its value +is the index of the invoking image. Otherwise, if @var{DIM} is not present, +a rank-1 array with corank elements is returned, containing the cosubscripts +for @var{COARRAY} specifying the invoking image. If @var{DIM} is present, +a scalar is returned, with the value of the @var{DIM} element of +@code{THIS_IMAGE(COARRAY)}. + +@item @emph{Example}: +@smallexample +INTEGER :: value[*] +INTEGER :: i +value = THIS_IMAGE() +SYNC ALL +IF (THIS_IMAGE() == 1) THEN + DO i = 1, NUM_IMAGES() + WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i] + END DO +END IF +@end smallexample + +@item @emph{See also}: +@ref{NUM_IMAGES}, @ref{IMAGE_INDEX} +@end table + + + @node TIME @section @code{TIME} --- Time function @fnindex TIME @@ -11030,7 +11262,46 @@ dimension, the upper bound is taken to be the number of elements along the relevant dimension. @item @emph{See also}: -@ref{LBOUND} +@ref{LBOUND}, @ref{LCOBOUND} +@end table + + + +@node UCOBOUND +@section @code{UCOBOUND} --- Upper codimension bounds of an array +@fnindex UCOBOUND +@cindex coarray, upper bound + +@table @asis +@item @emph{Description}: +Returns the upper cobounds of a coarray, or a single upper cobound +along the @var{DIM} codimension. +@item @emph{Standard}: +Fortran 2008 and later + +@item @emph{Class}: +Inquiry function + +@item @emph{Syntax}: +@code{RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{ARRAY} @tab Shall be an coarray, of any type. +@item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}. +@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization +expression indicating the kind parameter of the result. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{INTEGER} and of kind @var{KIND}. If +@var{KIND} is absent, the return value is of default integer kind. +If @var{DIM} is absent, the result is an array of the lower cobounds of +@var{COARRAY}. If @var{DIM} is present, the result is a scalar +corresponding to the lower cobound of the array along that codimension. + +@item @emph{See also}: +@ref{LCOBOUND}, @ref{LBOUND} @end table diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 1ce26df570d..6766f3d8a23 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -1,5 +1,6 @@ /* Deal with I/O statements & related stuff. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010 Free Software Foundation, Inc. Contributed by Andy Vaught @@ -1229,14 +1230,9 @@ gfc_match_format (void) new_st.loc = start; new_st.op = EXEC_NOP; - e = gfc_get_expr(); - e->expr_type = EXPR_CONSTANT; - e->ts.type = BT_CHARACTER; - e->ts.kind = gfc_default_character_kind; - e->where = start; - e->value.character.string = format_string - = gfc_get_wide_string (format_length + 1); - e->value.character.length = format_length; + e = gfc_get_character_expr (gfc_default_character_kind, &start, + NULL, format_length); + format_string = e->value.character.string; gfc_statement_label->format = e; mode = MODE_COPY; @@ -2439,7 +2435,7 @@ default_unit (io_kind k) else unit = 6; - return gfc_int_expr (unit); + return gfc_get_int_expr (gfc_default_integer_kind, NULL, unit); } @@ -3655,17 +3651,8 @@ get_io_list: that might have a format expression without unit number. */ if (!comma_flag && gfc_match_char (',') == MATCH_YES) { - dt->extra_comma = gfc_get_expr (); - - /* Set the types to something compatible with iokind. This is needed to - get through gfc_free_expr later since iokind really has no Basic Type, - BT, of its own. */ - dt->extra_comma->expr_type = EXPR_CONSTANT; - dt->extra_comma->ts.type = BT_LOGICAL; - /* Save the iokind and locus for later use in resolution. */ - dt->extra_comma->value.iokind = k; - dt->extra_comma->where = gfc_current_locus; + dt->extra_comma = gfc_get_iokind_expr (&gfc_current_locus, k); } io_code = NULL; diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index a2ed88ca748..0b75604cf2c 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "gfortran.h" #include "intrinsic.h" +#include "constructor.h" /* Given printf-like arguments, return a stable version of the result string. @@ -68,12 +69,18 @@ check_charlen_present (gfc_expr *source) if (source->expr_type == EXPR_CONSTANT) { - source->ts.u.cl->length = gfc_int_expr (source->value.character.length); + source->ts.u.cl->length + = gfc_get_int_expr (gfc_default_integer_kind, NULL, + source->value.character.length); source->rank = 0; } else if (source->expr_type == EXPR_ARRAY) - source->ts.u.cl->length = - gfc_int_expr (source->value.constructor->expr->value.character.length); + { + gfc_constructor *c = gfc_constructor_first (source->value.constructor); + source->ts.u.cl->length + = gfc_get_int_expr (gfc_default_integer_kind, NULL, + c->expr->value.character.length); + } } /* Helper function for resolving the "mask" argument. */ @@ -163,7 +170,7 @@ gfc_resolve_char_achar (gfc_expr *f, gfc_expr *x, gfc_expr *kind, f->ts.kind = (kind == NULL) ? gfc_default_character_kind : mpz_get_si (kind->value.integer); f->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); - f->ts.u.cl->length = gfc_int_expr (1); + f->ts.u.cl->length = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); f->value.function.name = gfc_get_string (name, f->ts.kind, gfc_type_letter (x->ts.type), @@ -488,7 +495,8 @@ gfc_resolve_cmplx (gfc_expr *f, gfc_expr *x, gfc_expr *y, gfc_expr *kind) void gfc_resolve_dcmplx (gfc_expr *f, gfc_expr *x, gfc_expr *y) { - gfc_resolve_cmplx (f, x, y, gfc_int_expr (gfc_default_double_kind)); + gfc_resolve_cmplx (f, x, y, gfc_get_int_expr (gfc_default_integer_kind, NULL, + gfc_default_double_kind)); } @@ -1968,11 +1976,11 @@ gfc_resolve_reshape (gfc_expr *f, gfc_expr *source, gfc_expr *shape, { gfc_constructor *c; f->shape = gfc_get_shape (f->rank); - c = shape->value.constructor; + c = gfc_constructor_first (shape->value.constructor); for (i = 0; i < f->rank; i++) { mpz_init_set (f->shape[i], c->expr->value.integer); - c = c->next; + c = gfc_constructor_next (c); } } @@ -2398,11 +2406,17 @@ gfc_resolve_transfer (gfc_expr *f, gfc_expr *source ATTRIBUTE_UNUSED, { int len; if (mold->expr_type == EXPR_CONSTANT) - mold->ts.u.cl->length = gfc_int_expr (mold->value.character.length); + { + len = mold->value.character.length; + mold->ts.u.cl->length = gfc_get_int_expr (gfc_default_integer_kind, + NULL, len); + } else { - len = mold->value.constructor->expr->value.character.length; - mold->ts.u.cl->length = gfc_int_expr (len); + gfc_constructor *c = gfc_constructor_first (mold->value.constructor); + len = c->expr->value.character.length; + mold->ts.u.cl->length = gfc_get_int_expr (gfc_default_integer_kind, + NULL, len); } } diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 2709de7236c..44e9f9d8a19 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -1,5 +1,6 @@ /* Matching subroutines in all sizes, shapes and colors. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010 2010 Free Software Foundation, Inc. Contributed by Andy Vaught @@ -1005,7 +1006,7 @@ gfc_match_iterator (gfc_iterator *iter, int init_flag) if (gfc_match_char (',') != MATCH_YES) { - e3 = gfc_int_expr (1); + e3 = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); goto done; } @@ -1752,7 +1753,7 @@ gfc_match_critical (void) if (gfc_option.coarray == GFC_FCOARRAY_NONE) { - gfc_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); return MATCH_ERROR; } @@ -1826,7 +1827,7 @@ gfc_match_do (void) if (gfc_match_eos () == MATCH_YES) { - iter.end = gfc_logical_expr (1, NULL); + iter.end = gfc_get_logical_expr (gfc_default_logical_kind, NULL, true); new_st.op = EXEC_DO_WHILE; goto done; } @@ -2153,7 +2154,7 @@ sync_statement (gfc_statement st) if (gfc_option.coarray == GFC_FCOARRAY_NONE) { - gfc_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); return MATCH_ERROR; } @@ -2464,7 +2465,8 @@ gfc_match_goto (void) } cp = gfc_get_case (); - cp->low = cp->high = gfc_int_expr (i++); + cp->low = cp->high = gfc_get_int_expr (gfc_default_integer_kind, + NULL, i++); tail->op = EXEC_SELECT; tail->ext.case_list = cp; @@ -2944,10 +2946,7 @@ gfc_match_nullify (void) } /* build ' => NULL() '. */ - e = gfc_get_expr (); - e->where = gfc_current_locus; - e->expr_type = EXPR_NULL; - e->ts.type = BT_UNKNOWN; + e = gfc_get_null_expr (&gfc_current_locus); /* Chain to list. */ if (tail == NULL) @@ -3355,7 +3354,8 @@ gfc_match_call (void) c->op = EXEC_SELECT; new_case = gfc_get_case (); - new_case->high = new_case->low = gfc_int_expr (i); + new_case->high = gfc_get_int_expr (gfc_default_integer_kind, NULL, i); + new_case->low = new_case->high; c->ext.case_list = new_case; c->next = gfc_get_code (); @@ -4786,7 +4786,7 @@ match_forall_iterator (gfc_forall_iterator **result) goto cleanup; if (gfc_match_char (':') == MATCH_NO) - iter->stride = gfc_int_expr (1); + iter->stride = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); else { m = gfc_match_expr (&iter->stride); diff --git a/gcc/fortran/matchexp.c b/gcc/fortran/matchexp.c index f66623f82d0..8b99ce98692 100644 --- a/gcc/fortran/matchexp.c +++ b/gcc/fortran/matchexp.c @@ -1,5 +1,5 @@ /* Expression parser. - Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Andy Vaught @@ -130,14 +130,10 @@ gfc_get_parentheses (gfc_expr *e) { gfc_expr *e2; - e2 = gfc_get_expr(); - e2->expr_type = EXPR_OP; + e2 = gfc_get_operator_expr (&e->where, INTRINSIC_PARENTHESES, e, NULL); e2->ts = e->ts; e2->rank = e->rank; - e2->where = e->where; - e2->value.op.op = INTRINSIC_PARENTHESES; - e2->value.op.op1 = e; - e2->value.op.op2 = NULL; + return e2; } @@ -195,26 +191,6 @@ syntax: } -/* Build an operator expression node. */ - -static gfc_expr * -build_node (gfc_intrinsic_op op, locus *where, - gfc_expr *op1, gfc_expr *op2) -{ - gfc_expr *new_expr; - - new_expr = gfc_get_expr (); - new_expr->expr_type = EXPR_OP; - new_expr->value.op.op = op; - new_expr->where = *where; - - new_expr->value.op.op1 = op1; - new_expr->value.op.op2 = op2; - - return new_expr; -} - - /* Match a level 1 expression. */ static match @@ -239,7 +215,7 @@ match_level_1 (gfc_expr **result) *result = e; else { - f = build_node (INTRINSIC_USER, &where, e, NULL); + f = gfc_get_operator_expr (&where, INTRINSIC_USER, e, NULL); f->value.op.uop = uop; *result = f; } @@ -915,7 +891,7 @@ gfc_match_expr (gfc_expr **result) return MATCH_ERROR; } - all = build_node (INTRINSIC_USER, &where, all, e); + all = gfc_get_operator_expr (&where, INTRINSIC_USER, all, e); all->value.op.uop = uop; } diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index ac572c8ccc6..c58a67c3d58 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -73,6 +73,7 @@ along with GCC; see the file COPYING3. If not see #include "match.h" #include "parse.h" /* FIXME */ #include "md5.h" +#include "constructor.h" #define MODULE_EXTENSION ".mod" @@ -2628,15 +2629,15 @@ done: static void -mio_constructor (gfc_constructor **cp) +mio_constructor (gfc_constructor_base *cp) { - gfc_constructor *c, *tail; + gfc_constructor *c; mio_lparen (); if (iomode == IO_OUTPUT) { - for (c = *cp; c; c = c->next) + for (c = gfc_constructor_first (*cp); c; c = gfc_constructor_next (c)) { mio_lparen (); mio_expr (&c->expr); @@ -2646,19 +2647,9 @@ mio_constructor (gfc_constructor **cp) } else { - *cp = NULL; - tail = NULL; - while (peek_atom () != ATOM_RPAREN) { - c = gfc_get_constructor (); - - if (tail == NULL) - *cp = c; - else - tail->next = c; - - tail = c; + c = gfc_constructor_append_expr (cp, NULL, NULL); mio_lparen (); mio_expr (&c->expr); @@ -5343,7 +5334,7 @@ create_int_parameter (const char *name, int value, const char *modname, sym->attr.flavor = FL_PARAMETER; sym->ts.type = BT_INTEGER; sym->ts.kind = gfc_default_integer_kind; - sym->value = gfc_int_expr (value); + sym->value = gfc_get_int_expr (gfc_default_integer_kind, NULL, value); sym->attr.use_assoc = 1; sym->from_intmod = module; sym->intmod_sym_id = id; diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 34b687471bf..c8ca3d4cf8a 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1,5 +1,5 @@ /* Primary expression subroutines - Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Andy Vaught @@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see #include "match.h" #include "parse.h" #include "toplev.h" +#include "constructor.h" /* Matches a kind-parameter expression, which is either a named symbolic constant or a nonnegative integer constant. If @@ -276,8 +277,8 @@ match_hollerith_constant (gfc_expr **result) else { gfc_free_expr (e); - e = gfc_constant_result (BT_HOLLERITH, gfc_default_character_kind, - &gfc_current_locus); + e = gfc_get_constant_expr (BT_HOLLERITH, gfc_default_character_kind, + &gfc_current_locus); e->representation.string = XCNEWVEC (char, num + 1); @@ -711,7 +712,7 @@ match_substring (gfc_charlen *cl, int init, gfc_ref **result) ref->type = REF_SUBSTRING; if (start == NULL) - start = gfc_int_expr (1); + start = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); ref->u.ss.start = start; if (end == NULL && cl) end = gfc_copy_expr (cl->length); @@ -969,19 +970,10 @@ got_delim: if (peek == 'b' || peek == 'o' || peek =='z' || peek == 'x') goto no_match; - - e = gfc_get_expr (); - - e->expr_type = EXPR_CONSTANT; + e = gfc_get_character_expr (kind, &start_locus, NULL, length); e->ref = NULL; - e->ts.type = BT_CHARACTER; - e->ts.kind = kind; e->ts.is_c_interop = 0; e->ts.is_iso_c = 0; - e->where = start_locus; - - e->value.character.string = p = gfc_get_wide_string (length + 1); - e->value.character.length = length; gfc_current_locus = start_locus; gfc_next_char (); /* Skip delimiter */ @@ -991,6 +983,7 @@ got_delim: warn_ampersand = gfc_option.warn_ampersand; gfc_option.warn_ampersand = 0; + p = e->value.character.string; for (i = 0; i < length; i++) { c = next_string_char (delimiter, &ret); @@ -1084,15 +1077,9 @@ match_logical_constant (gfc_expr **result) return MATCH_ERROR; } - e = gfc_get_expr (); - - e->expr_type = EXPR_CONSTANT; - e->value.logical = i; - e->ts.type = BT_LOGICAL; - e->ts.kind = kind; + e = gfc_get_logical_expr (kind, &gfc_current_locus, i); e->ts.is_c_interop = 0; e->ts.is_iso_c = 0; - e->where = gfc_current_locus; *result = e; return MATCH_YES; @@ -2175,10 +2162,9 @@ gfc_free_structure_ctor_component (gfc_structure_ctor_component *comp) for components without explicit value given. */ static gfc_try build_actual_constructor (gfc_structure_ctor_component **comp_head, - gfc_constructor **ctor_head, gfc_symbol *sym) + gfc_constructor_base *ctor_head, gfc_symbol *sym) { gfc_structure_ctor_component *comp_iter; - gfc_constructor *ctor_tail = NULL; gfc_component *comp; for (comp = sym->components; comp; comp = comp->next) @@ -2199,11 +2185,10 @@ build_actual_constructor (gfc_structure_ctor_component **comp_head, a value expression for the parent derived type and calling self. */ if (!comp_iter && comp == sym->components && sym->attr.extension) { - value = gfc_get_expr (); - value->expr_type = EXPR_STRUCTURE; - value->value.constructor = NULL; + value = gfc_get_structure_constructor_expr (comp->ts.type, + comp->ts.kind, + &gfc_current_locus); value->ts = comp->ts; - value->where = gfc_current_locus; if (build_actual_constructor (comp_head, &value->value.constructor, comp->ts.u.derived) == FAILURE) @@ -2211,8 +2196,8 @@ build_actual_constructor (gfc_structure_ctor_component **comp_head, gfc_free_expr (value); return FAILURE; } - *ctor_head = ctor_tail = gfc_get_constructor (); - ctor_tail->expr = value; + + gfc_constructor_append_expr (ctor_head, value, NULL); continue; } @@ -2239,15 +2224,7 @@ build_actual_constructor (gfc_structure_ctor_component **comp_head, value = comp_iter->val; /* Add the value to the constructor chain built. */ - if (ctor_tail) - { - ctor_tail->next = gfc_get_constructor (); - ctor_tail = ctor_tail->next; - } - else - *ctor_head = ctor_tail = gfc_get_constructor (); - gcc_assert (value); - ctor_tail->expr = value; + gfc_constructor_append_expr (ctor_head, value, NULL); /* Remove the entry from the component list. We don't want the expression value to be free'd, so set it to NULL. */ @@ -2266,7 +2243,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result, bool parent) { gfc_structure_ctor_component *comp_tail, *comp_head, *comp_iter; - gfc_constructor *ctor_head, *ctor_tail; + gfc_constructor_base ctor_head = NULL; gfc_component *comp; /* Is set NULL when named component is first seen */ gfc_expr *e; locus where; @@ -2274,7 +2251,6 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result, const char* last_name = NULL; comp_tail = comp_head = NULL; - ctor_head = ctor_tail = NULL; if (!parent && gfc_match_char ('(') != MATCH_YES) goto syntax; @@ -2439,14 +2415,8 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result, else gcc_assert (!comp_head); - e = gfc_get_expr (); - - e->expr_type = EXPR_STRUCTURE; - - e->ts.type = BT_DERIVED; + e = gfc_get_structure_constructor_expr (BT_DERIVED, 0, &where); e->ts.u.derived = sym; - e->where = where; - e->value.constructor = ctor_head; *result = e; @@ -2462,7 +2432,7 @@ cleanup: gfc_free_structure_ctor_component (comp_iter); comp_iter = next; } - gfc_free_constructor (ctor_head); + gfc_constructor_free (ctor_head); return MATCH_ERROR; } diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 5e9b25c8a16..2831149c757 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "dependency.h" #include "data.h" #include "target-memory.h" /* for gfc_simplify_transfer */ +#include "constructor.h" /* Types used in equivalence statements. */ @@ -227,7 +228,8 @@ resolve_formal_arglist (gfc_symbol *proc) { sym->as->type = AS_ASSUMED_SHAPE; for (i = 0; i < sym->as->rank; i++) - sym->as->lower[i] = gfc_int_expr (1); + sym->as->lower[i] = gfc_get_int_expr (gfc_default_integer_kind, + NULL, 1); } if ((sym->as && sym->as->rank > 0 && sym->as->type == AS_ASSUMED_SHAPE) @@ -841,7 +843,7 @@ resolve_structure_cons (gfc_expr *expr) symbol_attribute a; t = SUCCESS; - cons = expr->value.constructor; + cons = gfc_constructor_first (expr->value.constructor); /* A constructor may have references if it is the result of substituting a parameter variable. In this case we just pull out the component we want. */ @@ -867,7 +869,7 @@ resolve_structure_cons (gfc_expr *expr) && cons->expr && cons->expr->expr_type == EXPR_NULL) return SUCCESS; - for (; comp; comp = comp->next, cons = cons->next) + for (; comp && cons; comp = comp->next, cons = gfc_constructor_next (cons)) { int rank; @@ -4309,7 +4311,7 @@ gfc_resolve_substring_charlen (gfc_expr *e) if (char_ref->u.ss.start) start = gfc_copy_expr (char_ref->u.ss.start); else - start = gfc_int_expr (1); + start = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); if (char_ref->u.ss.end) end = gfc_copy_expr (char_ref->u.ss.end); @@ -4323,7 +4325,9 @@ gfc_resolve_substring_charlen (gfc_expr *e) /* Length = (end - start +1). */ e->ts.u.cl->length = gfc_subtract (end, start); - e->ts.u.cl->length = gfc_add (e->ts.u.cl->length, gfc_int_expr (1)); + e->ts.u.cl->length = gfc_add (e->ts.u.cl->length, + gfc_get_int_expr (gfc_default_integer_kind, + NULL, 1)); e->ts.u.cl->length->ts.type = BT_INTEGER; e->ts.u.cl->length->ts.kind = gfc_charlen_int_kind; @@ -4820,12 +4824,14 @@ gfc_resolve_character_operator (gfc_expr *e) if (op1->ts.u.cl && op1->ts.u.cl->length) e1 = gfc_copy_expr (op1->ts.u.cl->length); else if (op1->expr_type == EXPR_CONSTANT) - e1 = gfc_int_expr (op1->value.character.length); + e1 = gfc_get_int_expr (gfc_default_integer_kind, NULL, + op1->value.character.length); if (op2->ts.u.cl && op2->ts.u.cl->length) e2 = gfc_copy_expr (op2->ts.u.cl->length); else if (op2->expr_type == EXPR_CONSTANT) - e2 = gfc_int_expr (op2->value.character.length); + e2 = gfc_get_int_expr (gfc_default_integer_kind, NULL, + op2->value.character.length); e->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); @@ -5690,15 +5696,16 @@ gfc_is_expandable_expr (gfc_expr *e) /* Traverse the constructor looking for variables that are flavor parameter. Parameters must be expanded since they are fully used at compile time. */ - for (con = e->value.constructor; con; con = con->next) + con = gfc_constructor_first (e->value.constructor); + for (; con; con = gfc_constructor_next (con)) { if (con->expr->expr_type == EXPR_VARIABLE - && con->expr->symtree - && (con->expr->symtree->n.sym->attr.flavor == FL_PARAMETER + && con->expr->symtree + && (con->expr->symtree->n.sym->attr.flavor == FL_PARAMETER || con->expr->symtree->n.sym->attr.flavor == FL_VARIABLE)) return true; if (con->expr->expr_type == EXPR_ARRAY - && gfc_is_expandable_expr (con->expr)) + && gfc_is_expandable_expr (con->expr)) return true; } } @@ -7282,12 +7289,14 @@ resolve_select_type (gfc_code *code) for (body = code->block; body; body = body->block) { c = body->ext.case_list; - + if (c->ts.type == BT_DERIVED) - c->low = c->high = gfc_int_expr (c->ts.u.derived->hash_value); + c->low = c->high = gfc_get_int_expr (gfc_default_integer_kind, NULL, + c->ts.u.derived->hash_value); + else if (c->ts.type == BT_UNKNOWN) continue; - + /* Assign temporary to selector. */ if (c->ts.type == BT_CLASS) sprintf (name, "tmp$class$%s", c->ts.u.derived->name); @@ -7543,7 +7552,8 @@ resolve_sync (gfc_code *code) && gfc_simplify_expr (code->expr1, 0) == SUCCESS) { gfc_constructor *cons; - for (cons = code->expr1->value.constructor; cons; cons = cons->next) + cons = gfc_constructor_first (code->expr1->value.constructor); + for (; cons; cons = gfc_constructor_next (cons)) if (cons->expr->expr_type == EXPR_CONSTANT && mpz_cmp_si (cons->expr->value.integer, 1) < 0) gfc_error ("Imageset argument at %L must between 1 and " @@ -8895,7 +8905,8 @@ resolve_charlen (gfc_charlen *cl) gfc_warning_now ("CHARACTER variable at %L has negative length %d," " the length has been set to zero", &cl->length->where, i); - gfc_replace_expr (cl->length, gfc_int_expr (0)); + gfc_replace_expr (cl->length, + gfc_get_int_expr (gfc_default_integer_kind, NULL, 0)); } /* Check that the character length is not too large. */ @@ -9027,12 +9038,9 @@ build_default_init_expr (gfc_symbol *sym) return NULL; /* Now we'll try to build an initializer expression. */ - init_expr = gfc_get_expr (); - init_expr->expr_type = EXPR_CONSTANT; - init_expr->ts.type = sym->ts.type; - init_expr->ts.kind = sym->ts.kind; - init_expr->where = sym->declared_at; - + init_expr = gfc_get_constant_expr (sym->ts.type, sym->ts.kind, + &sym->declared_at); + /* We will only initialize integers, reals, complex, logicals, and characters, and only if the corresponding command-line flags were set. Otherwise, we free init_expr and return null. */ @@ -12398,7 +12406,8 @@ resolve_equivalence (gfc_equiv *eq) { ref->type = REF_SUBSTRING; if (start == NULL) - start = gfc_int_expr (1); + start = gfc_get_int_expr (gfc_default_integer_kind, + NULL, 1); ref->u.ss.start = start; if (end == NULL && e->ts.u.cl) end = gfc_copy_expr (e->ts.u.cl->length); diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 50cd6da7591..1838c0071ea 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -26,10 +26,8 @@ along with GCC; see the file COPYING3. If not see #include "arith.h" #include "intrinsic.h" #include "target-memory.h" +#include "constructor.h" -/* Savely advance an array constructor by 'n' elements. - Mainly used by simplifiers of transformational intrinsics. */ -#define ADVANCE(ctor, n) do { int i; for (i = 0; i < n && ctor; ++i) ctor = ctor->next; } while (0) gfc_expr gfc_bad_expr; @@ -45,15 +43,12 @@ gfc_expr gfc_bad_expr; be a part of the new expression. NULL pointer indicating that no simplification was possible and - the original expression should remain intact. If the - simplification function sets the type and/or the function name - via the pointer gfc_simple_expression, then this type is - retained. + the original expression should remain intact. An expression pointer to gfc_bad_expr (a static placeholder) - indicating that some error has prevented simplification. For - example, sqrt(-1.0). The error is generated within the function - and should be propagated upwards + indicating that some error has prevented simplification. The + error is generated within the function and should be propagated + upwards By the time a simplification function gets control, it has been decided that the function call is really supposed to be the @@ -62,7 +57,8 @@ gfc_expr gfc_bad_expr; subroutine may have to look at the type of an argument as part of its processing. - Array arguments are never passed to these subroutines. + Array arguments are only passed to these subroutines that implement + the simplification of transformational intrinsics. The functions in this file don't have much comment with them, but everything is reasonably straight-forward. The Standard, chapter 13 @@ -136,20 +132,6 @@ get_kind (bt type, gfc_expr *k, const char *name, int default_kind) } -/* Helper function to get an integer constant with a kind number given - by an integer constant expression. */ -static gfc_expr * -int_expr_with_kind (int i, gfc_expr *kind, const char *name) -{ - gfc_expr *res = gfc_int_expr (i); - res->ts.kind = get_kind (BT_INTEGER, kind, name, gfc_default_integer_kind); - if (res->ts.kind == -1) - return NULL; - else - return res; -} - - /* Converts an mpz_t signed variable into an unsigned one, assuming two's complement representations and a binary width of bitsize. The conversion is a no-op unless x is negative; otherwise, it can @@ -214,6 +196,27 @@ convert_mpz_to_signed (mpz_t x, int bitsize) } } + +/* In-place convert BOZ to REAL of the specified kind. */ + +static gfc_expr * +convert_boz (gfc_expr *x, int kind) +{ + if (x && x->ts.type == BT_INTEGER && x->is_boz) + { + gfc_typespec ts; + gfc_clear_ts (&ts); + ts.type = BT_REAL; + ts.kind = kind; + + if (!gfc_convert_boz (x, &ts)) + return &gfc_bad_expr; + } + + return x; +} + + /* Test that the expression is an constant array. */ static bool @@ -227,7 +230,8 @@ is_constant_array_expr (gfc_expr *e) if (e->expr_type != EXPR_ARRAY || !gfc_is_constant_expr (e)) return false; - for (c = e->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (e->value.constructor); + c; c = gfc_constructor_next (c)) if (c->expr->expr_type != EXPR_CONSTANT) return false; @@ -242,11 +246,11 @@ init_result_expr (gfc_expr *e, int init, gfc_expr *array) { if (e && e->expr_type == EXPR_ARRAY) { - gfc_constructor *ctor = e->value.constructor; + gfc_constructor *ctor = gfc_constructor_first (e->value.constructor); while (ctor) { init_result_expr (ctor->expr, init, array); - ctor = ctor->next; + ctor = gfc_constructor_next (ctor); } } else if (e && e->expr_type == EXPR_CONSTANT) @@ -324,18 +328,18 @@ init_result_expr (gfc_expr *e, int init, gfc_expr *array) /* Helper function for gfc_simplify_dot_product() and gfc_simplify_matmul. */ static gfc_expr * -compute_dot_product (gfc_constructor *ctor_a, int stride_a, - gfc_constructor *ctor_b, int stride_b) +compute_dot_product (gfc_expr *matrix_a, int stride_a, int offset_a, + gfc_expr *matrix_b, int stride_b, int offset_b) { - gfc_expr *result; - gfc_expr *a = ctor_a->expr, *b = ctor_b->expr; - - gcc_assert (gfc_compare_types (&a->ts, &b->ts)); + gfc_expr *result, *a, *b; - result = gfc_constant_result (a->ts.type, a->ts.kind, &a->where); + result = gfc_get_constant_expr (matrix_a->ts.type, matrix_a->ts.kind, + &matrix_a->where); init_result_expr (result, 0, NULL); - while (ctor_a && ctor_b) + a = gfc_constructor_lookup_expr (matrix_a->value.constructor, offset_a); + b = gfc_constructor_lookup_expr (matrix_b->value.constructor, offset_b); + while (a && b) { /* Copying of expressions is required as operands are free'd by the gfc_arith routines. */ @@ -343,24 +347,27 @@ compute_dot_product (gfc_constructor *ctor_a, int stride_a, { case BT_LOGICAL: result = gfc_or (result, - gfc_and (gfc_copy_expr (ctor_a->expr), - gfc_copy_expr (ctor_b->expr))); + gfc_and (gfc_copy_expr (a), + gfc_copy_expr (b))); break; case BT_INTEGER: case BT_REAL: case BT_COMPLEX: result = gfc_add (result, - gfc_multiply (gfc_copy_expr (ctor_a->expr), - gfc_copy_expr (ctor_b->expr))); + gfc_multiply (gfc_copy_expr (a), + gfc_copy_expr (b))); break; default: gcc_unreachable(); } - ADVANCE (ctor_a, stride_a); - ADVANCE (ctor_b, stride_b); + offset_a += stride_a; + a = gfc_constructor_lookup_expr (matrix_a->value.constructor, offset_a); + + offset_b += stride_b; + b = gfc_constructor_lookup_expr (matrix_b->value.constructor, offset_b); } return result; @@ -378,9 +385,9 @@ transformational_result (gfc_expr *array, gfc_expr *dim, bt type, int i, nelem; if (!dim || array->rank == 1) - return gfc_constant_result (type, kind, where); + return gfc_get_constant_expr (type, kind, where); - result = gfc_start_constructor (type, kind, where); + result = gfc_get_array_expr (type, kind, where); result->shape = gfc_copy_shape_excluding (array->shape, array->rank, dim); result->rank = array->rank - 1; @@ -392,8 +399,9 @@ transformational_result (gfc_expr *array, gfc_expr *dim, bt type, for (i = 0; i < nelem; ++i) { - gfc_expr *e = gfc_constant_result (type, kind, where); - gfc_append_constructor (result, e); + gfc_constructor_append_expr (&result->value.constructor, + gfc_get_constant_expr (type, kind, where), + NULL); } return result; @@ -446,21 +454,21 @@ simplify_transformation_to_scalar (gfc_expr *result, gfc_expr *array, gfc_expr * && !mask->value.logical) return result; - array_ctor = array->value.constructor; + array_ctor = gfc_constructor_first (array->value.constructor); mask_ctor = NULL; if (mask && mask->expr_type == EXPR_ARRAY) - mask_ctor = mask->value.constructor; + mask_ctor = gfc_constructor_first (mask->value.constructor); while (array_ctor) { a = array_ctor->expr; - array_ctor = array_ctor->next; + array_ctor = gfc_constructor_next (array_ctor); /* A constant MASK equals .TRUE. here and can be ignored. */ if (mask_ctor) { m = mask_ctor->expr; - mask_ctor = mask_ctor->next; + mask_ctor = gfc_constructor_next (mask_ctor); if (!m->value.logical) continue; } @@ -505,22 +513,22 @@ simplify_transformation_to_array (gfc_expr *result, gfc_expr *array, gfc_expr *d arrayvec = (gfc_expr**) gfc_getmem (sizeof (gfc_expr*) * arraysize); - array_ctor = array->value.constructor; + array_ctor = gfc_constructor_first (array->value.constructor); mask_ctor = NULL; if (mask && mask->expr_type == EXPR_ARRAY) - mask_ctor = mask->value.constructor; + mask_ctor = gfc_constructor_first (mask->value.constructor); for (i = 0; i < arraysize; ++i) { arrayvec[i] = array_ctor->expr; - array_ctor = array_ctor->next; + array_ctor = gfc_constructor_next (array_ctor); if (mask_ctor) { if (!mask_ctor->expr->value.logical) arrayvec[i] = NULL; - mask_ctor = mask_ctor->next; + mask_ctor = gfc_constructor_next (mask_ctor); } } @@ -530,11 +538,11 @@ simplify_transformation_to_array (gfc_expr *result, gfc_expr *array, gfc_expr *d mpz_clear (size); resultvec = (gfc_expr**) gfc_getmem (sizeof (gfc_expr*) * resultsize); - result_ctor = result->value.constructor; + result_ctor = gfc_constructor_first (result->value.constructor); for (i = 0; i < resultsize; ++i) { resultvec[i] = result_ctor->expr; - result_ctor = result_ctor->next; + result_ctor = gfc_constructor_next (result_ctor); } gfc_extract_int (dim, &dim_index); @@ -592,11 +600,11 @@ simplify_transformation_to_array (gfc_expr *result, gfc_expr *array, gfc_expr *d } /* Place updated expression in result constructor. */ - result_ctor = result->value.constructor; + result_ctor = gfc_constructor_first (result->value.constructor); for (i = 0; i < resultsize; ++i) { result_ctor->expr = resultvec[i]; - result_ctor = result_ctor->next; + result_ctor = gfc_constructor_next (result_ctor); } gfc_free (arrayvec); @@ -618,36 +626,25 @@ gfc_simplify_abs (gfc_expr *e) switch (e->ts.type) { - case BT_INTEGER: - result = gfc_constant_result (BT_INTEGER, e->ts.kind, &e->where); - - mpz_abs (result->value.integer, e->value.integer); - - result = range_check (result, "IABS"); - break; - - case BT_REAL: - result = gfc_constant_result (BT_REAL, e->ts.kind, &e->where); - - mpfr_abs (result->value.real, e->value.real, GFC_RND_MODE); - - result = range_check (result, "ABS"); - break; - - case BT_COMPLEX: - result = gfc_constant_result (BT_REAL, e->ts.kind, &e->where); + case BT_INTEGER: + result = gfc_get_constant_expr (BT_INTEGER, e->ts.kind, &e->where); + mpz_abs (result->value.integer, e->value.integer); + return range_check (result, "IABS"); - gfc_set_model_kind (e->ts.kind); + case BT_REAL: + result = gfc_get_constant_expr (BT_REAL, e->ts.kind, &e->where); + mpfr_abs (result->value.real, e->value.real, GFC_RND_MODE); + return range_check (result, "ABS"); - mpc_abs (result->value.real, e->value.complex, GFC_RND_MODE); - result = range_check (result, "CABS"); - break; + case BT_COMPLEX: + gfc_set_model_kind (e->ts.kind); + result = gfc_get_constant_expr (BT_REAL, e->ts.kind, &e->where); + mpc_abs (result->value.real, e->value.complex, GFC_RND_MODE); + return range_check (result, "CABS"); - default: - gfc_internal_error ("gfc_simplify_abs(): Bad type"); + default: + gfc_internal_error ("gfc_simplify_abs(): Bad type"); } - - return result; } @@ -697,11 +694,9 @@ simplify_achar_char (gfc_expr *e, gfc_expr *k, const char *name, bool ascii) return &gfc_bad_expr; } - result = gfc_constant_result (BT_CHARACTER, kind, &e->where); - result->value.character.string = gfc_get_wide_string (2); - result->value.character.length = 1; + result = gfc_get_character_expr (kind, &e->where, NULL, 1); result->value.character.string[0] = mpz_get_ui (e->value.integer); - result->value.character.string[1] = '\0'; /* For debugger */ + return result; } @@ -735,18 +730,19 @@ gfc_simplify_acos (gfc_expr *x) &x->where); return &gfc_bad_expr; } - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_acos (result->value.real, x->value.real, GFC_RND_MODE); break; + case BT_COMPLEX: - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpc_acos (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); break; + default: gfc_internal_error ("in gfc_simplify_acos(): Bad type"); } - return range_check (result, "ACOS"); } @@ -768,13 +764,15 @@ gfc_simplify_acosh (gfc_expr *x) return &gfc_bad_expr; } - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_acosh (result->value.real, x->value.real, GFC_RND_MODE); break; + case BT_COMPLEX: - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpc_acosh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); break; + default: gfc_internal_error ("in gfc_simplify_acosh(): Bad type"); } @@ -794,11 +792,6 @@ gfc_simplify_adjustl (gfc_expr *e) len = e->value.character.length; - result = gfc_constant_result (BT_CHARACTER, e->ts.kind, &e->where); - - result->value.character.length = len; - result->value.character.string = gfc_get_wide_string (len + 1); - for (count = 0, i = 0; i < len; ++i) { ch = e->value.character.string[i]; @@ -807,14 +800,10 @@ gfc_simplify_adjustl (gfc_expr *e) ++count; } + result = gfc_get_character_expr (e->ts.kind, &e->where, NULL, len); for (i = 0; i < len - count; ++i) result->value.character.string[i] = e->value.character.string[count + i]; - for (i = len - count; i < len; ++i) - result->value.character.string[i] = ' '; - - result->value.character.string[len] = '\0'; /* For debugger */ - return result; } @@ -831,11 +820,6 @@ gfc_simplify_adjustr (gfc_expr *e) len = e->value.character.length; - result = gfc_constant_result (BT_CHARACTER, e->ts.kind, &e->where); - - result->value.character.length = len; - result->value.character.string = gfc_get_wide_string (len + 1); - for (count = 0, i = len - 1; i >= 0; --i) { ch = e->value.character.string[i]; @@ -844,14 +828,13 @@ gfc_simplify_adjustr (gfc_expr *e) ++count; } + result = gfc_get_character_expr (e->ts.kind, &e->where, NULL, len); for (i = 0; i < count; ++i) result->value.character.string[i] = ' '; for (i = count; i < len; ++i) result->value.character.string[i] = e->value.character.string[i - count]; - result->value.character.string[len] = '\0'; /* For debugger */ - return result; } @@ -864,7 +847,7 @@ gfc_simplify_aimag (gfc_expr *e) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_REAL, e->ts.kind, &e->where); + result = gfc_get_constant_expr (BT_REAL, e->ts.kind, &e->where); mpfr_set (result->value.real, mpc_imagref (e->value.complex), GFC_RND_MODE); return range_check (result, "AIMAG"); @@ -885,10 +868,10 @@ gfc_simplify_aint (gfc_expr *e, gfc_expr *k) return NULL; rtrunc = gfc_copy_expr (e); - mpfr_trunc (rtrunc->value.real, e->value.real); result = gfc_real2real (rtrunc, kind); + gfc_free_expr (rtrunc); return range_check (result, "AINT"); @@ -923,10 +906,10 @@ gfc_simplify_dint (gfc_expr *e) return NULL; rtrunc = gfc_copy_expr (e); - mpfr_trunc (rtrunc->value.real, e->value.real); result = gfc_real2real (rtrunc, gfc_default_double_kind); + gfc_free_expr (rtrunc); return range_check (result, "DINT"); @@ -946,8 +929,7 @@ gfc_simplify_anint (gfc_expr *e, gfc_expr *k) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (e->ts.type, kind, &e->where); - + result = gfc_get_constant_expr (e->ts.type, kind, &e->where); mpfr_round (result->value.real, e->value.real); return range_check (result, "ANINT"); @@ -964,17 +946,20 @@ gfc_simplify_and (gfc_expr *x, gfc_expr *y) return NULL; kind = x->ts.kind > y->ts.kind ? x->ts.kind : y->ts.kind; - if (x->ts.type == BT_INTEGER) - { - result = gfc_constant_result (BT_INTEGER, kind, &x->where); - mpz_and (result->value.integer, x->value.integer, y->value.integer); - return range_check (result, "AND"); - } - else /* BT_LOGICAL */ + + switch (x->ts.type) { - result = gfc_constant_result (BT_LOGICAL, kind, &x->where); - result->value.logical = x->value.logical && y->value.logical; - return result; + case BT_INTEGER: + result = gfc_get_constant_expr (BT_INTEGER, kind, &x->where); + mpz_and (result->value.integer, x->value.integer, y->value.integer); + return range_check (result, "AND"); + + case BT_LOGICAL: + return gfc_get_logical_expr (kind, &x->where, + x->value.logical && y->value.logical); + + default: + gcc_unreachable (); } } @@ -1006,8 +991,7 @@ gfc_simplify_dnint (gfc_expr *e) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_REAL, gfc_default_double_kind, &e->where); - + result = gfc_get_constant_expr (BT_REAL, gfc_default_double_kind, &e->where); mpfr_round (result->value.real, e->value.real); return range_check (result, "DNINT"); @@ -1032,13 +1016,15 @@ gfc_simplify_asin (gfc_expr *x) &x->where); return &gfc_bad_expr; } - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_asin (result->value.real, x->value.real, GFC_RND_MODE); break; + case BT_COMPLEX: - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpc_asin (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); break; + default: gfc_internal_error ("in gfc_simplify_asin(): Bad type"); } @@ -1055,16 +1041,18 @@ gfc_simplify_asinh (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); + switch (x->ts.type) { case BT_REAL: - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); mpfr_asinh (result->value.real, x->value.real, GFC_RND_MODE); break; + case BT_COMPLEX: - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); mpc_asinh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); break; + default: gfc_internal_error ("in gfc_simplify_asinh(): Bad type"); } @@ -1080,17 +1068,19 @@ gfc_simplify_atan (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - + + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); + switch (x->ts.type) { case BT_REAL: - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); mpfr_atan (result->value.real, x->value.real, GFC_RND_MODE); break; + case BT_COMPLEX: - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); mpc_atan (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); break; + default: gfc_internal_error ("in gfc_simplify_atan(): Bad type"); } @@ -1117,14 +1107,15 @@ gfc_simplify_atanh (gfc_expr *x) "to 1", &x->where); return &gfc_bad_expr; } - - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_atanh (result->value.real, x->value.real, GFC_RND_MODE); break; + case BT_COMPLEX: - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpc_atanh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); break; + default: gfc_internal_error ("in gfc_simplify_atanh(): Bad type"); } @@ -1148,8 +1139,7 @@ gfc_simplify_atan2 (gfc_expr *y, gfc_expr *x) return &gfc_bad_expr; } - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_atan2 (result->value.real, y->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "ATAN2"); @@ -1157,14 +1147,14 @@ gfc_simplify_atan2 (gfc_expr *y, gfc_expr *x) gfc_expr * -gfc_simplify_bessel_j0 (gfc_expr *x ATTRIBUTE_UNUSED) +gfc_simplify_bessel_j0 (gfc_expr *x) { gfc_expr *result; if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_j0 (result->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "BESSEL_J0"); @@ -1172,14 +1162,14 @@ gfc_simplify_bessel_j0 (gfc_expr *x ATTRIBUTE_UNUSED) gfc_expr * -gfc_simplify_bessel_j1 (gfc_expr *x ATTRIBUTE_UNUSED) +gfc_simplify_bessel_j1 (gfc_expr *x) { gfc_expr *result; if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_j1 (result->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "BESSEL_J1"); @@ -1187,8 +1177,7 @@ gfc_simplify_bessel_j1 (gfc_expr *x ATTRIBUTE_UNUSED) gfc_expr * -gfc_simplify_bessel_jn (gfc_expr *order ATTRIBUTE_UNUSED, - gfc_expr *x ATTRIBUTE_UNUSED) +gfc_simplify_bessel_jn (gfc_expr *order, gfc_expr *x) { gfc_expr *result; long n; @@ -1197,7 +1186,7 @@ gfc_simplify_bessel_jn (gfc_expr *order ATTRIBUTE_UNUSED, return NULL; n = mpz_get_si (order->value.integer); - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_jn (result->value.real, n, x->value.real, GFC_RND_MODE); return range_check (result, "BESSEL_JN"); @@ -1205,14 +1194,14 @@ gfc_simplify_bessel_jn (gfc_expr *order ATTRIBUTE_UNUSED, gfc_expr * -gfc_simplify_bessel_y0 (gfc_expr *x ATTRIBUTE_UNUSED) +gfc_simplify_bessel_y0 (gfc_expr *x) { gfc_expr *result; if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_y0 (result->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "BESSEL_Y0"); @@ -1220,14 +1209,14 @@ gfc_simplify_bessel_y0 (gfc_expr *x ATTRIBUTE_UNUSED) gfc_expr * -gfc_simplify_bessel_y1 (gfc_expr *x ATTRIBUTE_UNUSED) +gfc_simplify_bessel_y1 (gfc_expr *x) { gfc_expr *result; if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_y1 (result->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "BESSEL_Y1"); @@ -1235,8 +1224,7 @@ gfc_simplify_bessel_y1 (gfc_expr *x ATTRIBUTE_UNUSED) gfc_expr * -gfc_simplify_bessel_yn (gfc_expr *order ATTRIBUTE_UNUSED, - gfc_expr *x ATTRIBUTE_UNUSED) +gfc_simplify_bessel_yn (gfc_expr *order, gfc_expr *x) { gfc_expr *result; long n; @@ -1245,7 +1233,7 @@ gfc_simplify_bessel_yn (gfc_expr *order ATTRIBUTE_UNUSED, return NULL; n = mpz_get_si (order->value.integer); - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_yn (result->value.real, n, x->value.real, GFC_RND_MODE); return range_check (result, "BESSEL_YN"); @@ -1255,14 +1243,9 @@ gfc_simplify_bessel_yn (gfc_expr *order ATTRIBUTE_UNUSED, gfc_expr * gfc_simplify_bit_size (gfc_expr *e) { - gfc_expr *result; - int i; - - i = gfc_validate_kind (e->ts.type, e->ts.kind, false); - result = gfc_constant_result (BT_INTEGER, e->ts.kind, &e->where); - mpz_set_ui (result->value.integer, gfc_integer_kinds[i].bit_size); - - return result; + int i = gfc_validate_kind (e->ts.type, e->ts.kind, false); + return gfc_get_int_expr (e->ts.kind, &e->where, + gfc_integer_kinds[i].bit_size); } @@ -1275,9 +1258,10 @@ gfc_simplify_btest (gfc_expr *e, gfc_expr *bit) return NULL; if (gfc_extract_int (bit, &b) != NULL || b < 0) - return gfc_logical_expr (0, &e->where); + return gfc_get_logical_expr (gfc_default_logical_kind, &e->where, false); - return gfc_logical_expr (mpz_tstbit (e->value.integer, b), &e->where); + return gfc_get_logical_expr (gfc_default_logical_kind, &e->where, + mpz_tstbit (e->value.integer, b)); } @@ -1294,11 +1278,10 @@ gfc_simplify_ceiling (gfc_expr *e, gfc_expr *k) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, kind, &e->where); - ceil = gfc_copy_expr (e); - mpfr_ceil (ceil->value.real, e->value.real); + + result = gfc_get_constant_expr (BT_INTEGER, kind, &e->where); gfc_mpfr_to_mpz (result->value.integer, ceil->value.real, &e->where); gfc_free_expr (ceil); @@ -1314,117 +1297,75 @@ gfc_simplify_char (gfc_expr *e, gfc_expr *k) } -/* Common subroutine for simplifying CMPLX and DCMPLX. */ +/* Common subroutine for simplifying CMPLX, COMPLEX and DCMPLX. */ static gfc_expr * simplify_cmplx (const char *name, gfc_expr *x, gfc_expr *y, int kind) { gfc_expr *result; - result = gfc_constant_result (BT_COMPLEX, kind, &x->where); + if (convert_boz (x, kind) == &gfc_bad_expr) + return &gfc_bad_expr; + + if (convert_boz (y, kind) == &gfc_bad_expr) + return &gfc_bad_expr; + + if (x->expr_type != EXPR_CONSTANT + || (y != NULL && y->expr_type != EXPR_CONSTANT)) + return NULL; + + result = gfc_get_constant_expr (BT_COMPLEX, kind, &x->where); switch (x->ts.type) { - case BT_INTEGER: - if (!x->is_boz) + case BT_INTEGER: mpc_set_z (result->value.complex, x->value.integer, GFC_MPC_RND_MODE); - break; + break; - case BT_REAL: - mpc_set_fr (result->value.complex, x->value.real, GFC_RND_MODE); - break; + case BT_REAL: + mpc_set_fr (result->value.complex, x->value.real, GFC_RND_MODE); + break; - case BT_COMPLEX: - mpc_set (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); - break; + case BT_COMPLEX: + mpc_set (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); + break; - default: - gfc_internal_error ("gfc_simplify_dcmplx(): Bad type (x)"); + default: + gfc_internal_error ("gfc_simplify_dcmplx(): Bad type (x)"); } - if (y != NULL) - { - switch (y->ts.type) - { - case BT_INTEGER: - if (!y->is_boz) - mpfr_set_z (mpc_imagref (result->value.complex), - y->value.integer, GFC_RND_MODE); - break; - - case BT_REAL: - mpfr_set (mpc_imagref (result->value.complex), - y->value.real, GFC_RND_MODE); - break; - - default: - gfc_internal_error ("gfc_simplify_dcmplx(): Bad type (y)"); - } - } + if (!y) + return range_check (result, name); - /* Handle BOZ. */ - if (x->is_boz) + switch (y->ts.type) { - gfc_typespec ts; - gfc_clear_ts (&ts); - ts.kind = result->ts.kind; - ts.type = BT_REAL; - if (!gfc_convert_boz (x, &ts)) - return &gfc_bad_expr; - mpfr_set (mpc_realref (result->value.complex), - x->value.real, GFC_RND_MODE); - } + case BT_INTEGER: + mpfr_set_z (mpc_imagref (result->value.complex), + y->value.integer, GFC_RND_MODE); + break; - if (y && y->is_boz) - { - gfc_typespec ts; - gfc_clear_ts (&ts); - ts.kind = result->ts.kind; - ts.type = BT_REAL; - if (!gfc_convert_boz (y, &ts)) - return &gfc_bad_expr; - mpfr_set (mpc_imagref (result->value.complex), - y->value.real, GFC_RND_MODE); + case BT_REAL: + mpfr_set (mpc_imagref (result->value.complex), + y->value.real, GFC_RND_MODE); + break; + + default: + gfc_internal_error ("gfc_simplify_dcmplx(): Bad type (y)"); } return range_check (result, name); } -/* Function called when we won't simplify an expression like CMPLX (or - COMPLEX or DCMPLX) but still want to convert BOZ arguments. */ - -static gfc_expr * -only_convert_cmplx_boz (gfc_expr *x, gfc_expr *y, int kind) -{ - gfc_typespec ts; - gfc_clear_ts (&ts); - ts.type = BT_REAL; - ts.kind = kind; - - if (x->is_boz && !gfc_convert_boz (x, &ts)) - return &gfc_bad_expr; - - if (y && y->is_boz && !gfc_convert_boz (y, &ts)) - return &gfc_bad_expr; - - return NULL; -} - - gfc_expr * gfc_simplify_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *k) { int kind; - kind = get_kind (BT_REAL, k, "CMPLX", gfc_default_real_kind); + kind = get_kind (BT_REAL, k, "CMPLX", gfc_default_complex_kind); if (kind == -1) return &gfc_bad_expr; - if (x->expr_type != EXPR_CONSTANT - || (y != NULL && y->expr_type != EXPR_CONSTANT)) - return only_convert_cmplx_boz (x, y, kind); - return simplify_cmplx ("CMPLX", x, y, kind); } @@ -1434,24 +1375,16 @@ gfc_simplify_complex (gfc_expr *x, gfc_expr *y) { int kind; - if (x->ts.type == BT_INTEGER) - { - if (y->ts.type == BT_INTEGER) - kind = gfc_default_real_kind; - else - kind = y->ts.kind; - } + if (x->ts.type == BT_INTEGER && y->ts.type == BT_INTEGER) + kind = gfc_default_complex_kind; + else if (x->ts.type == BT_REAL || y->ts.type == BT_INTEGER) + kind = x->ts.kind; + else if (x->ts.type == BT_INTEGER || y->ts.type == BT_REAL) + kind = y->ts.kind; + else if (x->ts.type == BT_REAL && y->ts.type == BT_REAL) + kind = (x->ts.kind > y->ts.kind) ? x->ts.kind : y->ts.kind; else - { - if (y->ts.type == BT_REAL) - kind = (x->ts.kind > y->ts.kind) ? x->ts.kind : y->ts.kind; - else - kind = x->ts.kind; - } - - if (x->expr_type != EXPR_CONSTANT - || (y != NULL && y->expr_type != EXPR_CONSTANT)) - return only_convert_cmplx_boz (x, y, kind); + gcc_unreachable (); return simplify_cmplx ("COMPLEX", x, y, kind); } @@ -1467,6 +1400,7 @@ gfc_simplify_conjg (gfc_expr *e) result = gfc_copy_expr (e); mpc_conj (result->value.complex, result->value.complex, GFC_MPC_RND_MODE); + return range_check (result, "CONJG"); } @@ -1479,23 +1413,24 @@ gfc_simplify_cos (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); switch (x->ts.type) { - case BT_REAL: - mpfr_cos (result->value.real, x->value.real, GFC_RND_MODE); - break; - case BT_COMPLEX: - gfc_set_model_kind (x->ts.kind); - mpc_cos (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); - break; - default: - gfc_internal_error ("in gfc_simplify_cos(): Bad type"); + case BT_REAL: + mpfr_cos (result->value.real, x->value.real, GFC_RND_MODE); + break; + + case BT_COMPLEX: + gfc_set_model_kind (x->ts.kind); + mpc_cos (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); + break; + + default: + gfc_internal_error ("in gfc_simplify_cos(): Bad type"); } return range_check (result, "COS"); - } @@ -1507,14 +1442,21 @@ gfc_simplify_cosh (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); - if (x->ts.type == BT_REAL) - mpfr_cosh (result->value.real, x->value.real, GFC_RND_MODE); - else if (x->ts.type == BT_COMPLEX) - mpc_cosh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); - else - gcc_unreachable (); + switch (x->ts.type) + { + case BT_REAL: + mpfr_cosh (result->value.real, x->value.real, GFC_RND_MODE); + break; + + case BT_COMPLEX: + mpc_cosh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); + break; + + default: + gcc_unreachable (); + } return range_check (result, "COSH"); } @@ -1549,11 +1491,6 @@ gfc_simplify_count (gfc_expr *mask, gfc_expr *dim, gfc_expr *kind) gfc_expr * gfc_simplify_dcmplx (gfc_expr *x, gfc_expr *y) { - - if (x->expr_type != EXPR_CONSTANT - || (y != NULL && y->expr_type != EXPR_CONSTANT)) - return only_convert_cmplx_boz (x, y, gfc_default_double_kind); - return simplify_cmplx ("DCMPLX", x, y, gfc_default_double_kind); } @@ -1566,38 +1503,12 @@ gfc_simplify_dble (gfc_expr *e) if (e->expr_type != EXPR_CONSTANT) return NULL; - switch (e->ts.type) - { - case BT_INTEGER: - if (!e->is_boz) - result = gfc_int2real (e, gfc_default_double_kind); - break; - - case BT_REAL: - result = gfc_real2real (e, gfc_default_double_kind); - break; - - case BT_COMPLEX: - result = gfc_complex2real (e, gfc_default_double_kind); - break; - - default: - gfc_internal_error ("gfc_simplify_dble(): bad type at %L", &e->where); - } + if (convert_boz (e, gfc_default_double_kind) == &gfc_bad_expr) + return &gfc_bad_expr; - if (e->ts.type == BT_INTEGER && e->is_boz) - { - gfc_typespec ts; - gfc_clear_ts (&ts); - ts.type = BT_REAL; - ts.kind = gfc_default_double_kind; - result = gfc_copy_expr (e); - if (!gfc_convert_boz (result, &ts)) - { - gfc_free_expr (result); - return &gfc_bad_expr; - } - } + result = gfc_convert_constant (e, BT_REAL, gfc_default_double_kind); + if (result == &gfc_bad_expr) + return &gfc_bad_expr; return range_check (result, "DBLE"); } @@ -1609,22 +1520,23 @@ gfc_simplify_digits (gfc_expr *x) int i, digits; i = gfc_validate_kind (x->ts.type, x->ts.kind, false); + switch (x->ts.type) { - case BT_INTEGER: - digits = gfc_integer_kinds[i].digits; - break; + case BT_INTEGER: + digits = gfc_integer_kinds[i].digits; + break; - case BT_REAL: - case BT_COMPLEX: - digits = gfc_real_kinds[i].digits; - break; + case BT_REAL: + case BT_COMPLEX: + digits = gfc_real_kinds[i].digits; + break; - default: - gcc_unreachable (); + default: + gcc_unreachable (); } - return gfc_int_expr (digits); + return gfc_get_int_expr (gfc_default_integer_kind, NULL, digits); } @@ -1638,29 +1550,29 @@ gfc_simplify_dim (gfc_expr *x, gfc_expr *y) return NULL; kind = x->ts.kind > y->ts.kind ? x->ts.kind : y->ts.kind; - result = gfc_constant_result (x->ts.type, kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, kind, &x->where); switch (x->ts.type) { - case BT_INTEGER: - if (mpz_cmp (x->value.integer, y->value.integer) > 0) - mpz_sub (result->value.integer, x->value.integer, y->value.integer); - else - mpz_set_ui (result->value.integer, 0); + case BT_INTEGER: + if (mpz_cmp (x->value.integer, y->value.integer) > 0) + mpz_sub (result->value.integer, x->value.integer, y->value.integer); + else + mpz_set_ui (result->value.integer, 0); - break; + break; - case BT_REAL: - if (mpfr_cmp (x->value.real, y->value.real) > 0) - mpfr_sub (result->value.real, x->value.real, y->value.real, - GFC_RND_MODE); - else - mpfr_set_ui (result->value.real, 0, GFC_RND_MODE); + case BT_REAL: + if (mpfr_cmp (x->value.real, y->value.real) > 0) + mpfr_sub (result->value.real, x->value.real, y->value.real, + GFC_RND_MODE); + else + mpfr_set_ui (result->value.real, 0, GFC_RND_MODE); - break; + break; - default: - gfc_internal_error ("gfc_simplify_dim(): Bad type"); + default: + gfc_internal_error ("gfc_simplify_dim(): Bad type"); } return range_check (result, "DIM"); @@ -1670,8 +1582,6 @@ gfc_simplify_dim (gfc_expr *x, gfc_expr *y) gfc_expr* gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b) { - gfc_expr *result; - if (!is_constant_array_expr (vector_a) || !is_constant_array_expr (vector_b)) return NULL; @@ -1680,16 +1590,7 @@ gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b) gcc_assert (vector_b->rank == 1); gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts)); - if (vector_a->value.constructor && vector_b->value.constructor) - return compute_dot_product (vector_a->value.constructor, 1, - vector_b->value.constructor, 1); - - /* Zero sized array ... */ - result = gfc_constant_result (vector_a->ts.type, - vector_a->ts.kind, - &vector_a->where); - init_result_expr (result, 0, NULL); - return result; + return compute_dot_product (vector_a, 1, 0, vector_b, 1, 0); } @@ -1701,15 +1602,14 @@ gfc_simplify_dprod (gfc_expr *x, gfc_expr *y) if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_REAL, gfc_default_double_kind, &x->where); - a1 = gfc_real2real (x, gfc_default_double_kind); a2 = gfc_real2real (y, gfc_default_double_kind); + result = gfc_get_constant_expr (BT_REAL, gfc_default_double_kind, &x->where); mpfr_mul (result->value.real, a1->value.real, a2->value.real, GFC_RND_MODE); - gfc_free_expr (a1); gfc_free_expr (a2); + gfc_free_expr (a1); return range_check (result, "DPROD"); } @@ -1723,8 +1623,7 @@ gfc_simplify_erf (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_erf (result->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "ERF"); @@ -1739,8 +1638,7 @@ gfc_simplify_erfc (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_erfc (result->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "ERFC"); @@ -1871,7 +1769,7 @@ gfc_simplify_erfc_scaled (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); if (mpfr_cmp_d (x->value.real, ARG_LIMIT) >= 0) asympt_erfc_scaled (result->value.real, x->value.real); else @@ -1892,8 +1790,7 @@ gfc_simplify_epsilon (gfc_expr *e) i = gfc_validate_kind (e->ts.type, e->ts.kind, false); - result = gfc_constant_result (BT_REAL, e->ts.kind, &e->where); - + result = gfc_get_constant_expr (BT_REAL, e->ts.kind, &e->where); mpfr_set (result->value.real, gfc_real_kinds[i].epsilon, GFC_RND_MODE); return range_check (result, "EPSILON"); @@ -1908,21 +1805,21 @@ gfc_simplify_exp (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); switch (x->ts.type) { - case BT_REAL: - mpfr_exp (result->value.real, x->value.real, GFC_RND_MODE); - break; + case BT_REAL: + mpfr_exp (result->value.real, x->value.real, GFC_RND_MODE); + break; - case BT_COMPLEX: - gfc_set_model_kind (x->ts.kind); - mpc_exp (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); - break; + case BT_COMPLEX: + gfc_set_model_kind (x->ts.kind); + mpc_exp (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); + break; - default: - gfc_internal_error ("in gfc_simplify_exp(): Bad type"); + default: + gfc_internal_error ("in gfc_simplify_exp(): Bad type"); } return range_check (result, "EXP"); @@ -1938,8 +1835,8 @@ gfc_simplify_exponent (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, - &x->where); + result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, + &x->where); gfc_set_model (x->value.real); @@ -1966,21 +1863,14 @@ gfc_simplify_float (gfc_expr *a) if (a->is_boz) { - gfc_typespec ts; - gfc_clear_ts (&ts); - - ts.type = BT_REAL; - ts.kind = gfc_default_real_kind; + if (convert_boz (a, gfc_default_real_kind) == &gfc_bad_expr) + return &gfc_bad_expr; result = gfc_copy_expr (a); - if (!gfc_convert_boz (result, &ts)) - { - gfc_free_expr (result); - return &gfc_bad_expr; - } } else result = gfc_int2real (a, gfc_default_real_kind); + return range_check (result, "FLOAT"); } @@ -1999,12 +1889,12 @@ gfc_simplify_floor (gfc_expr *e, gfc_expr *k) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, kind, &e->where); - gfc_set_model_kind (kind); + mpfr_init (floor); mpfr_floor (floor, e->value.real); + result = gfc_get_constant_expr (BT_INTEGER, kind, &e->where); gfc_mpfr_to_mpz (result->value.integer, floor, &e->where); mpfr_clear (floor); @@ -2022,7 +1912,7 @@ gfc_simplify_fraction (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_REAL, x->ts.kind, &x->where); + result = gfc_get_constant_expr (BT_REAL, x->ts.kind, &x->where); if (mpfr_sgn (x->value.real) == 0) { @@ -2059,8 +1949,7 @@ gfc_simplify_gamma (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_gamma (result->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "GAMMA"); @@ -2074,21 +1963,20 @@ gfc_simplify_huge (gfc_expr *e) int i; i = gfc_validate_kind (e->ts.type, e->ts.kind, false); - - result = gfc_constant_result (e->ts.type, e->ts.kind, &e->where); + result = gfc_get_constant_expr (e->ts.type, e->ts.kind, &e->where); switch (e->ts.type) { - case BT_INTEGER: - mpz_set (result->value.integer, gfc_integer_kinds[i].huge); - break; + case BT_INTEGER: + mpz_set (result->value.integer, gfc_integer_kinds[i].huge); + break; - case BT_REAL: - mpfr_set (result->value.real, gfc_real_kinds[i].huge, GFC_RND_MODE); - break; + case BT_REAL: + mpfr_set (result->value.real, gfc_real_kinds[i].huge, GFC_RND_MODE); + break; - default: - gcc_unreachable (); + default: + gcc_unreachable (); } return result; @@ -2103,7 +1991,7 @@ gfc_simplify_hypot (gfc_expr *x, gfc_expr *y) if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_hypot (result->value.real, x->value.real, y->value.real, GFC_RND_MODE); return range_check (result, "HYPOT"); } @@ -2117,6 +2005,7 @@ gfc_simplify_iachar (gfc_expr *e, gfc_expr *kind) { gfc_expr *result; gfc_char_t index; + int k; if (e->expr_type != EXPR_CONSTANT) return NULL; @@ -2133,10 +2022,11 @@ gfc_simplify_iachar (gfc_expr *e, gfc_expr *kind) gfc_warning ("Argument of IACHAR function at %L outside of range 0..127", &e->where); - if ((result = int_expr_with_kind (index, kind, "IACHAR")) == NULL) + k = get_kind (BT_INTEGER, kind, "IACHAR", gfc_default_integer_kind); + if (k == -1) return &gfc_bad_expr; - result->where = e->where; + result = gfc_get_int_expr (k, &e->where, index); return range_check (result, "IACHAR"); } @@ -2150,8 +2040,7 @@ gfc_simplify_iand (gfc_expr *x, gfc_expr *y) if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (BT_INTEGER, x->ts.kind, &x->where); mpz_and (result->value.integer, x->value.integer, y->value.integer); return range_check (result, "IAND"); @@ -2232,7 +2121,7 @@ gfc_simplify_ibits (gfc_expr *x, gfc_expr *y, gfc_expr *z) return &gfc_bad_expr; } - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); convert_mpz_to_unsigned (result->value.integer, gfc_integer_kinds[k].bit_size); @@ -2306,6 +2195,7 @@ gfc_simplify_ichar (gfc_expr *e, gfc_expr *kind) { gfc_expr *result; gfc_char_t index; + int k; if (e->expr_type != EXPR_CONSTANT) return NULL; @@ -2318,10 +2208,12 @@ gfc_simplify_ichar (gfc_expr *e, gfc_expr *kind) index = e->value.character.string[0]; - if ((result = int_expr_with_kind (index, kind, "ICHAR")) == NULL) + k = get_kind (BT_INTEGER, kind, "ICHAR", gfc_default_integer_kind); + if (k == -1) return &gfc_bad_expr; - result->where = e->where; + result = gfc_get_int_expr (k, &e->where, index); + return range_check (result, "ICHAR"); } @@ -2334,8 +2226,7 @@ gfc_simplify_ieor (gfc_expr *x, gfc_expr *y) if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (BT_INTEGER, x->ts.kind, &x->where); mpz_xor (result->value.integer, x->value.integer, y->value.integer); return range_check (result, "IEOR"); @@ -2362,7 +2253,7 @@ gfc_simplify_index (gfc_expr *x, gfc_expr *y, gfc_expr *b, gfc_expr *kind) if (k == -1) return &gfc_bad_expr; - result = gfc_constant_result (BT_INTEGER, k, &x->where); + result = gfc_get_constant_expr (BT_INTEGER, k, &x->where); len = x->value.character.length; lensub = y->value.character.length; @@ -2487,73 +2378,34 @@ done: } -gfc_expr * -gfc_simplify_int (gfc_expr *e, gfc_expr *k) +static gfc_expr * +simplify_intconv (gfc_expr *e, int kind, const char *name) { gfc_expr *result = NULL; - int kind; - - kind = get_kind (BT_INTEGER, k, "INT", gfc_default_integer_kind); - if (kind == -1) - return &gfc_bad_expr; if (e->expr_type != EXPR_CONSTANT) return NULL; - switch (e->ts.type) - { - case BT_INTEGER: - result = gfc_int2int (e, kind); - break; - - case BT_REAL: - result = gfc_real2int (e, kind); - break; - - case BT_COMPLEX: - result = gfc_complex2int (e, kind); - break; - - default: - gfc_error ("Argument of INT at %L is not a valid type", &e->where); - return &gfc_bad_expr; - } + result = gfc_convert_constant (e, BT_INTEGER, kind); + if (result == &gfc_bad_expr) + return &gfc_bad_expr; - return range_check (result, "INT"); + return range_check (result, name); } -static gfc_expr * -simplify_intconv (gfc_expr *e, int kind, const char *name) +gfc_expr * +gfc_simplify_int (gfc_expr *e, gfc_expr *k) { - gfc_expr *result = NULL; - - if (e->expr_type != EXPR_CONSTANT) - return NULL; - - switch (e->ts.type) - { - case BT_INTEGER: - result = gfc_int2int (e, kind); - break; - - case BT_REAL: - result = gfc_real2int (e, kind); - break; - - case BT_COMPLEX: - result = gfc_complex2int (e, kind); - break; + int kind; - default: - gfc_error ("Argument of %s at %L is not a valid type", name, &e->where); - return &gfc_bad_expr; - } + kind = get_kind (BT_INTEGER, k, "INT", gfc_default_integer_kind); + if (kind == -1) + return &gfc_bad_expr; - return range_check (result, name); + return simplify_intconv (e, kind, "INT"); } - gfc_expr * gfc_simplify_int2 (gfc_expr *e) { @@ -2583,15 +2435,15 @@ gfc_simplify_ifix (gfc_expr *e) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, - &e->where); - rtrunc = gfc_copy_expr (e); - mpfr_trunc (rtrunc->value.real, e->value.real); + + result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, + &e->where); gfc_mpfr_to_mpz (result->value.integer, rtrunc->value.real, &e->where); gfc_free_expr (rtrunc); + return range_check (result, "IFIX"); } @@ -2604,15 +2456,15 @@ gfc_simplify_idint (gfc_expr *e) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, - &e->where); - rtrunc = gfc_copy_expr (e); - mpfr_trunc (rtrunc->value.real, e->value.real); + + result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, + &e->where); gfc_mpfr_to_mpz (result->value.integer, rtrunc->value.real, &e->where); gfc_free_expr (rtrunc); + return range_check (result, "IDINT"); } @@ -2625,9 +2477,9 @@ gfc_simplify_ior (gfc_expr *x, gfc_expr *y) if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (BT_INTEGER, x->ts.kind, &x->where); mpz_ior (result->value.integer, x->value.integer, y->value.integer); + return range_check (result, "IOR"); } @@ -2635,48 +2487,35 @@ gfc_simplify_ior (gfc_expr *x, gfc_expr *y) gfc_expr * gfc_simplify_is_iostat_end (gfc_expr *x) { - gfc_expr *result; - if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &x->where); - result->value.logical = (mpz_cmp_si (x->value.integer, LIBERROR_END) == 0); - - return result; + return gfc_get_logical_expr (gfc_default_logical_kind, &x->where, + mpz_cmp_si (x->value.integer, + LIBERROR_END) == 0); } gfc_expr * gfc_simplify_is_iostat_eor (gfc_expr *x) { - gfc_expr *result; - if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &x->where); - result->value.logical = (mpz_cmp_si (x->value.integer, LIBERROR_EOR) == 0); - - return result; + return gfc_get_logical_expr (gfc_default_logical_kind, &x->where, + mpz_cmp_si (x->value.integer, + LIBERROR_EOR) == 0); } gfc_expr * gfc_simplify_isnan (gfc_expr *x) { - gfc_expr *result; - if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_LOGICAL, gfc_default_logical_kind, - &x->where); - result->value.logical = mpfr_nan_p (x->value.real); - - return result; + return gfc_get_logical_expr (gfc_default_logical_kind, &x->where, + mpfr_nan_p (x->value.real)); } @@ -2711,7 +2550,7 @@ gfc_simplify_ishft (gfc_expr *e, gfc_expr *s) return &gfc_bad_expr; } - result = gfc_constant_result (e->ts.type, e->ts.kind, &e->where); + result = gfc_get_constant_expr (e->ts.type, e->ts.kind, &e->where); if (shift == 0) { @@ -2814,7 +2653,7 @@ gfc_simplify_ishftc (gfc_expr *e, gfc_expr *s, gfc_expr *sz) return &gfc_bad_expr; } - result = gfc_constant_result (e->ts.type, e->ts.kind, &e->where); + result = gfc_get_constant_expr (e->ts.type, e->ts.kind, &e->where); mpz_set (result->value.integer, e->value.integer); @@ -2877,26 +2716,20 @@ gfc_simplify_ishftc (gfc_expr *e, gfc_expr *s, gfc_expr *sz) gfc_expr * gfc_simplify_kind (gfc_expr *e) { - - if (e->ts.type == BT_DERIVED) - { - gfc_error ("Argument of KIND at %L is a DERIVED type", &e->where); - return &gfc_bad_expr; - } - - return gfc_int_expr (e->ts.kind); + return gfc_get_int_expr (gfc_default_integer_kind, NULL, e->ts.kind); } static gfc_expr * simplify_bound_dim (gfc_expr *array, gfc_expr *kind, int d, int upper, - gfc_array_spec *as, gfc_ref *ref) + gfc_array_spec *as, gfc_ref *ref, bool coarray) { gfc_expr *l, *u, *result; int k; /* The last dimension of an assumed-size array is special. */ - if (d == as->rank && as->type == AS_ASSUMED_SIZE && !upper) + if ((!coarray && d == as->rank && as->type == AS_ASSUMED_SIZE && !upper) + || (coarray && d == as->rank + as->corank)) { if (as->lower[d-1]->expr_type == EXPR_CONSTANT) return gfc_copy_expr (as->lower[d-1]); @@ -2909,16 +2742,17 @@ simplify_bound_dim (gfc_expr *array, gfc_expr *kind, int d, int upper, if (k == -1) return &gfc_bad_expr; - result = gfc_constant_result (BT_INTEGER, k, &array->where); + result = gfc_get_constant_expr (BT_INTEGER, k, &array->where); /* Then, we need to know the extent of the given dimension. */ - if (ref->u.ar.type == AR_FULL) + if (coarray || ref->u.ar.type == AR_FULL) { l = as->lower[d-1]; u = as->upper[d-1]; - if (l->expr_type != EXPR_CONSTANT || u->expr_type != EXPR_CONSTANT) + if (l->expr_type != EXPR_CONSTANT || u == NULL + || u->expr_type != EXPR_CONSTANT) return NULL; if (mpz_cmp (l->value.integer, u->value.integer) > 0) @@ -3016,7 +2850,6 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) /* Multi-dimensional bounds. */ gfc_expr *bounds[GFC_MAX_DIMENSIONS]; gfc_expr *e; - gfc_constructor *head, *tail; int k; /* UBOUND(ARRAY) is not valid for an assumed-size array. */ @@ -3030,7 +2863,8 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) /* Simplify the bounds for each dimension. */ for (d = 0; d < array->rank; d++) { - bounds[d] = simplify_bound_dim (array, kind, d + 1, upper, as, ref); + bounds[d] = simplify_bound_dim (array, kind, d + 1, upper, as, ref, + false); if (bounds[d] == NULL || bounds[d] == &gfc_bad_expr) { int j; @@ -3042,18 +2876,12 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) } /* Allocate the result expression. */ - e = gfc_get_expr (); - e->where = array->where; - e->expr_type = EXPR_ARRAY; - e->ts.type = BT_INTEGER; k = get_kind (BT_INTEGER, kind, upper ? "UBOUND" : "LBOUND", - gfc_default_integer_kind); + gfc_default_integer_kind); if (k == -1) - { - gfc_free_expr (e); - return &gfc_bad_expr; - } - e->ts.kind = k; + return &gfc_bad_expr; + + e = gfc_get_array_expr (BT_INTEGER, k, &array->where); /* The result is a rank 1 array; its size is the rank of the first argument to {L,U}BOUND. */ @@ -3062,22 +2890,9 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) mpz_init_set_ui (e->shape[0], array->rank); /* Create the constructor for this array. */ - head = tail = NULL; for (d = 0; d < array->rank; d++) - { - /* Get a new constructor element. */ - if (head == NULL) - head = tail = gfc_get_constructor (); - else - { - tail->next = gfc_get_constructor (); - tail = tail->next; - } - - tail->where = e->where; - tail->expr = bounds[d]; - } - e->value.constructor = head; + gfc_constructor_append_expr (&e->value.constructor, + bounds[d], &e->where); return e; } @@ -3096,116 +2911,233 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) return &gfc_bad_expr; } - return simplify_bound_dim (array, kind, d, upper, as, ref); + return simplify_bound_dim (array, kind, d, upper, as, ref, false); } } -gfc_expr * -gfc_simplify_lbound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) -{ - return simplify_bound (array, dim, kind, 0); -} - - -gfc_expr * -gfc_simplify_leadz (gfc_expr *e) +static gfc_expr * +simplify_cobound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) { - gfc_expr *result; - unsigned long lz, bs; - int i; + gfc_ref *ref; + gfc_array_spec *as; + int d; - if (e->expr_type != EXPR_CONSTANT) + if (array->expr_type != EXPR_VARIABLE) return NULL; - i = gfc_validate_kind (e->ts.type, e->ts.kind, false); - bs = gfc_integer_kinds[i].bit_size; - if (mpz_cmp_si (e->value.integer, 0) == 0) - lz = bs; - else if (mpz_cmp_si (e->value.integer, 0) < 0) - lz = 0; - else - lz = bs - mpz_sizeinbase (e->value.integer, 2); + /* Follow any component references. */ + as = array->symtree->n.sym->as; + for (ref = array->ref; ref; ref = ref->next) + { + switch (ref->type) + { + case REF_ARRAY: + switch (ref->u.ar.type) + { + case AR_ELEMENT: + as = NULL; + continue; - result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, - &e->where); - mpz_set_ui (result->value.integer, lz); + case AR_FULL: + /* We're done because 'as' has already been set in the + previous iteration. */ + if (!ref->next) + goto done; - return result; -} + /* Fall through. */ + case AR_UNKNOWN: + return NULL; -gfc_expr * -gfc_simplify_len (gfc_expr *e, gfc_expr *kind) -{ - gfc_expr *result; - int k = get_kind (BT_INTEGER, kind, "LEN", gfc_default_integer_kind); + case AR_SECTION: + as = ref->u.ar.as; + goto done; + } - if (k == -1) - return &gfc_bad_expr; + gcc_unreachable (); - if (e->expr_type == EXPR_CONSTANT) - { - result = gfc_constant_result (BT_INTEGER, k, &e->where); - mpz_set_si (result->value.integer, e->value.character.length); - if (gfc_range_check (result) == ARITH_OK) - return result; - else - { - gfc_free_expr (result); - return NULL; - } - } + case REF_COMPONENT: + as = ref->u.c.component->as; + continue; - if (e->ts.u.cl != NULL && e->ts.u.cl->length != NULL - && e->ts.u.cl->length->expr_type == EXPR_CONSTANT - && e->ts.u.cl->length->ts.type == BT_INTEGER) - { - result = gfc_constant_result (BT_INTEGER, k, &e->where); - mpz_set (result->value.integer, e->ts.u.cl->length->value.integer); - if (gfc_range_check (result) == ARITH_OK) - return result; - else - { - gfc_free_expr (result); - return NULL; + case REF_SUBSTRING: + continue; } } - return NULL; -} - - -gfc_expr * -gfc_simplify_len_trim (gfc_expr *e, gfc_expr *kind) -{ - gfc_expr *result; - int count, len, lentrim, i; - int k = get_kind (BT_INTEGER, kind, "LEN_TRIM", gfc_default_integer_kind); + gcc_unreachable (); - if (k == -1) - return &gfc_bad_expr; + done: - if (e->expr_type != EXPR_CONSTANT) + if (as->type == AS_DEFERRED || as->type == AS_ASSUMED_SHAPE) return NULL; - result = gfc_constant_result (BT_INTEGER, k, &e->where); - len = e->value.character.length; - - for (count = 0, i = 1; i <= len; i++) - if (e->value.character.string[len - i] == ' ') - count++; - else - break; + if (dim == NULL) + { + /* Multi-dimensional cobounds. */ + gfc_expr *bounds[GFC_MAX_DIMENSIONS]; + gfc_expr *e; + int k; - lentrim = len - count; + /* Simplify the cobounds for each dimension. */ + for (d = 0; d < as->corank; d++) + { + bounds[d] = simplify_bound_dim (array, kind, d + 1 + array->rank, + upper, as, ref, true); + if (bounds[d] == NULL || bounds[d] == &gfc_bad_expr) + { + int j; + + for (j = 0; j < d; j++) + gfc_free_expr (bounds[j]); + return bounds[d]; + } + } + + /* Allocate the result expression. */ + e = gfc_get_expr (); + e->where = array->where; + e->expr_type = EXPR_ARRAY; + e->ts.type = BT_INTEGER; + k = get_kind (BT_INTEGER, kind, upper ? "UCOBOUND" : "LCOBOUND", + gfc_default_integer_kind); + if (k == -1) + { + gfc_free_expr (e); + return &gfc_bad_expr; + } + e->ts.kind = k; + + /* The result is a rank 1 array; its size is the rank of the first + argument to {L,U}COBOUND. */ + e->rank = 1; + e->shape = gfc_get_shape (1); + mpz_init_set_ui (e->shape[0], as->corank); + + /* Create the constructor for this array. */ + for (d = 0; d < as->corank; d++) + gfc_constructor_append_expr (&e->value.constructor, + bounds[d], &e->where); + return e; + } + else + { + /* A DIM argument is specified. */ + if (dim->expr_type != EXPR_CONSTANT) + return NULL; + + d = mpz_get_si (dim->value.integer); + + if (d < 1 || d > as->corank) + { + gfc_error ("DIM argument at %L is out of bounds", &dim->where); + return &gfc_bad_expr; + } + + return simplify_bound_dim (array, kind, d+array->rank, upper, as, ref, true); + } +} + + +gfc_expr * +gfc_simplify_lbound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) +{ + return simplify_bound (array, dim, kind, 0); +} + + +gfc_expr * +gfc_simplify_lcobound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) +{ + gfc_expr *e; + /* return simplify_cobound (array, dim, kind, 0);*/ + + e = simplify_cobound (array, dim, kind, 0); + if (e != NULL) + return e; + + gfc_error ("Not yet implemented: LCOBOUND for coarray with non-constant " + "cobounds at %L", &array->where); + return &gfc_bad_expr; +} + +gfc_expr * +gfc_simplify_leadz (gfc_expr *e) +{ + unsigned long lz, bs; + int i; + + if (e->expr_type != EXPR_CONSTANT) + return NULL; + + i = gfc_validate_kind (e->ts.type, e->ts.kind, false); + bs = gfc_integer_kinds[i].bit_size; + if (mpz_cmp_si (e->value.integer, 0) == 0) + lz = bs; + else if (mpz_cmp_si (e->value.integer, 0) < 0) + lz = 0; + else + lz = bs - mpz_sizeinbase (e->value.integer, 2); - mpz_set_si (result->value.integer, lentrim); + return gfc_get_int_expr (gfc_default_integer_kind, &e->where, lz); +} + + +gfc_expr * +gfc_simplify_len (gfc_expr *e, gfc_expr *kind) +{ + gfc_expr *result; + int k = get_kind (BT_INTEGER, kind, "LEN", gfc_default_integer_kind); + + if (k == -1) + return &gfc_bad_expr; + + if (e->expr_type == EXPR_CONSTANT) + { + result = gfc_get_constant_expr (BT_INTEGER, k, &e->where); + mpz_set_si (result->value.integer, e->value.character.length); + return range_check (result, "LEN"); + } + else if (e->ts.u.cl != NULL && e->ts.u.cl->length != NULL + && e->ts.u.cl->length->expr_type == EXPR_CONSTANT + && e->ts.u.cl->length->ts.type == BT_INTEGER) + { + result = gfc_get_constant_expr (BT_INTEGER, k, &e->where); + mpz_set (result->value.integer, e->ts.u.cl->length->value.integer); + return range_check (result, "LEN"); + } + else + return NULL; +} + + +gfc_expr * +gfc_simplify_len_trim (gfc_expr *e, gfc_expr *kind) +{ + gfc_expr *result; + int count, len, i; + int k = get_kind (BT_INTEGER, kind, "LEN_TRIM", gfc_default_integer_kind); + + if (k == -1) + return &gfc_bad_expr; + + if (e->expr_type != EXPR_CONSTANT) + return NULL; + + len = e->value.character.length; + for (count = 0, i = 1; i <= len; i++) + if (e->value.character.string[len - i] == ' ') + count++; + else + break; + + result = gfc_get_int_expr (k, &e->where, len - count); return range_check (result, "LEN_TRIM"); } gfc_expr * -gfc_simplify_lgamma (gfc_expr *x ATTRIBUTE_UNUSED) +gfc_simplify_lgamma (gfc_expr *x) { gfc_expr *result; int sg; @@ -3213,8 +3145,7 @@ gfc_simplify_lgamma (gfc_expr *x ATTRIBUTE_UNUSED) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_lgamma (result->value.real, &sg, x->value.real, GFC_RND_MODE); return range_check (result, "LGAMMA"); @@ -3227,7 +3158,8 @@ gfc_simplify_lge (gfc_expr *a, gfc_expr *b) if (a->expr_type != EXPR_CONSTANT || b->expr_type != EXPR_CONSTANT) return NULL; - return gfc_logical_expr (gfc_compare_string (a, b) >= 0, &a->where); + return gfc_get_logical_expr (gfc_default_logical_kind, &a->where, + gfc_compare_string (a, b) >= 0); } @@ -3237,8 +3169,8 @@ gfc_simplify_lgt (gfc_expr *a, gfc_expr *b) if (a->expr_type != EXPR_CONSTANT || b->expr_type != EXPR_CONSTANT) return NULL; - return gfc_logical_expr (gfc_compare_string (a, b) > 0, - &a->where); + return gfc_get_logical_expr (gfc_default_logical_kind, &a->where, + gfc_compare_string (a, b) > 0); } @@ -3248,7 +3180,8 @@ gfc_simplify_lle (gfc_expr *a, gfc_expr *b) if (a->expr_type != EXPR_CONSTANT || b->expr_type != EXPR_CONSTANT) return NULL; - return gfc_logical_expr (gfc_compare_string (a, b) <= 0, &a->where); + return gfc_get_logical_expr (gfc_default_logical_kind, &a->where, + gfc_compare_string (a, b) <= 0); } @@ -3258,7 +3191,8 @@ gfc_simplify_llt (gfc_expr *a, gfc_expr *b) if (a->expr_type != EXPR_CONSTANT || b->expr_type != EXPR_CONSTANT) return NULL; - return gfc_logical_expr (gfc_compare_string (a, b) < 0, &a->where); + return gfc_get_logical_expr (gfc_default_logical_kind, &a->where, + gfc_compare_string (a, b) < 0); } @@ -3270,8 +3204,7 @@ gfc_simplify_log (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); switch (x->ts.type) { @@ -3324,8 +3257,7 @@ gfc_simplify_log10 (gfc_expr *x) return &gfc_bad_expr; } - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); mpfr_log10 (result->value.real, x->value.real, GFC_RND_MODE); return range_check (result, "LOG10"); @@ -3335,7 +3267,6 @@ gfc_simplify_log10 (gfc_expr *x) gfc_expr * gfc_simplify_logical (gfc_expr *e, gfc_expr *k) { - gfc_expr *result; int kind; kind = get_kind (BT_LOGICAL, k, "LOGICAL", gfc_default_logical_kind); @@ -3345,11 +3276,7 @@ gfc_simplify_logical (gfc_expr *e, gfc_expr *k) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_LOGICAL, kind, &e->where); - - result->value.logical = e->value.logical; - - return result; + return gfc_get_logical_expr (kind, &e->where, e->value.logical); } @@ -3357,17 +3284,17 @@ gfc_expr* gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b) { gfc_expr *result; - gfc_constructor *ma_ctor, *mb_ctor; - int row, result_rows, col, result_columns, stride_a, stride_b; + int row, result_rows, col, result_columns; + int stride_a, offset_a, stride_b, offset_b; if (!is_constant_array_expr (matrix_a) || !is_constant_array_expr (matrix_b)) return NULL; gcc_assert (gfc_compare_types (&matrix_a->ts, &matrix_b->ts)); - result = gfc_start_constructor (matrix_a->ts.type, - matrix_a->ts.kind, - &matrix_a->where); + result = gfc_get_array_expr (matrix_a->ts.type, + matrix_a->ts.kind, + &matrix_a->where); if (matrix_a->rank == 1 && matrix_b->rank == 2) { @@ -3406,25 +3333,22 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b) else gcc_unreachable(); - ma_ctor = matrix_a->value.constructor; - mb_ctor = matrix_b->value.constructor; - + offset_a = offset_b = 0; for (col = 0; col < result_columns; ++col) { - ma_ctor = matrix_a->value.constructor; + offset_a = 0; for (row = 0; row < result_rows; ++row) { - gfc_expr *e; - e = compute_dot_product (ma_ctor, stride_a, - mb_ctor, 1); + gfc_expr *e = compute_dot_product (matrix_a, stride_a, offset_a, + matrix_b, 1, offset_b); + gfc_constructor_append_expr (&result->value.constructor, + e, NULL); - gfc_append_constructor (result, e); + offset_a += 1; + } - ADVANCE (ma_ctor, 1); - } - - ADVANCE (mb_ctor, stride_b); + offset_b += stride_b; } return result; @@ -3584,26 +3508,25 @@ gfc_simplify_max (gfc_expr *e) static gfc_expr * simplify_minval_maxval (gfc_expr *expr, int sign) { - gfc_constructor *ctr, *extremum; + gfc_constructor *c, *extremum; gfc_intrinsic_sym * specific; extremum = NULL; specific = expr->value.function.isym; - ctr = expr->value.constructor; - - for (; ctr; ctr = ctr->next) + for (c = gfc_constructor_first (expr->value.constructor); + c; c = gfc_constructor_next (c)) { - if (ctr->expr->expr_type != EXPR_CONSTANT) + if (c->expr->expr_type != EXPR_CONSTANT) return NULL; if (extremum == NULL) { - extremum = ctr; + extremum = c; continue; } - min_max_choose (ctr->expr, extremum->expr, sign); + min_max_choose (c->expr, extremum->expr, sign); } if (extremum == NULL) @@ -3627,7 +3550,7 @@ gfc_simplify_minval (gfc_expr *array, gfc_expr* dim, gfc_expr *mask) { if (array->expr_type != EXPR_ARRAY || array->rank != 1 || dim || mask) return NULL; - + return simplify_minval_maxval (array, -1); } @@ -3637,6 +3560,7 @@ gfc_simplify_maxval (gfc_expr *array, gfc_expr* dim, gfc_expr *mask) { if (array->expr_type != EXPR_ARRAY || array->rank != 1 || dim || mask) return NULL; + return simplify_minval_maxval (array, 1); } @@ -3644,30 +3568,18 @@ gfc_simplify_maxval (gfc_expr *array, gfc_expr* dim, gfc_expr *mask) gfc_expr * gfc_simplify_maxexponent (gfc_expr *x) { - gfc_expr *result; - int i; - - i = gfc_validate_kind (BT_REAL, x->ts.kind, false); - - result = gfc_int_expr (gfc_real_kinds[i].max_exponent); - result->where = x->where; - - return result; + int i = gfc_validate_kind (BT_REAL, x->ts.kind, false); + return gfc_get_int_expr (gfc_default_integer_kind, &x->where, + gfc_real_kinds[i].max_exponent); } gfc_expr * gfc_simplify_minexponent (gfc_expr *x) { - gfc_expr *result; - int i; - - i = gfc_validate_kind (BT_REAL, x->ts.kind, false); - - result = gfc_int_expr (gfc_real_kinds[i].min_exponent); - result->where = x->where; - - return result; + int i = gfc_validate_kind (BT_REAL, x->ts.kind, false); + return gfc_get_int_expr (gfc_default_integer_kind, &x->where, + gfc_real_kinds[i].min_exponent); } @@ -3682,41 +3594,41 @@ gfc_simplify_mod (gfc_expr *a, gfc_expr *p) return NULL; kind = a->ts.kind > p->ts.kind ? a->ts.kind : p->ts.kind; - result = gfc_constant_result (a->ts.type, kind, &a->where); + result = gfc_get_constant_expr (a->ts.type, kind, &a->where); switch (a->ts.type) { - case BT_INTEGER: - if (mpz_cmp_ui (p->value.integer, 0) == 0) - { - /* Result is processor-dependent. */ - gfc_error ("Second argument MOD at %L is zero", &a->where); - gfc_free_expr (result); - return &gfc_bad_expr; - } - mpz_tdiv_r (result->value.integer, a->value.integer, p->value.integer); - break; + case BT_INTEGER: + if (mpz_cmp_ui (p->value.integer, 0) == 0) + { + /* Result is processor-dependent. */ + gfc_error ("Second argument MOD at %L is zero", &a->where); + gfc_free_expr (result); + return &gfc_bad_expr; + } + mpz_tdiv_r (result->value.integer, a->value.integer, p->value.integer); + break; - case BT_REAL: - if (mpfr_cmp_ui (p->value.real, 0) == 0) - { - /* Result is processor-dependent. */ - gfc_error ("Second argument of MOD at %L is zero", &p->where); - gfc_free_expr (result); - return &gfc_bad_expr; - } + case BT_REAL: + if (mpfr_cmp_ui (p->value.real, 0) == 0) + { + /* Result is processor-dependent. */ + gfc_error ("Second argument of MOD at %L is zero", &p->where); + gfc_free_expr (result); + return &gfc_bad_expr; + } - gfc_set_model_kind (kind); - mpfr_init (tmp); - mpfr_div (tmp, a->value.real, p->value.real, GFC_RND_MODE); - mpfr_trunc (tmp, tmp); - mpfr_mul (tmp, tmp, p->value.real, GFC_RND_MODE); - mpfr_sub (result->value.real, a->value.real, tmp, GFC_RND_MODE); - mpfr_clear (tmp); - break; + gfc_set_model_kind (kind); + mpfr_init (tmp); + mpfr_div (tmp, a->value.real, p->value.real, GFC_RND_MODE); + mpfr_trunc (tmp, tmp); + mpfr_mul (tmp, tmp, p->value.real, GFC_RND_MODE); + mpfr_sub (result->value.real, a->value.real, tmp, GFC_RND_MODE); + mpfr_clear (tmp); + break; - default: - gfc_internal_error ("gfc_simplify_mod(): Bad arguments"); + default: + gfc_internal_error ("gfc_simplify_mod(): Bad arguments"); } return range_check (result, "MOD"); @@ -3734,43 +3646,43 @@ gfc_simplify_modulo (gfc_expr *a, gfc_expr *p) return NULL; kind = a->ts.kind > p->ts.kind ? a->ts.kind : p->ts.kind; - result = gfc_constant_result (a->ts.type, kind, &a->where); + result = gfc_get_constant_expr (a->ts.type, kind, &a->where); switch (a->ts.type) { - case BT_INTEGER: - if (mpz_cmp_ui (p->value.integer, 0) == 0) - { - /* Result is processor-dependent. This processor just opts - to not handle it at all. */ - gfc_error ("Second argument of MODULO at %L is zero", &a->where); - gfc_free_expr (result); - return &gfc_bad_expr; - } - mpz_fdiv_r (result->value.integer, a->value.integer, p->value.integer); + case BT_INTEGER: + if (mpz_cmp_ui (p->value.integer, 0) == 0) + { + /* Result is processor-dependent. This processor just opts + to not handle it at all. */ + gfc_error ("Second argument of MODULO at %L is zero", &a->where); + gfc_free_expr (result); + return &gfc_bad_expr; + } + mpz_fdiv_r (result->value.integer, a->value.integer, p->value.integer); - break; + break; - case BT_REAL: - if (mpfr_cmp_ui (p->value.real, 0) == 0) - { - /* Result is processor-dependent. */ - gfc_error ("Second argument of MODULO at %L is zero", &p->where); - gfc_free_expr (result); - return &gfc_bad_expr; - } + case BT_REAL: + if (mpfr_cmp_ui (p->value.real, 0) == 0) + { + /* Result is processor-dependent. */ + gfc_error ("Second argument of MODULO at %L is zero", &p->where); + gfc_free_expr (result); + return &gfc_bad_expr; + } - gfc_set_model_kind (kind); - mpfr_init (tmp); - mpfr_div (tmp, a->value.real, p->value.real, GFC_RND_MODE); - mpfr_floor (tmp, tmp); - mpfr_mul (tmp, tmp, p->value.real, GFC_RND_MODE); - mpfr_sub (result->value.real, a->value.real, tmp, GFC_RND_MODE); - mpfr_clear (tmp); - break; + gfc_set_model_kind (kind); + mpfr_init (tmp); + mpfr_div (tmp, a->value.real, p->value.real, GFC_RND_MODE); + mpfr_floor (tmp, tmp); + mpfr_mul (tmp, tmp, p->value.real, GFC_RND_MODE); + mpfr_sub (result->value.real, a->value.real, tmp, GFC_RND_MODE); + mpfr_clear (tmp); + break; - default: - gfc_internal_error ("gfc_simplify_modulo(): Bad arguments"); + default: + gfc_internal_error ("gfc_simplify_modulo(): Bad arguments"); } return range_check (result, "MODULO"); @@ -3859,12 +3771,10 @@ simplify_nint (const char *name, gfc_expr *e, gfc_expr *k) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_INTEGER, kind, &e->where); - itrunc = gfc_copy_expr (e); - mpfr_round (itrunc->value.real, e->value.real); + result = gfc_get_constant_expr (BT_INTEGER, kind, &e->where); gfc_mpfr_to_mpz (result->value.integer, itrunc->value.real, &e->where); gfc_free_expr (itrunc); @@ -3878,11 +3788,9 @@ gfc_simplify_new_line (gfc_expr *e) { gfc_expr *result; - result = gfc_constant_result (BT_CHARACTER, e->ts.kind, &e->where); - result->value.character.string = gfc_get_wide_string (2); - result->value.character.length = 1; + result = gfc_get_character_expr (e->ts.kind, &e->where, NULL, 1); result->value.character.string[0] = '\n'; - result->value.character.string[1] = '\0'; /* For debugger */ + return result; } @@ -3909,8 +3817,7 @@ gfc_simplify_not (gfc_expr *e) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (e->ts.type, e->ts.kind, &e->where); - + result = gfc_get_constant_expr (e->ts.type, e->ts.kind, &e->where); mpz_com (result->value.integer, e->value.integer); return range_check (result, "NOT"); @@ -3922,14 +3829,13 @@ gfc_simplify_null (gfc_expr *mold) { gfc_expr *result; - if (mold == NULL) + if (mold) { - result = gfc_get_expr (); - result->ts.type = BT_UNKNOWN; + result = gfc_copy_expr (mold); + result->expr_type = EXPR_NULL; } else - result = gfc_copy_expr (mold); - result->expr_type = EXPR_NULL; + result = gfc_get_null_expr (NULL); return result; } @@ -3939,8 +3845,16 @@ gfc_expr * gfc_simplify_num_images (void) { gfc_expr *result; + + if (gfc_option.coarray == GFC_FCOARRAY_NONE) + { + gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable"); + return &gfc_bad_expr; + } + /* FIXME: gfc_current_locus is wrong. */ - result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, &gfc_current_locus); + result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, + &gfc_current_locus); mpz_set_si (result->value.integer, 1); return result; } @@ -3956,17 +3870,19 @@ gfc_simplify_or (gfc_expr *x, gfc_expr *y) return NULL; kind = x->ts.kind > y->ts.kind ? x->ts.kind : y->ts.kind; - if (x->ts.type == BT_INTEGER) - { - result = gfc_constant_result (BT_INTEGER, kind, &x->where); - mpz_ior (result->value.integer, x->value.integer, y->value.integer); - return range_check (result, "OR"); - } - else /* BT_LOGICAL */ + + switch (x->ts.type) { - result = gfc_constant_result (BT_LOGICAL, kind, &x->where); - result->value.logical = x->value.logical || y->value.logical; - return result; + case BT_INTEGER: + result = gfc_get_constant_expr (BT_INTEGER, kind, &x->where); + mpz_ior (result->value.integer, x->value.integer, y->value.integer); + return range_check (result, "OR"); + + case BT_LOGICAL: + return gfc_get_logical_expr (kind, &x->where, + x->value.logical || y->value.logical); + default: + gcc_unreachable(); } } @@ -3983,12 +3899,12 @@ gfc_simplify_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector) && !is_constant_array_expr(mask))) return NULL; - result = gfc_start_constructor (array->ts.type, - array->ts.kind, - &array->where); + result = gfc_get_array_expr (array->ts.type, array->ts.kind, &array->where); - array_ctor = array->value.constructor; - vector_ctor = vector ? vector->value.constructor : NULL; + array_ctor = gfc_constructor_first (array->value.constructor); + vector_ctor = vector + ? gfc_constructor_first (vector->value.constructor) + : NULL; if (mask->expr_type == EXPR_CONSTANT && mask->value.logical) @@ -3996,38 +3912,41 @@ gfc_simplify_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector) /* Copy all elements of ARRAY to RESULT. */ while (array_ctor) { - gfc_append_constructor (result, - gfc_copy_expr (array_ctor->expr)); + gfc_constructor_append_expr (&result->value.constructor, + gfc_copy_expr (array_ctor->expr), + NULL); - ADVANCE (array_ctor, 1); - ADVANCE (vector_ctor, 1); + array_ctor = gfc_constructor_next (array_ctor); + vector_ctor = gfc_constructor_next (vector_ctor); } } else if (mask->expr_type == EXPR_ARRAY) { /* Copy only those elements of ARRAY to RESULT whose MASK equals .TRUE.. */ - mask_ctor = mask->value.constructor; + mask_ctor = gfc_constructor_first (mask->value.constructor); while (mask_ctor) { if (mask_ctor->expr->value.logical) { - gfc_append_constructor (result, - gfc_copy_expr (array_ctor->expr)); - ADVANCE (vector_ctor, 1); + gfc_constructor_append_expr (&result->value.constructor, + gfc_copy_expr (array_ctor->expr), + NULL); + vector_ctor = gfc_constructor_next (vector_ctor); } - ADVANCE (array_ctor, 1); - ADVANCE (mask_ctor, 1); + array_ctor = gfc_constructor_next (array_ctor); + mask_ctor = gfc_constructor_next (mask_ctor); } } /* Append any left-over elements from VECTOR to RESULT. */ while (vector_ctor) { - gfc_append_constructor (result, - gfc_copy_expr (vector_ctor->expr)); - ADVANCE (vector_ctor, 1); + gfc_constructor_append_expr (&result->value.constructor, + gfc_copy_expr (vector_ctor->expr), + NULL); + vector_ctor = gfc_constructor_next (vector_ctor); } result->shape = gfc_get_shape (1); @@ -4043,15 +3962,9 @@ gfc_simplify_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector) gfc_expr * gfc_simplify_precision (gfc_expr *e) { - gfc_expr *result; - int i; - - i = gfc_validate_kind (e->ts.type, e->ts.kind, false); - - result = gfc_int_expr (gfc_real_kinds[i].precision); - result->where = e->where; - - return result; + int i = gfc_validate_kind (e->ts.type, e->ts.kind, false); + return gfc_get_int_expr (gfc_default_integer_kind, &e->where, + gfc_real_kinds[i].precision); } @@ -4082,59 +3995,49 @@ gfc_simplify_product (gfc_expr *array, gfc_expr *dim, gfc_expr *mask) gfc_expr * gfc_simplify_radix (gfc_expr *e) { - gfc_expr *result; int i; - i = gfc_validate_kind (e->ts.type, e->ts.kind, false); + switch (e->ts.type) { - case BT_INTEGER: - i = gfc_integer_kinds[i].radix; - break; + case BT_INTEGER: + i = gfc_integer_kinds[i].radix; + break; - case BT_REAL: - i = gfc_real_kinds[i].radix; - break; + case BT_REAL: + i = gfc_real_kinds[i].radix; + break; - default: - gcc_unreachable (); + default: + gcc_unreachable (); } - result = gfc_int_expr (i); - result->where = e->where; - - return result; + return gfc_get_int_expr (gfc_default_integer_kind, &e->where, i); } gfc_expr * gfc_simplify_range (gfc_expr *e) { - gfc_expr *result; int i; - long j; - i = gfc_validate_kind (e->ts.type, e->ts.kind, false); switch (e->ts.type) { - case BT_INTEGER: - j = gfc_integer_kinds[i].range; - break; + case BT_INTEGER: + i = gfc_integer_kinds[i].range; + break; - case BT_REAL: - case BT_COMPLEX: - j = gfc_real_kinds[i].range; - break; + case BT_REAL: + case BT_COMPLEX: + i = gfc_real_kinds[i].range; + break; - default: - gcc_unreachable (); + default: + gcc_unreachable (); } - result = gfc_int_expr (j); - result->where = e->where; - - return result; + return gfc_get_int_expr (gfc_default_integer_kind, &e->where, i); } @@ -4155,39 +4058,12 @@ gfc_simplify_real (gfc_expr *e, gfc_expr *k) if (e->expr_type != EXPR_CONSTANT) return NULL; - switch (e->ts.type) - { - case BT_INTEGER: - if (!e->is_boz) - result = gfc_int2real (e, kind); - break; - - case BT_REAL: - result = gfc_real2real (e, kind); - break; - - case BT_COMPLEX: - result = gfc_complex2real (e, kind); - break; - - default: - gfc_internal_error ("bad type in REAL"); - /* Not reached */ - } + if (convert_boz (e, kind) == &gfc_bad_expr) + return &gfc_bad_expr; - if (e->ts.type == BT_INTEGER && e->is_boz) - { - gfc_typespec ts; - gfc_clear_ts (&ts); - ts.type = BT_REAL; - ts.kind = kind; - result = gfc_copy_expr (e); - if (!gfc_convert_boz (result, &ts)) - { - gfc_free_expr (result); - return &gfc_bad_expr; - } - } + result = gfc_convert_constant (e, BT_REAL, kind); + if (result == &gfc_bad_expr) + return &gfc_bad_expr; return range_check (result, "REAL"); } @@ -4201,8 +4077,9 @@ gfc_simplify_realpart (gfc_expr *e) if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_REAL, e->ts.kind, &e->where); + result = gfc_get_constant_expr (BT_REAL, e->ts.kind, &e->where); mpc_real (result->value.real, e->value.complex, GFC_RND_MODE); + return range_check (result, "REALPART"); } @@ -4303,19 +4180,15 @@ gfc_simplify_repeat (gfc_expr *e, gfc_expr *n) len = e->value.character.length; nlen = ncop * len; - result = gfc_constant_result (BT_CHARACTER, e->ts.kind, &e->where); + result = gfc_get_constant_expr (BT_CHARACTER, e->ts.kind, &e->where); if (ncop == 0) - { - result->value.character.string = gfc_get_wide_string (1); - result->value.character.length = 0; - result->value.character.string[0] = '\0'; - return result; - } + return gfc_get_character_expr (e->ts.kind, &e->where, NULL, 0); - result->value.character.length = nlen; - result->value.character.string = gfc_get_wide_string (nlen + 1); + len = e->value.character.length; + nlen = ncop * len; + result = gfc_get_character_expr (e->ts.kind, &e->where, NULL, nlen); for (i = 0; i < ncop; i++) for (j = 0; j < len; j++) result->value.character.string[j+i*len]= e->value.character.string[j]; @@ -4333,11 +4206,10 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp, { int order[GFC_MAX_DIMENSIONS], shape[GFC_MAX_DIMENSIONS]; int i, rank, npad, x[GFC_MAX_DIMENSIONS]; - gfc_constructor *head, *tail; mpz_t index, size; unsigned long j; size_t nsource; - gfc_expr *e; + gfc_expr *e, *result; /* Check that argument expression types are OK. */ if (!is_constant_array_expr (source) @@ -4350,11 +4222,10 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp, mpz_init (index); rank = 0; - head = tail = NULL; for (;;) { - e = gfc_get_array_element (shape_exp, rank); + e = gfc_constructor_lookup_expr (shape_exp->value.constructor, rank); if (e == NULL) break; @@ -4363,7 +4234,6 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp, gcc_assert (rank >= 0 && rank < GFC_MAX_DIMENSIONS); gcc_assert (shape[rank] >= 0); - gfc_free_expr (e); rank++; } @@ -4382,11 +4252,10 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp, for (i = 0; i < rank; i++) { - e = gfc_get_array_element (order_exp, i); + e = gfc_constructor_lookup_expr (order_exp->value.constructor, i); gcc_assert (e); gfc_extract_int (e, &order[i]); - gfc_free_expr (e); gcc_assert (order[i] >= 1 && order[i] <= rank); order[i]--; @@ -4417,6 +4286,13 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp, for (i = 0; i < rank; i++) x[i] = 0; + result = gfc_get_array_expr (source->ts.type, source->ts.kind, + &source->where); + result->rank = rank; + result->shape = gfc_get_shape (rank); + for (i = 0; i < rank; i++) + mpz_init_set_ui (result->shape[i], shape[i]); + while (nsource > 0 || npad > 0) { /* Figure out which element to extract. */ @@ -4435,27 +4311,19 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp, j = mpz_get_ui (index); if (j < nsource) - e = gfc_get_array_element (source, j); + e = gfc_constructor_lookup_expr (source->value.constructor, j); else { gcc_assert (npad > 0); j = j - nsource; j = j % npad; - e = gfc_get_array_element (pad, j); + e = gfc_constructor_lookup_expr (pad->value.constructor, j); } gcc_assert (e); - if (head == NULL) - head = tail = gfc_get_constructor (); - else - { - tail->next = gfc_get_constructor (); - tail = tail->next; - } - - tail->where = e->where; - tail->expr = e; + gfc_constructor_append_expr (&result->value.constructor, + gfc_copy_expr (e), &e->where); /* Calculate the next element. */ i = 0; @@ -4472,19 +4340,7 @@ inc: mpz_clear (index); - e = gfc_get_expr (); - e->where = source->where; - e->expr_type = EXPR_ARRAY; - e->value.constructor = head; - e->shape = gfc_get_shape (rank); - - for (i = 0; i < rank; i++) - mpz_init_set_ui (e->shape[i], shape[i]); - - e->ts = source->ts; - e->rank = rank; - - return e; + return result; } @@ -4500,8 +4356,7 @@ gfc_simplify_rrspacing (gfc_expr *x) i = gfc_validate_kind (x->ts.type, x->ts.kind, false); - result = gfc_constant_result (BT_REAL, x->ts.kind, &x->where); - + result = gfc_get_constant_expr (BT_REAL, x->ts.kind, &x->where); mpfr_abs (result->value.real, x->value.real, GFC_RND_MODE); /* Special case x = -0 and 0. */ @@ -4532,7 +4387,7 @@ gfc_simplify_scale (gfc_expr *x, gfc_expr *i) if (x->expr_type != EXPR_CONSTANT || i->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_REAL, x->ts.kind, &x->where); + result = gfc_get_constant_expr (BT_REAL, x->ts.kind, &x->where); if (mpfr_sgn (x->value.real) == 0) { @@ -4646,8 +4501,6 @@ gfc_simplify_scan (gfc_expr *e, gfc_expr *c, gfc_expr *b, gfc_expr *kind) else back = 0; - result = gfc_constant_result (BT_INTEGER, k, &e->where); - len = e->value.character.length; lenc = c->value.character.length; @@ -4680,7 +4533,8 @@ gfc_simplify_scan (gfc_expr *e, gfc_expr *c, gfc_expr *b, gfc_expr *kind) } } } - mpz_set_ui (result->value.integer, indx); + + result = gfc_get_int_expr (k, &e->where, indx); return range_check (result, "SCAN"); } @@ -4689,7 +4543,6 @@ gfc_expr * gfc_simplify_selected_char_kind (gfc_expr *e) { int kind; - gfc_expr *result; if (e->expr_type != EXPR_CONSTANT) return NULL; @@ -4702,10 +4555,7 @@ gfc_simplify_selected_char_kind (gfc_expr *e) else kind = -1; - result = gfc_int_expr (kind); - result->where = e->where; - - return result; + return gfc_get_int_expr (gfc_default_integer_kind, &e->where, kind); } @@ -4713,7 +4563,6 @@ gfc_expr * gfc_simplify_selected_int_kind (gfc_expr *e) { int i, kind, range; - gfc_expr *result; if (e->expr_type != EXPR_CONSTANT || gfc_extract_int (e, &range) != NULL) return NULL; @@ -4728,10 +4577,7 @@ gfc_simplify_selected_int_kind (gfc_expr *e) if (kind == INT_MAX) kind = -1; - result = gfc_int_expr (kind); - result->where = e->where; - - return result; + return gfc_get_int_expr (gfc_default_integer_kind, &e->where, kind); } @@ -4739,7 +4585,6 @@ gfc_expr * gfc_simplify_selected_real_kind (gfc_expr *p, gfc_expr *q) { int range, precision, i, kind, found_precision, found_range; - gfc_expr *result; if (p == NULL) precision = 0; @@ -4786,10 +4631,8 @@ gfc_simplify_selected_real_kind (gfc_expr *p, gfc_expr *q) kind -= 2; } - result = gfc_int_expr (kind); - result->where = (p != NULL) ? p->where : q->where; - - return result; + return gfc_get_int_expr (gfc_default_integer_kind, + p ? &p->where : &q->where, kind); } @@ -4803,7 +4646,7 @@ gfc_simplify_set_exponent (gfc_expr *x, gfc_expr *i) if (x->expr_type != EXPR_CONSTANT || i->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (BT_REAL, x->ts.kind, &x->where); + result = gfc_get_constant_expr (BT_REAL, x->ts.kind, &x->where); if (mpfr_sgn (x->value.real) == 0) { @@ -4849,14 +4692,14 @@ gfc_simplify_shape (gfc_expr *source) gfc_try t; if (source->rank == 0) - return gfc_start_constructor (BT_INTEGER, gfc_default_integer_kind, - &source->where); + return gfc_get_array_expr (BT_INTEGER, gfc_default_integer_kind, + &source->where); if (source->expr_type != EXPR_VARIABLE) return NULL; - result = gfc_start_constructor (BT_INTEGER, gfc_default_integer_kind, - &source->where); + result = gfc_get_array_expr (BT_INTEGER, gfc_default_integer_kind, + &source->where); ar = gfc_find_array_ref (source); @@ -4864,8 +4707,8 @@ gfc_simplify_shape (gfc_expr *source) for (n = 0; n < source->rank; n++) { - e = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, - &source->where); + e = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, + &source->where); if (t == SUCCESS) { @@ -4889,7 +4732,7 @@ gfc_simplify_shape (gfc_expr *source) } } - gfc_append_constructor (result, e); + gfc_constructor_append_expr (&result->value.constructor, e, NULL); } return result; @@ -4900,7 +4743,6 @@ gfc_expr * gfc_simplify_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) { mpz_t size; - gfc_expr *result; int d; int k = get_kind (BT_INTEGER, kind, "SIZE", gfc_default_integer_kind); @@ -4922,9 +4764,7 @@ gfc_simplify_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) return NULL; } - result = gfc_constant_result (BT_INTEGER, k, &array->where); - mpz_set (result->value.integer, size); - return result; + return gfc_get_int_expr (k, &array->where, mpz_get_si (size)); } @@ -4936,27 +4776,27 @@ gfc_simplify_sign (gfc_expr *x, gfc_expr *y) if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); switch (x->ts.type) - { - case BT_INTEGER: - mpz_abs (result->value.integer, x->value.integer); - if (mpz_sgn (y->value.integer) < 0) - mpz_neg (result->value.integer, result->value.integer); - break; + { + case BT_INTEGER: + mpz_abs (result->value.integer, x->value.integer); + if (mpz_sgn (y->value.integer) < 0) + mpz_neg (result->value.integer, result->value.integer); + break; - case BT_REAL: - if (gfc_option.flag_sign_zero) - mpfr_copysign (result->value.real, x->value.real, y->value.real, - GFC_RND_MODE); - else - mpfr_setsign (result->value.real, x->value.real, - mpfr_sgn (y->value.real) < 0 ? 1 : 0, GFC_RND_MODE); - break; + case BT_REAL: + if (gfc_option.flag_sign_zero) + mpfr_copysign (result->value.real, x->value.real, y->value.real, + GFC_RND_MODE); + else + mpfr_setsign (result->value.real, x->value.real, + mpfr_sgn (y->value.real) < 0 ? 1 : 0, GFC_RND_MODE); + break; - default: - gfc_internal_error ("Bad type in gfc_simplify_sign"); + default: + gfc_internal_error ("Bad type in gfc_simplify_sign"); } return result; @@ -4971,21 +4811,21 @@ gfc_simplify_sin (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); switch (x->ts.type) { - case BT_REAL: - mpfr_sin (result->value.real, x->value.real, GFC_RND_MODE); - break; + case BT_REAL: + mpfr_sin (result->value.real, x->value.real, GFC_RND_MODE); + break; - case BT_COMPLEX: - gfc_set_model (x->value.real); - mpc_sin (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); - break; + case BT_COMPLEX: + gfc_set_model (x->value.real); + mpc_sin (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); + break; - default: - gfc_internal_error ("in gfc_simplify_sin(): Bad type"); + default: + gfc_internal_error ("in gfc_simplify_sin(): Bad type"); } return range_check (result, "SIN"); @@ -5000,15 +4840,21 @@ gfc_simplify_sinh (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); - if (x->ts.type == BT_REAL) - mpfr_sinh (result->value.real, x->value.real, GFC_RND_MODE); - else if (x->ts.type == BT_COMPLEX) - mpc_sinh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); - else - gcc_unreachable (); + switch (x->ts.type) + { + case BT_REAL: + mpfr_sinh (result->value.real, x->value.real, GFC_RND_MODE); + break; + + case BT_COMPLEX: + mpc_sinh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); + break; + default: + gcc_unreachable (); + } return range_check (result, "SINH"); } @@ -5042,7 +4888,7 @@ gfc_simplify_spacing (gfc_expr *x) i = gfc_validate_kind (x->ts.type, x->ts.kind, false); - result = gfc_constant_result (BT_REAL, x->ts.kind, &x->where); + result = gfc_get_constant_expr (BT_REAL, x->ts.kind, &x->where); /* Special case x = 0 and -0. */ mpfr_abs (result->value.real, x->value.real, GFC_RND_MODE); @@ -5106,31 +4952,29 @@ gfc_simplify_spread (gfc_expr *source, gfc_expr *dim_expr, gfc_expr *ncopies_exp { gcc_assert (dim == 0); - result = gfc_start_constructor (source->ts.type, - source->ts.kind, - &source->where); + result = gfc_get_array_expr (source->ts.type, source->ts.kind, + &source->where); result->rank = 1; result->shape = gfc_get_shape (result->rank); mpz_init_set_si (result->shape[0], ncopies); for (i = 0; i < ncopies; ++i) - gfc_append_constructor (result, gfc_copy_expr (source)); + gfc_constructor_append_expr (&result->value.constructor, + gfc_copy_expr (source), NULL); } else if (source->expr_type == EXPR_ARRAY) { - int result_size, rstride[GFC_MAX_DIMENSIONS], extent[GFC_MAX_DIMENSIONS]; - gfc_constructor *ctor, *source_ctor, *result_ctor; + int offset, rstride[GFC_MAX_DIMENSIONS], extent[GFC_MAX_DIMENSIONS]; + gfc_constructor *source_ctor; gcc_assert (source->rank < GFC_MAX_DIMENSIONS); gcc_assert (dim >= 0 && dim <= source->rank); - result = gfc_start_constructor (source->ts.type, - source->ts.kind, - &source->where); + result = gfc_get_array_expr (source->ts.type, source->ts.kind, + &source->where); result->rank = source->rank + 1; result->shape = gfc_get_shape (result->rank); - result_size = 1; for (i = 0, j = 0; i < result->rank; ++i) { if (i != dim) @@ -5140,26 +4984,18 @@ gfc_simplify_spread (gfc_expr *source, gfc_expr *dim_expr, gfc_expr *ncopies_exp extent[i] = mpz_get_si (result->shape[i]); rstride[i] = (i == 0) ? 1 : rstride[i-1] * extent[i-1]; - result_size *= extent[i]; } - for (i = 0; i < result_size; ++i) - gfc_append_constructor (result, NULL); - - source_ctor = source->value.constructor; - result_ctor = result->value.constructor; - while (source_ctor) + offset = 0; + for (source_ctor = gfc_constructor_first (source->value.constructor); + source_ctor; source_ctor = gfc_constructor_next (source_ctor)) { - ctor = result_ctor; - for (i = 0; i < ncopies; ++i) - { - ctor->expr = gfc_copy_expr (source_ctor->expr); - ADVANCE (ctor, rstride[dim]); - } + gfc_constructor_insert_expr (&result->value.constructor, + gfc_copy_expr (source_ctor->expr), + NULL, offset + i * rstride[dim]); - ADVANCE (result_ctor, (dim == 0 ? ncopies : 1)); - ADVANCE (source_ctor, 1); + offset += (dim == 0 ? ncopies : 1); } } else @@ -5178,37 +5014,36 @@ gfc_simplify_spread (gfc_expr *source, gfc_expr *dim_expr, gfc_expr *ncopies_exp gfc_expr * gfc_simplify_sqrt (gfc_expr *e) { - gfc_expr *result; + gfc_expr *result = NULL; if (e->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (e->ts.type, e->ts.kind, &e->where); - switch (e->ts.type) { - case BT_REAL: - if (mpfr_cmp_si (e->value.real, 0) < 0) - goto negative_arg; - mpfr_sqrt (result->value.real, e->value.real, GFC_RND_MODE); + case BT_REAL: + if (mpfr_cmp_si (e->value.real, 0) < 0) + { + gfc_error ("Argument of SQRT at %L has a negative value", + &e->where); + return &gfc_bad_expr; + } + result = gfc_get_constant_expr (e->ts.type, e->ts.kind, &e->where); + mpfr_sqrt (result->value.real, e->value.real, GFC_RND_MODE); + break; - break; + case BT_COMPLEX: + gfc_set_model (e->value.real); - case BT_COMPLEX: - gfc_set_model (e->value.real); - mpc_sqrt (result->value.complex, e->value.complex, GFC_MPC_RND_MODE); - break; + result = gfc_get_constant_expr (e->ts.type, e->ts.kind, &e->where); + mpc_sqrt (result->value.complex, e->value.complex, GFC_MPC_RND_MODE); + break; - default: - gfc_internal_error ("invalid argument of SQRT at %L", &e->where); + default: + gfc_internal_error ("invalid argument of SQRT at %L", &e->where); } return range_check (result, "SQRT"); - -negative_arg: - gfc_free_expr (result); - gfc_error ("Argument of SQRT at %L has a negative value", &e->where); - return &gfc_bad_expr; } @@ -5244,14 +5079,21 @@ gfc_simplify_tan (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); - if (x->ts.type == BT_REAL) - mpfr_tan (result->value.real, x->value.real, GFC_RND_MODE); - else if (x->ts.type == BT_COMPLEX) - mpc_tan (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); - else - gcc_unreachable (); + switch (x->ts.type) + { + case BT_REAL: + mpfr_tan (result->value.real, x->value.real, GFC_RND_MODE); + break; + + case BT_COMPLEX: + mpc_tan (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); + break; + + default: + gcc_unreachable (); + } return range_check (result, "TAN"); } @@ -5265,17 +5107,23 @@ gfc_simplify_tanh (gfc_expr *x) if (x->expr_type != EXPR_CONSTANT) return NULL; - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); - if (x->ts.type == BT_REAL) - mpfr_tanh (result->value.real, x->value.real, GFC_RND_MODE); - else if (x->ts.type == BT_COMPLEX) - mpc_tanh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); - else - gcc_unreachable (); + switch (x->ts.type) + { + case BT_REAL: + mpfr_tanh (result->value.real, x->value.real, GFC_RND_MODE); + break; - return range_check (result, "TANH"); + case BT_COMPLEX: + mpc_tanh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE); + break; + default: + gcc_unreachable (); + } + + return range_check (result, "TANH"); } @@ -5287,7 +5135,7 @@ gfc_simplify_tiny (gfc_expr *e) i = gfc_validate_kind (BT_REAL, e->ts.kind, false); - result = gfc_constant_result (BT_REAL, e->ts.kind, &e->where); + result = gfc_get_constant_expr (BT_REAL, e->ts.kind, &e->where); mpfr_set (result->value.real, gfc_real_kinds[i].tiny, GFC_RND_MODE); return result; @@ -5297,7 +5145,6 @@ gfc_simplify_tiny (gfc_expr *e) gfc_expr * gfc_simplify_trailz (gfc_expr *e) { - gfc_expr *result; unsigned long tz, bs; int i; @@ -5308,10 +5155,8 @@ gfc_simplify_trailz (gfc_expr *e) bs = gfc_integer_kinds[i].bit_size; tz = mpz_scan1 (e->value.integer, 0); - result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, &e->where); - mpz_set_ui (result->value.integer, MIN (tz, bs)); - - return result; + return gfc_get_int_expr (gfc_default_integer_kind, + &e->where, MIN (tz, bs)); } @@ -5343,12 +5188,12 @@ gfc_simplify_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size) source_size = gfc_target_expr_size (source); /* Create an empty new expression with the appropriate characteristics. */ - result = gfc_constant_result (mold->ts.type, mold->ts.kind, - &source->where); + result = gfc_get_constant_expr (mold->ts.type, mold->ts.kind, + &source->where); result->ts = mold->ts; mold_element = mold->expr_type == EXPR_ARRAY - ? mold->value.constructor->expr + ? gfc_constructor_first (mold->value.constructor)->expr : mold; /* Set result character length, if needed. Note that this needs to be @@ -5415,16 +5260,16 @@ gfc_simplify_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size) gfc_expr * gfc_simplify_transpose (gfc_expr *matrix) { - int i, matrix_rows; + int row, matrix_rows, col, matrix_cols; gfc_expr *result; - gfc_constructor *matrix_ctor; if (!is_constant_array_expr (matrix)) return NULL; gcc_assert (matrix->rank == 2); - result = gfc_start_constructor (matrix->ts.type, matrix->ts.kind, &matrix->where); + result = gfc_get_array_expr (matrix->ts.type, matrix->ts.kind, + &matrix->where); result->rank = 2; result->shape = gfc_get_shape (result->rank); mpz_set (result->shape[0], matrix->shape[1]); @@ -5434,20 +5279,16 @@ gfc_simplify_transpose (gfc_expr *matrix) result->ts.u.cl = matrix->ts.u.cl; matrix_rows = mpz_get_si (matrix->shape[0]); - matrix_ctor = matrix->value.constructor; - for (i = 0; i < matrix_rows; ++i) - { - gfc_constructor *column_ctor = matrix_ctor; - while (column_ctor) - { - gfc_append_constructor (result, - gfc_copy_expr (column_ctor->expr)); - - ADVANCE (column_ctor, matrix_rows); - } - - ADVANCE (matrix_ctor, 1); - } + matrix_cols = mpz_get_si (matrix->shape[1]); + for (row = 0; row < matrix_rows; ++row) + for (col = 0; col < matrix_cols; ++col) + { + gfc_expr *e = gfc_constructor_lookup_expr (matrix->value.constructor, + col * matrix_rows + row); + gfc_constructor_insert_expr (&result->value.constructor, + gfc_copy_expr (e), &matrix->where, + row * matrix_cols + col); + } return result; } @@ -5463,9 +5304,6 @@ gfc_simplify_trim (gfc_expr *e) return NULL; len = e->value.character.length; - - result = gfc_constant_result (BT_CHARACTER, e->ts.kind, &e->where); - for (count = 0, i = 1; i <= len; ++i) { if (e->value.character.string[len - i] == ' ') @@ -5476,15 +5314,233 @@ gfc_simplify_trim (gfc_expr *e) lentrim = len - count; - result->value.character.length = lentrim; - result->value.character.string = gfc_get_wide_string (lentrim + 1); - + result = gfc_get_character_expr (e->ts.kind, &e->where, NULL, lentrim); for (i = 0; i < lentrim; i++) result->value.character.string[i] = e->value.character.string[i]; - result->value.character.string[lentrim] = '\0'; /* For debugger */ + return result; +} + + +gfc_expr * +gfc_simplify_image_index (gfc_expr *coarray, gfc_expr *sub) +{ + gfc_expr *result; + gfc_ref *ref; + gfc_array_spec *as; + gfc_constructor *sub_cons; + bool first_image; + int d; + + if (!is_constant_array_expr (sub)) + goto not_implemented; /* return NULL;*/ + + /* Follow any component references. */ + as = coarray->symtree->n.sym->as; + for (ref = coarray->ref; ref; ref = ref->next) + if (ref->type == REF_COMPONENT) + as = ref->u.ar.as; + + if (as->type == AS_DEFERRED) + goto not_implemented; /* return NULL;*/ + + /* "valid sequence of cosubscripts" are required; thus, return 0 unless + the cosubscript addresses the first image. */ + + sub_cons = gfc_constructor_first (sub->value.constructor); + first_image = true; + + for (d = 1; d <= as->corank; d++) + { + gfc_expr *ca_bound; + int cmp; + + if (sub_cons == NULL) + { + gfc_error ("Too few elements in expression for SUB= argument at %L", + &sub->where); + return &gfc_bad_expr; + } + + ca_bound = simplify_bound_dim (coarray, NULL, d + as->rank, 0, as, + NULL, true); + if (ca_bound == NULL) + goto not_implemented; /* return NULL */ + + if (ca_bound == &gfc_bad_expr) + return ca_bound; + + cmp = mpz_cmp (ca_bound->value.integer, sub_cons->expr->value.integer); + + if (cmp == 0) + { + gfc_free_expr (ca_bound); + sub_cons = gfc_constructor_next (sub_cons); + continue; + } + + first_image = false; + + if (cmp > 0) + { + gfc_error ("Out of bounds in IMAGE_INDEX at %L for dimension %d, " + "SUB has %ld and COARRAY lower bound is %ld)", + &coarray->where, d, + mpz_get_si (sub_cons->expr->value.integer), + mpz_get_si (ca_bound->value.integer)); + gfc_free_expr (ca_bound); + return &gfc_bad_expr; + } + + gfc_free_expr (ca_bound); + + /* Check whether upperbound is valid for the multi-images case. */ + if (d < as->corank) + { + ca_bound = simplify_bound_dim (coarray, NULL, d + as->rank, 1, as, + NULL, true); + if (ca_bound == &gfc_bad_expr) + return ca_bound; + + if (ca_bound && ca_bound->expr_type == EXPR_CONSTANT + && mpz_cmp (ca_bound->value.integer, + sub_cons->expr->value.integer) < 0) + { + gfc_error ("Out of bounds in IMAGE_INDEX at %L for dimension %d, " + "SUB has %ld and COARRAY upper bound is %ld)", + &coarray->where, d, + mpz_get_si (sub_cons->expr->value.integer), + mpz_get_si (ca_bound->value.integer)); + gfc_free_expr (ca_bound); + return &gfc_bad_expr; + } + + if (ca_bound) + gfc_free_expr (ca_bound); + } + + sub_cons = gfc_constructor_next (sub_cons); + } + + if (sub_cons != NULL) + { + gfc_error ("Too many elements in expression for SUB= argument at %L", + &sub->where); + return &gfc_bad_expr; + } + + result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, + &gfc_current_locus); + if (first_image) + mpz_set_si (result->value.integer, 1); + else + mpz_set_si (result->value.integer, 0); return result; + +not_implemented: + gfc_error ("Not yet implemented: IMAGE_INDEX for coarray with non-constant " + "cobounds at %L", &coarray->where); + return &gfc_bad_expr; +} + + +gfc_expr * +gfc_simplify_this_image (gfc_expr *coarray, gfc_expr *dim) +{ + gfc_ref *ref; + gfc_array_spec *as; + int d; + + if (coarray == NULL) + { + gfc_expr *result; + /* FIXME: gfc_current_locus is wrong. */ + result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, + &gfc_current_locus); + mpz_set_si (result->value.integer, 1); + return result; + } + + gcc_assert (coarray->expr_type == EXPR_VARIABLE); + + /* Follow any component references. */ + as = coarray->symtree->n.sym->as; + for (ref = coarray->ref; ref; ref = ref->next) + if (ref->type == REF_COMPONENT) + as = ref->u.ar.as; + + if (as->type == AS_DEFERRED) + goto not_implemented; /* return NULL;*/ + + if (dim == NULL) + { + /* Multi-dimensional bounds. */ + gfc_expr *bounds[GFC_MAX_DIMENSIONS]; + gfc_expr *e; + + /* Simplify the bounds for each dimension. */ + for (d = 0; d < as->corank; d++) + { + bounds[d] = simplify_bound_dim (coarray, NULL, d + as->rank + 1, 0, + as, NULL, true); + if (bounds[d] == NULL || bounds[d] == &gfc_bad_expr) + { + int j; + + for (j = 0; j < d; j++) + gfc_free_expr (bounds[j]); + if (bounds[d] == NULL) + goto not_implemented; + return bounds[d]; + } + } + + /* Allocate the result expression. */ + e = gfc_get_expr (); + e->where = coarray->where; + e->expr_type = EXPR_ARRAY; + e->ts.type = BT_INTEGER; + e->ts.kind = gfc_default_integer_kind; + + e->rank = 1; + e->shape = gfc_get_shape (1); + mpz_init_set_ui (e->shape[0], as->corank); + + /* Create the constructor for this array. */ + for (d = 0; d < as->corank; d++) + gfc_constructor_append_expr (&e->value.constructor, + bounds[d], &e->where); + + return e; + } + else + { + gfc_expr *e; + /* A DIM argument is specified. */ + if (dim->expr_type != EXPR_CONSTANT) + goto not_implemented; /*return NULL;*/ + + d = mpz_get_si (dim->value.integer); + + if (d < 1 || d > as->corank) + { + gfc_error ("DIM argument at %L is out of bounds", &dim->where); + return &gfc_bad_expr; + } + + /*return simplify_bound_dim (coarray, NULL, d + as->rank, 0, as, NULL, true);*/ + e = simplify_bound_dim (coarray, NULL, d + as->rank, 0, as, NULL, true); + if (e != NULL) + return e; + else + goto not_implemented; + } + +not_implemented: + gfc_error ("Not yet implemented: THIS_IMAGE for coarray with non-constant " + "cobounds at %L", &coarray->where); + return &gfc_bad_expr; } @@ -5494,6 +5550,21 @@ gfc_simplify_ubound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) return simplify_bound (array, dim, kind, 1); } +gfc_expr * +gfc_simplify_ucobound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) +{ + gfc_expr *e; + /* return simplify_cobound (array, dim, kind, 1);*/ + + e = simplify_cobound (array, dim, kind, 1); + if (e != NULL) + return e; + + gfc_error ("Not yet implemented: UCOBOUND for coarray with non-constant " + "cobounds at %L", &array->where); + return &gfc_bad_expr; +} + gfc_expr * gfc_simplify_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field) @@ -5507,18 +5578,20 @@ gfc_simplify_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field) && !is_constant_array_expr(field))) return NULL; - result = gfc_start_constructor (vector->ts.type, - vector->ts.kind, - &vector->where); + result = gfc_get_array_expr (vector->ts.type, vector->ts.kind, + &vector->where); result->rank = mask->rank; result->shape = gfc_copy_shape (mask->shape, mask->rank); if (vector->ts.type == BT_CHARACTER) result->ts.u.cl = vector->ts.u.cl; - vector_ctor = vector->value.constructor; - mask_ctor = mask->value.constructor; - field_ctor = field->expr_type == EXPR_ARRAY ? field->value.constructor : NULL; + vector_ctor = gfc_constructor_first (vector->value.constructor); + mask_ctor = gfc_constructor_first (mask->value.constructor); + field_ctor + = field->expr_type == EXPR_ARRAY + ? gfc_constructor_first (field->value.constructor) + : NULL; while (mask_ctor) { @@ -5526,17 +5599,17 @@ gfc_simplify_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field) { gcc_assert (vector_ctor); e = gfc_copy_expr (vector_ctor->expr); - ADVANCE (vector_ctor, 1); + vector_ctor = gfc_constructor_next (vector_ctor); } else if (field->expr_type == EXPR_ARRAY) e = gfc_copy_expr (field_ctor->expr); else e = gfc_copy_expr (field); - gfc_append_constructor (result, e); + gfc_constructor_append_expr (&result->value.constructor, e, NULL); - ADVANCE (mask_ctor, 1); - ADVANCE (field_ctor, 1); + mask_ctor = gfc_constructor_next (mask_ctor); + field_ctor = gfc_constructor_next (field_ctor); } return result; @@ -5563,7 +5636,7 @@ gfc_simplify_verify (gfc_expr *s, gfc_expr *set, gfc_expr *b, gfc_expr *kind) else back = 0; - result = gfc_constant_result (BT_INTEGER, k, &s->where); + result = gfc_get_constant_expr (BT_INTEGER, k, &s->where); len = s->value.character.length; lenset = set->value.character.length; @@ -5623,20 +5696,22 @@ gfc_simplify_xor (gfc_expr *x, gfc_expr *y) return NULL; kind = x->ts.kind > y->ts.kind ? x->ts.kind : y->ts.kind; - if (x->ts.type == BT_INTEGER) - { - result = gfc_constant_result (BT_INTEGER, kind, &x->where); - mpz_xor (result->value.integer, x->value.integer, y->value.integer); - return range_check (result, "XOR"); - } - else /* BT_LOGICAL */ + + switch (x->ts.type) { - result = gfc_constant_result (BT_LOGICAL, kind, &x->where); - result->value.logical = (x->value.logical && !y->value.logical) - || (!x->value.logical && y->value.logical); - return result; - } + case BT_INTEGER: + result = gfc_get_constant_expr (BT_INTEGER, kind, &x->where); + mpz_xor (result->value.integer, x->value.integer, y->value.integer); + return range_check (result, "XOR"); + + case BT_LOGICAL: + return gfc_get_logical_expr (kind, &x->where, + (x->value.logical && !y->value.logical) + || (!x->value.logical && y->value.logical)); + default: + gcc_unreachable (); + } } @@ -5651,7 +5726,7 @@ gfc_expr * gfc_convert_constant (gfc_expr *e, bt type, int kind) { gfc_expr *g, *result, *(*f) (gfc_expr *, int); - gfc_constructor *head, *c, *tail = NULL; + gfc_constructor *c; switch (e->ts.type) { @@ -5771,45 +5846,37 @@ gfc_convert_constant (gfc_expr *e, bt type, int kind) if (!gfc_is_constant_expr (e)) break; - head = NULL; + result = gfc_get_array_expr (type, kind, &e->where); + result->shape = gfc_copy_shape (e->shape, e->rank); + result->rank = e->rank; - for (c = e->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (e->value.constructor); + c; c = gfc_constructor_next (c)) { - if (head == NULL) - head = tail = gfc_get_constructor (); - else - { - tail->next = gfc_get_constructor (); - tail = tail->next; - } - - tail->where = c->where; - + gfc_expr *tmp; if (c->iterator == NULL) - tail->expr = f (c->expr, kind); + tmp = f (c->expr, kind); else { g = gfc_convert_constant (c->expr, type, kind); if (g == &gfc_bad_expr) - return g; - tail->expr = g; + { + gfc_free_expr (result); + return g; + } + tmp = g; } - if (tail->expr == NULL) + if (tmp == NULL) { - gfc_free_constructor (head); + gfc_free_expr (result); return NULL; } + + gfc_constructor_append_expr (&result->value.constructor, + tmp, &c->where); } - result = gfc_get_expr (); - result->ts.type = type; - result->ts.kind = kind; - result->expr_type = EXPR_ARRAY; - result->value.constructor = head; - result->shape = gfc_copy_shape (e->shape, e->rank); - result->where = e->where; - result->rank = e->rank; break; default: @@ -5833,7 +5900,7 @@ gfc_convert_char_constant (gfc_expr *e, bt type ATTRIBUTE_UNUSED, int kind) if (e->expr_type == EXPR_CONSTANT) { /* Simple case of a scalar. */ - result = gfc_constant_result (BT_CHARACTER, kind, &e->where); + result = gfc_get_constant_expr (BT_CHARACTER, kind, &e->where); if (result == NULL) return &gfc_bad_expr; @@ -5860,42 +5927,32 @@ gfc_convert_char_constant (gfc_expr *e, bt type ATTRIBUTE_UNUSED, int kind) else if (e->expr_type == EXPR_ARRAY) { /* For an array constructor, we convert each constructor element. */ - gfc_constructor *head = NULL, *tail = NULL, *c; + gfc_constructor *c; - for (c = e->value.constructor; c; c = c->next) - { - if (head == NULL) - head = tail = gfc_get_constructor (); - else - { - tail->next = gfc_get_constructor (); - tail = tail->next; - } + result = gfc_get_array_expr (type, kind, &e->where); + result->shape = gfc_copy_shape (e->shape, e->rank); + result->rank = e->rank; + result->ts.u.cl = e->ts.u.cl; - tail->where = c->where; - tail->expr = gfc_convert_char_constant (c->expr, type, kind); - if (tail->expr == &gfc_bad_expr) + for (c = gfc_constructor_first (e->value.constructor); + c; c = gfc_constructor_next (c)) + { + gfc_expr *tmp = gfc_convert_char_constant (c->expr, type, kind); + if (tmp == &gfc_bad_expr) { - tail->expr = NULL; + gfc_free_expr (result); return &gfc_bad_expr; } - if (tail->expr == NULL) + if (tmp == NULL) { - gfc_free_constructor (head); + gfc_free_expr (result); return NULL; } - } - result = gfc_get_expr (); - result->ts.type = type; - result->ts.kind = kind; - result->expr_type = EXPR_ARRAY; - result->value.constructor = head; - result->shape = gfc_copy_shape (e->shape, e->rank); - result->where = e->where; - result->rank = e->rank; - result->ts.u.cl = e->ts.u.cl; + gfc_constructor_append_expr (&result->value.constructor, + tmp, &c->where); + } return result; } diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index dbbc97c78cd..4356845e206 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see #include "gfortran.h" #include "parse.h" #include "match.h" +#include "constructor.h" /* Strings for all symbol attributes. We use these for dumping the @@ -3664,6 +3665,7 @@ gen_special_c_interop_ptr (int ptr_id, const char *ptr_name, { gfc_symtree *tmp_symtree; gfc_symbol *tmp_sym; + gfc_constructor *c; tmp_symtree = gfc_find_symtree (gfc_current_ns->sym_root, ptr_name); @@ -3725,10 +3727,11 @@ gen_special_c_interop_ptr (int ptr_id, const char *ptr_name, tmp_sym->value->expr_type = EXPR_STRUCTURE; tmp_sym->value->ts.type = BT_DERIVED; tmp_sym->value->ts.u.derived = tmp_sym->ts.u.derived; - tmp_sym->value->value.constructor = gfc_get_constructor (); - tmp_sym->value->value.constructor->expr = gfc_get_expr (); - tmp_sym->value->value.constructor->expr->expr_type = EXPR_NULL; - tmp_sym->value->value.constructor->expr->ts.is_iso_c = 1; + gfc_constructor_append_expr (&tmp_sym->value->value.constructor, NULL, NULL); + c = gfc_constructor_first (tmp_sym->value->value.constructor); + c->expr = gfc_get_expr (); + c->expr->expr_type = EXPR_NULL; + c->expr->ts.is_iso_c = 1; /* Must declare c_null_ptr and c_null_funptr as having the PARAMETER attribute so they can be used in init expressions. */ tmp_sym->attr.flavor = FL_PARAMETER; @@ -3934,7 +3937,8 @@ gen_shape_param (gfc_formal_arglist **head, param_sym->as->upper[i] = NULL; } param_sym->as->rank = 1; - param_sym->as->lower[0] = gfc_int_expr (1); + param_sym->as->lower[0] = gfc_get_int_expr (gfc_default_integer_kind, + NULL, 1); /* The extent is unknown until we get it. The length give us the rank the incoming pointer. */ @@ -4277,7 +4281,8 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s, #define NAMED_CHARKNDCST(a,b,c) case a : #include "iso-c-binding.def" - tmp_sym->value = gfc_int_expr (c_interop_kinds_table[s].value); + tmp_sym->value = gfc_get_int_expr (gfc_default_integer_kind, NULL, + c_interop_kinds_table[s].value); /* Initialize an integer constant expression node. */ tmp_sym->attr.flavor = FL_PARAMETER; @@ -4307,20 +4312,16 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s, /* Initialize an integer constant expression node for the length of the character. */ - tmp_sym->value = gfc_get_expr (); - tmp_sym->value->expr_type = EXPR_CONSTANT; - tmp_sym->value->ts.type = BT_CHARACTER; - tmp_sym->value->ts.kind = gfc_default_character_kind; - tmp_sym->value->where = gfc_current_locus; + tmp_sym->value = gfc_get_character_expr (gfc_default_character_kind, + &gfc_current_locus, NULL, 1); tmp_sym->value->ts.is_c_interop = 1; tmp_sym->value->ts.is_iso_c = 1; tmp_sym->value->value.character.length = 1; - tmp_sym->value->value.character.string = gfc_get_wide_string (2); tmp_sym->value->value.character.string[0] = (gfc_char_t) c_interop_kinds_table[s].value; - tmp_sym->value->value.character.string[1] = '\0'; tmp_sym->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); - tmp_sym->ts.u.cl->length = gfc_int_expr (1); + tmp_sym->ts.u.cl->length = gfc_get_int_expr (gfc_default_integer_kind, + NULL, 1); /* May not need this in both attr and ts, but do need in attr for writing module file. */ @@ -4756,8 +4757,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr, c->attr.codimension = attr->codimension; c->attr.abstract = ts->u.derived->attr.abstract; c->as = (*as); - c->initializer = gfc_get_expr (); - c->initializer->expr_type = EXPR_NULL; + c->initializer = gfc_get_null_expr (NULL); /* Add component '$vptr'. */ if (gfc_add_component (fclass, "$vptr", &c) == FAILURE) @@ -4767,8 +4767,6 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr, gcc_assert (vtab); c->ts.u.derived = vtab->ts.u.derived; c->attr.pointer = 1; - c->initializer = gfc_get_expr (); - c->initializer->expr_type = EXPR_NULL; } /* Since the extension field is 8 bit wide, we can only have @@ -4842,7 +4840,8 @@ gfc_find_derived_vtab (gfc_symbol *derived) c->ts.type = BT_INTEGER; c->ts.kind = 4; c->attr.access = ACCESS_PRIVATE; - c->initializer = gfc_int_expr (derived->hash_value); + c->initializer = gfc_get_int_expr (gfc_default_integer_kind, + NULL, derived->hash_value); /* Add component '$size'. */ if (gfc_add_component (vtype, "$size", &c) == FAILURE) @@ -4854,20 +4853,21 @@ gfc_find_derived_vtab (gfc_symbol *derived) so that the correct initializer can be set later on (in gfc_conv_structure). */ c->ts.u.derived = derived; - c->initializer = gfc_int_expr (0); + c->initializer = gfc_get_int_expr (gfc_default_integer_kind, + NULL, 0); /* Add component $extends. */ if (gfc_add_component (vtype, "$extends", &c) == FAILURE) return NULL; c->attr.pointer = 1; c->attr.access = ACCESS_PRIVATE; - c->initializer = gfc_get_expr (); parent = gfc_get_derived_super_type (derived); if (parent) { parent_vtab = gfc_find_derived_vtab (parent); c->ts.type = BT_DERIVED; c->ts.u.derived = parent_vtab->ts.u.derived; + c->initializer = gfc_get_expr (); c->initializer->expr_type = EXPR_VARIABLE; gfc_find_sym_tree (parent_vtab->name, parent_vtab->ns, 0, &c->initializer->symtree); @@ -4876,7 +4876,7 @@ gfc_find_derived_vtab (gfc_symbol *derived) { c->ts.type = BT_DERIVED; c->ts.u.derived = vtype; - c->initializer->expr_type = EXPR_NULL; + c->initializer = gfc_get_null_expr (NULL); } } vtab->ts.u.derived = vtype; diff --git a/gcc/fortran/target-memory.c b/gcc/fortran/target-memory.c index 19b24c509ed..93e1c8c89bb 100644 --- a/gcc/fortran/target-memory.c +++ b/gcc/fortran/target-memory.c @@ -1,5 +1,5 @@ /* Simulate storage of variables into target memory. - Copyright (C) 2007, 2008, 2009 + Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Paul Thomas and Brooks Moses @@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "gfortran.h" #include "arith.h" +#include "constructor.h" #include "trans.h" #include "trans-const.h" #include "trans-types.h" @@ -38,7 +39,8 @@ static size_t size_array (gfc_expr *e) { mpz_t array_size; - size_t elt_size = gfc_target_expr_size (e->value.constructor->expr); + gfc_constructor *c = gfc_constructor_first (e->value.constructor); + size_t elt_size = gfc_target_expr_size (c->expr); gfc_array_size (e, &array_size); return (size_t)mpz_get_ui (array_size) * elt_size; @@ -134,10 +136,12 @@ encode_array (gfc_expr *expr, unsigned char *buffer, size_t buffer_size) int i; int ptr = 0; + gfc_constructor_base ctor = expr->value.constructor; + gfc_array_size (expr, &array_size); for (i = 0; i < (int)mpz_get_ui (array_size); i++) { - ptr += gfc_target_encode_expr (gfc_get_array_element (expr, i), + ptr += gfc_target_encode_expr (gfc_constructor_lookup_expr (ctor, i), &buffer[ptr], buffer_size - ptr); } @@ -205,28 +209,29 @@ gfc_encode_character (int kind, int length, const gfc_char_t *string, static int encode_derived (gfc_expr *source, unsigned char *buffer, size_t buffer_size) { - gfc_constructor *ctr; + gfc_constructor *c; gfc_component *cmp; int ptr; tree type; type = gfc_typenode_for_spec (&source->ts); - ctr = source->value.constructor; - cmp = source->ts.u.derived->components; - for (;ctr; ctr = ctr->next, cmp = cmp->next) + for (c = gfc_constructor_first (source->value.constructor), + cmp = source->ts.u.derived->components; + c; + c = gfc_constructor_next (c), cmp = cmp->next) { gcc_assert (cmp); - if (!ctr->expr) + if (!c->expr) continue; ptr = TREE_INT_CST_LOW(DECL_FIELD_OFFSET(cmp->backend_decl)) + TREE_INT_CST_LOW(DECL_FIELD_BIT_OFFSET(cmp->backend_decl))/8; - if (ctr->expr->expr_type == EXPR_NULL) + if (c->expr->expr_type == EXPR_NULL) memset (&buffer[ptr], 0, int_size_in_bytes (TREE_TYPE (cmp->backend_decl))); else - gfc_target_encode_expr (ctr->expr, &buffer[ptr], + gfc_target_encode_expr (c->expr, &buffer[ptr], buffer_size - ptr); } @@ -302,10 +307,10 @@ gfc_target_encode_expr (gfc_expr *source, unsigned char *buffer, static int interpret_array (unsigned char *buffer, size_t buffer_size, gfc_expr *result) { + gfc_constructor_base base = NULL; int array_size = 1; int i; int ptr = 0; - gfc_constructor *head = NULL, *tail = NULL; /* Calculate array size from its shape and rank. */ gcc_assert (result->rank > 0 && result->shape); @@ -316,27 +321,19 @@ interpret_array (unsigned char *buffer, size_t buffer_size, gfc_expr *result) /* Iterate over array elements, producing constructors. */ for (i = 0; i < array_size; i++) { - if (head == NULL) - head = tail = gfc_get_constructor (); - else - { - tail->next = gfc_get_constructor (); - tail = tail->next; - } + gfc_expr *e = gfc_get_constant_expr (result->ts.type, result->ts.kind, + &result->where); + e->ts = result->ts; - tail->where = result->where; - tail->expr = gfc_constant_result (result->ts.type, - result->ts.kind, &result->where); - tail->expr->ts = result->ts; + if (e->ts.type == BT_CHARACTER) + e->value.character.length = result->value.character.length; - if (tail->expr->ts.type == BT_CHARACTER) - tail->expr->value.character.length = result->value.character.length; + gfc_constructor_append_expr (&base, e, &result->where); - ptr += gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr, - tail->expr); + ptr += gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr, e); } - result->value.constructor = head; + result->value.constructor = base; return ptr; } @@ -439,7 +436,6 @@ int gfc_interpret_derived (unsigned char *buffer, size_t buffer_size, gfc_expr *result) { gfc_component *cmp; - gfc_constructor *head = NULL, *tail = NULL; int ptr; tree type; @@ -452,45 +448,37 @@ gfc_interpret_derived (unsigned char *buffer, size_t buffer_size, gfc_expr *resu /* Run through the derived type components. */ for (;cmp; cmp = cmp->next) { - if (head == NULL) - head = tail = gfc_get_constructor (); - else - { - tail->next = gfc_get_constructor (); - tail = tail->next; - } - - /* The constructor points to the component. */ - tail->n.component = cmp; - - tail->expr = gfc_constant_result (cmp->ts.type, cmp->ts.kind, - &result->where); - tail->expr->ts = cmp->ts; + gfc_constructor *c; + gfc_expr *e = gfc_get_constant_expr (cmp->ts.type, cmp->ts.kind, + &result->where); + e->ts = cmp->ts; /* Copy shape, if needed. */ if (cmp->as && cmp->as->rank) { int n; - tail->expr->expr_type = EXPR_ARRAY; - tail->expr->rank = cmp->as->rank; + e->expr_type = EXPR_ARRAY; + e->rank = cmp->as->rank; - tail->expr->shape = gfc_get_shape (tail->expr->rank); - for (n = 0; n < tail->expr->rank; n++) + e->shape = gfc_get_shape (e->rank); + for (n = 0; n < e->rank; n++) { - mpz_init_set_ui (tail->expr->shape[n], 1); - mpz_add (tail->expr->shape[n], tail->expr->shape[n], + mpz_init_set_ui (e->shape[n], 1); + mpz_add (e->shape[n], e->shape[n], cmp->as->upper[n]->value.integer); - mpz_sub (tail->expr->shape[n], tail->expr->shape[n], + mpz_sub (e->shape[n], e->shape[n], cmp->as->lower[n]->value.integer); } } - ptr = TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl)); - gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr, - tail->expr); + c = gfc_constructor_append_expr (&result->value.constructor, e, NULL); - result->value.constructor = head; + /* The constructor points to the component. */ + c->n.component = cmp; + + ptr = TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl)); + gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr, e); } return int_size_in_bytes (type); @@ -578,7 +566,7 @@ expr_to_char (gfc_expr *e, unsigned char *data, unsigned char *chk, size_t len) { int i; int ptr; - gfc_constructor *ctr; + gfc_constructor *c; gfc_component *cmp; unsigned char *buffer; @@ -589,16 +577,16 @@ expr_to_char (gfc_expr *e, unsigned char *data, unsigned char *chk, size_t len) declaration. */ if (e->ts.type == BT_DERIVED) { - ctr = e->value.constructor; - cmp = e->ts.u.derived->components; - for (;ctr; ctr = ctr->next, cmp = cmp->next) + for (c = gfc_constructor_first (e->value.constructor), + cmp = e->ts.u.derived->components; + c; c = gfc_constructor_next (c), cmp = cmp->next) { gcc_assert (cmp && cmp->backend_decl); - if (!ctr->expr) + if (!c->expr) continue; ptr = TREE_INT_CST_LOW(DECL_FIELD_OFFSET(cmp->backend_decl)) + TREE_INT_CST_LOW(DECL_FIELD_BIT_OFFSET(cmp->backend_decl))/8; - expr_to_char (ctr->expr, &data[ptr], &chk[ptr], len); + expr_to_char (c->expr, &data[ptr], &chk[ptr], len); } return len; } @@ -645,12 +633,13 @@ gfc_merge_initializers (gfc_typespec ts, gfc_expr *e, unsigned char *data, break; case EXPR_ARRAY: - for (c = e->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (e->value.constructor); + c; c = gfc_constructor_next (c)) { size_t elt_size = gfc_target_expr_size (c->expr); - if (c->n.offset) - len = elt_size * (size_t)mpz_get_si (c->n.offset); + if (c->offset) + len = elt_size * (size_t)mpz_get_si (c->offset); len = len + gfc_merge_initializers (ts, c->expr, &data[len], &chk[len], length - len); diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index cbdd8b9c90e..a880f0efe61 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -86,6 +86,7 @@ along with GCC; see the file COPYING3. If not see #include "real.h" #include "flags.h" #include "gfortran.h" +#include "constructor.h" #include "trans.h" #include "trans-stmt.h" #include "trans-types.h" @@ -94,7 +95,7 @@ along with GCC; see the file COPYING3. If not see #include "dependency.h" static gfc_ss *gfc_walk_subexpr (gfc_ss *, gfc_expr *); -static bool gfc_get_array_constructor_size (mpz_t *, gfc_constructor *); +static bool gfc_get_array_constructor_size (mpz_t *, gfc_constructor_base); /* The contents of this structure aren't actually used, just the address. */ static gfc_ss gfc_ss_terminator_var; @@ -1014,8 +1015,9 @@ gfc_get_array_constructor_element_size (mpz_t * size, gfc_expr * expr) of array constructor C. */ static bool -gfc_get_array_constructor_size (mpz_t * size, gfc_constructor * c) +gfc_get_array_constructor_size (mpz_t * size, gfc_constructor_base base) { + gfc_constructor *c; gfc_iterator *i; mpz_t val; mpz_t len; @@ -1026,7 +1028,7 @@ gfc_get_array_constructor_size (mpz_t * size, gfc_constructor * c) mpz_init (val); dynamic = false; - for (; c; c = c->next) + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) { i = c->iterator; if (i && gfc_iterator_has_dynamic_bounds (i)) @@ -1231,7 +1233,7 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock, static void gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, - tree desc, gfc_constructor * c, + tree desc, gfc_constructor_base base, tree * poffset, tree * offsetvar, bool dynamic) { @@ -1239,12 +1241,13 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, stmtblock_t body; gfc_se se; mpz_t size; + gfc_constructor *c; tree shadow_loopvar = NULL_TREE; gfc_saved_var saved_loopvar; mpz_init (size); - for (; c; c = c->next) + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) { /* If this is an iterator or an array, the offset must be a variable. */ if ((c->iterator || c->expr->rank > 0) && INTEGER_CST_P (*poffset)) @@ -1289,7 +1292,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, n = 0; while (p && !(p->iterator || p->expr->expr_type != EXPR_CONSTANT)) { - p = p->next; + p = gfc_constructor_next (p); n++; } if (n < 4) @@ -1332,7 +1335,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, list = tree_cons (build_int_cst (gfc_array_index_type, idx++), se.expr, list); c = p; - p = p->next; + p = gfc_constructor_next (p); } bound = build_int_cst (NULL_TREE, n - 1); @@ -1585,13 +1588,14 @@ get_array_ctor_all_strlen (stmtblock_t *block, gfc_expr *e, tree *len) Returns TRUE if all elements are character constants. */ bool -get_array_ctor_strlen (stmtblock_t *block, gfc_constructor * c, tree * len) +get_array_ctor_strlen (stmtblock_t *block, gfc_constructor_base base, tree * len) { + gfc_constructor *c; bool is_const; - + is_const = TRUE; - if (c == NULL) + if (gfc_constructor_first (base) == NULL) { if (len) *len = build_int_cstu (gfc_charlen_type_node, 0); @@ -1601,7 +1605,8 @@ get_array_ctor_strlen (stmtblock_t *block, gfc_constructor * c, tree * len) /* Loop over all constructor elements to find out is_const, but in len we want to store the length of the first, not the last, element. We can of course exit the loop as soon as is_const is found to be false. */ - for (; c && is_const; c = c->next) + for (c = gfc_constructor_first (base); + c && is_const; c = gfc_constructor_next (c)) { switch (c->expr->expr_type) { @@ -1641,17 +1646,18 @@ get_array_ctor_strlen (stmtblock_t *block, gfc_constructor * c, tree * len) return zero. Note, an empty or NULL array constructor returns zero. */ unsigned HOST_WIDE_INT -gfc_constant_array_constructor_p (gfc_constructor * c) +gfc_constant_array_constructor_p (gfc_constructor_base base) { unsigned HOST_WIDE_INT nelem = 0; + gfc_constructor *c = gfc_constructor_first (base); while (c) { if (c->iterator || c->expr->rank > 0 || c->expr->expr_type != EXPR_CONSTANT) return 0; - c = c->next; + c = gfc_constructor_next (c); nelem++; } return nelem; @@ -1676,7 +1682,7 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type) to tree to build an initializer. */ nelem = 0; list = NULL_TREE; - c = expr->value.constructor; + c = gfc_constructor_first (expr->value.constructor); while (c) { gfc_init_se (&se, NULL); @@ -1688,7 +1694,7 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type) se.expr); list = tree_cons (build_int_cst (gfc_array_index_type, nelem), se.expr, list); - c = c->next; + c = gfc_constructor_next (c); nelem++; } @@ -1702,15 +1708,17 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type) as.type = AS_EXPLICIT; if (!expr->shape) { - as.lower[0] = gfc_int_expr (0); - as.upper[0] = gfc_int_expr (nelem - 1); + as.lower[0] = gfc_get_int_expr (gfc_default_integer_kind, NULL, 0); + as.upper[0] = gfc_get_int_expr (gfc_default_integer_kind, + NULL, nelem - 1); } else for (i = 0; i < expr->rank; i++) { int tmp = (int) mpz_get_si (expr->shape[i]); - as.lower[i] = gfc_int_expr (0); - as.upper[i] = gfc_int_expr (tmp - 1); + as.lower[i] = gfc_get_int_expr (gfc_default_integer_kind, NULL, 0); + as.upper[i] = gfc_get_int_expr (gfc_default_integer_kind, + NULL, tmp - 1); } tmptype = gfc_get_nodesc_array_type (type, &as, PACKED_STATIC, true); @@ -1807,7 +1815,7 @@ constant_array_constructor_loop_size (gfc_loopinfo * loop) static void gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where) { - gfc_constructor *c; + gfc_constructor_base c; tree offset; tree offsetvar; tree desc; @@ -2316,10 +2324,6 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n, && se->loop->ss->loop_chain->expr->symtree) name = se->loop->ss->loop_chain->expr->symtree->name; - if (!name && se->loop && se->loop->ss && se->loop->ss->loop_chain - && se->loop->ss->loop_chain->expr->symtree) - name = se->loop->ss->loop_chain->expr->symtree->name; - if (!name && se->loop && se->loop->ss && se->loop->ss->expr) { if (se->loop->ss->expr->expr_type == EXPR_FUNCTION @@ -2331,6 +2335,9 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n, name = "unnamed constant"; } + if (descriptor->base.code != COMPONENT_REF) + name = IDENTIFIER_POINTER (DECL_NAME (descriptor)); + /* If upper bound is present, include both bounds in the error message. */ if (check_upper) { @@ -3557,7 +3564,6 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where) tree tmp; gfc_ss *loopspec[GFC_MAX_DIMENSIONS]; bool dynamic[GFC_MAX_DIMENSIONS]; - gfc_constructor *c; mpz_t *cshape; mpz_t i; @@ -3582,6 +3588,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where) if (ss->type == GFC_SS_CONSTRUCTOR) { + gfc_constructor_base base; /* An unknown size constructor will always be rank one. Higher rank constructors will either have known shape, or still be wrapped in a call to reshape. */ @@ -3591,8 +3598,8 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where) can be determined at compile time. Prefer not to otherwise, since the general case involves realloc, and it's better to avoid that overhead if possible. */ - c = ss->expr->value.constructor; - dynamic[n] = gfc_get_array_constructor_size (&i, c); + base = ss->expr->value.constructor; + dynamic[n] = gfc_get_array_constructor_size (&i, base); if (!dynamic[n] || !loopspec[n]) loopspec[n] = ss; continue; @@ -4117,7 +4124,8 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) case EXPR_ARRAY: /* Create a vector of all the elements. */ - for (c = expr->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (expr->value.constructor); + c; c = gfc_constructor_next (c)) { if (c->iterator) { @@ -4130,8 +4138,8 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) gfc_option.flag_max_array_constructor); return NULL_TREE; } - if (mpz_cmp_si (c->n.offset, 0) != 0) - index = gfc_conv_mpz_to_tree (c->n.offset, gfc_index_integer_kind); + if (mpz_cmp_si (c->offset, 0) != 0) + index = gfc_conv_mpz_to_tree (c->offset, gfc_index_integer_kind); else index = NULL_TREE; mpz_init (maxval); @@ -4140,16 +4148,16 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) tree tmp1, tmp2; mpz_set (maxval, c->repeat); - mpz_add (maxval, c->n.offset, maxval); + mpz_add (maxval, c->offset, maxval); mpz_sub_ui (maxval, maxval, 1); tmp2 = gfc_conv_mpz_to_tree (maxval, gfc_index_integer_kind); - if (mpz_cmp_si (c->n.offset, 0) != 0) + if (mpz_cmp_si (c->offset, 0) != 0) { - mpz_add_ui (maxval, c->n.offset, 1); + mpz_add_ui (maxval, c->offset, 1); tmp1 = gfc_conv_mpz_to_tree (maxval, gfc_index_integer_kind); } else - tmp1 = gfc_conv_mpz_to_tree (c->n.offset, gfc_index_integer_kind); + tmp1 = gfc_conv_mpz_to_tree (c->offset, gfc_index_integer_kind); range = fold_build2 (RANGE_EXPR, integer_type_node, tmp1, tmp2); } diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h index d48d6c8b67b..44256fb86f4 100644 --- a/gcc/fortran/trans-array.h +++ b/gcc/fortran/trans-array.h @@ -144,7 +144,7 @@ void gfc_conv_descriptor_ubound_set (stmtblock_t *, tree, tree, tree); void gfc_add_intrinsic_ss_code (gfc_loopinfo *, gfc_ss *); /* Functions for constant array constructor processing. */ -unsigned HOST_WIDE_INT gfc_constant_array_constructor_p (gfc_constructor *); +unsigned HOST_WIDE_INT gfc_constant_array_constructor_p (gfc_constructor_base); tree gfc_build_constant_array_constructor (gfc_expr *, tree); /* Copy a string from src to dest. */ diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c index 74520889d7e..9afb9351d59 100644 --- a/gcc/fortran/trans-const.c +++ b/gcc/fortran/trans-const.c @@ -1,6 +1,6 @@ /* Translation of constants - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software - Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. Contributed by Paul Brook This file is part of GCC. @@ -349,14 +349,15 @@ gfc_conv_constant (gfc_se * se, gfc_expr * expr) || expr->symtree->n.sym->intmod_sym_id == ISOCBINDING_NULL_FUNPTR) { /* Create a new EXPR_CONSTANT expression for our local uses. */ - expr = gfc_int_expr (0); + expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, 0); } } if (expr->expr_type != EXPR_CONSTANT) { + gfc_expr *e = gfc_get_int_expr (gfc_default_integer_kind, NULL, 0); gfc_error ("non-constant initialization expression at %L", &expr->where); - se->expr = gfc_conv_constant_to_tree (gfc_int_expr (0)); + se->expr = gfc_conv_constant_to_tree (e); return; } diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 53c4b475add..2545ad2a320 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see #include "debug.h" #include "gfortran.h" #include "pointer-set.h" +#include "constructor.h" #include "trans.h" #include "trans-types.h" #include "trans-array.h" @@ -770,19 +771,33 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym) for (dim = sym->as->rank - 1; dim >= 0; dim--) { - rtype = build_range_type (gfc_array_index_type, - GFC_TYPE_ARRAY_LBOUND (type, dim), - GFC_TYPE_ARRAY_UBOUND (type, dim)); + tree lbound, ubound; + lbound = GFC_TYPE_ARRAY_LBOUND (type, dim); + ubound = GFC_TYPE_ARRAY_UBOUND (type, dim); + rtype = build_range_type (gfc_array_index_type, lbound, ubound); gtype = build_array_type (gtype, rtype); - /* Ensure the bound variables aren't optimized out at -O0. */ - if (!optimize) + /* Ensure the bound variables aren't optimized out at -O0. + For -O1 and above they often will be optimized out, but + can be tracked by VTA. Also clear the artificial + lbound.N or ubound.N DECL_NAME, so that it doesn't end up + in debug info. */ + if (lbound && TREE_CODE (lbound) == VAR_DECL + && DECL_ARTIFICIAL (lbound) && DECL_IGNORED_P (lbound)) { - if (GFC_TYPE_ARRAY_LBOUND (type, dim) - && TREE_CODE (GFC_TYPE_ARRAY_LBOUND (type, dim)) == VAR_DECL) - DECL_IGNORED_P (GFC_TYPE_ARRAY_LBOUND (type, dim)) = 0; - if (GFC_TYPE_ARRAY_UBOUND (type, dim) - && TREE_CODE (GFC_TYPE_ARRAY_UBOUND (type, dim)) == VAR_DECL) - DECL_IGNORED_P (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 0; + if (DECL_NAME (lbound) + && strstr (IDENTIFIER_POINTER (DECL_NAME (lbound)), + "lbound") != 0) + DECL_NAME (lbound) = NULL_TREE; + DECL_IGNORED_P (lbound) = 0; + } + if (ubound && TREE_CODE (ubound) == VAR_DECL + && DECL_ARTIFICIAL (ubound) && DECL_IGNORED_P (ubound)) + { + if (DECL_NAME (ubound) + && strstr (IDENTIFIER_POINTER (DECL_NAME (ubound)), + "ubound") != 0) + DECL_NAME (ubound) = NULL_TREE; + DECL_IGNORED_P (ubound) = 0; } } TYPE_NAME (type) = type_decl = build_decl (input_location, @@ -3578,7 +3593,8 @@ check_constant_initializer (gfc_expr *expr, gfc_typespec *ts, bool array, return check_constant_initializer (expr, ts, false, false); else if (expr->expr_type != EXPR_ARRAY) return false; - for (c = expr->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (expr->value.constructor); + c; c = gfc_constructor_next (c)) { if (c->iterator) return false; @@ -3598,7 +3614,8 @@ check_constant_initializer (gfc_expr *expr, gfc_typespec *ts, bool array, if (expr->expr_type != EXPR_STRUCTURE) return false; cm = expr->ts.u.derived->components; - for (c = expr->value.constructor; c; c = c->next, cm = cm->next) + for (c = gfc_constructor_first (expr->value.constructor); + c; c = gfc_constructor_next (c), cm = cm->next) { if (!c->expr || cm->attr.allocatable) continue; diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 10716b70692..42e1d34d38c 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see #include "flags.h" #include "gfortran.h" #include "arith.h" +#include "constructor.h" #include "trans.h" #include "trans-const.h" #include "trans-types.h" @@ -278,11 +279,14 @@ flatten_array_ctors_without_strlen (gfc_expr* e) /* We've found what we're looking for. */ if (e->ts.type == BT_CHARACTER && !e->ts.u.cl->length) { + gfc_constructor *c; gfc_expr* new_expr; + gcc_assert (e->value.constructor); - new_expr = e->value.constructor->expr; - e->value.constructor->expr = NULL; + c = gfc_constructor_first (e->value.constructor); + new_expr = c->expr; + c->expr = NULL; flatten_array_ctors_without_strlen (new_expr); gfc_replace_expr (e, new_expr); @@ -291,7 +295,8 @@ flatten_array_ctors_without_strlen (gfc_expr* e) /* Otherwise, fall through to handle constructor elements. */ case EXPR_STRUCTURE: - for (c = e->value.constructor; c; c = c->next) + for (c = gfc_constructor_first (e->value.constructor); + c; c = gfc_constructor_next (c)) flatten_array_ctors_without_strlen (c->expr); break; @@ -1432,7 +1437,8 @@ gfc_conv_scalar_char_value (gfc_symbol *sym, gfc_se *se, gfc_expr **expr) gfc_typespec ts; gfc_clear_ts (&ts); - *expr = gfc_int_expr ((int)(*expr)->value.character.string[0]); + *expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, + (int)(*expr)->value.character.string[0]); if ((*expr)->ts.kind != gfc_c_int_kind) { /* The expr needs to be compatible with a C int. If the @@ -1991,9 +1997,10 @@ gfc_finish_interface_mapping (gfc_interface_mapping * mapping, static void gfc_apply_interface_mapping_to_cons (gfc_interface_mapping * mapping, - gfc_constructor * c) + gfc_constructor_base base) { - for (; c; c = c->next) + gfc_constructor *c; + for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c)) { gfc_apply_interface_mapping_to_expr (mapping, c->expr); if (c->iterator) @@ -2101,7 +2108,9 @@ gfc_map_intrinsic_function (gfc_expr *expr, gfc_interface_mapping *mapping) return false; } - tmp = gfc_add (gfc_copy_expr (sym->as->upper[d]), gfc_int_expr (1)); + tmp = gfc_add (gfc_copy_expr (sym->as->upper[d]), + gfc_get_int_expr (gfc_default_integer_kind, + NULL, 1)); tmp = gfc_subtract (tmp, gfc_copy_expr (sym->as->lower[d])); if (new_expr) new_expr = gfc_multiply (new_expr, tmp); @@ -3984,12 +3993,10 @@ gfc_conv_initializer (gfc_expr * expr, gfc_typespec * ts, tree type, { gfc_symbol *derived = expr->ts.u.derived; - expr = gfc_int_expr (0); - /* The derived symbol has already been converted to a (void *). Use its kind. */ + expr = gfc_get_int_expr (derived->ts.kind, NULL, 0); expr->ts.f90_type = derived->ts.f90_type; - expr->ts.kind = derived->ts.kind; gfc_init_se (&se, NULL); gfc_conv_constant (&se, expr); @@ -4389,7 +4396,8 @@ gfc_trans_structure_assign (tree dest, gfc_expr * expr) gfc_start_block (&block); cm = expr->ts.u.derived->components; - for (c = expr->value.constructor; c; c = c->next, cm = cm->next) + for (c = gfc_constructor_first (expr->value.constructor); + c; c = gfc_constructor_next (c), cm = cm->next) { /* Skip absent members in default initializers. */ if (!c->expr) @@ -4445,7 +4453,8 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init) cm = expr->ts.u.derived->components; - for (c = expr->value.constructor; c; c = c->next, cm = cm->next) + for (c = gfc_constructor_first (expr->value.constructor); + c; c = gfc_constructor_next (c), cm = cm->next) { /* Skip absent members in default initializers and allocatable components. Although the latter have a default initializer @@ -5619,7 +5628,7 @@ gfc_trans_class_assign (gfc_code *code) rhs->ts = vtab->ts; } else if (code->expr2->expr_type == EXPR_NULL) - rhs = gfc_int_expr (0); + rhs = gfc_get_int_expr (gfc_default_integer_kind, NULL, 0); else gcc_unreachable (); diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 95a8af47463..1ffe2842ce3 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -4684,7 +4684,8 @@ gfc_conv_same_type_as (gfc_se *se, gfc_expr *expr) gfc_add_component_ref (a, "$hash"); } else if (a->ts.type == BT_DERIVED) - a = gfc_int_expr (a->ts.u.derived->hash_value); + a = gfc_get_int_expr (gfc_default_integer_kind, NULL, + a->ts.u.derived->hash_value); if (b->ts.type == BT_CLASS) { @@ -4692,7 +4693,8 @@ gfc_conv_same_type_as (gfc_se *se, gfc_expr *expr) gfc_add_component_ref (b, "$hash"); } else if (b->ts.type == BT_DERIVED) - b = gfc_int_expr (b->ts.u.derived->hash_value); + b = gfc_get_int_expr (gfc_default_integer_kind, NULL, + b->ts.u.derived->hash_value); gfc_conv_expr (&se1, a); gfc_conv_expr (&se2, b); diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index 96671f3819c..b7464d0519c 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -1391,21 +1391,6 @@ gfc_trans_wait (gfc_code * code) } -static gfc_expr * -gfc_new_nml_name_expr (const char * name) -{ - gfc_expr * nml_name; - - nml_name = gfc_get_expr(); - nml_name->ref = NULL; - nml_name->expr_type = EXPR_CONSTANT; - nml_name->ts.kind = gfc_default_character_kind; - nml_name->ts.type = BT_CHARACTER; - nml_name->value.character.length = strlen(name); - nml_name->value.character.string = gfc_char_to_widechar (name); - - return nml_name; -} /* nml_full_name builds up the fully qualified name of a derived type component. */ @@ -1776,7 +1761,9 @@ build_dt (tree function, gfc_code * code) if (dt->format_expr || dt->format_label) gfc_internal_error ("build_dt: format with namelist"); - nmlname = gfc_new_nml_name_expr (dt->namelist->name); + nmlname = gfc_get_character_expr (gfc_default_character_kind, NULL, + dt->namelist->name, + strlen (dt->namelist->name)); mask |= set_string (&block, &post_block, var, IOPARM_dt_namelist_name, nmlname); diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index fe34f691127..782ff1d9e78 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -450,7 +450,7 @@ extern GTY(()) tree gfc_static_ctors; void gfc_generate_constructors (void); /* Get the string length of an array constructor. */ -bool get_array_ctor_strlen (stmtblock_t *, gfc_constructor *, tree *); +bool get_array_ctor_strlen (stmtblock_t *, gfc_constructor_base, tree *); /* Generate a runtime error call. */ tree gfc_trans_runtime_error (bool, locus*, const char*, ...); diff --git a/gcc/gcc-plugin.h b/gcc/gcc-plugin.h index 275be1d980a..948c4397570 100644 --- a/gcc/gcc-plugin.h +++ b/gcc/gcc-plugin.h @@ -141,4 +141,10 @@ extern void register_callback (const char *plugin_name, extern int unregister_callback (const char *plugin_name, int event); + +/* Retrieve the plugin directory name, as returned by the + -fprint-file-name=plugin argument to the gcc program, which is the + -iplugindir program argument to cc1. */ +extern const char* default_plugin_dir_name (void); + #endif /* GCC_PLUGIN_H */ diff --git a/gcc/gcc.c b/gcc/gcc.c index cee4bf7767b..d2190533796 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -403,6 +403,7 @@ static const char *if_exists_else_spec_function (int, const char **); static const char *replace_outfile_spec_function (int, const char **); static const char *version_compare_spec_function (int, const char **); static const char *include_spec_function (int, const char **); +static const char *find_file_spec_function (int, const char **); static const char *print_asm_header_spec_function (int, const char **); static const char *compare_debug_dump_opt_spec_function (int, const char **); static const char *compare_debug_self_opt_spec_function (int, const char **); @@ -872,6 +873,7 @@ static const char *cpp_unique_options = %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\ %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\ %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\ + %{!iplugindir*:%{fplugin*:-iplugindir=%:find-file(plugin)}}\ %{H} %C %{D*&U*&A*} %{i*} %Z %i\ %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\ %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\ @@ -894,6 +896,7 @@ static const char *cpp_debug_options = "%{d*}"; /* NB: This is shared amongst all front-ends, except for Ada. */ static const char *cc1_options = "%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ + %{!iplugindir*:%{fplugin*:-iplugindir=%:find-file(plugin)}}\ %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{a*}\ %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \ %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}} \ @@ -1726,6 +1729,7 @@ static const struct spec_function static_spec_functions[] = { "replace-outfile", replace_outfile_spec_function }, { "version-compare", version_compare_spec_function }, { "include", include_spec_function }, + { "find-file", find_file_spec_function }, { "print-asm-header", print_asm_header_spec_function }, { "compare-debug-dump-opt", compare_debug_dump_opt_spec_function }, { "compare-debug-self-opt", compare_debug_self_opt_spec_function }, @@ -8710,6 +8714,22 @@ include_spec_function (int argc, const char **argv) return NULL; } +/* %:find-file spec function. This function replace its argument by + the file found thru find_file, that is the -print-file-name gcc + program option. */ +static const char * +find_file_spec_function (int argc, const char**argv) +{ + const char *file; + + if (argc != 1) + abort (); + + file = find_file (argv[0]); + return file; +} + + /* %:print-asm-header spec function. Print a banner to say that the following output is from the assembler. */ diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 1e5198a3dad..08f92a04979 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -3323,7 +3323,7 @@ write_test_expr (rtx exp, int flags) } else { - printf ("%s((1 << which_alternative) & 0x%x)", + printf ("%s((1 << which_alternative) & %#x)", XINT (exp, 1) ? "!" : "", set); } } @@ -3894,7 +3894,7 @@ write_attr_valueq (struct attr_desc *attr, const char *s) printf ("%d", num); if (num > 9 || num < 0) - printf (" /* 0x%x */", num); + printf (" /* %#x */", num); } else { diff --git a/gcc/genoutput.c b/gcc/genoutput.c index e651cb4d878..b0be21c476b 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -266,6 +266,8 @@ output_operand_data (void) printf (" %d,\n", d->strict_low); + printf (" %d,\n", d->constraint == NULL ? 1 : 0); + printf (" %d\n", d->eliminable); printf(" },\n"); diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index fc42f45d59c..28c2b793f22 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see #include "hosthooks-def.h" #include "plugin.h" #include "vec.h" +#include "timevar.h" #ifdef HAVE_SYS_RESOURCE_H # include @@ -501,6 +502,7 @@ gt_pch_save (FILE *f) gt_pch_save_stringpool (); + timevar_push (TV_PCH_PTR_REALLOC); saving_htab = htab_create (50000, saving_htab_hash, saving_htab_eq, free); for (rt = gt_ggc_rtab; *rt; rt++) @@ -532,8 +534,13 @@ gt_pch_save (FILE *f) state.ptrs = XNEWVEC (struct ptr_data *, state.count); state.ptrs_i = 0; + htab_traverse (saving_htab, call_alloc, &state); + timevar_pop (TV_PCH_PTR_REALLOC); + + timevar_push (TV_PCH_PTR_SORT); qsort (state.ptrs, state.count, sizeof (*state.ptrs), compare_ptr_data); + timevar_pop (TV_PCH_PTR_SORT); /* Write out all the scalar variables. */ for (rt = gt_pch_scalar_rtab; *rt; rt++) diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c new file mode 100644 index 00000000000..270475c0c6c --- /dev/null +++ b/gcc/gimple-fold.c @@ -0,0 +1,1596 @@ +/* Statement simplification on GIMPLE. + Copyright (C) 2010 Free Software Foundation, Inc. + Split out from tree-ssa-ccp.c. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3, or (at your option) any +later version. + +GCC is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "flags.h" +#include "rtl.h" +#include "tm_p.h" +#include "ggc.h" +#include "basic-block.h" +#include "output.h" +#include "expr.h" +#include "function.h" +#include "diagnostic.h" +#include "timevar.h" +#include "tree-dump.h" +#include "tree-flow.h" +#include "tree-pass.h" +#include "tree-ssa-propagate.h" +#include "value-prof.h" +#include "langhooks.h" +#include "target.h" + + +/* If SYM is a constant variable with known value, return the value. + NULL_TREE is returned otherwise. */ + +tree +get_symbol_constant_value (tree sym) +{ + if (TREE_STATIC (sym) + && (TREE_READONLY (sym) + || TREE_CODE (sym) == CONST_DECL)) + { + tree val = DECL_INITIAL (sym); + if (val) + { + STRIP_NOPS (val); + if (is_gimple_min_invariant (val)) + { + if (TREE_CODE (val) == ADDR_EXPR) + { + tree base = get_base_address (TREE_OPERAND (val, 0)); + if (base && TREE_CODE (base) == VAR_DECL) + { + TREE_ADDRESSABLE (base) = 1; + if (gimple_referenced_vars (cfun)) + add_referenced_var (base); + } + } + return val; + } + } + /* Variables declared 'const' without an initializer + have zero as the initializer if they may not be + overridden at link or run time. */ + if (!val + && !DECL_EXTERNAL (sym) + && targetm.binds_local_p (sym) + && (INTEGRAL_TYPE_P (TREE_TYPE (sym)) + || SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym)))) + return fold_convert (TREE_TYPE (sym), integer_zero_node); + } + + return NULL_TREE; +} + + +/* Return true if we may propagate the address expression ADDR into the + dereference DEREF and cancel them. */ + +bool +may_propagate_address_into_dereference (tree addr, tree deref) +{ + gcc_assert (INDIRECT_REF_P (deref) + && TREE_CODE (addr) == ADDR_EXPR); + + /* Don't propagate if ADDR's operand has incomplete type. */ + if (!COMPLETE_TYPE_P (TREE_TYPE (TREE_OPERAND (addr, 0)))) + return false; + + /* If the address is invariant then we do not need to preserve restrict + qualifications. But we do need to preserve volatile qualifiers until + we can annotate the folded dereference itself properly. */ + if (is_gimple_min_invariant (addr) + && (!TREE_THIS_VOLATILE (deref) + || TYPE_VOLATILE (TREE_TYPE (addr)))) + return useless_type_conversion_p (TREE_TYPE (deref), + TREE_TYPE (TREE_OPERAND (addr, 0))); + + /* Else both the address substitution and the folding must result in + a valid useless type conversion sequence. */ + return (useless_type_conversion_p (TREE_TYPE (TREE_OPERAND (deref, 0)), + TREE_TYPE (addr)) + && useless_type_conversion_p (TREE_TYPE (deref), + TREE_TYPE (TREE_OPERAND (addr, 0)))); +} + + +/* A subroutine of fold_stmt. Attempts to fold *(A+O) to A[X]. + BASE is an array type. OFFSET is a byte displacement. ORIG_TYPE + is the desired result type. + + LOC is the location of the original expression. */ + +static tree +maybe_fold_offset_to_array_ref (location_t loc, tree base, tree offset, + tree orig_type, + bool allow_negative_idx) +{ + tree min_idx, idx, idx_type, elt_offset = integer_zero_node; + tree array_type, elt_type, elt_size; + tree domain_type; + + /* If BASE is an ARRAY_REF, we can pick up another offset (this time + measured in units of the size of elements type) from that ARRAY_REF). + We can't do anything if either is variable. + + The case we handle here is *(&A[N]+O). */ + if (TREE_CODE (base) == ARRAY_REF) + { + tree low_bound = array_ref_low_bound (base); + + elt_offset = TREE_OPERAND (base, 1); + if (TREE_CODE (low_bound) != INTEGER_CST + || TREE_CODE (elt_offset) != INTEGER_CST) + return NULL_TREE; + + elt_offset = int_const_binop (MINUS_EXPR, elt_offset, low_bound, 0); + base = TREE_OPERAND (base, 0); + } + + /* Ignore stupid user tricks of indexing non-array variables. */ + array_type = TREE_TYPE (base); + if (TREE_CODE (array_type) != ARRAY_TYPE) + return NULL_TREE; + elt_type = TREE_TYPE (array_type); + if (!useless_type_conversion_p (orig_type, elt_type)) + return NULL_TREE; + + /* Use signed size type for intermediate computation on the index. */ + idx_type = signed_type_for (size_type_node); + + /* If OFFSET and ELT_OFFSET are zero, we don't care about the size of the + element type (so we can use the alignment if it's not constant). + Otherwise, compute the offset as an index by using a division. If the + division isn't exact, then don't do anything. */ + elt_size = TYPE_SIZE_UNIT (elt_type); + if (!elt_size) + return NULL; + if (integer_zerop (offset)) + { + if (TREE_CODE (elt_size) != INTEGER_CST) + elt_size = size_int (TYPE_ALIGN (elt_type)); + + idx = build_int_cst (idx_type, 0); + } + else + { + unsigned HOST_WIDE_INT lquo, lrem; + HOST_WIDE_INT hquo, hrem; + double_int soffset; + + /* The final array offset should be signed, so we need + to sign-extend the (possibly pointer) offset here + and use signed division. */ + soffset = double_int_sext (tree_to_double_int (offset), + TYPE_PRECISION (TREE_TYPE (offset))); + if (TREE_CODE (elt_size) != INTEGER_CST + || div_and_round_double (TRUNC_DIV_EXPR, 0, + soffset.low, soffset.high, + TREE_INT_CST_LOW (elt_size), + TREE_INT_CST_HIGH (elt_size), + &lquo, &hquo, &lrem, &hrem) + || lrem || hrem) + return NULL_TREE; + + idx = build_int_cst_wide (idx_type, lquo, hquo); + } + + /* Assume the low bound is zero. If there is a domain type, get the + low bound, if any, convert the index into that type, and add the + low bound. */ + min_idx = build_int_cst (idx_type, 0); + domain_type = TYPE_DOMAIN (array_type); + if (domain_type) + { + idx_type = domain_type; + if (TYPE_MIN_VALUE (idx_type)) + min_idx = TYPE_MIN_VALUE (idx_type); + else + min_idx = fold_convert (idx_type, min_idx); + + if (TREE_CODE (min_idx) != INTEGER_CST) + return NULL_TREE; + + elt_offset = fold_convert (idx_type, elt_offset); + } + + if (!integer_zerop (min_idx)) + idx = int_const_binop (PLUS_EXPR, idx, min_idx, 0); + if (!integer_zerop (elt_offset)) + idx = int_const_binop (PLUS_EXPR, idx, elt_offset, 0); + + /* Make sure to possibly truncate late after offsetting. */ + idx = fold_convert (idx_type, idx); + + /* We don't want to construct access past array bounds. For example + char *(c[4]); + c[3][2]; + should not be simplified into (*c)[14] or tree-vrp will + give false warnings. The same is true for + struct A { long x; char d[0]; } *a; + (char *)a - 4; + which should be not folded to &a->d[-8]. */ + if (domain_type + && TYPE_MAX_VALUE (domain_type) + && TREE_CODE (TYPE_MAX_VALUE (domain_type)) == INTEGER_CST) + { + tree up_bound = TYPE_MAX_VALUE (domain_type); + + if (tree_int_cst_lt (up_bound, idx) + /* Accesses after the end of arrays of size 0 (gcc + extension) and 1 are likely intentional ("struct + hack"). */ + && compare_tree_int (up_bound, 1) > 0) + return NULL_TREE; + } + if (domain_type + && TYPE_MIN_VALUE (domain_type)) + { + if (!allow_negative_idx + && TREE_CODE (TYPE_MIN_VALUE (domain_type)) == INTEGER_CST + && tree_int_cst_lt (idx, TYPE_MIN_VALUE (domain_type))) + return NULL_TREE; + } + else if (!allow_negative_idx + && compare_tree_int (idx, 0) < 0) + return NULL_TREE; + + { + tree t = build4 (ARRAY_REF, elt_type, base, idx, NULL_TREE, NULL_TREE); + SET_EXPR_LOCATION (t, loc); + return t; + } +} + + +/* Attempt to fold *(S+O) to S.X. + BASE is a record type. OFFSET is a byte displacement. ORIG_TYPE + is the desired result type. + + LOC is the location of the original expression. */ + +static tree +maybe_fold_offset_to_component_ref (location_t loc, tree record_type, + tree base, tree offset, tree orig_type) +{ + tree f, t, field_type, tail_array_field, field_offset; + tree ret; + tree new_base; + + if (TREE_CODE (record_type) != RECORD_TYPE + && TREE_CODE (record_type) != UNION_TYPE + && TREE_CODE (record_type) != QUAL_UNION_TYPE) + return NULL_TREE; + + /* Short-circuit silly cases. */ + if (useless_type_conversion_p (record_type, orig_type)) + return NULL_TREE; + + tail_array_field = NULL_TREE; + for (f = TYPE_FIELDS (record_type); f ; f = TREE_CHAIN (f)) + { + int cmp; + + if (TREE_CODE (f) != FIELD_DECL) + continue; + if (DECL_BIT_FIELD (f)) + continue; + + if (!DECL_FIELD_OFFSET (f)) + continue; + field_offset = byte_position (f); + if (TREE_CODE (field_offset) != INTEGER_CST) + continue; + + /* ??? Java creates "interesting" fields for representing base classes. + They have no name, and have no context. With no context, we get into + trouble with nonoverlapping_component_refs_p. Skip them. */ + if (!DECL_FIELD_CONTEXT (f)) + continue; + + /* The previous array field isn't at the end. */ + tail_array_field = NULL_TREE; + + /* Check to see if this offset overlaps with the field. */ + cmp = tree_int_cst_compare (field_offset, offset); + if (cmp > 0) + continue; + + field_type = TREE_TYPE (f); + + /* Here we exactly match the offset being checked. If the types match, + then we can return that field. */ + if (cmp == 0 + && useless_type_conversion_p (orig_type, field_type)) + { + t = fold_build3 (COMPONENT_REF, field_type, base, f, NULL_TREE); + return t; + } + + /* Don't care about offsets into the middle of scalars. */ + if (!AGGREGATE_TYPE_P (field_type)) + continue; + + /* Check for array at the end of the struct. This is often + used as for flexible array members. We should be able to + turn this into an array access anyway. */ + if (TREE_CODE (field_type) == ARRAY_TYPE) + tail_array_field = f; + + /* Check the end of the field against the offset. */ + if (!DECL_SIZE_UNIT (f) + || TREE_CODE (DECL_SIZE_UNIT (f)) != INTEGER_CST) + continue; + t = int_const_binop (MINUS_EXPR, offset, field_offset, 1); + if (!tree_int_cst_lt (t, DECL_SIZE_UNIT (f))) + continue; + + /* If we matched, then set offset to the displacement into + this field. */ + new_base = fold_build3 (COMPONENT_REF, field_type, base, f, NULL_TREE); + SET_EXPR_LOCATION (new_base, loc); + + /* Recurse to possibly find the match. */ + ret = maybe_fold_offset_to_array_ref (loc, new_base, t, orig_type, + f == TYPE_FIELDS (record_type)); + if (ret) + return ret; + ret = maybe_fold_offset_to_component_ref (loc, field_type, new_base, t, + orig_type); + if (ret) + return ret; + } + + if (!tail_array_field) + return NULL_TREE; + + f = tail_array_field; + field_type = TREE_TYPE (f); + offset = int_const_binop (MINUS_EXPR, offset, byte_position (f), 1); + + /* If we get here, we've got an aggregate field, and a possibly + nonzero offset into them. Recurse and hope for a valid match. */ + base = fold_build3 (COMPONENT_REF, field_type, base, f, NULL_TREE); + SET_EXPR_LOCATION (base, loc); + + t = maybe_fold_offset_to_array_ref (loc, base, offset, orig_type, + f == TYPE_FIELDS (record_type)); + if (t) + return t; + return maybe_fold_offset_to_component_ref (loc, field_type, base, offset, + orig_type); +} + +/* Attempt to express (ORIG_TYPE)BASE+OFFSET as BASE->field_of_orig_type + or BASE[index] or by combination of those. + + LOC is the location of original expression. + + Before attempting the conversion strip off existing ADDR_EXPRs and + handled component refs. */ + +tree +maybe_fold_offset_to_reference (location_t loc, tree base, tree offset, + tree orig_type) +{ + tree ret; + tree type; + + STRIP_NOPS (base); + if (TREE_CODE (base) != ADDR_EXPR) + return NULL_TREE; + + base = TREE_OPERAND (base, 0); + + /* Handle case where existing COMPONENT_REF pick e.g. wrong field of union, + so it needs to be removed and new COMPONENT_REF constructed. + The wrong COMPONENT_REF are often constructed by folding the + (type *)&object within the expression (type *)&object+offset */ + if (handled_component_p (base)) + { + HOST_WIDE_INT sub_offset, size, maxsize; + tree newbase; + newbase = get_ref_base_and_extent (base, &sub_offset, + &size, &maxsize); + gcc_assert (newbase); + if (size == maxsize + && size != -1 + && !(sub_offset & (BITS_PER_UNIT - 1))) + { + base = newbase; + if (sub_offset) + offset = int_const_binop (PLUS_EXPR, offset, + build_int_cst (TREE_TYPE (offset), + sub_offset / BITS_PER_UNIT), 1); + } + } + if (useless_type_conversion_p (orig_type, TREE_TYPE (base)) + && integer_zerop (offset)) + return base; + type = TREE_TYPE (base); + + ret = maybe_fold_offset_to_component_ref (loc, type, base, offset, orig_type); + if (!ret) + ret = maybe_fold_offset_to_array_ref (loc, base, offset, orig_type, true); + + return ret; +} + +/* Attempt to express (ORIG_TYPE)&BASE+OFFSET as &BASE->field_of_orig_type + or &BASE[index] or by combination of those. + + LOC is the location of the original expression. + + Before attempting the conversion strip off existing component refs. */ + +tree +maybe_fold_offset_to_address (location_t loc, tree addr, tree offset, + tree orig_type) +{ + tree t; + + gcc_assert (POINTER_TYPE_P (TREE_TYPE (addr)) + && POINTER_TYPE_P (orig_type)); + + t = maybe_fold_offset_to_reference (loc, addr, offset, + TREE_TYPE (orig_type)); + if (t != NULL_TREE) + { + tree orig = addr; + tree ptr_type; + + /* For __builtin_object_size to function correctly we need to + make sure not to fold address arithmetic so that we change + reference from one array to another. This would happen for + example for + + struct X { char s1[10]; char s2[10] } s; + char *foo (void) { return &s.s2[-4]; } + + where we need to avoid generating &s.s1[6]. As the C and + C++ frontends create different initial trees + (char *) &s.s1 + -4 vs. &s.s1[-4] we have to do some + sophisticated comparisons here. Note that checking for the + condition after the fact is easier than trying to avoid doing + the folding. */ + STRIP_NOPS (orig); + if (TREE_CODE (orig) == ADDR_EXPR) + orig = TREE_OPERAND (orig, 0); + if ((TREE_CODE (orig) == ARRAY_REF + || (TREE_CODE (orig) == COMPONENT_REF + && TREE_CODE (TREE_TYPE (TREE_OPERAND (orig, 1))) == ARRAY_TYPE)) + && (TREE_CODE (t) == ARRAY_REF + || TREE_CODE (t) == COMPONENT_REF) + && !operand_equal_p (TREE_CODE (orig) == ARRAY_REF + ? TREE_OPERAND (orig, 0) : orig, + TREE_CODE (t) == ARRAY_REF + ? TREE_OPERAND (t, 0) : t, 0)) + return NULL_TREE; + + ptr_type = build_pointer_type (TREE_TYPE (t)); + if (!useless_type_conversion_p (orig_type, ptr_type)) + return NULL_TREE; + return build_fold_addr_expr_with_type_loc (loc, t, ptr_type); + } + + return NULL_TREE; +} + +/* A subroutine of fold_stmt. Attempt to simplify *(BASE+OFFSET). + Return the simplified expression, or NULL if nothing could be done. */ + +static tree +maybe_fold_stmt_indirect (tree expr, tree base, tree offset) +{ + tree t; + bool volatile_p = TREE_THIS_VOLATILE (expr); + location_t loc = EXPR_LOCATION (expr); + + /* We may well have constructed a double-nested PLUS_EXPR via multiple + substitutions. Fold that down to one. Remove NON_LVALUE_EXPRs that + are sometimes added. */ + base = fold (base); + STRIP_TYPE_NOPS (base); + TREE_OPERAND (expr, 0) = base; + + /* One possibility is that the address reduces to a string constant. */ + t = fold_read_from_constant_string (expr); + if (t) + return t; + + /* Add in any offset from a POINTER_PLUS_EXPR. */ + if (TREE_CODE (base) == POINTER_PLUS_EXPR) + { + tree offset2; + + offset2 = TREE_OPERAND (base, 1); + if (TREE_CODE (offset2) != INTEGER_CST) + return NULL_TREE; + base = TREE_OPERAND (base, 0); + + offset = fold_convert (sizetype, + int_const_binop (PLUS_EXPR, offset, offset2, 1)); + } + + if (TREE_CODE (base) == ADDR_EXPR) + { + tree base_addr = base; + + /* Strip the ADDR_EXPR. */ + base = TREE_OPERAND (base, 0); + + /* Fold away CONST_DECL to its value, if the type is scalar. */ + if (TREE_CODE (base) == CONST_DECL + && is_gimple_min_invariant (DECL_INITIAL (base))) + return DECL_INITIAL (base); + + /* If there is no offset involved simply return the folded base. */ + if (integer_zerop (offset)) + return base; + + /* Try folding *(&B+O) to B.X. */ + t = maybe_fold_offset_to_reference (loc, base_addr, offset, + TREE_TYPE (expr)); + if (t) + { + /* Preserve volatileness of the original expression. + We can end up with a plain decl here which is shared + and we shouldn't mess with its flags. */ + if (!SSA_VAR_P (t)) + TREE_THIS_VOLATILE (t) = volatile_p; + return t; + } + } + else + { + /* We can get here for out-of-range string constant accesses, + such as "_"[3]. Bail out of the entire substitution search + and arrange for the entire statement to be replaced by a + call to __builtin_trap. In all likelihood this will all be + constant-folded away, but in the meantime we can't leave with + something that get_expr_operands can't understand. */ + + t = base; + STRIP_NOPS (t); + if (TREE_CODE (t) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (t, 0)) == STRING_CST) + { + /* FIXME: Except that this causes problems elsewhere with dead + code not being deleted, and we die in the rtl expanders + because we failed to remove some ssa_name. In the meantime, + just return zero. */ + /* FIXME2: This condition should be signaled by + fold_read_from_constant_string directly, rather than + re-checking for it here. */ + return integer_zero_node; + } + + /* Try folding *(B+O) to B->X. Still an improvement. */ + if (POINTER_TYPE_P (TREE_TYPE (base))) + { + t = maybe_fold_offset_to_reference (loc, base, offset, + TREE_TYPE (expr)); + if (t) + return t; + } + } + + /* Otherwise we had an offset that we could not simplify. */ + return NULL_TREE; +} + + +/* A quaint feature extant in our address arithmetic is that there + can be hidden type changes here. The type of the result need + not be the same as the type of the input pointer. + + What we're after here is an expression of the form + (T *)(&array + const) + where array is OP0, const is OP1, RES_TYPE is T and + the cast doesn't actually exist, but is implicit in the + type of the POINTER_PLUS_EXPR. We'd like to turn this into + &array[x] + which may be able to propagate further. */ + +tree +maybe_fold_stmt_addition (location_t loc, tree res_type, tree op0, tree op1) +{ + tree ptd_type; + tree t; + + /* The first operand should be an ADDR_EXPR. */ + if (TREE_CODE (op0) != ADDR_EXPR) + return NULL_TREE; + op0 = TREE_OPERAND (op0, 0); + + /* It had better be a constant. */ + if (TREE_CODE (op1) != INTEGER_CST) + { + /* Or op0 should now be A[0] and the non-constant offset defined + via a multiplication by the array element size. */ + if (TREE_CODE (op0) == ARRAY_REF + && integer_zerop (TREE_OPERAND (op0, 1)) + && TREE_CODE (op1) == SSA_NAME + && host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (op0)), 1)) + { + gimple offset_def = SSA_NAME_DEF_STMT (op1); + if (!is_gimple_assign (offset_def)) + return NULL_TREE; + + if (gimple_assign_rhs_code (offset_def) == MULT_EXPR + && TREE_CODE (gimple_assign_rhs2 (offset_def)) == INTEGER_CST + && tree_int_cst_equal (gimple_assign_rhs2 (offset_def), + TYPE_SIZE_UNIT (TREE_TYPE (op0)))) + return build_fold_addr_expr + (build4 (ARRAY_REF, TREE_TYPE (op0), + TREE_OPERAND (op0, 0), + gimple_assign_rhs1 (offset_def), + TREE_OPERAND (op0, 2), + TREE_OPERAND (op0, 3))); + else if (integer_onep (TYPE_SIZE_UNIT (TREE_TYPE (op0))) + && gimple_assign_rhs_code (offset_def) != MULT_EXPR) + return build_fold_addr_expr + (build4 (ARRAY_REF, TREE_TYPE (op0), + TREE_OPERAND (op0, 0), + op1, + TREE_OPERAND (op0, 2), + TREE_OPERAND (op0, 3))); + } + return NULL_TREE; + } + + /* If the first operand is an ARRAY_REF, expand it so that we can fold + the offset into it. */ + while (TREE_CODE (op0) == ARRAY_REF) + { + tree array_obj = TREE_OPERAND (op0, 0); + tree array_idx = TREE_OPERAND (op0, 1); + tree elt_type = TREE_TYPE (op0); + tree elt_size = TYPE_SIZE_UNIT (elt_type); + tree min_idx; + + if (TREE_CODE (array_idx) != INTEGER_CST) + break; + if (TREE_CODE (elt_size) != INTEGER_CST) + break; + + /* Un-bias the index by the min index of the array type. */ + min_idx = TYPE_DOMAIN (TREE_TYPE (array_obj)); + if (min_idx) + { + min_idx = TYPE_MIN_VALUE (min_idx); + if (min_idx) + { + if (TREE_CODE (min_idx) != INTEGER_CST) + break; + + array_idx = fold_convert (TREE_TYPE (min_idx), array_idx); + if (!integer_zerop (min_idx)) + array_idx = int_const_binop (MINUS_EXPR, array_idx, + min_idx, 0); + } + } + + /* Convert the index to a byte offset. */ + array_idx = fold_convert (sizetype, array_idx); + array_idx = int_const_binop (MULT_EXPR, array_idx, elt_size, 0); + + /* Update the operands for the next round, or for folding. */ + op1 = int_const_binop (PLUS_EXPR, + array_idx, op1, 0); + op0 = array_obj; + } + + ptd_type = TREE_TYPE (res_type); + /* If we want a pointer to void, reconstruct the reference from the + array element type. A pointer to that can be trivially converted + to void *. This happens as we fold (void *)(ptr p+ off). */ + if (VOID_TYPE_P (ptd_type) + && TREE_CODE (TREE_TYPE (op0)) == ARRAY_TYPE) + ptd_type = TREE_TYPE (TREE_TYPE (op0)); + + /* At which point we can try some of the same things as for indirects. */ + t = maybe_fold_offset_to_array_ref (loc, op0, op1, ptd_type, true); + if (!t) + t = maybe_fold_offset_to_component_ref (loc, TREE_TYPE (op0), op0, op1, + ptd_type); + if (t) + { + t = build1 (ADDR_EXPR, res_type, t); + SET_EXPR_LOCATION (t, loc); + } + + return t; +} + +/* Subroutine of fold_stmt. We perform several simplifications of the + memory reference tree EXPR and make sure to re-gimplify them properly + after propagation of constant addresses. IS_LHS is true if the + reference is supposed to be an lvalue. */ + +static tree +maybe_fold_reference (tree expr, bool is_lhs) +{ + tree *t = &expr; + + if (TREE_CODE (expr) == ARRAY_REF + && !is_lhs) + { + tree tem = fold_read_from_constant_string (expr); + if (tem) + return tem; + } + + /* ??? We might want to open-code the relevant remaining cases + to avoid using the generic fold. */ + if (handled_component_p (*t) + && CONSTANT_CLASS_P (TREE_OPERAND (*t, 0))) + { + tree tem = fold (*t); + if (tem != *t) + return tem; + } + + while (handled_component_p (*t)) + t = &TREE_OPERAND (*t, 0); + + if (TREE_CODE (*t) == INDIRECT_REF) + { + tree tem = maybe_fold_stmt_indirect (*t, TREE_OPERAND (*t, 0), + integer_zero_node); + /* Avoid folding *"abc" = 5 into 'a' = 5. */ + if (is_lhs && tem && CONSTANT_CLASS_P (tem)) + tem = NULL_TREE; + if (!tem + && TREE_CODE (TREE_OPERAND (*t, 0)) == ADDR_EXPR) + /* If we had a good reason for propagating the address here, + make sure we end up with valid gimple. See PR34989. */ + tem = TREE_OPERAND (TREE_OPERAND (*t, 0), 0); + + if (tem) + { + *t = tem; + tem = maybe_fold_reference (expr, is_lhs); + if (tem) + return tem; + return expr; + } + } + else if (!is_lhs + && DECL_P (*t)) + { + tree tem = get_symbol_constant_value (*t); + if (tem + && useless_type_conversion_p (TREE_TYPE (*t), TREE_TYPE (tem))) + { + *t = unshare_expr (tem); + tem = maybe_fold_reference (expr, is_lhs); + if (tem) + return tem; + return expr; + } + } + + return NULL_TREE; +} + + +/* Attempt to fold an assignment statement pointed-to by SI. Returns a + replacement rhs for the statement or NULL_TREE if no simplification + could be made. It is assumed that the operands have been previously + folded. */ + +static tree +fold_gimple_assign (gimple_stmt_iterator *si) +{ + gimple stmt = gsi_stmt (*si); + enum tree_code subcode = gimple_assign_rhs_code (stmt); + location_t loc = gimple_location (stmt); + + tree result = NULL_TREE; + + switch (get_gimple_rhs_class (subcode)) + { + case GIMPLE_SINGLE_RHS: + { + tree rhs = gimple_assign_rhs1 (stmt); + + /* Try to fold a conditional expression. */ + if (TREE_CODE (rhs) == COND_EXPR) + { + tree op0 = COND_EXPR_COND (rhs); + tree tem; + bool set = false; + location_t cond_loc = EXPR_LOCATION (rhs); + + if (COMPARISON_CLASS_P (op0)) + { + fold_defer_overflow_warnings (); + tem = fold_binary_loc (cond_loc, + TREE_CODE (op0), TREE_TYPE (op0), + TREE_OPERAND (op0, 0), + TREE_OPERAND (op0, 1)); + /* This is actually a conditional expression, not a GIMPLE + conditional statement, however, the valid_gimple_rhs_p + test still applies. */ + set = (tem && is_gimple_condexpr (tem) + && valid_gimple_rhs_p (tem)); + fold_undefer_overflow_warnings (set, stmt, 0); + } + else if (is_gimple_min_invariant (op0)) + { + tem = op0; + set = true; + } + else + return NULL_TREE; + + if (set) + result = fold_build3_loc (cond_loc, COND_EXPR, TREE_TYPE (rhs), tem, + COND_EXPR_THEN (rhs), COND_EXPR_ELSE (rhs)); + } + + else if (TREE_CODE (rhs) == TARGET_MEM_REF) + return maybe_fold_tmr (rhs); + + else if (REFERENCE_CLASS_P (rhs)) + return maybe_fold_reference (rhs, false); + + else if (TREE_CODE (rhs) == ADDR_EXPR) + { + tree tem = maybe_fold_reference (TREE_OPERAND (rhs, 0), true); + if (tem) + result = fold_convert (TREE_TYPE (rhs), + build_fold_addr_expr_loc (loc, tem)); + } + + else if (TREE_CODE (rhs) == CONSTRUCTOR + && TREE_CODE (TREE_TYPE (rhs)) == VECTOR_TYPE + && (CONSTRUCTOR_NELTS (rhs) + == TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)))) + { + /* Fold a constant vector CONSTRUCTOR to VECTOR_CST. */ + unsigned i; + tree val; + + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (rhs), i, val) + if (TREE_CODE (val) != INTEGER_CST + && TREE_CODE (val) != REAL_CST + && TREE_CODE (val) != FIXED_CST) + return NULL_TREE; + + return build_vector_from_ctor (TREE_TYPE (rhs), + CONSTRUCTOR_ELTS (rhs)); + } + + else if (DECL_P (rhs)) + return unshare_expr (get_symbol_constant_value (rhs)); + + /* If we couldn't fold the RHS, hand over to the generic + fold routines. */ + if (result == NULL_TREE) + result = fold (rhs); + + /* Strip away useless type conversions. Both the NON_LVALUE_EXPR + that may have been added by fold, and "useless" type + conversions that might now be apparent due to propagation. */ + STRIP_USELESS_TYPE_CONVERSION (result); + + if (result != rhs && valid_gimple_rhs_p (result)) + return result; + + return NULL_TREE; + } + break; + + case GIMPLE_UNARY_RHS: + { + tree rhs = gimple_assign_rhs1 (stmt); + + result = fold_unary_loc (loc, subcode, gimple_expr_type (stmt), rhs); + if (result) + { + /* If the operation was a conversion do _not_ mark a + resulting constant with TREE_OVERFLOW if the original + constant was not. These conversions have implementation + defined behavior and retaining the TREE_OVERFLOW flag + here would confuse later passes such as VRP. */ + if (CONVERT_EXPR_CODE_P (subcode) + && TREE_CODE (result) == INTEGER_CST + && TREE_CODE (rhs) == INTEGER_CST) + TREE_OVERFLOW (result) = TREE_OVERFLOW (rhs); + + STRIP_USELESS_TYPE_CONVERSION (result); + if (valid_gimple_rhs_p (result)) + return result; + } + else if (CONVERT_EXPR_CODE_P (subcode) + && POINTER_TYPE_P (gimple_expr_type (stmt)) + && POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt)))) + { + tree type = gimple_expr_type (stmt); + tree t = maybe_fold_offset_to_address (loc, + gimple_assign_rhs1 (stmt), + integer_zero_node, type); + if (t) + return t; + } + } + break; + + case GIMPLE_BINARY_RHS: + /* Try to fold pointer addition. */ + if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR) + { + tree type = TREE_TYPE (gimple_assign_rhs1 (stmt)); + if (TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE) + { + type = build_pointer_type (TREE_TYPE (TREE_TYPE (type))); + if (!useless_type_conversion_p + (TREE_TYPE (gimple_assign_lhs (stmt)), type)) + type = TREE_TYPE (gimple_assign_rhs1 (stmt)); + } + result = maybe_fold_stmt_addition (gimple_location (stmt), + type, + gimple_assign_rhs1 (stmt), + gimple_assign_rhs2 (stmt)); + } + + if (!result) + result = fold_binary_loc (loc, subcode, + TREE_TYPE (gimple_assign_lhs (stmt)), + gimple_assign_rhs1 (stmt), + gimple_assign_rhs2 (stmt)); + + if (result) + { + STRIP_USELESS_TYPE_CONVERSION (result); + if (valid_gimple_rhs_p (result)) + return result; + + /* Fold might have produced non-GIMPLE, so if we trust it blindly + we lose canonicalization opportunities. Do not go again + through fold here though, or the same non-GIMPLE will be + produced. */ + if (commutative_tree_code (subcode) + && tree_swap_operands_p (gimple_assign_rhs1 (stmt), + gimple_assign_rhs2 (stmt), false)) + return build2 (subcode, TREE_TYPE (gimple_assign_lhs (stmt)), + gimple_assign_rhs2 (stmt), + gimple_assign_rhs1 (stmt)); + } + break; + + case GIMPLE_INVALID_RHS: + gcc_unreachable (); + } + + return NULL_TREE; +} + +/* Attempt to fold a conditional statement. Return true if any changes were + made. We only attempt to fold the condition expression, and do not perform + any transformation that would require alteration of the cfg. It is + assumed that the operands have been previously folded. */ + +static bool +fold_gimple_cond (gimple stmt) +{ + tree result = fold_binary_loc (gimple_location (stmt), + gimple_cond_code (stmt), + boolean_type_node, + gimple_cond_lhs (stmt), + gimple_cond_rhs (stmt)); + + if (result) + { + STRIP_USELESS_TYPE_CONVERSION (result); + if (is_gimple_condexpr (result) && valid_gimple_rhs_p (result)) + { + gimple_cond_set_condition_from_tree (stmt, result); + return true; + } + } + + return false; +} + +/* Convert EXPR into a GIMPLE value suitable for substitution on the + RHS of an assignment. Insert the necessary statements before + iterator *SI_P. The statement at *SI_P, which must be a GIMPLE_CALL + is replaced. If the call is expected to produces a result, then it + is replaced by an assignment of the new RHS to the result variable. + If the result is to be ignored, then the call is replaced by a + GIMPLE_NOP. */ + +void +gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr) +{ + tree lhs; + tree tmp = NULL_TREE; /* Silence warning. */ + gimple stmt, new_stmt; + gimple_stmt_iterator i; + gimple_seq stmts = gimple_seq_alloc(); + struct gimplify_ctx gctx; + gimple last = NULL; + + stmt = gsi_stmt (*si_p); + + gcc_assert (is_gimple_call (stmt)); + + lhs = gimple_call_lhs (stmt); + + push_gimplify_context (&gctx); + + if (lhs == NULL_TREE) + gimplify_and_add (expr, &stmts); + else + tmp = get_initialized_tmp_var (expr, &stmts, NULL); + + pop_gimplify_context (NULL); + + if (gimple_has_location (stmt)) + annotate_all_with_location (stmts, gimple_location (stmt)); + + /* The replacement can expose previously unreferenced variables. */ + for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i)) + { + if (last) + { + gsi_insert_before (si_p, last, GSI_NEW_STMT); + gsi_next (si_p); + } + new_stmt = gsi_stmt (i); + find_new_referenced_vars (new_stmt); + mark_symbols_for_renaming (new_stmt); + last = new_stmt; + } + + if (lhs == NULL_TREE) + { + unlink_stmt_vdef (stmt); + release_defs (stmt); + new_stmt = last; + } + else + { + if (last) + { + gsi_insert_before (si_p, last, GSI_NEW_STMT); + gsi_next (si_p); + } + new_stmt = gimple_build_assign (lhs, tmp); + gimple_set_vuse (new_stmt, gimple_vuse (stmt)); + gimple_set_vdef (new_stmt, gimple_vdef (stmt)); + move_ssa_defining_stmt_for_defs (new_stmt, stmt); + } + + gimple_set_location (new_stmt, gimple_location (stmt)); + gsi_replace (si_p, new_stmt, false); +} + +/* Return the string length, maximum string length or maximum value of + ARG in LENGTH. + If ARG is an SSA name variable, follow its use-def chains. If LENGTH + is not NULL and, for TYPE == 0, its value is not equal to the length + we determine or if we are unable to determine the length or value, + return false. VISITED is a bitmap of visited variables. + TYPE is 0 if string length should be returned, 1 for maximum string + length and 2 for maximum value ARG can have. */ + +static bool +get_maxval_strlen (tree arg, tree *length, bitmap visited, int type) +{ + tree var, val; + gimple def_stmt; + + if (TREE_CODE (arg) != SSA_NAME) + { + if (TREE_CODE (arg) == COND_EXPR) + return get_maxval_strlen (COND_EXPR_THEN (arg), length, visited, type) + && get_maxval_strlen (COND_EXPR_ELSE (arg), length, visited, type); + /* We can end up with &(*iftmp_1)[0] here as well, so handle it. */ + else if (TREE_CODE (arg) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (arg, 0)) == ARRAY_REF + && integer_zerop (TREE_OPERAND (TREE_OPERAND (arg, 0), 1))) + { + tree aop0 = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); + if (TREE_CODE (aop0) == INDIRECT_REF + && TREE_CODE (TREE_OPERAND (aop0, 0)) == SSA_NAME) + return get_maxval_strlen (TREE_OPERAND (aop0, 0), + length, visited, type); + } + + if (type == 2) + { + val = arg; + if (TREE_CODE (val) != INTEGER_CST + || tree_int_cst_sgn (val) < 0) + return false; + } + else + val = c_strlen (arg, 1); + if (!val) + return false; + + if (*length) + { + if (type > 0) + { + if (TREE_CODE (*length) != INTEGER_CST + || TREE_CODE (val) != INTEGER_CST) + return false; + + if (tree_int_cst_lt (*length, val)) + *length = val; + return true; + } + else if (simple_cst_equal (val, *length) != 1) + return false; + } + + *length = val; + return true; + } + + /* If we were already here, break the infinite cycle. */ + if (bitmap_bit_p (visited, SSA_NAME_VERSION (arg))) + return true; + bitmap_set_bit (visited, SSA_NAME_VERSION (arg)); + + var = arg; + def_stmt = SSA_NAME_DEF_STMT (var); + + switch (gimple_code (def_stmt)) + { + case GIMPLE_ASSIGN: + /* The RHS of the statement defining VAR must either have a + constant length or come from another SSA_NAME with a constant + length. */ + if (gimple_assign_single_p (def_stmt) + || gimple_assign_unary_nop_p (def_stmt)) + { + tree rhs = gimple_assign_rhs1 (def_stmt); + return get_maxval_strlen (rhs, length, visited, type); + } + return false; + + case GIMPLE_PHI: + { + /* All the arguments of the PHI node must have the same constant + length. */ + unsigned i; + + for (i = 0; i < gimple_phi_num_args (def_stmt); i++) + { + tree arg = gimple_phi_arg (def_stmt, i)->def; + + /* If this PHI has itself as an argument, we cannot + determine the string length of this argument. However, + if we can find a constant string length for the other + PHI args then we can still be sure that this is a + constant string length. So be optimistic and just + continue with the next argument. */ + if (arg == gimple_phi_result (def_stmt)) + continue; + + if (!get_maxval_strlen (arg, length, visited, type)) + return false; + } + } + return true; + + default: + return false; + } +} + + +/* Fold builtin call in statement STMT. Returns a simplified tree. + We may return a non-constant expression, including another call + to a different function and with different arguments, e.g., + substituting memcpy for strcpy when the string length is known. + Note that some builtins expand into inline code that may not + be valid in GIMPLE. Callers must take care. */ + +tree +gimple_fold_builtin (gimple stmt) +{ + tree result, val[3]; + tree callee, a; + int arg_idx, type; + bitmap visited; + bool ignore; + int nargs; + location_t loc = gimple_location (stmt); + + gcc_assert (is_gimple_call (stmt)); + + ignore = (gimple_call_lhs (stmt) == NULL); + + /* First try the generic builtin folder. If that succeeds, return the + result directly. */ + result = fold_call_stmt (stmt, ignore); + if (result) + { + if (ignore) + STRIP_NOPS (result); + return result; + } + + /* Ignore MD builtins. */ + callee = gimple_call_fndecl (stmt); + if (DECL_BUILT_IN_CLASS (callee) == BUILT_IN_MD) + return NULL_TREE; + + /* If the builtin could not be folded, and it has no argument list, + we're done. */ + nargs = gimple_call_num_args (stmt); + if (nargs == 0) + return NULL_TREE; + + /* Limit the work only for builtins we know how to simplify. */ + switch (DECL_FUNCTION_CODE (callee)) + { + case BUILT_IN_STRLEN: + case BUILT_IN_FPUTS: + case BUILT_IN_FPUTS_UNLOCKED: + arg_idx = 0; + type = 0; + break; + case BUILT_IN_STRCPY: + case BUILT_IN_STRNCPY: + arg_idx = 1; + type = 0; + break; + case BUILT_IN_MEMCPY_CHK: + case BUILT_IN_MEMPCPY_CHK: + case BUILT_IN_MEMMOVE_CHK: + case BUILT_IN_MEMSET_CHK: + case BUILT_IN_STRNCPY_CHK: + arg_idx = 2; + type = 2; + break; + case BUILT_IN_STRCPY_CHK: + case BUILT_IN_STPCPY_CHK: + arg_idx = 1; + type = 1; + break; + case BUILT_IN_SNPRINTF_CHK: + case BUILT_IN_VSNPRINTF_CHK: + arg_idx = 1; + type = 2; + break; + default: + return NULL_TREE; + } + + if (arg_idx >= nargs) + return NULL_TREE; + + /* Try to use the dataflow information gathered by the CCP process. */ + visited = BITMAP_ALLOC (NULL); + bitmap_clear (visited); + + memset (val, 0, sizeof (val)); + a = gimple_call_arg (stmt, arg_idx); + if (!get_maxval_strlen (a, &val[arg_idx], visited, type)) + val[arg_idx] = NULL_TREE; + + BITMAP_FREE (visited); + + result = NULL_TREE; + switch (DECL_FUNCTION_CODE (callee)) + { + case BUILT_IN_STRLEN: + if (val[0] && nargs == 1) + { + tree new_val = + fold_convert (TREE_TYPE (gimple_call_lhs (stmt)), val[0]); + + /* If the result is not a valid gimple value, or not a cast + of a valid gimple value, then we can not use the result. */ + if (is_gimple_val (new_val) + || (is_gimple_cast (new_val) + && is_gimple_val (TREE_OPERAND (new_val, 0)))) + return new_val; + } + break; + + case BUILT_IN_STRCPY: + if (val[1] && is_gimple_val (val[1]) && nargs == 2) + result = fold_builtin_strcpy (loc, callee, + gimple_call_arg (stmt, 0), + gimple_call_arg (stmt, 1), + val[1]); + break; + + case BUILT_IN_STRNCPY: + if (val[1] && is_gimple_val (val[1]) && nargs == 3) + result = fold_builtin_strncpy (loc, callee, + gimple_call_arg (stmt, 0), + gimple_call_arg (stmt, 1), + gimple_call_arg (stmt, 2), + val[1]); + break; + + case BUILT_IN_FPUTS: + if (nargs == 2) + result = fold_builtin_fputs (loc, gimple_call_arg (stmt, 0), + gimple_call_arg (stmt, 1), + ignore, false, val[0]); + break; + + case BUILT_IN_FPUTS_UNLOCKED: + if (nargs == 2) + result = fold_builtin_fputs (loc, gimple_call_arg (stmt, 0), + gimple_call_arg (stmt, 1), + ignore, true, val[0]); + break; + + case BUILT_IN_MEMCPY_CHK: + case BUILT_IN_MEMPCPY_CHK: + case BUILT_IN_MEMMOVE_CHK: + case BUILT_IN_MEMSET_CHK: + if (val[2] && is_gimple_val (val[2]) && nargs == 4) + result = fold_builtin_memory_chk (loc, callee, + gimple_call_arg (stmt, 0), + gimple_call_arg (stmt, 1), + gimple_call_arg (stmt, 2), + gimple_call_arg (stmt, 3), + val[2], ignore, + DECL_FUNCTION_CODE (callee)); + break; + + case BUILT_IN_STRCPY_CHK: + case BUILT_IN_STPCPY_CHK: + if (val[1] && is_gimple_val (val[1]) && nargs == 3) + result = fold_builtin_stxcpy_chk (loc, callee, + gimple_call_arg (stmt, 0), + gimple_call_arg (stmt, 1), + gimple_call_arg (stmt, 2), + val[1], ignore, + DECL_FUNCTION_CODE (callee)); + break; + + case BUILT_IN_STRNCPY_CHK: + if (val[2] && is_gimple_val (val[2]) && nargs == 4) + result = fold_builtin_strncpy_chk (loc, gimple_call_arg (stmt, 0), + gimple_call_arg (stmt, 1), + gimple_call_arg (stmt, 2), + gimple_call_arg (stmt, 3), + val[2]); + break; + + case BUILT_IN_SNPRINTF_CHK: + case BUILT_IN_VSNPRINTF_CHK: + if (val[1] && is_gimple_val (val[1])) + result = gimple_fold_builtin_snprintf_chk (stmt, val[1], + DECL_FUNCTION_CODE (callee)); + break; + + default: + gcc_unreachable (); + } + + if (result && ignore) + result = fold_ignored_result (result); + return result; +} + +/* Attempt to fold a call statement referenced by the statement iterator GSI. + The statement may be replaced by another statement, e.g., if the call + simplifies to a constant value. Return true if any changes were made. + It is assumed that the operands have been previously folded. */ + +static bool +fold_gimple_call (gimple_stmt_iterator *gsi) +{ + gimple stmt = gsi_stmt (*gsi); + + tree callee = gimple_call_fndecl (stmt); + + /* Check for builtins that CCP can handle using information not + available in the generic fold routines. */ + if (callee && DECL_BUILT_IN (callee)) + { + tree result = gimple_fold_builtin (stmt); + + if (result) + { + if (!update_call_from_tree (gsi, result)) + gimplify_and_update_call_from_tree (gsi, result); + return true; + } + } + else + { + /* Check for resolvable OBJ_TYPE_REF. The only sorts we can resolve + here are when we've propagated the address of a decl into the + object slot. */ + /* ??? Should perhaps do this in fold proper. However, doing it + there requires that we create a new CALL_EXPR, and that requires + copying EH region info to the new node. Easier to just do it + here where we can just smash the call operand. */ + /* ??? Is there a good reason not to do this in fold_stmt_inplace? */ + callee = gimple_call_fn (stmt); + if (TREE_CODE (callee) == OBJ_TYPE_REF + && lang_hooks.fold_obj_type_ref + && TREE_CODE (OBJ_TYPE_REF_OBJECT (callee)) == ADDR_EXPR + && DECL_P (TREE_OPERAND + (OBJ_TYPE_REF_OBJECT (callee), 0))) + { + tree t; + + /* ??? Caution: Broken ADDR_EXPR semantics means that + looking at the type of the operand of the addr_expr + can yield an array type. See silly exception in + check_pointer_types_r. */ + t = TREE_TYPE (TREE_TYPE (OBJ_TYPE_REF_OBJECT (callee))); + t = lang_hooks.fold_obj_type_ref (callee, t); + if (t) + { + gimple_call_set_fn (stmt, t); + return true; + } + } + } + + return false; +} + +/* Worker for both fold_stmt and fold_stmt_inplace. The INPLACE argument + distinguishes both cases. */ + +static bool +fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace) +{ + bool changed = false; + gimple stmt = gsi_stmt (*gsi); + unsigned i; + + /* Fold the main computation performed by the statement. */ + switch (gimple_code (stmt)) + { + case GIMPLE_ASSIGN: + { + unsigned old_num_ops = gimple_num_ops (stmt); + tree new_rhs = fold_gimple_assign (gsi); + tree lhs = gimple_assign_lhs (stmt); + if (new_rhs + && !useless_type_conversion_p (TREE_TYPE (lhs), + TREE_TYPE (new_rhs))) + new_rhs = fold_convert (TREE_TYPE (lhs), new_rhs); + if (new_rhs + && (!inplace + || get_gimple_rhs_num_ops (TREE_CODE (new_rhs)) < old_num_ops)) + { + gimple_assign_set_rhs_from_tree (gsi, new_rhs); + changed = true; + } + break; + } + + case GIMPLE_COND: + changed |= fold_gimple_cond (stmt); + break; + + case GIMPLE_CALL: + /* Fold *& in call arguments. */ + for (i = 0; i < gimple_call_num_args (stmt); ++i) + if (REFERENCE_CLASS_P (gimple_call_arg (stmt, i))) + { + tree tmp = maybe_fold_reference (gimple_call_arg (stmt, i), false); + if (tmp) + { + gimple_call_set_arg (stmt, i, tmp); + changed = true; + } + } + /* The entire statement may be replaced in this case. */ + if (!inplace) + changed |= fold_gimple_call (gsi); + break; + + case GIMPLE_ASM: + /* Fold *& in asm operands. */ + for (i = 0; i < gimple_asm_noutputs (stmt); ++i) + { + tree link = gimple_asm_output_op (stmt, i); + tree op = TREE_VALUE (link); + if (REFERENCE_CLASS_P (op) + && (op = maybe_fold_reference (op, true)) != NULL_TREE) + { + TREE_VALUE (link) = op; + changed = true; + } + } + for (i = 0; i < gimple_asm_ninputs (stmt); ++i) + { + tree link = gimple_asm_input_op (stmt, i); + tree op = TREE_VALUE (link); + if (REFERENCE_CLASS_P (op) + && (op = maybe_fold_reference (op, false)) != NULL_TREE) + { + TREE_VALUE (link) = op; + changed = true; + } + } + break; + + default:; + } + + stmt = gsi_stmt (*gsi); + + /* Fold *& on the lhs. */ + if (gimple_has_lhs (stmt)) + { + tree lhs = gimple_get_lhs (stmt); + if (lhs && REFERENCE_CLASS_P (lhs)) + { + tree new_lhs = maybe_fold_reference (lhs, true); + if (new_lhs) + { + gimple_set_lhs (stmt, new_lhs); + changed = true; + } + } + } + + return changed; +} + +/* Fold the statement pointed to by GSI. In some cases, this function may + replace the whole statement with a new one. Returns true iff folding + makes any changes. + The statement pointed to by GSI should be in valid gimple form but may + be in unfolded state as resulting from for example constant propagation + which can produce *&x = 0. */ + +bool +fold_stmt (gimple_stmt_iterator *gsi) +{ + return fold_stmt_1 (gsi, false); +} + +/* Perform the minimal folding on statement STMT. Only operations like + *&x created by constant propagation are handled. The statement cannot + be replaced with a new one. Return true if the statement was + changed, false otherwise. + The statement STMT should be in valid gimple form but may + be in unfolded state as resulting from for example constant propagation + which can produce *&x = 0. */ + +bool +fold_stmt_inplace (gimple stmt) +{ + gimple_stmt_iterator gsi = gsi_for_stmt (stmt); + bool changed = fold_stmt_1 (&gsi, true); + gcc_assert (gsi_stmt (gsi) == stmt); + return changed; +} + diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c index 6329d51f2da..c9a9242e3ca 100644 --- a/gcc/gimple-pretty-print.c +++ b/gcc/gimple-pretty-print.c @@ -477,6 +477,60 @@ dump_gimple_call_args (pretty_printer *buffer, gimple gs, int flags) } } +/* Dump the points-to solution *PT to BUFFER. */ + +static void +pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt) +{ + if (pt->anything) + { + pp_string (buffer, "anything "); + return; + } + if (pt->nonlocal) + pp_string (buffer, "nonlocal "); + if (pt->escaped) + pp_string (buffer, "escaped "); + if (pt->ipa_escaped) + pp_string (buffer, "unit-escaped "); + if (pt->null) + pp_string (buffer, "null "); + if (pt->vars + && !bitmap_empty_p (pt->vars)) + { + bitmap_iterator bi; + unsigned i; + pp_string (buffer, "{ "); + EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi) + { + struct tree_decl_minimal in; + tree var; + in.uid = i; + var = (tree) htab_find_with_hash (gimple_referenced_vars (cfun), + &in, i); + if (var) + { + dump_generic_node (buffer, var, 0, dump_flags, false); + if (DECL_PT_UID (var) != DECL_UID (var)) + { + pp_string (buffer, "ptD."); + pp_decimal_int (buffer, DECL_PT_UID (var)); + } + } + else + { + pp_string (buffer, "D."); + pp_decimal_int (buffer, i); + } + pp_character (buffer, ' '); + } + pp_character (buffer, '}'); + if (pt->vars_contains_global) + pp_string (buffer, " (glob)"); + if (pt->vars_contains_restrict) + pp_string (buffer, " (restr)"); + } +} /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */ @@ -486,6 +540,25 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags) { tree lhs = gimple_call_lhs (gs); + if (flags & TDF_ALIAS) + { + struct pt_solution *pt; + pt = gimple_call_use_set (gs); + if (!pt_solution_empty_p (pt)) + { + pp_string (buffer, "# USE = "); + pp_points_to_solution (buffer, pt); + newline_and_indent (buffer, spc); + } + pt = gimple_call_clobber_set (gs); + if (!pt_solution_empty_p (pt)) + { + pp_string (buffer, "# CLB = "); + pp_points_to_solution (buffer, pt); + newline_and_indent (buffer, spc); + } + } + if (flags & TDF_RAW) { dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T", @@ -1257,13 +1330,24 @@ static void dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, int flags) { size_t i; + tree lhs = gimple_phi_result (phi); + + if (flags & TDF_ALIAS + && POINTER_TYPE_P (TREE_TYPE (lhs)) + && SSA_NAME_PTR_INFO (lhs)) + { + pp_string (buffer, "PT = "); + pp_points_to_solution (buffer, &SSA_NAME_PTR_INFO (lhs)->pt); + newline_and_indent (buffer, spc); + pp_string (buffer, "# "); + } if (flags & TDF_RAW) dump_gimple_fmt (buffer, spc, flags, "%G <%T, ", phi, gimple_phi_result (phi)); else { - dump_generic_node (buffer, gimple_phi_result (phi), spc, flags, false); + dump_generic_node (buffer, lhs, spc, flags, false); pp_string (buffer, " = PHI <"); } for (i = 0; i < gimple_phi_num_args (phi); i++) @@ -1531,6 +1615,20 @@ dump_gimple_stmt (pretty_printer *buffer, gimple gs, int spc, int flags) && gimple_has_mem_ops (gs)) dump_gimple_mem_ops (buffer, gs, spc, flags); + if ((flags & TDF_ALIAS) + && gimple_has_lhs (gs)) + { + tree lhs = gimple_get_lhs (gs); + if (TREE_CODE (lhs) == SSA_NAME + && POINTER_TYPE_P (TREE_TYPE (lhs)) + && SSA_NAME_PTR_INFO (lhs)) + { + pp_string (buffer, "# PT = "); + pp_points_to_solution (buffer, &SSA_NAME_PTR_INFO (lhs)->pt); + newline_and_indent (buffer, spc); + } + } + switch (gimple_code (gs)) { case GIMPLE_ASM: diff --git a/gcc/gimple.c b/gcc/gimple.c index ce1f75a884e..aab6ef25f34 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1324,11 +1324,15 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op, switch (gimple_code (stmt)) { case GIMPLE_ASSIGN: - /* Walk the RHS operands. A formal temporary LHS may use a - COMPONENT_REF RHS. */ + /* Walk the RHS operands. If the LHS is of a non-renamable type or + is a register variable, we may use a COMPONENT_REF on the RHS. */ if (wi) - wi->val_only = !is_gimple_reg (gimple_assign_lhs (stmt)) - || !gimple_assign_single_p (stmt); + { + tree lhs = gimple_assign_lhs (stmt); + wi->val_only + = (is_gimple_reg_type (TREE_TYPE (lhs)) && !is_gimple_reg (lhs)) + || !gimple_assign_single_p (stmt); + } for (i = 1; i < gimple_num_ops (stmt); i++) { diff --git a/gcc/gimple.h b/gcc/gimple.h index 9df6e92dacf..18ebbb1e560 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -4787,4 +4787,16 @@ gimple_alloc_kind (enum gimple_code code) extern void dump_gimple_statistics (void); +/* In gimple-fold.c. */ +void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree); +tree gimple_fold_builtin (gimple); +bool fold_stmt (gimple_stmt_iterator *); +bool fold_stmt_inplace (gimple); +tree maybe_fold_offset_to_reference (location_t, tree, tree, tree); +tree maybe_fold_offset_to_address (location_t, tree, tree, tree); +tree maybe_fold_stmt_addition (location_t, tree, tree, tree); +tree get_symbol_constant_value (tree); +bool may_propagate_address_into_dereference (tree, tree); + + #endif /* GCC_GIMPLE_H */ diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index e9f60ed5e8b..1f4773a6d45 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -385,7 +385,11 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, rtx false_expr; /* test for then block insns */ rtx true_prob_val; /* probability of else block */ rtx false_prob_val; /* probability of then block */ - int n_insns; + rtx then_last_head = NULL_RTX; /* Last match at the head of THEN */ + rtx else_last_head = NULL_RTX; /* Last match at the head of ELSE */ + rtx then_first_tail = NULL_RTX; /* First match at the tail of THEN */ + rtx else_first_tail = NULL_RTX; /* First match at the tail of ELSE */ + int then_n_insns, else_n_insns, n_insns; enum rtx_code false_code; /* If test is comprised of && or || elements, and we've failed at handling @@ -418,15 +422,78 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, number of insns and see if it is small enough to convert. */ then_start = first_active_insn (then_bb); then_end = last_active_insn (then_bb, TRUE); - n_insns = ce_info->num_then_insns = count_bb_insns (then_bb); + then_n_insns = ce_info->num_then_insns = count_bb_insns (then_bb); + n_insns = then_n_insns; max = MAX_CONDITIONAL_EXECUTE; if (else_bb) { + int n_matching; + max *= 2; else_start = first_active_insn (else_bb); else_end = last_active_insn (else_bb, TRUE); - n_insns += ce_info->num_else_insns = count_bb_insns (else_bb); + else_n_insns = ce_info->num_else_insns = count_bb_insns (else_bb); + n_insns += else_n_insns; + + /* Look for matching sequences at the head and tail of the two blocks, + and limit the range of insns to be converted if possible. */ + n_matching = flow_find_cross_jump (then_bb, else_bb, + &then_first_tail, &else_first_tail); + if (then_first_tail == BB_HEAD (then_bb)) + then_start = then_end = NULL_RTX; + if (else_first_tail == BB_HEAD (else_bb)) + else_start = else_end = NULL_RTX; + + if (n_matching > 0) + { + if (then_end) + then_end = prev_active_insn (then_first_tail); + if (else_end) + else_end = prev_active_insn (else_first_tail); + n_insns -= 2 * n_matching; + } + + if (then_start && else_start) + { + int longest_match = MIN (then_n_insns - n_matching, + else_n_insns - n_matching); + n_matching + = flow_find_head_matching_sequence (then_bb, else_bb, + &then_last_head, + &else_last_head, + longest_match); + + if (n_matching > 0) + { + rtx insn; + + /* We won't pass the insns in the head sequence to + cond_exec_process_insns, so we need to test them here + to make sure that they don't clobber the condition. */ + for (insn = BB_HEAD (then_bb); + insn != NEXT_INSN (then_last_head); + insn = NEXT_INSN (insn)) + if (!LABEL_P (insn) && !NOTE_P (insn) + && !DEBUG_INSN_P (insn) + && modified_in_p (test_expr, insn)) + return FALSE; + } + + if (then_last_head == then_end) + then_start = then_end = NULL_RTX; + if (else_last_head == else_end) + else_start = else_end = NULL_RTX; + + if (n_matching > 0) + { + if (then_start) + then_start = next_active_insn (then_last_head); + if (else_start) + else_start = next_active_insn (else_last_head); + n_insns -= 2 * n_matching; + } + } } if (n_insns > max) @@ -570,7 +637,21 @@ cond_exec_process_if_block (ce_if_block_t * ce_info, fprintf (dump_file, "%d insn%s converted to conditional execution.\n", n_insns, (n_insns == 1) ? " was" : "s were"); - /* Merge the blocks! */ + /* Merge the blocks! If we had matching sequences, make sure to delete one + copy at the appropriate location first: delete the copy in the THEN branch + for a tail sequence so that the remaining one is executed last for both + branches, and delete the copy in the ELSE branch for a head sequence so + that the remaining one is executed first for both branches. */ + if (then_first_tail) + { + rtx from = then_first_tail; + if (!INSN_P (from)) + from = next_active_insn (from); + delete_insn_chain (from, BB_END (then_bb), false); + } + if (else_last_head) + delete_insn_chain (first_active_insn (else_bb), else_last_head, false); + merge_if_block (ce_info); cond_exec_changed_p = TRUE; return TRUE; diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index e9ba04b371c..601695a3fda 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -306,8 +306,6 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original, struct cgraph_node *to = NULL, *what; struct cgraph_edge *curr = e; int freq; - bool duplicate = false; - int orig_size = e->callee->global.size; gcc_assert (e->inline_failed); e->inline_failed = CIF_OK; @@ -316,10 +314,6 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original, DECL_POSSIBLY_INLINED (e->callee->decl) = true; e->callee->global.inlined = true; - if (e->callee->callers->next_caller - || !cgraph_can_remove_if_no_direct_calls_p (e->callee) - || e->callee->same_comdat_group) - duplicate = true; cgraph_clone_inlined_nodes (e, true, update_original); what = e->callee; @@ -337,8 +331,6 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original, gcc_assert (what->global.inlined_to == to); if (new_size > old_size) overall_size += new_size - old_size; - if (!duplicate) - overall_size -= orig_size; ncalls_inlined++; if (flag_indirect_inlining) @@ -544,23 +536,54 @@ cgraph_recursive_inlining_p (struct cgraph_node *to, of the function or function body size. */ static int -cgraph_edge_badness (struct cgraph_edge *edge) +cgraph_edge_badness (struct cgraph_edge *edge, bool dump) { gcov_type badness; int growth = - cgraph_estimate_size_after_inlining (1, edge->caller, edge->callee); + (cgraph_estimate_size_after_inlining (1, edge->caller, edge->callee) + - edge->caller->global.size); - growth -= edge->caller->global.size; + if (dump) + { + fprintf (dump_file, " Badness calculcation for %s -> %s\n", + cgraph_node_name (edge->caller), + cgraph_node_name (edge->callee)); + fprintf (dump_file, " growth %i, time %i-%i, size %i-%i\n", + growth, + edge->callee->global.time, + inline_summary (edge->callee)->time_inlining_benefit, + edge->callee->global.size, + inline_summary (edge->callee)->size_inlining_benefit); + } /* Always prefer inlining saving code size. */ if (growth <= 0) - badness = INT_MIN - growth; + { + badness = INT_MIN - growth; + if (dump) + fprintf (dump_file, " %i: Growth %i < 0\n", (int) badness, + growth); + } /* When profiling is available, base priorities -(#calls / growth). So we optimize for overall number of "executed" inlined calls. */ else if (max_count) - badness = ((int)((double)edge->count * INT_MIN / max_count / (max_benefit + 1)) - * (inline_summary (edge->callee)->time_inlining_benefit + 1)) / growth; + { + badness = + ((int) + ((double) edge->count * INT_MIN / max_count / (max_benefit + 1)) * + (inline_summary (edge->callee)->time_inlining_benefit + 1)) / growth; + if (dump) + { + fprintf (dump_file, + " %i (relative %f): profile info. Relative count %f" + " * Relative benefit %f\n", + (int) badness, (double) badness / INT_MIN, + (double) edge->count / max_count, + (double) (inline_summary (edge->callee)-> + time_inlining_benefit + 1) / (max_benefit + 1)); + } + } /* When function local profile is available, base priorities on growth / frequency, so we optimize for overall frequency of inlined @@ -574,9 +597,13 @@ cgraph_edge_badness (struct cgraph_edge *edge) else if (flag_guess_branch_prob) { int div = edge->frequency * 100 / CGRAPH_FREQ_BASE + 1; + int benefitperc; + int growth_for_all; badness = growth * 10000; - div *= MIN (100 * inline_summary (edge->callee)->time_inlining_benefit - / (edge->callee->global.time + 1) + 1, 100); + benefitperc = + MIN (100 * inline_summary (edge->callee)->time_inlining_benefit / + (edge->callee->global.time + 1) +1, 100); + div *= benefitperc; /* Decrease badness if call is nested. */ @@ -587,9 +614,17 @@ cgraph_edge_badness (struct cgraph_edge *edge) div = 1; if (badness > 0) badness /= div; - badness += cgraph_estimate_growth (edge->callee); + growth_for_all = cgraph_estimate_growth (edge->callee); + badness += growth_for_all; if (badness > INT_MAX) - badness = INT_MAX; + badness = INT_MAX; + if (dump) + { + fprintf (dump_file, + " %i: guessed profile. frequency %i, overall growth %i," + " benefit %i%%, divisor %i\n", + (int) badness, edge->frequency, growth_for_all, benefitperc, div); + } } /* When function local profile is not available or it does not give useful information (ie frequency is zero), base the cost on @@ -604,10 +639,17 @@ cgraph_edge_badness (struct cgraph_edge *edge) if (badness > 0) badness >>= nest; else - { + { badness <<= nest; - } + } + if (dump) + fprintf (dump_file, " %i: no profile. nest %i\n", (int) badness, + nest); } + + /* Ensure that we did not overflow in all the fixed point math above. */ + gcc_assert (badness >= INT_MIN); + gcc_assert (badness <= INT_MAX - 1); /* Make recursive inlining happen always after other inlining is done. */ if (cgraph_recursive_inlining_p (edge->caller, edge->callee, NULL)) return badness + 1; @@ -651,7 +693,7 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node, for (edge = node->callers; edge; edge = edge->next_caller) if (edge->inline_failed) { - int badness = cgraph_edge_badness (edge); + int badness = cgraph_edge_badness (edge, false); if (edge->aux) { fibnode_t n = (fibnode_t) edge->aux; @@ -660,8 +702,12 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node, continue; /* fibheap_replace_key only increase the keys. */ - if (fibheap_replace_key (heap, n, badness)) - continue; + if (badness < n->key) + { + fibheap_replace_key (heap, n, badness); + gcc_assert (n->key == badness); + continue; + } fibheap_delete_node (heap, (fibnode_t) edge->aux); } edge->aux = fibheap_insert (heap, badness, edge); @@ -889,7 +935,7 @@ add_new_edges_to_heap (fibheap_t heap, VEC (cgraph_edge_p, heap) *new_edges) struct cgraph_edge *edge = VEC_pop (cgraph_edge_p, new_edges); gcc_assert (!edge->aux); - edge->aux = fibheap_insert (heap, cgraph_edge_badness (edge), edge); + edge->aux = fibheap_insert (heap, cgraph_edge_badness (edge, false), edge); } } @@ -938,7 +984,7 @@ cgraph_decide_inlining_of_small_functions (void) if (edge->inline_failed) { gcc_assert (!edge->aux); - edge->aux = fibheap_insert (heap, cgraph_edge_badness (edge), edge); + edge->aux = fibheap_insert (heap, cgraph_edge_badness (edge, false), edge); } } @@ -946,15 +992,26 @@ cgraph_decide_inlining_of_small_functions (void) min_size = overall_size; while (overall_size <= max_size - && (edge = (struct cgraph_edge *) fibheap_extract_min (heap))) + && !fibheap_empty (heap)) { int old_size = overall_size; - struct cgraph_node *where; - int growth = - cgraph_estimate_size_after_inlining (1, edge->caller, edge->callee); + struct cgraph_node *where, *callee; + int badness = fibheap_min_key (heap); + int growth; cgraph_inline_failed_t not_good = CIF_OK; - growth -= edge->caller->global.size; + edge = (struct cgraph_edge *) fibheap_extract_min (heap); + gcc_assert (edge->aux); + edge->aux = NULL; + if (!edge->inline_failed) + continue; +#ifdef ENABLE_CHECKING + gcc_assert (cgraph_edge_badness (edge, false) == badness); +#endif + callee = edge->callee; + + growth = (cgraph_estimate_size_after_inlining (1, edge->caller, edge->callee) + - edge->caller->global.size); if (dump_file) { @@ -970,15 +1027,13 @@ cgraph_decide_inlining_of_small_functions (void) gimple_filename ((const_gimple) edge->call_stmt), gimple_lineno ((const_gimple) edge->call_stmt), cgraph_estimate_growth (edge->callee), - cgraph_edge_badness (edge), + badness, edge->frequency / (double)CGRAPH_FREQ_BASE); if (edge->count) fprintf (dump_file," Called "HOST_WIDEST_INT_PRINT_DEC"x\n", edge->count); + if (dump_flags & TDF_DETAILS) + cgraph_edge_badness (edge, true); } - gcc_assert (edge->aux); - edge->aux = NULL; - if (!edge->inline_failed) - continue; /* When not having profile info ready we don't weight by any way the position of call in procedure itself. This means if call of @@ -1096,6 +1151,11 @@ cgraph_decide_inlining_of_small_functions (void) called by function we inlined (since number of it inlinable callers might change). */ update_caller_keys (heap, where, updated_nodes); + + /* We removed one call of the function we just inlined. If offline + copy is still needed, be sure to update the keys. */ + if (callee != where && !callee->global.inlined_to) + update_caller_keys (heap, callee, updated_nodes); bitmap_clear (updated_nodes); if (dump_file) @@ -1117,10 +1177,39 @@ cgraph_decide_inlining_of_small_functions (void) fprintf (dump_file, "New minimal size reached: %i\n", min_size); } } - while ((edge = (struct cgraph_edge *) fibheap_extract_min (heap)) != NULL) + while (!fibheap_empty (heap)) { + int badness = fibheap_min_key (heap); + + edge = (struct cgraph_edge *) fibheap_extract_min (heap); gcc_assert (edge->aux); edge->aux = NULL; + if (!edge->inline_failed) + continue; +#ifdef ENABLE_CHECKING + gcc_assert (cgraph_edge_badness (edge, false) == badness); +#endif + if (dump_file) + { + fprintf (dump_file, + "\nSkipping %s with %i size\n", + cgraph_node_name (edge->callee), + edge->callee->global.size); + fprintf (dump_file, + " called by %s in %s:%i\n" + " Estimated growth after inlined into all callees is %+i insns.\n" + " Estimated badness is %i, frequency %.2f.\n", + cgraph_node_name (edge->caller), + gimple_filename ((const_gimple) edge->call_stmt), + gimple_lineno ((const_gimple) edge->call_stmt), + cgraph_estimate_growth (edge->callee), + badness, + edge->frequency / (double)CGRAPH_FREQ_BASE); + if (edge->count) + fprintf (dump_file," Called "HOST_WIDEST_INT_PRINT_DEC"x\n", edge->count); + if (dump_flags & TDF_DETAILS) + cgraph_edge_badness (edge, true); + } if (!edge->callee->local.disregard_inline_limits && edge->inline_failed && !cgraph_recursive_inlining_p (edge->caller, edge->callee, &edge->inline_failed)) diff --git a/gcc/ira-color.c b/gcc/ira-color.c index c7ae9105a45..f507db18aee 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2860,20 +2860,48 @@ bool ira_reassign_pseudos (int *spilled_pseudo_regs, int num, HARD_REG_SET bad_spill_regs, HARD_REG_SET *pseudo_forbidden_regs, - HARD_REG_SET *pseudo_previous_regs, bitmap spilled) + HARD_REG_SET *pseudo_previous_regs, + bitmap spilled) { - int i, m, n, regno; + int i, n, regno; bool changed_p; ira_allocno_t a, conflict_a; HARD_REG_SET forbidden_regs; ira_allocno_conflict_iterator aci; + bitmap temp = BITMAP_ALLOC (NULL); + + /* Add pseudos which conflict with pseudos already in + SPILLED_PSEUDO_REGS to SPILLED_PSEUDO_REGS. This is preferable + to allocating in two steps as some of the conflicts might have + a higher priority than the pseudos passed in SPILLED_PSEUDO_REGS. */ + for (i = 0; i < num; i++) + bitmap_set_bit (temp, spilled_pseudo_regs[i]); + + for (i = 0, n = num; i < n; i++) + { + int regno = spilled_pseudo_regs[i]; + bitmap_set_bit (temp, regno); + + a = ira_regno_allocno_map[regno]; + FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci) + if (ALLOCNO_HARD_REGNO (conflict_a) < 0 + && ! ALLOCNO_DONT_REASSIGN_P (conflict_a) + && ! bitmap_bit_p (temp, ALLOCNO_REGNO (conflict_a))) + { + spilled_pseudo_regs[num++] = ALLOCNO_REGNO (conflict_a); + bitmap_set_bit (temp, ALLOCNO_REGNO (conflict_a)); + /* ?!? This seems wrong. */ + bitmap_set_bit (consideration_allocno_bitmap, + ALLOCNO_NUM (conflict_a)); + } + } if (num > 1) qsort (spilled_pseudo_regs, num, sizeof (int), pseudo_reg_compare); changed_p = false; /* Try to assign hard registers to pseudos from SPILLED_PSEUDO_REGS. */ - for (m = i = 0; i < num; i++) + for (i = 0; i < num; i++) { regno = spilled_pseudo_regs[i]; COPY_HARD_REG_SET (forbidden_regs, bad_spill_regs); @@ -2885,7 +2913,7 @@ ira_reassign_pseudos (int *spilled_pseudo_regs, int num, ira_assert (reg_renumber[regno] < 0); if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL) fprintf (ira_dump_file, - " Spill %d(a%d), cost=%d", regno, ALLOCNO_NUM (a), + " Try Assign %d(a%d), cost=%d", regno, ALLOCNO_NUM (a), ALLOCNO_MEMORY_COST (a) - ALLOCNO_COVER_CLASS_COST (a)); allocno_reload_assign (a, forbidden_regs); @@ -2894,60 +2922,8 @@ ira_reassign_pseudos (int *spilled_pseudo_regs, int num, CLEAR_REGNO_REG_SET (spilled, regno); changed_p = true; } - else - spilled_pseudo_regs[m++] = regno; - } - if (m == 0) - return changed_p; - if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL) - { - fprintf (ira_dump_file, " Spilled regs"); - for (i = 0; i < m; i++) - fprintf (ira_dump_file, " %d", spilled_pseudo_regs[i]); - fprintf (ira_dump_file, "\n"); - } - /* Try to assign hard registers to pseudos conflicting with ones - from SPILLED_PSEUDO_REGS. */ - for (i = n = 0; i < m; i++) - { - regno = spilled_pseudo_regs[i]; - a = ira_regno_allocno_map[regno]; - FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci) - if (ALLOCNO_HARD_REGNO (conflict_a) < 0 - && ! ALLOCNO_DONT_REASSIGN_P (conflict_a) - && ! bitmap_bit_p (consideration_allocno_bitmap, - ALLOCNO_NUM (conflict_a))) - { - sorted_allocnos[n++] = conflict_a; - bitmap_set_bit (consideration_allocno_bitmap, - ALLOCNO_NUM (conflict_a)); - } - } - if (n != 0) - { - setup_allocno_priorities (sorted_allocnos, n); - qsort (sorted_allocnos, n, sizeof (ira_allocno_t), - allocno_priority_compare_func); - for (i = 0; i < n; i++) - { - a = sorted_allocnos[i]; - regno = ALLOCNO_REGNO (a); - COPY_HARD_REG_SET (forbidden_regs, bad_spill_regs); - IOR_HARD_REG_SET (forbidden_regs, pseudo_forbidden_regs[regno]); - IOR_HARD_REG_SET (forbidden_regs, pseudo_previous_regs[regno]); - if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL) - fprintf (ira_dump_file, - " Try assign %d(a%d), cost=%d", - regno, ALLOCNO_NUM (a), - ALLOCNO_MEMORY_COST (a) - - ALLOCNO_COVER_CLASS_COST (a)); - if (allocno_reload_assign (a, forbidden_regs)) - { - changed_p = true; - bitmap_clear_bit (spilled, regno); - } - } } + BITMAP_FREE (temp); return changed_p; } diff --git a/gcc/longlong.h b/gcc/longlong.h index 5470f9bb7b0..49daa6e4255 100644 --- a/gcc/longlong.h +++ b/gcc/longlong.h @@ -318,6 +318,7 @@ UDItype __umulsidi3 (USItype, USItype); #endif #if (defined (__i370__) || defined (__s390__) || defined (__mvs__)) && W_TYPE_SIZE == 32 +#if !defined (__zarch__) #define smul_ppmm(xh, xl, m0, m1) \ do { \ union {DItype __ll; \ @@ -339,6 +340,28 @@ UDItype __umulsidi3 (USItype, USItype); : "0" (__x.__ll), "r" (d)); \ (q) = __x.__i.__l; (r) = __x.__i.__h; \ } while (0) +#else +#define smul_ppmm(xh, xl, m0, m1) \ + do { \ + register SItype r0 __asm__ ("0"); \ + register SItype r1 __asm__ ("1") = m0; \ + \ + __asm__ ("mr\t%%r0,%3" \ + : "=r" (r0), "=r" (r1) \ + : "r" (r1), "r" (m1)); \ + (xh) = r1; (xl) = r0; \ + } while (0) +#define sdiv_qrnnd(q, r, n1, n0, d) \ + do { \ + register SItype r0 __asm__ ("0") = n0; \ + register SItype r1 __asm__ ("1") = n1; \ + \ + __asm__ ("dr\t%%r0,%3" \ + : "=r" (r0), "=r" (r1) \ + : "r" (r0), "r" (r1), "r" (d)); \ + (q) = r0; (r) = r1; \ + } while (0) +#endif /* __zarch__ */ #endif #if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32 diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index c92562f708b..20b89d69761 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2010-04-16 Rainer Orth + + * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New + function. + 2010-03-09 Eric Botcazou PR bootstrap/43276 diff --git a/gcc/lto/lto-elf.c b/gcc/lto/lto-elf.c index 59f71509f50..c777da70f88 100644 --- a/gcc/lto/lto-elf.c +++ b/gcc/lto/lto-elf.c @@ -455,6 +455,22 @@ DEFINE_VALIDATE_EHDR (32) DEFINE_VALIDATE_EHDR (64) +#ifndef HAVE_ELF_GETSHDRSTRNDX +/* elf_getshdrstrndx replacement for systems that lack it, but provide + either the gABI conformant or Solaris 2 variant of elf_getshstrndx + instead. */ + +static int +elf_getshdrstrndx (Elf *elf, size_t *dst) +{ +#ifdef HAVE_ELF_GETSHSTRNDX_GABI + return elf_getshstrndx (elf, dst); +#else + return elf_getshstrndx (elf, dst) ? 0 : -1; +#endif +} +#endif + /* Validate's ELF_FILE's executable header and, if cached_file_attrs is uninitialized, caches the results. Also records the section header string table's section index. Returns true on success or false on failure. */ diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index f5b485aa62b..4eeb67bdbea 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -194,3 +194,21 @@ function var_ref(name, flags) return "&target_flags" return "0" } + +# Given the option called NAME return a sanitized version of its name. +function opt_sanitized_name(name) +{ + if (name == "finline-limit=" || name == "Wlarger-than=" \ + || name == "ftemplate-depth=") + name = name "eq" + if (name == "gdwarf+") + name = "gdwarfplus" + gsub ("[^A-Za-z0-9]", "_", name) + return name +} + +# Given the option called NAME return the appropriate enum for it. +function opt_enum(name) +{ + return "OPT_" opt_sanitized_name(name) +} diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 0cff3753245..da595e94bc0 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -170,11 +170,7 @@ for (i = 0; i < n_opts; i++) { } len = length (opts[i]); - enum = "OPT_" opts[i] - if (opts[i] == "finline-limit=" || opts[i] == "Wlarger-than=" \ - || opts[i] == "ftemplate-depth=") - enum = enum "eq" - gsub ("[^A-Za-z0-9]", "_", enum) + enum = opt_enum(opts[i]) # If this switch takes joined arguments, back-chain all # subsequent switches to it for which it is a prefix. If diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk index 93a9008bdcf..cf2ef9683c8 100644 --- a/gcc/opth-gen.awk +++ b/gcc/opth-gen.awk @@ -331,13 +331,7 @@ for (i = 0; i < n_opts; i++) { } len = length (opts[i]); - enum = "OPT_" opts[i] - if (opts[i] == "finline-limit=" || opts[i] == "Wlarger-than=" \ - || opts[i] == "ftemplate-depth=") - enum = enum "eq" - if (opts[i] == "gdwarf+") - enum = "OPT_gdwarfplus" - gsub ("[^A-Za-z0-9]", "_", enum) + enum = opt_enum(opts[i]) # If this switch takes joined arguments, back-chain all # subsequent switches to it for which it is a prefix. If diff --git a/gcc/plugin.c b/gcc/plugin.c index 25e5b95be8f..9e1b5f4ada1 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -1,5 +1,5 @@ /* Support for GCC plugin mechanism. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -124,16 +124,41 @@ get_plugin_base_name (const char *full_name) } -/* Create a plugin_name_args object for the give plugin and insert it to - the hash table. This function is called when -fplugin=/path/to/NAME.so - option is processed. */ +/* Create a plugin_name_args object for the given plugin and insert it + to the hash table. This function is called when + -fplugin=/path/to/NAME.so or -fplugin=NAME option is processed. */ void add_new_plugin (const char* plugin_name) { struct plugin_name_args *plugin; void **slot; - char *base_name = get_plugin_base_name (plugin_name); + char *base_name; + bool name_is_short; + const char *pc; + + /* Replace short names by their full path when relevant. */ + name_is_short = !IS_ABSOLUTE_PATH (plugin_name); + for (pc = plugin_name; name_is_short && *pc; pc++) + if (*pc == '.' || IS_DIR_SEPARATOR (*pc)) + name_is_short = false; + + if (name_is_short) + { + base_name = CONST_CAST (char*, plugin_name); + /* FIXME: the ".so" suffix is currently builtin, since plugins + only work on ELF host systems like e.g. Linux or Solaris. + When plugins shall be available on non ELF systems such as + Windows or MacOS, this code has to be greatly improved. */ + plugin_name = concat (default_plugin_dir_name (), "/", + plugin_name, ".so", NULL); + if (access (plugin_name, R_OK)) + fatal_error + ("inacessible plugin file %s expanded from short plugin name %s: %m", + plugin_name, base_name); + } + else + base_name = get_plugin_base_name (plugin_name); /* If this is the first -fplugin= option we encounter, create 'plugin_name_args_tab' hash table. */ @@ -809,6 +834,7 @@ plugin_default_version_check (struct plugin_gcc_version *gcc_version, return true; } + /* Return the current value of event_last, so that plugins which provide additional functionality for events for the benefit of high-level plugins know how many valid entries plugin_event_name holds. */ @@ -818,3 +844,15 @@ get_event_last (void) { return event_last; } + + +/* Retrieve the default plugin directory. The gcc driver should have passed + it as -iplugindir to the cc1 program, and it is queriable thru the + -print-file-name=plugin option to gcc. */ +const char* +default_plugin_dir_name (void) +{ + if (!plugindir_string) + fatal_error ("-iplugindir option not passed from the gcc driver"); + return plugindir_string; +} diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 718af8d27f1..143944e6d50 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,8 @@ +2010-04-16 Joseph Myers + + * be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, id.po, ja.po, + nl.po, ru.po, sr.po, sv.po, tr.po, zh_CN.po, zh_TW.po: Update. + 2010-04-06 Joseph Myers * gcc.pot: Regenerate. diff --git a/gcc/po/be.po b/gcc/po/be.po index de9ef9627ce..0917b583564 100644 --- a/gcc/po/be.po +++ b/gcc/po/be.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gcc 3.1\n" "Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" -"POT-Creation-Date: 2010-02-04 16:20+0000\n" +"POT-Creation-Date: 2010-04-06 14:11+0000\n" "PO-Revision-Date: 2002-05-17 15:54+0200\n" "Last-Translator: Ales Nyakhaychyk \n" "Language-Team: Belarusian \n" @@ -14,67 +14,67 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: c-decl.c:4569 c-pretty-print.c:403 c-typeck.c:5558 toplev.c:1648 +#: c-decl.c:4573 c-pretty-print.c:403 c-typeck.c:5590 toplev.c:1652 #: cp/error.c:581 cp/error.c:854 msgid "" msgstr "" -#: c-format.c:363 c-format.c:387 config/i386/msformat-c.c:49 +#: c-format.c:363 c-format.c:387 config/i386/msformat-c.c:50 #, fuzzy msgid "' ' flag" msgstr "'0' флаг" -#: c-format.c:363 c-format.c:387 config/i386/msformat-c.c:49 +#: c-format.c:363 c-format.c:387 config/i386/msformat-c.c:50 msgid "the ' ' printf flag" msgstr "" #: c-format.c:364 c-format.c:388 c-format.c:422 c-format.c:434 c-format.c:493 -#: config/i386/msformat-c.c:50 +#: config/i386/msformat-c.c:51 #, fuzzy msgid "'+' flag" msgstr "'0' флаг" #: c-format.c:364 c-format.c:388 c-format.c:422 c-format.c:434 -#: config/i386/msformat-c.c:50 +#: config/i386/msformat-c.c:51 msgid "the '+' printf flag" msgstr "" #: c-format.c:365 c-format.c:389 c-format.c:435 c-format.c:469 -#: config/i386/msformat-c.c:51 config/i386/msformat-c.c:86 +#: config/i386/msformat-c.c:52 config/i386/msformat-c.c:87 #, fuzzy msgid "'#' flag" msgstr "'0' флаг" -#: c-format.c:365 c-format.c:389 c-format.c:435 config/i386/msformat-c.c:51 +#: c-format.c:365 c-format.c:389 c-format.c:435 config/i386/msformat-c.c:52 msgid "the '#' printf flag" msgstr "" -#: c-format.c:366 c-format.c:390 c-format.c:467 config/i386/msformat-c.c:52 +#: c-format.c:366 c-format.c:390 c-format.c:467 config/i386/msformat-c.c:53 #, fuzzy msgid "'0' flag" msgstr "'0' флаг" -#: c-format.c:366 c-format.c:390 config/i386/msformat-c.c:52 +#: c-format.c:366 c-format.c:390 config/i386/msformat-c.c:53 msgid "the '0' printf flag" msgstr "" #: c-format.c:367 c-format.c:391 c-format.c:466 c-format.c:496 -#: config/i386/msformat-c.c:53 +#: config/i386/msformat-c.c:54 #, fuzzy msgid "'-' flag" msgstr "'0' флаг" -#: c-format.c:367 c-format.c:391 config/i386/msformat-c.c:53 +#: c-format.c:367 c-format.c:391 config/i386/msformat-c.c:54 msgid "the '-' printf flag" msgstr "" -#: c-format.c:368 c-format.c:449 config/i386/msformat-c.c:54 -#: config/i386/msformat-c.c:74 +#: c-format.c:368 c-format.c:449 config/i386/msformat-c.c:55 +#: config/i386/msformat-c.c:75 #, fuzzy msgid "''' flag" msgstr "'0' флаг" -#: c-format.c:368 config/i386/msformat-c.c:54 +#: c-format.c:368 config/i386/msformat-c.c:55 msgid "the ''' printf flag" msgstr "" @@ -88,34 +88,34 @@ msgid "the 'I' printf flag" msgstr "" #: c-format.c:370 c-format.c:392 c-format.c:447 c-format.c:470 c-format.c:497 -#: c-format.c:1621 config/sol2-c.c:45 config/i386/msformat-c.c:55 -#: config/i386/msformat-c.c:72 +#: c-format.c:1621 config/sol2-c.c:45 config/i386/msformat-c.c:56 +#: config/i386/msformat-c.c:73 msgid "field width" msgstr "" #: c-format.c:370 c-format.c:392 config/sol2-c.c:45 -#: config/i386/msformat-c.c:55 +#: config/i386/msformat-c.c:56 msgid "field width in printf format" msgstr "" #: c-format.c:371 c-format.c:393 c-format.c:424 c-format.c:437 -#: config/i386/msformat-c.c:56 +#: config/i386/msformat-c.c:57 msgid "precision" msgstr "" #: c-format.c:371 c-format.c:393 c-format.c:424 c-format.c:437 -#: config/i386/msformat-c.c:56 +#: config/i386/msformat-c.c:57 msgid "precision in printf format" msgstr "" #: c-format.c:372 c-format.c:394 c-format.c:425 c-format.c:438 c-format.c:448 -#: c-format.c:500 config/sol2-c.c:46 config/i386/msformat-c.c:57 -#: config/i386/msformat-c.c:73 +#: c-format.c:500 config/sol2-c.c:46 config/i386/msformat-c.c:58 +#: config/i386/msformat-c.c:74 msgid "length modifier" msgstr "" #: c-format.c:372 c-format.c:394 c-format.c:425 c-format.c:438 -#: config/sol2-c.c:46 config/i386/msformat-c.c:57 +#: config/sol2-c.c:46 config/i386/msformat-c.c:58 msgid "length modifier in printf format" msgstr "" @@ -128,20 +128,20 @@ msgstr "'0' флаг" msgid "the 'q' diagnostic flag" msgstr "" -#: c-format.c:444 config/i386/msformat-c.c:70 +#: c-format.c:444 config/i386/msformat-c.c:71 msgid "assignment suppression" msgstr "" -#: c-format.c:444 config/i386/msformat-c.c:70 +#: c-format.c:444 config/i386/msformat-c.c:71 msgid "the assignment suppression scanf feature" msgstr "" -#: c-format.c:445 config/i386/msformat-c.c:71 +#: c-format.c:445 config/i386/msformat-c.c:72 #, fuzzy msgid "'a' flag" msgstr "'0' флаг" -#: c-format.c:445 config/i386/msformat-c.c:71 +#: c-format.c:445 config/i386/msformat-c.c:72 msgid "the 'a' scanf flag" msgstr "" @@ -154,15 +154,15 @@ msgstr "'0' флаг" msgid "the 'm' scanf flag" msgstr "" -#: c-format.c:447 config/i386/msformat-c.c:72 +#: c-format.c:447 config/i386/msformat-c.c:73 msgid "field width in scanf format" msgstr "" -#: c-format.c:448 config/i386/msformat-c.c:73 +#: c-format.c:448 config/i386/msformat-c.c:74 msgid "length modifier in scanf format" msgstr "" -#: c-format.c:449 config/i386/msformat-c.c:74 +#: c-format.c:449 config/i386/msformat-c.c:75 msgid "the ''' scanf flag" msgstr "" @@ -196,7 +196,7 @@ msgstr "'0' флаг" msgid "the '^' strftime flag" msgstr "" -#: c-format.c:469 config/i386/msformat-c.c:86 +#: c-format.c:469 config/i386/msformat-c.c:87 msgid "the '#' strftime flag" msgstr "" @@ -297,12 +297,12 @@ msgstr "" msgid "({anonymous})" msgstr "" -#: c-opts.c:1497 tree.c:3966 cp/error.c:999 fortran/cpp.c:552 +#: c-opts.c:1501 tree.c:3970 cp/error.c:999 fortran/cpp.c:552 msgid "" msgstr "" #. Handle deferred options from command-line. -#: c-opts.c:1515 fortran/cpp.c:557 +#: c-opts.c:1519 fortran/cpp.c:557 msgid "" msgstr "" @@ -428,62 +428,62 @@ msgstr "" msgid "" msgstr "сінтаксічная памылка" -#: c-pretty-print.c:1136 +#: c-pretty-print.c:1142 msgid "" msgstr "" -#: c-pretty-print.c:1140 cp/cxx-pretty-print.c:154 +#: c-pretty-print.c:1146 cp/cxx-pretty-print.c:154 #, fuzzy msgid "" msgstr "вяртанне" -#: c-typeck.c:5675 +#: c-typeck.c:5707 msgid "array initialized from parenthesized string constant" msgstr "" -#: c-typeck.c:5748 c-typeck.c:6619 +#: c-typeck.c:5780 c-typeck.c:6651 msgid "initialization of a flexible array member" msgstr "" -#: c-typeck.c:5758 cp/typeck2.c:851 +#: c-typeck.c:5790 cp/typeck2.c:851 #, gcc-internal-format msgid "char-array initialized from wide string" msgstr "" -#: c-typeck.c:5766 +#: c-typeck.c:5798 msgid "wide character array initialized from non-wide string" msgstr "" -#: c-typeck.c:5772 +#: c-typeck.c:5804 msgid "wide character array initialized from incompatible wide string" msgstr "" -#: c-typeck.c:5806 +#: c-typeck.c:5838 msgid "array of inappropriate type initialized from string constant" msgstr "" #. ??? This should not be an error when inlining calls to #. unprototyped functions. -#: c-typeck.c:5874 c-typeck.c:5327 cp/typeck.c:1853 +#: c-typeck.c:5906 c-typeck.c:5359 cp/typeck.c:1862 #, gcc-internal-format msgid "invalid use of non-lvalue array" msgstr "" -#: c-typeck.c:5900 +#: c-typeck.c:5932 msgid "array initialized from non-constant array expression" msgstr "" -#: c-typeck.c:5914 c-typeck.c:5917 c-typeck.c:5925 c-typeck.c:5964 -#: c-typeck.c:7418 +#: c-typeck.c:5946 c-typeck.c:5949 c-typeck.c:5957 c-typeck.c:5996 +#: c-typeck.c:7450 msgid "initializer element is not constant" msgstr "" -#: c-typeck.c:5930 c-typeck.c:5976 c-typeck.c:7428 +#: c-typeck.c:5962 c-typeck.c:6008 c-typeck.c:7460 #, fuzzy msgid "initializer element is not a constant expression" msgstr "памер масіва \"%s\" адмоўны" -#: c-typeck.c:5971 c-typeck.c:7423 +#: c-typeck.c:6003 c-typeck.c:7455 #, gcc-internal-format msgid "initializer element is not computable at load time" msgstr "" @@ -492,119 +492,119 @@ msgstr "" #. of VLAs themselves count as VLAs, it does not make #. sense to permit them to be initialized given that #. ordinary VLAs may not be initialized. -#: c-typeck.c:5985 c-decl.c:3951 c-decl.c:3966 +#: c-typeck.c:6017 c-decl.c:3954 c-decl.c:3969 #, gcc-internal-format msgid "variable-sized object may not be initialized" msgstr "" -#: c-typeck.c:5989 +#: c-typeck.c:6021 msgid "invalid initializer" msgstr "нерэчаісны ініцыялізатар" -#: c-typeck.c:6198 +#: c-typeck.c:6230 msgid "(anonymous)" msgstr "" -#: c-typeck.c:6476 +#: c-typeck.c:6508 msgid "extra brace group at end of initializer" msgstr "" -#: c-typeck.c:6497 +#: c-typeck.c:6529 msgid "missing braces around initializer" msgstr "" -#: c-typeck.c:6558 +#: c-typeck.c:6590 msgid "braces around scalar initializer" msgstr "" -#: c-typeck.c:6616 +#: c-typeck.c:6648 msgid "initialization of flexible array member in a nested context" msgstr "" -#: c-typeck.c:6647 +#: c-typeck.c:6679 msgid "missing initializer" msgstr "прапушчан ініцыялізатар" -#: c-typeck.c:6669 +#: c-typeck.c:6701 msgid "empty scalar initializer" msgstr "" -#: c-typeck.c:6674 +#: c-typeck.c:6706 msgid "extra elements in scalar initializer" msgstr "" -#: c-typeck.c:6782 c-typeck.c:6860 +#: c-typeck.c:6814 c-typeck.c:6892 msgid "array index in non-array initializer" msgstr "" -#: c-typeck.c:6787 c-typeck.c:6916 +#: c-typeck.c:6819 c-typeck.c:6948 msgid "field name not in record or union initializer" msgstr "" -#: c-typeck.c:6833 +#: c-typeck.c:6865 #, fuzzy msgid "array index in initializer not of integer type" msgstr "\"%s\" мае незавершаны тып" -#: c-typeck.c:6842 c-typeck.c:6851 +#: c-typeck.c:6874 c-typeck.c:6883 #, fuzzy msgid "array index in initializer is not an integer constant expression" msgstr "памер масіва \"%s\" адмоўны" -#: c-typeck.c:6856 c-typeck.c:6858 +#: c-typeck.c:6888 c-typeck.c:6890 msgid "nonconstant array index in initializer" msgstr "" -#: c-typeck.c:6862 c-typeck.c:6865 +#: c-typeck.c:6894 c-typeck.c:6897 msgid "array index in initializer exceeds array bounds" msgstr "" -#: c-typeck.c:6879 +#: c-typeck.c:6911 msgid "empty index range in initializer" msgstr "" -#: c-typeck.c:6888 +#: c-typeck.c:6920 msgid "array index range in initializer exceeds array bounds" msgstr "" -#: c-typeck.c:6971 c-typeck.c:6998 c-typeck.c:7517 +#: c-typeck.c:7003 c-typeck.c:7030 c-typeck.c:7549 msgid "initialized field with side-effects overwritten" msgstr "" -#: c-typeck.c:6973 c-typeck.c:7000 c-typeck.c:7519 +#: c-typeck.c:7005 c-typeck.c:7032 c-typeck.c:7551 msgid "initialized field overwritten" msgstr "" -#: c-typeck.c:7445 c-typeck.c:4933 +#: c-typeck.c:7477 c-typeck.c:4965 #, gcc-internal-format msgid "enum conversion in initialization is invalid in C++" msgstr "" -#: c-typeck.c:7734 +#: c-typeck.c:7766 msgid "excess elements in char array initializer" msgstr "" -#: c-typeck.c:7741 c-typeck.c:7800 +#: c-typeck.c:7773 c-typeck.c:7832 msgid "excess elements in struct initializer" msgstr "" -#: c-typeck.c:7815 +#: c-typeck.c:7847 msgid "non-static initialization of a flexible array member" msgstr "" -#: c-typeck.c:7885 +#: c-typeck.c:7917 msgid "excess elements in union initializer" msgstr "" -#: c-typeck.c:7974 +#: c-typeck.c:8006 msgid "excess elements in array initializer" msgstr "" -#: c-typeck.c:8007 +#: c-typeck.c:8039 msgid "excess elements in vector initializer" msgstr "" -#: c-typeck.c:8038 +#: c-typeck.c:8070 msgid "excess elements in scalar initializer" msgstr "" @@ -624,157 +624,163 @@ msgstr "" msgid "return not followed by barrier" msgstr "" -#: collect2.c:486 gcc.c:7719 +#: collect2.c:497 gcc.c:7734 #, fuzzy, c-format msgid "internal gcc abort in %s, at %s:%d" msgstr "спынена ў %s, ля %s:%d" -#: collect2.c:939 +#: collect2.c:950 #, c-format msgid "COLLECT_LTO_WRAPPER must be set." msgstr "" -#: collect2.c:1081 +#: collect2.c:1092 #, fuzzy, c-format msgid "too many lto output files" msgstr "вельмі шмат уваходзячых файлаў" -#: collect2.c:1297 +#: collect2.c:1308 #, c-format msgid "no arguments" msgstr "няма аргументаў" -#: collect2.c:1704 collect2.c:1866 collect2.c:1901 +#: collect2.c:1715 collect2.c:1886 collect2.c:1921 #, c-format msgid "fopen %s" msgstr "" -#: collect2.c:1707 collect2.c:1871 collect2.c:1904 +#: collect2.c:1718 collect2.c:1891 collect2.c:1924 #, c-format msgid "fclose %s" msgstr "" -#: collect2.c:1716 +#: collect2.c:1727 #, c-format msgid "collect2 version %s" msgstr "" -#: collect2.c:1812 -#, c-format -msgid "%d constructor(s) found\n" -msgstr "%d канструктар(аў) знойдзен(а)\n" +#: collect2.c:1823 +#, fuzzy, c-format +msgid "%d constructor found\n" +msgid_plural "%d constructors found\n" +msgstr[0] "%d канструктар(аў) знойдзен(а)\n" +msgstr[1] "%d канструктар(аў) знойдзен(а)\n" -#: collect2.c:1813 -#, c-format -msgid "%d destructor(s) found\n" -msgstr "%d дэструктар(аў) знойдзен(а)\n" +#: collect2.c:1827 +#, fuzzy, c-format +msgid "%d destructor found\n" +msgid_plural "%d destructors found\n" +msgstr[0] "%d дэструктар(аў) знойдзен(а)\n" +msgstr[1] "%d дэструктар(аў) знойдзен(а)\n" -#: collect2.c:1814 +#: collect2.c:1831 #, c-format -msgid "%d frame table(s) found\n" -msgstr "" +msgid "%d frame table found\n" +msgid_plural "%d frame tables found\n" +msgstr[0] "" +msgstr[1] "" -#: collect2.c:1965 lto-wrapper.c:175 +#: collect2.c:1985 lto-wrapper.c:175 #, c-format msgid "can't get program status" msgstr "" -#: collect2.c:2034 +#: collect2.c:2054 #, fuzzy, c-format msgid "could not open response file %s" msgstr "не магу знайсці крыніцу %s\n" -#: collect2.c:2039 +#: collect2.c:2059 #, fuzzy, c-format msgid "could not write to response file %s" msgstr "не магу знайсці крыніцу %s\n" -#: collect2.c:2044 +#: collect2.c:2064 #, fuzzy, c-format msgid "could not close response file %s" msgstr "не магу знайсці крыніцу %s\n" -#: collect2.c:2062 +#: collect2.c:2082 #, c-format msgid "[cannot find %s]" msgstr "[нельга знайсці %s]" -#: collect2.c:2077 +#: collect2.c:2097 #, fuzzy, c-format msgid "cannot find '%s'" msgstr "нельга знайсці \"%s\"" -#: collect2.c:2081 collect2.c:2604 collect2.c:2800 gcc.c:3085 +#: collect2.c:2101 collect2.c:2624 collect2.c:2820 gcc.c:3085 #: lto-wrapper.c:147 #, c-format msgid "pex_init failed" msgstr "" -#: collect2.c:2119 +#: collect2.c:2139 #, c-format msgid "[Leaving %s]\n" msgstr "" -#: collect2.c:2351 +#: collect2.c:2371 #, c-format msgid "" "\n" "write_c_file - output name is %s, prefix is %s\n" msgstr "" -#: collect2.c:2578 +#: collect2.c:2598 #, fuzzy, c-format msgid "cannot find 'nm'" msgstr "нельга знайсці \"nm\"" -#: collect2.c:2626 +#: collect2.c:2646 #, fuzzy, c-format msgid "can't open nm output" msgstr "немагчыма адчыніць файл уводу `%s'" -#: collect2.c:2709 +#: collect2.c:2729 #, c-format msgid "init function found in object %s" msgstr "" -#: collect2.c:2719 +#: collect2.c:2739 #, c-format msgid "fini function found in object %s" msgstr "" -#: collect2.c:2821 +#: collect2.c:2841 #, fuzzy, c-format msgid "can't open ldd output" msgstr "немагчыма адчыніць файл уводу `%s'" -#: collect2.c:2824 +#: collect2.c:2844 #, c-format msgid "" "\n" "ldd output with constructors/destructors.\n" msgstr "" -#: collect2.c:2839 +#: collect2.c:2859 #, c-format msgid "dynamic dependency %s not found" msgstr "" -#: collect2.c:2851 +#: collect2.c:2871 #, c-format msgid "unable to open dynamic dependency '%s'" msgstr "" -#: collect2.c:3012 +#: collect2.c:3032 #, c-format msgid "%s: not a COFF file" msgstr "" -#: collect2.c:3142 +#: collect2.c:3162 #, c-format msgid "%s: cannot open as COFF file" msgstr "" -#: collect2.c:3200 +#: collect2.c:3220 #, fuzzy, c-format msgid "library lib%s not found" msgstr "Бібліятэка lib%s не знойдзена" @@ -789,12 +795,12 @@ msgstr "" msgid "too many input files" msgstr "вельмі шмат уваходзячых файлаў" -#: diagnostic.c:185 +#: diagnostic.c:186 #, fuzzy, c-format msgid "compilation terminated due to -Wfatal-errors.\n" msgstr "кампіляцыя завершана.\n" -#: diagnostic.c:194 +#: diagnostic.c:195 #, c-format msgid "" "Please submit a full bug report,\n" @@ -802,65 +808,65 @@ msgid "" "See %s for instructions.\n" msgstr "" -#: diagnostic.c:203 +#: diagnostic.c:204 #, c-format msgid "compilation terminated.\n" msgstr "кампіляцыя завершана.\n" -#: diagnostic.c:381 +#: diagnostic.c:382 #, c-format msgid "*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.\n" msgstr "" -#: diagnostic.c:398 +#: diagnostic.c:399 #, c-format msgid "%s:%d: confused by earlier errors, bailing out\n" msgstr "" -#: diagnostic.c:709 +#: diagnostic.c:744 #, c-format msgid "Internal compiler error: Error reporting routines re-entered.\n" msgstr "" -#: final.c:1150 +#: final.c:1153 msgid "negative insn length" msgstr "" -#: final.c:2647 +#: final.c:2650 msgid "could not split insn" msgstr "" -#: final.c:3081 +#: final.c:3084 #, fuzzy msgid "invalid 'asm': " msgstr "нерэчаісная маска" -#: final.c:3264 +#: final.c:3267 #, c-format msgid "nested assembly dialect alternatives" msgstr "" -#: final.c:3281 final.c:3293 +#: final.c:3284 final.c:3296 #, c-format msgid "unterminated assembly dialect alternative" msgstr "" -#: final.c:3340 +#: final.c:3343 #, c-format msgid "operand number missing after %%-letter" msgstr "" -#: final.c:3343 final.c:3384 +#: final.c:3346 final.c:3387 #, c-format msgid "operand number out of range" msgstr "" -#: final.c:3403 +#: final.c:3406 #, c-format msgid "invalid %%-code" msgstr "нерэчаісны %%-код" -#: final.c:3433 +#: final.c:3436 #, c-format msgid "'%%l' operand isn't a label" msgstr "" @@ -871,13 +877,13 @@ msgstr "" #. handle them. #. We can't handle floating point constants; #. PRINT_OPERAND must handle them. -#: final.c:3579 vmsdbgout.c:496 config/i386/i386.c:10747 +#: final.c:3582 vmsdbgout.c:496 config/i386/i386.c:10813 #: config/pdp11/pdp11.c:1682 #, c-format msgid "floating constant misused" msgstr "" -#: final.c:3641 vmsdbgout.c:553 config/i386/i386.c:10834 +#: final.c:3644 vmsdbgout.c:553 config/i386/i386.c:10900 #: config/pdp11/pdp11.c:1729 #, c-format msgid "invalid expression as operand" @@ -952,7 +958,7 @@ msgstr "" msgid "spec file has no spec for linking" msgstr "" -#: gcc.c:2705 gcc.c:5265 +#: gcc.c:2705 gcc.c:5280 #, c-format msgid "%s\n" msgstr "%s\n" @@ -1275,120 +1281,120 @@ msgstr "аргумент для \"-x\" прапушчан" msgid "argument to '-x' is missing" msgstr "аргумент для \"-x\" прапушчан" -#: gcc.c:4533 gcc.c:4983 +#: gcc.c:4533 gcc.c:4998 #, fuzzy, c-format msgid "argument to '-%s' is missing" msgstr "аргумент для \"-%s\" прапушчан" -#: gcc.c:4771 +#: gcc.c:4786 #, c-format msgid "unable to locate default linker script '%s' in the library search paths" msgstr "" -#: gcc.c:4959 +#: gcc.c:4974 #, c-format msgid "switch '%s' does not start with '-'" msgstr "" -#: gcc.c:5075 +#: gcc.c:5090 #, fuzzy, c-format msgid "could not open temporary response file %s" msgstr "Немагчыма адчыніць файл з дадзенымі %s.\n" -#: gcc.c:5081 +#: gcc.c:5096 #, fuzzy, c-format msgid "could not write to temporary response file %s" msgstr "немагчыма стварыць часовы файл" -#: gcc.c:5087 +#: gcc.c:5102 #, fuzzy, c-format msgid "could not close temporary response file %s" msgstr "немагчыма стварыць часовы файл" -#: gcc.c:5189 +#: gcc.c:5204 #, c-format msgid "spec '%s' invalid" msgstr "" -#: gcc.c:5338 +#: gcc.c:5353 #, fuzzy, c-format msgid "spec '%s' has invalid '%%0%c'" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: gcc.c:5647 +#: gcc.c:5662 #, fuzzy, c-format msgid "spec '%s' has invalid '%%W%c" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: gcc.c:5667 +#: gcc.c:5682 #, fuzzy, c-format msgid "spec '%s' has invalid '%%x%c'" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: gcc.c:5889 +#: gcc.c:5904 #, c-format msgid "Processing spec %c%s%c, which is '%s'\n" msgstr "" -#: gcc.c:6014 +#: gcc.c:6029 #, fuzzy, c-format msgid "unknown spec function '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: gcc.c:6034 +#: gcc.c:6049 #, fuzzy, c-format msgid "error in args to spec function '%s'" msgstr "вельмі шмат аргумэнтаў у функцыі `%s'" -#: gcc.c:6083 +#: gcc.c:6098 #, c-format msgid "malformed spec function name" msgstr "" #. ) -#: gcc.c:6086 +#: gcc.c:6101 #, fuzzy, c-format msgid "no arguments for spec function" msgstr "не хапае аргументаў у функцыі" -#: gcc.c:6105 +#: gcc.c:6120 #, c-format msgid "malformed spec function arguments" msgstr "" -#: gcc.c:6351 +#: gcc.c:6366 #, c-format msgid "braced spec '%s' is invalid at '%c'" msgstr "" -#: gcc.c:6439 +#: gcc.c:6454 #, c-format msgid "braced spec body '%s' is invalid" msgstr "" -#: gcc.c:7139 +#: gcc.c:7154 #, c-format msgid "install: %s%s\n" msgstr "" -#: gcc.c:7142 +#: gcc.c:7157 #, c-format msgid "programs: %s\n" msgstr "праграмы: %s\n" -#: gcc.c:7144 +#: gcc.c:7159 #, c-format msgid "libraries: %s\n" msgstr "бібліятэкі: %s\n" #. The error status indicates that only one set of fixed #. headers should be built. -#: gcc.c:7210 +#: gcc.c:7225 #, c-format msgid "not configured with sysroot headers suffix" msgstr "" -#: gcc.c:7219 +#: gcc.c:7234 #, c-format msgid "" "\n" @@ -1397,16 +1403,16 @@ msgstr "" "\n" "Інструкцыі для паведамленняў аб памылках глядзіце тут:\n" -#: gcc.c:7235 +#: gcc.c:7250 #, fuzzy, c-format msgid "%s %s%s\n" msgstr "%s: %s: " -#: gcc.c:7238 gcov.c:430 fortran/gfortranspec.c:373 java/jcf-dump.c:1170 +#: gcc.c:7253 gcov.c:430 fortran/gfortranspec.c:373 java/jcf-dump.c:1170 msgid "(C)" msgstr "" -#: gcc.c:7239 java/jcf-dump.c:1171 +#: gcc.c:7254 java/jcf-dump.c:1171 #, c-format msgid "" "This is free software; see the source for copying conditions. There is NO\n" @@ -1414,57 +1420,57 @@ msgid "" "\n" msgstr "" -#: gcc.c:7256 +#: gcc.c:7271 #, fuzzy, c-format msgid "Target: %s\n" msgstr "бібліятэкі: %s\n" -#: gcc.c:7257 +#: gcc.c:7272 #, c-format msgid "Configured with: %s\n" msgstr "" -#: gcc.c:7271 +#: gcc.c:7286 #, c-format msgid "Thread model: %s\n" msgstr "" -#: gcc.c:7282 +#: gcc.c:7297 #, fuzzy, c-format msgid "gcc version %s %s\n" msgstr "версія gcc %s\n" -#: gcc.c:7284 +#: gcc.c:7299 #, c-format msgid "gcc driver version %s %sexecuting gcc version %s\n" msgstr "" -#: gcc.c:7292 +#: gcc.c:7307 #, fuzzy, c-format msgid "no input files" msgstr "няма ўваходзячых файлаў" -#: gcc.c:7341 +#: gcc.c:7356 #, c-format msgid "cannot specify -o with -c, -S or -E with multiple files" msgstr "" -#: gcc.c:7375 +#: gcc.c:7390 #, fuzzy, c-format msgid "spec '%s' is invalid" msgstr "параметр \"%s\" ініцыялізаваны" -#: gcc.c:7566 +#: gcc.c:7581 #, c-format msgid "-fuse-linker-plugin, but liblto_plugin.so not found" msgstr "" -#: gcc.c:7571 +#: gcc.c:7586 #, fuzzy, c-format msgid "could not find libgcc.a" msgstr "Не выкарыстоўваць рэгістра sb" -#: gcc.c:7582 +#: gcc.c:7597 #, c-format msgid "" "\n" @@ -1473,59 +1479,59 @@ msgid "" "\n" msgstr "" -#: gcc.c:7583 +#: gcc.c:7598 #, c-format msgid "" "Use \"-Wl,OPTION\" to pass \"OPTION\" to the linker.\n" "\n" msgstr "" -#: gcc.c:7935 +#: gcc.c:7950 #, fuzzy, c-format msgid "multilib spec '%s' is invalid" msgstr "параметр \"%s\" ініцыялізаваны" -#: gcc.c:8126 +#: gcc.c:8141 #, c-format msgid "multilib exclusions '%s' is invalid" msgstr "" -#: gcc.c:8184 gcc.c:8325 +#: gcc.c:8199 gcc.c:8340 #, fuzzy, c-format msgid "multilib select '%s' is invalid" msgstr "параметр \"%s\" ініцыялізаваны" -#: gcc.c:8363 +#: gcc.c:8378 #, c-format msgid "multilib exclusion '%s' is invalid" msgstr "" -#: gcc.c:8569 +#: gcc.c:8584 #, c-format msgid "environment variable \"%s\" not defined" msgstr "" -#: gcc.c:8660 gcc.c:8665 +#: gcc.c:8675 gcc.c:8680 #, fuzzy, c-format msgid "invalid version number `%s'" msgstr "нявернае выкарыстанне \"restict\"" -#: gcc.c:8708 +#: gcc.c:8723 #, fuzzy, c-format msgid "too few arguments to %%:version-compare" msgstr "не хапае аргументаў у функцыі" -#: gcc.c:8714 +#: gcc.c:8729 #, fuzzy, c-format msgid "too many arguments to %%:version-compare" msgstr "вельмі шмат аргументаў у функцыі" -#: gcc.c:8755 +#: gcc.c:8770 #, c-format msgid "unknown operator '%s' in %%:version-compare" msgstr "" -#: gcc.c:8789 +#: gcc.c:8804 #, c-format msgid "" "Assembler options\n" @@ -1533,34 +1539,34 @@ msgid "" "\n" msgstr "" -#: gcc.c:8790 +#: gcc.c:8805 #, c-format msgid "" "Use \"-Wa,OPTION\" to pass \"OPTION\" to the assembler.\n" "\n" msgstr "" -#: gcc.c:8836 +#: gcc.c:8851 #, fuzzy, c-format msgid "too many arguments to %%:compare-debug-dump-opt" msgstr "вельмі шмат аргументаў у функцыі" -#: gcc.c:8903 +#: gcc.c:8918 #, fuzzy, c-format msgid "too many arguments to %%:compare-debug-self-opt" msgstr "вельмі шмат аргументаў у функцыі" -#: gcc.c:8938 +#: gcc.c:8953 #, c-format msgid "too few arguments to %%:compare-debug-auxbase-opt" msgstr "" -#: gcc.c:8941 +#: gcc.c:8956 #, fuzzy, c-format msgid "too many arguments to %%:compare-debug-auxbase-opt" msgstr "вельмі шмат аргументаў у функцыі" -#: gcc.c:8948 +#: gcc.c:8963 #, c-format msgid "argument to %%:compare-debug-auxbase-opt does not end in .gk" msgstr "" @@ -1966,7 +1972,7 @@ msgstr "" msgid "%s terminated with signal %d [%s]" msgstr "" -#: lto-wrapper.c:192 collect2.c:1991 +#: lto-wrapper.c:192 collect2.c:2011 #, gcc-internal-format msgid "%s returned %d exit status" msgstr "" @@ -2001,79 +2007,79 @@ msgstr "немагчыма адчыніць %s" msgid "This switch lacks documentation" msgstr "" -#: opts.c:1316 +#: opts.c:1310 msgid "[enabled]" msgstr "" -#: opts.c:1316 +#: opts.c:1310 msgid "[disabled]" msgstr "" -#: opts.c:1331 +#: opts.c:1325 #, c-format msgid " No options with the desired characteristics were found\n" msgstr "" -#: opts.c:1340 +#: opts.c:1334 #, c-format msgid " None found. Use --help=%s to show *all* the options supported by the %s front-end\n" msgstr "" -#: opts.c:1346 +#: opts.c:1340 #, c-format msgid " All options with the desired characteristics have already been displayed\n" msgstr "" -#: opts.c:1400 +#: opts.c:1394 msgid "The following options are target specific" msgstr "" -#: opts.c:1403 +#: opts.c:1397 msgid "The following options control compiler warning messages" msgstr "" -#: opts.c:1406 +#: opts.c:1400 msgid "The following options control optimizations" msgstr "" -#: opts.c:1409 opts.c:1448 +#: opts.c:1403 opts.c:1442 msgid "The following options are language-independent" msgstr "" -#: opts.c:1412 +#: opts.c:1406 msgid "The --param option recognizes the following as parameters" msgstr "" -#: opts.c:1418 +#: opts.c:1412 msgid "The following options are specific to just the language " msgstr "" -#: opts.c:1420 +#: opts.c:1414 msgid "The following options are supported by the language " msgstr "" -#: opts.c:1431 +#: opts.c:1425 msgid "The following options are not documented" msgstr "" -#: opts.c:1433 +#: opts.c:1427 msgid "The following options take separate arguments" msgstr "" -#: opts.c:1435 +#: opts.c:1429 msgid "The following options take joined arguments" msgstr "" -#: opts.c:1446 +#: opts.c:1440 msgid "The following options are language-related" msgstr "" -#: opts.c:1606 +#: opts.c:1600 #, c-format msgid "warning: --help argument %.*s is ambiguous, please be more specific\n" msgstr "" -#: opts.c:1614 +#: opts.c:1608 #, c-format msgid "warning: unrecognized argument to --help= option: %.*s\n" msgstr "" @@ -2090,22 +2096,22 @@ msgstr "" msgid "unable to generate reloads for:" msgstr "" -#: reload1.c:2141 +#: reload1.c:2158 msgid "this is the insn:" msgstr "" #. It's the compiler's fault. -#: reload1.c:5661 +#: reload1.c:5693 #, fuzzy msgid "could not find a spill register" msgstr "Не выкарыстоўваць рэгістра sb" #. It's the compiler's fault. -#: reload1.c:7646 +#: reload1.c:7678 msgid "VOIDmode on an output" msgstr "" -#: reload1.c:8401 +#: reload1.c:8433 msgid "Failure trying to reload:" msgstr "" @@ -2169,7 +2175,7 @@ msgstr "" msgid "unrecoverable error" msgstr "унутраная памылка" -#: toplev.c:1213 +#: toplev.c:1217 #, fuzzy, c-format msgid "" "%s%s%s %sversion %s (%s)\n" @@ -2179,56 +2185,56 @@ msgstr "" "%s\tзкампілявана GNU C версія %s.\n" "%s%s%s версія %s (%s) зкампілявана CC.\n" -#: toplev.c:1215 +#: toplev.c:1219 #, c-format msgid "%s%s%s %sversion %s (%s) compiled by CC, " msgstr "" -#: toplev.c:1219 +#: toplev.c:1223 #, c-format msgid "GMP version %s, MPFR version %s, MPC version %s\n" msgstr "" -#: toplev.c:1221 +#: toplev.c:1225 #, c-format msgid "%s%swarning: %s header version %s differs from library version %s.\n" msgstr "" -#: toplev.c:1223 +#: toplev.c:1227 #, c-format msgid "%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n" msgstr "" -#: toplev.c:1386 +#: toplev.c:1390 msgid "options passed: " msgstr "" -#: toplev.c:1421 +#: toplev.c:1425 msgid "options enabled: " msgstr "выбары ўключаны:" -#: toplev.c:1556 +#: toplev.c:1560 #, c-format msgid "created and used with differing settings of '%s'" msgstr "" -#: toplev.c:1558 +#: toplev.c:1562 msgid "out of memory" msgstr "" -#: toplev.c:1573 +#: toplev.c:1577 msgid "created and used with different settings of -fpic" msgstr "" -#: toplev.c:1575 +#: toplev.c:1579 msgid "created and used with different settings of -fpie" msgstr "" -#: tree-vrp.c:6492 +#: tree-vrp.c:6503 msgid "assuming signed overflow does not occur when simplifying && or || to & or |" msgstr "" -#: tree-vrp.c:6496 +#: tree-vrp.c:6507 msgid "assuming signed overflow does not occur when simplifying ==, != or ! to identity or ^" msgstr "" @@ -2493,319 +2499,335 @@ msgstr "" msgid "The maximum number of insns of a peeled loop that rolls only once" msgstr "" -#: params.def:273 -msgid "The maximum number of insns of an unswitched loop" +#: params.def:272 +msgid "The maximum depth of a loop nest we completely peel" msgstr "" #: params.def:278 +msgid "The maximum number of insns of an unswitched loop" +msgstr "" + +#: params.def:283 msgid "The maximum number of unswitchings in a single loop" msgstr "" -#: params.def:285 +#: params.def:290 msgid "Bound on the number of iterations the brute force # of iterations analysis algorithm evaluates" msgstr "" -#: params.def:291 +#: params.def:296 msgid "Bound on the cost of an expression to compute the number of iterations" msgstr "" -#: params.def:297 +#: params.def:302 msgid "A factor for tuning the upper bound that swing modulo scheduler uses for scheduling a loop" msgstr "" -#: params.def:301 +#: params.def:306 msgid "The number of cycles the swing modulo scheduler considers when checking conflicts using DFA" msgstr "" -#: params.def:305 +#: params.def:310 msgid "A threshold on the average loop count considered by the swing modulo scheduler" msgstr "" -#: params.def:310 +#: params.def:315 msgid "Select fraction of the maximal count of repetitions of basic block in program given basic block needs to have to be considered hot" msgstr "" -#: params.def:314 +#: params.def:319 msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot" msgstr "" -#: params.def:319 +#: params.def:324 msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block get alignment" msgstr "" -#: params.def:324 +#: params.def:329 msgid "Loops iterating at least selected number of iterations will get loop alignement." msgstr "" -#: params.def:340 +#: params.def:345 msgid "The maximum number of loop iterations we predict statically" msgstr "" -#: params.def:344 +#: params.def:349 msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is available" msgstr "" -#: params.def:348 +#: params.def:353 msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is not available" msgstr "" -#: params.def:352 +#: params.def:357 msgid "Maximal code growth caused by tail duplication (in percent)" msgstr "" -#: params.def:356 +#: params.def:361 msgid "Stop reverse growth if the reverse probability of best edge is less than this threshold (in percent)" msgstr "" -#: params.def:360 +#: params.def:365 msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is available" msgstr "" -#: params.def:364 +#: params.def:369 msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is not available" msgstr "" -#: params.def:370 +#: params.def:375 msgid "The maximum number of incoming edges to consider for crossjumping" msgstr "" -#: params.def:376 +#: params.def:381 msgid "The minimum number of matching instructions to consider for crossjumping" msgstr "" -#: params.def:382 +#: params.def:387 msgid "The maximum expansion factor when copying basic blocks" msgstr "" -#: params.def:388 +#: params.def:393 msgid "The maximum number of insns to duplicate when unfactoring computed gotos" msgstr "" -#: params.def:394 +#: params.def:399 msgid "The maximum length of path considered in cse" msgstr "" -#: params.def:398 +#: params.def:403 msgid "The maximum instructions CSE process before flushing" msgstr "" -#: params.def:405 +#: params.def:410 msgid "The minimum cost of an expensive expression in the loop invariant motion" msgstr "" -#: params.def:414 +#: params.def:419 msgid "Bound on number of candidates below that all candidates are considered in iv optimizations" msgstr "" -#: params.def:422 +#: params.def:427 msgid "Bound on number of iv uses in loop optimized in iv optimizations" msgstr "" -#: params.def:430 +#: params.def:435 msgid "If number of candidates in the set is smaller, we always try to remove unused ivs during its optimization" msgstr "" -#: params.def:435 +#: params.def:440 msgid "Bound on size of expressions used in the scalar evolutions analyzer" msgstr "" -#: params.def:440 +#: params.def:445 msgid "Bound on the number of variables in Omega constraint systems" msgstr "" -#: params.def:445 +#: params.def:450 msgid "Bound on the number of inequalities in Omega constraint systems" msgstr "" -#: params.def:450 +#: params.def:455 msgid "Bound on the number of equalities in Omega constraint systems" msgstr "" -#: params.def:455 +#: params.def:460 msgid "Bound on the number of wild cards in Omega constraint systems" msgstr "" -#: params.def:460 +#: params.def:465 msgid "Bound on the size of the hash table in Omega constraint systems" msgstr "" -#: params.def:465 +#: params.def:470 msgid "Bound on the number of keys in Omega constraint systems" msgstr "" -#: params.def:470 +#: params.def:475 msgid "When set to 1, use expensive methods to eliminate all redundant constraints" msgstr "" -#: params.def:475 +#: params.def:480 msgid "Bound on number of runtime checks inserted by the vectorizer's loop versioning for alignment check" msgstr "" -#: params.def:480 +#: params.def:485 msgid "Bound on number of runtime checks inserted by the vectorizer's loop versioning for alias check" msgstr "" -#: params.def:485 +#: params.def:490 msgid "The maximum memory locations recorded by cselib" msgstr "" -#: params.def:498 +#: params.def:503 msgid "Minimum heap expansion to trigger garbage collection, as a percentage of the total size of the heap" msgstr "" -#: params.def:503 +#: params.def:508 msgid "Minimum heap size before we start collecting garbage, in kilobytes" msgstr "" -#: params.def:511 +#: params.def:516 msgid "The maximum number of instructions to search backward when looking for equivalent reload" msgstr "" -#: params.def:516 params.def:526 +#: params.def:521 params.def:531 msgid "The maximum number of blocks in a region to be considered for interblock scheduling" msgstr "" -#: params.def:521 params.def:531 +#: params.def:526 params.def:536 msgid "The maximum number of insns in a region to be considered for interblock scheduling" msgstr "" -#: params.def:536 +#: params.def:541 msgid "The minimum probability of reaching a source block for interblock speculative scheduling" msgstr "" -#: params.def:541 +#: params.def:546 msgid "The maximum number of iterations through CFG to extend regions" msgstr "" -#: params.def:546 +#: params.def:551 msgid "The maximum conflict delay for an insn to be considered for speculative motion" msgstr "" -#: params.def:551 +#: params.def:556 msgid "The minimal probability of speculation success (in percents), so that speculative insn will be scheduled." msgstr "" -#: params.def:556 +#: params.def:561 msgid "The maximum size of the lookahead window of selective scheduling" msgstr "" -#: params.def:561 +#: params.def:566 msgid "Maximum number of times that an insn could be scheduled" msgstr "" -#: params.def:566 +#: params.def:571 msgid "Maximum number of instructions in the ready list that are considered eligible for renaming" msgstr "" -#: params.def:571 +#: params.def:576 msgid "Minimal distance between possibly conflicting store and load" msgstr "" -#: params.def:576 +#: params.def:581 msgid "The maximum number of RTL nodes that can be recorded as combiner's last value" msgstr "" -#: params.def:584 +#: params.def:589 msgid "The upper bound for sharing integer constants" msgstr "" -#: params.def:603 +#: params.def:608 msgid "Minimum number of virtual mappings to consider switching to full virtual renames" msgstr "" -#: params.def:608 +#: params.def:613 msgid "Ratio between virtual mappings and virtual symbols to do full virtual renames" msgstr "" -#: params.def:613 +#: params.def:618 msgid "The lower bound for a buffer to be considered for stack smashing protection" msgstr "" -#: params.def:631 +#: params.def:636 msgid "Maximum number of statements allowed in a block that needs to be duplicated when threading jumps" msgstr "" -#: params.def:640 +#: params.def:645 msgid "Maximum number of fields in a structure before pointer analysis treats the structure as a single variable" msgstr "" -#: params.def:645 +#: params.def:650 msgid "The maximum number of instructions ready to be issued to be considered by the scheduler during the first scheduling pass" msgstr "" -#: params.def:655 +#: params.def:660 msgid "The number of insns executed before prefetch is completed" msgstr "" -#: params.def:662 +#: params.def:667 msgid "The number of prefetches that can run at the same time" msgstr "" -#: params.def:669 +#: params.def:674 msgid "The size of L1 cache" msgstr "" -#: params.def:676 +#: params.def:681 msgid "The size of L1 cache line" msgstr "" -#: params.def:683 +#: params.def:688 msgid "The size of L2 cache" msgstr "" -#: params.def:694 +#: params.def:699 msgid "Whether to use canonical types" msgstr "" -#: params.def:699 +#: params.def:704 msgid "Maximum length of partial antic set when performing tree pre optimization" msgstr "" -#: params.def:709 +#: params.def:714 msgid "Maximum size of a SCC before SCCVN stops processing a function" msgstr "" -#: params.def:714 +#: params.def:719 msgid "Max loops number for regional RA" msgstr "" -#: params.def:719 +#: params.def:724 msgid "Max size of conflict table in MB" msgstr "" -#: params.def:724 +#: params.def:729 msgid "The number of registers in each class kept unused by loop invariant motion" msgstr "" -#: params.def:732 +#: params.def:737 msgid "The maximum ratio between array size and switch branches for a switch conversion to take place" msgstr "" -#: params.def:740 +#: params.def:745 msgid "size of tiles for loop blocking" msgstr "" -#: params.def:747 +#: params.def:752 +msgid "maximum number of parameters in a SCoP" +msgstr "" + +#: params.def:759 +msgid "maximum number of basic blocks per function to be analyzed by Graphite" +msgstr "" + +#: params.def:766 msgid "Max basic blocks number in loop for loop invariant motion" msgstr "" -#: params.def:753 +#: params.def:772 msgid "Maximum number of instructions in basic block to be considered for SLP vectorization" msgstr "" -#: params.def:758 +#: params.def:777 msgid "Min. ratio of insns to prefetches to enable prefetching for a loop with an unknown trip count" msgstr "" -#: params.def:764 +#: params.def:783 msgid "Min. ratio of insns to mem ops to enable prefetching in a loop" msgstr "" -#: params.def:771 +#: params.def:790 +msgid "Max. size of var tracking hash tables" +msgstr "" + +#: params.def:797 msgid "The minimum UID to be used for a nondebug insn" msgstr "" -#: params.def:776 +#: params.def:802 msgid "Maximum allowed growth of size of new parameters ipa-sra replaces a pointer to an aggregate with" msgstr "" @@ -2814,7 +2836,7 @@ msgstr "" msgid "invalid %%H value" msgstr "нерэчаіснае значэньне %%H" -#: config/alpha/alpha.c:5156 config/bfin/bfin.c:1682 +#: config/alpha/alpha.c:5156 config/bfin/bfin.c:1683 #, fuzzy, c-format msgid "invalid %%J value" msgstr "дрэннае %%Q значэнне" @@ -2825,18 +2847,18 @@ msgid "invalid %%r value" msgstr "нерэчаіснае значэньне %%r" #: config/alpha/alpha.c:5196 config/ia64/ia64.c:4929 -#: config/rs6000/rs6000.c:14636 config/xtensa/xtensa.c:2253 +#: config/rs6000/rs6000.c:14626 config/xtensa/xtensa.c:2253 #, c-format msgid "invalid %%R value" msgstr "нерэчаіснае значэньне %%R" -#: config/alpha/alpha.c:5202 config/rs6000/rs6000.c:14555 +#: config/alpha/alpha.c:5202 config/rs6000/rs6000.c:14545 #: config/xtensa/xtensa.c:2220 #, c-format msgid "invalid %%N value" msgstr "нерэчаіснае значэньне %%N" -#: config/alpha/alpha.c:5210 config/rs6000/rs6000.c:14583 +#: config/alpha/alpha.c:5210 config/rs6000/rs6000.c:14573 #, c-format msgid "invalid %%P value" msgstr "нерэчаіснае значэньне %%P" @@ -2851,12 +2873,12 @@ msgstr "нерэчаіснае значэньне %%h" msgid "invalid %%L value" msgstr "нерэчаіснае значэньне %%L" -#: config/alpha/alpha.c:5265 config/rs6000/rs6000.c:14537 +#: config/alpha/alpha.c:5265 config/rs6000/rs6000.c:14527 #, c-format msgid "invalid %%m value" msgstr "нерэчаіснае значэньне %%m" -#: config/alpha/alpha.c:5273 config/rs6000/rs6000.c:14545 +#: config/alpha/alpha.c:5273 config/rs6000/rs6000.c:14535 #, c-format msgid "invalid %%M value" msgstr "нерэчаіснае значэньне %%M" @@ -2867,7 +2889,7 @@ msgid "invalid %%U value" msgstr "нерэчаіснае значэньне %%U" #: config/alpha/alpha.c:5329 config/alpha/alpha.c:5343 -#: config/rs6000/rs6000.c:14644 +#: config/rs6000/rs6000.c:14634 #, c-format msgid "invalid %%s value" msgstr "нерэчаіснае значэньне %%v" @@ -2877,7 +2899,7 @@ msgstr "нерэчаіснае значэньне %%v" msgid "invalid %%C value" msgstr "нерэчаіснае значэньне %%C" -#: config/alpha/alpha.c:5403 config/rs6000/rs6000.c:14391 +#: config/alpha/alpha.c:5403 config/rs6000/rs6000.c:14381 #, c-format msgid "invalid %%E value" msgstr "нерэчаіснае значэньне %%E" @@ -2888,7 +2910,7 @@ msgid "unknown relocation unspec" msgstr "" #: config/alpha/alpha.c:5437 config/crx/crx.c:1092 -#: config/rs6000/rs6000.c:14998 config/spu/spu.c:1695 +#: config/rs6000/rs6000.c:14988 config/spu/spu.c:1695 #, c-format msgid "invalid %%xn code" msgstr "нерэчаіснае значэньне %%xn" @@ -2915,56 +2937,56 @@ msgstr "нерэчаісны %%-код" #. Unknown flag. #. Undocumented flag. -#: config/arc/arc.c:1796 config/m32r/m32r.c:2101 config/sparc/sparc.c:7160 +#: config/arc/arc.c:1796 config/m32r/m32r.c:2101 config/sparc/sparc.c:7164 #, c-format msgid "invalid operand output code" msgstr "" -#: config/arm/arm.c:14826 config/arm/arm.c:14844 +#: config/arm/arm.c:14854 config/arm/arm.c:14872 #, fuzzy, c-format msgid "predicated Thumb instruction" msgstr "нявернае выкарыстанне \"restict\"" -#: config/arm/arm.c:14832 +#: config/arm/arm.c:14860 #, c-format msgid "predicated instruction in conditional sequence" msgstr "" -#: config/arm/arm.c:15002 +#: config/arm/arm.c:15030 #, fuzzy, c-format msgid "invalid shift operand" msgstr "нерэчаісны %%f аперанд" -#: config/arm/arm.c:15049 config/arm/arm.c:15059 config/arm/arm.c:15069 -#: config/arm/arm.c:15079 config/arm/arm.c:15089 config/arm/arm.c:15128 -#: config/arm/arm.c:15146 config/arm/arm.c:15181 config/arm/arm.c:15200 -#: config/arm/arm.c:15215 config/arm/arm.c:15242 config/arm/arm.c:15249 -#: config/arm/arm.c:15267 config/arm/arm.c:15274 config/arm/arm.c:15282 -#: config/arm/arm.c:15303 config/arm/arm.c:15310 config/arm/arm.c:15400 -#: config/arm/arm.c:15407 config/arm/arm.c:15425 config/arm/arm.c:15432 -#: config/bfin/bfin.c:1695 config/bfin/bfin.c:1702 config/bfin/bfin.c:1709 -#: config/bfin/bfin.c:1716 config/bfin/bfin.c:1725 config/bfin/bfin.c:1732 -#: config/bfin/bfin.c:1739 config/bfin/bfin.c:1746 +#: config/arm/arm.c:15077 config/arm/arm.c:15087 config/arm/arm.c:15097 +#: config/arm/arm.c:15107 config/arm/arm.c:15117 config/arm/arm.c:15156 +#: config/arm/arm.c:15174 config/arm/arm.c:15209 config/arm/arm.c:15228 +#: config/arm/arm.c:15243 config/arm/arm.c:15270 config/arm/arm.c:15277 +#: config/arm/arm.c:15295 config/arm/arm.c:15302 config/arm/arm.c:15310 +#: config/arm/arm.c:15331 config/arm/arm.c:15338 config/arm/arm.c:15428 +#: config/arm/arm.c:15435 config/arm/arm.c:15453 config/arm/arm.c:15460 +#: config/bfin/bfin.c:1696 config/bfin/bfin.c:1703 config/bfin/bfin.c:1710 +#: config/bfin/bfin.c:1717 config/bfin/bfin.c:1726 config/bfin/bfin.c:1733 +#: config/bfin/bfin.c:1740 config/bfin/bfin.c:1747 #, fuzzy, c-format msgid "invalid operand for code '%c'" msgstr "Нерэчаісны выбар \"%s\"" -#: config/arm/arm.c:15141 +#: config/arm/arm.c:15169 #, c-format msgid "instruction never executed" msgstr "" -#: config/arm/arm.c:15444 +#: config/arm/arm.c:15472 #, fuzzy, c-format msgid "missing operand" msgstr "прапушчан ініцыялізатар" -#: config/arm/arm.c:17718 +#: config/arm/arm.c:17746 #, fuzzy msgid "function parameters cannot have __fp16 type" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: config/arm/arm.c:17728 +#: config/arm/arm.c:17756 #, fuzzy msgid "functions cannot return __fp16 type" msgstr "функцыя не вяртае тып string" @@ -3018,20 +3040,20 @@ msgstr "" msgid "internal compiler error. Incorrect shift:" msgstr "" -#: config/bfin/bfin.c:1644 +#: config/bfin/bfin.c:1645 #, c-format msgid "invalid %%j value" msgstr "" -#: config/bfin/bfin.c:1837 +#: config/bfin/bfin.c:1838 #, fuzzy, c-format msgid "invalid const_double operand" msgstr "нерэчаісны %%c аперанд" -#: config/cris/cris.c:528 config/moxie/moxie.c:91 c-typeck.c:5624 -#: c-typeck.c:5640 c-typeck.c:5657 final.c:3086 final.c:3088 fold-const.c:990 -#: gcc.c:5251 loop-iv.c:2968 loop-iv.c:2977 rtl-error.c:105 toplev.c:629 -#: tree-ssa-loop-niter.c:1885 tree-vrp.c:5704 cp/typeck.c:5039 java/expr.c:411 +#: config/cris/cris.c:528 config/moxie/moxie.c:91 c-typeck.c:5656 +#: c-typeck.c:5672 c-typeck.c:5689 final.c:3089 final.c:3091 fold-const.c:990 +#: gcc.c:5266 loop-iv.c:2968 loop-iv.c:2977 rtl-error.c:105 toplev.c:629 +#: tree-ssa-loop-niter.c:1885 tree-vrp.c:5707 cp/typeck.c:5126 java/expr.c:411 #, gcc-internal-format msgid "%s" msgstr "" @@ -3268,67 +3290,67 @@ msgstr "" msgid " (frv)" msgstr "" -#: config/i386/i386.c:10828 +#: config/i386/i386.c:10894 #, c-format msgid "invalid UNSPEC as operand" msgstr "" -#: config/i386/i386.c:11357 +#: config/i386/i386.c:11440 #, c-format msgid "'%%&' used without any local dynamic TLS references" msgstr "" -#: config/i386/i386.c:11448 config/i386/i386.c:11523 +#: config/i386/i386.c:11531 config/i386/i386.c:11606 #, fuzzy, c-format msgid "invalid operand size for operand code '%c'" msgstr "Нерэчаісны выбар \"%s\"" -#: config/i386/i386.c:11518 +#: config/i386/i386.c:11601 #, fuzzy, c-format msgid "invalid operand type used with operand code '%c'" msgstr "Нерэчаісны выбар \"%s\"" -#: config/i386/i386.c:11598 config/i386/i386.c:11638 +#: config/i386/i386.c:11681 config/i386/i386.c:11721 #, c-format msgid "operand is not a condition code, invalid operand code 'D'" msgstr "" -#: config/i386/i386.c:11664 +#: config/i386/i386.c:11747 #, c-format msgid "operand is neither a constant nor a condition code, invalid operand code 'C'" msgstr "" -#: config/i386/i386.c:11674 +#: config/i386/i386.c:11757 #, c-format msgid "operand is neither a constant nor a condition code, invalid operand code 'F'" msgstr "" -#: config/i386/i386.c:11692 +#: config/i386/i386.c:11775 #, c-format msgid "operand is neither a constant nor a condition code, invalid operand code 'c'" msgstr "" -#: config/i386/i386.c:11702 +#: config/i386/i386.c:11785 #, c-format msgid "operand is neither a constant nor a condition code, invalid operand code 'f'" msgstr "" -#: config/i386/i386.c:11813 +#: config/i386/i386.c:11888 #, c-format msgid "operand is not a condition code, invalid operand code 'Y'" msgstr "" -#: config/i386/i386.c:11828 +#: config/i386/i386.c:11903 #, fuzzy, c-format msgid "invalid operand code '%c'" msgstr "Нерэчаісны выбар \"%s\"" -#: config/i386/i386.c:11878 +#: config/i386/i386.c:11953 #, fuzzy, c-format msgid "invalid constraints for operand" msgstr "нерэчаісны %%c аперанд" -#: config/i386/i386.c:19474 +#: config/i386/i386.c:19549 #, fuzzy msgid "unknown insn mode" msgstr "невядомы рэжым машыны \"%s\"" @@ -3380,7 +3402,7 @@ msgstr "нерэчаісны %%-код" msgid "invalid %%P operand" msgstr "нерэчаісны %%-код" -#: config/iq2000/iq2000.c:3173 config/rs6000/rs6000.c:14573 +#: config/iq2000/iq2000.c:3173 config/rs6000/rs6000.c:14563 #, c-format msgid "invalid %%p value" msgstr "" @@ -3445,7 +3467,7 @@ msgid "post-increment address is not a register" msgstr "" #: config/m32r/m32r.c:2205 config/m32r/m32r.c:2219 -#: config/rs6000/rs6000.c:23731 +#: config/rs6000/rs6000.c:23777 msgid "bad address" msgstr "дрэнны адрас" @@ -3494,7 +3516,7 @@ msgstr "" msgid "invalid Z register replacement for insn" msgstr "" -#: config/mep/mep.c:3415 +#: config/mep/mep.c:3394 #, fuzzy, c-format msgid "invalid %%L code" msgstr "нерэчаіснае значэньне %%xn" @@ -3582,116 +3604,116 @@ msgstr "" msgid "Try running '%s' in the shell to raise its limit.\n" msgstr "" -#: config/rs6000/rs6000.c:2422 +#: config/rs6000/rs6000.c:2419 #, fuzzy msgid "-mvsx requires hardware floating point" msgstr "Выкарыстоўваць апаратную \"плаваючую кропку\"" -#: config/rs6000/rs6000.c:2427 +#: config/rs6000/rs6000.c:2424 msgid "-mvsx and -mpaired are incompatible" msgstr "" -#: config/rs6000/rs6000.c:2432 +#: config/rs6000/rs6000.c:2429 msgid "-mvsx used with little endian code" msgstr "" -#: config/rs6000/rs6000.c:2434 +#: config/rs6000/rs6000.c:2431 msgid "-mvsx needs indexed addressing" msgstr "" -#: config/rs6000/rs6000.c:2438 +#: config/rs6000/rs6000.c:2435 msgid "-mvsx and -mno-altivec are incompatible" msgstr "" -#: config/rs6000/rs6000.c:2440 +#: config/rs6000/rs6000.c:2437 msgid "-mno-altivec disables vsx" msgstr "" -#: config/rs6000/rs6000.c:6705 +#: config/rs6000/rs6000.c:6691 msgid "bad move" msgstr "" -#: config/rs6000/rs6000.c:14372 +#: config/rs6000/rs6000.c:14362 #, fuzzy, c-format msgid "invalid %%c value" msgstr "дрэннае %%Q значэнне" -#: config/rs6000/rs6000.c:14400 +#: config/rs6000/rs6000.c:14390 #, c-format msgid "invalid %%f value" msgstr "" -#: config/rs6000/rs6000.c:14409 +#: config/rs6000/rs6000.c:14399 #, c-format msgid "invalid %%F value" msgstr "" -#: config/rs6000/rs6000.c:14418 +#: config/rs6000/rs6000.c:14408 #, c-format msgid "invalid %%G value" msgstr "" -#: config/rs6000/rs6000.c:14453 +#: config/rs6000/rs6000.c:14443 #, c-format msgid "invalid %%j code" msgstr "" -#: config/rs6000/rs6000.c:14463 +#: config/rs6000/rs6000.c:14453 #, c-format msgid "invalid %%J code" msgstr "" -#: config/rs6000/rs6000.c:14473 +#: config/rs6000/rs6000.c:14463 #, c-format msgid "invalid %%k value" msgstr "" -#: config/rs6000/rs6000.c:14493 config/xtensa/xtensa.c:2239 +#: config/rs6000/rs6000.c:14483 config/xtensa/xtensa.c:2239 #, c-format msgid "invalid %%K value" msgstr "" -#: config/rs6000/rs6000.c:14563 +#: config/rs6000/rs6000.c:14553 #, c-format msgid "invalid %%O value" msgstr "нерэчаіснае значэньне %%O" -#: config/rs6000/rs6000.c:14610 +#: config/rs6000/rs6000.c:14600 #, c-format msgid "invalid %%q value" msgstr "" -#: config/rs6000/rs6000.c:14654 +#: config/rs6000/rs6000.c:14644 #, c-format msgid "invalid %%S value" msgstr "" -#: config/rs6000/rs6000.c:14694 +#: config/rs6000/rs6000.c:14684 #, c-format msgid "invalid %%T value" msgstr "" -#: config/rs6000/rs6000.c:14704 +#: config/rs6000/rs6000.c:14694 #, c-format msgid "invalid %%u value" msgstr "" -#: config/rs6000/rs6000.c:14713 config/xtensa/xtensa.c:2209 +#: config/rs6000/rs6000.c:14703 config/xtensa/xtensa.c:2209 #, c-format msgid "invalid %%v value" msgstr "" -#: config/rs6000/rs6000.c:14812 config/xtensa/xtensa.c:2260 +#: config/rs6000/rs6000.c:14802 config/xtensa/xtensa.c:2260 #, fuzzy, c-format msgid "invalid %%x value" msgstr "нерэчаіснае значэньне %%x/X" -#: config/rs6000/rs6000.c:14957 +#: config/rs6000/rs6000.c:14947 #, fuzzy, c-format msgid "invalid %%y value, try using the 'Z' constraint" msgstr "нявернае выкарыстанне \"restict\"" -#: config/rs6000/rs6000.c:25704 +#: config/rs6000/rs6000.c:25750 #, fuzzy msgid "AltiVec argument passed to unprototyped function" msgstr "не хапае аргументаў у функцыі" @@ -3711,69 +3733,69 @@ msgstr "" msgid "invalid operand for code: '%c'" msgstr "Нерэчаісны выбар \"%s\"" -#: config/sh/sh.c:1121 +#: config/sh/sh.c:1125 #, fuzzy, c-format msgid "invalid operand to %%R" msgstr "нерэчаісны %%-код" -#: config/sh/sh.c:1148 +#: config/sh/sh.c:1152 #, fuzzy, c-format msgid "invalid operand to %%S" msgstr "нерэчаісны %%-код" -#: config/sh/sh.c:8932 +#: config/sh/sh.c:8968 msgid "created and used with different architectures / ABIs" msgstr "" -#: config/sh/sh.c:8934 +#: config/sh/sh.c:8970 msgid "created and used with different ABIs" msgstr "" -#: config/sh/sh.c:8936 +#: config/sh/sh.c:8972 msgid "created and used with different endianness" msgstr "" -#: config/sparc/sparc.c:6968 config/sparc/sparc.c:6974 +#: config/sparc/sparc.c:6972 config/sparc/sparc.c:6978 #, c-format msgid "invalid %%Y operand" msgstr "нерэчаісны %%Y аперанд" -#: config/sparc/sparc.c:7044 +#: config/sparc/sparc.c:7048 #, c-format msgid "invalid %%A operand" msgstr "нерэчаісны %%A аперанд" -#: config/sparc/sparc.c:7054 +#: config/sparc/sparc.c:7058 #, c-format msgid "invalid %%B operand" msgstr "нерэчаісны %%B аперанд" -#: config/sparc/sparc.c:7093 +#: config/sparc/sparc.c:7097 #, c-format msgid "invalid %%c operand" msgstr "нерэчаісны %%c аперанд" -#: config/sparc/sparc.c:7115 +#: config/sparc/sparc.c:7119 #, c-format msgid "invalid %%d operand" msgstr "нерэчаісны %%d аперанд" -#: config/sparc/sparc.c:7132 +#: config/sparc/sparc.c:7136 #, c-format msgid "invalid %%f operand" msgstr "нерэчаісны %%f аперанд" -#: config/sparc/sparc.c:7146 +#: config/sparc/sparc.c:7150 #, fuzzy, c-format msgid "invalid %%s operand" msgstr "нерэчаісны %%-код" -#: config/sparc/sparc.c:7200 +#: config/sparc/sparc.c:7204 #, c-format msgid "long long constant not a valid immediate operand" msgstr "" -#: config/sparc/sparc.c:7203 +#: config/sparc/sparc.c:7207 #, c-format msgid "floating point constant not a valid immediate operand" msgstr "" @@ -3863,23 +3885,23 @@ msgstr "невядомая назва рэгістра: %s" msgid "address offset not a constant" msgstr "" -#: cp/call.c:2775 cp/pt.c:1700 cp/pt.c:15861 +#: cp/call.c:2779 cp/pt.c:1701 cp/pt.c:16017 msgid "candidates are:" msgstr "" -#: cp/call.c:2775 cp/pt.c:15861 +#: cp/call.c:2779 cp/pt.c:16017 msgid "candidate is:" msgstr "" -#: cp/call.c:7348 +#: cp/call.c:7360 msgid "candidate 1:" msgstr "" -#: cp/call.c:7349 +#: cp/call.c:7361 msgid "candidate 2:" msgstr "" -#: cp/cxx-pretty-print.c:173 cp/error.c:923 objc/objc-act.c:7138 +#: cp/cxx-pretty-print.c:173 cp/error.c:923 objc/objc-act.c:7141 msgid "" msgstr "" @@ -3888,11 +3910,11 @@ msgstr "" msgid "template-parameter-" msgstr "невыкарыстаемы параметр \"%s\"" -#: cp/decl2.c:693 +#: cp/decl2.c:721 msgid "candidates are: %+#D" msgstr "" -#: cp/decl2.c:695 cp/pt.c:1696 +#: cp/decl2.c:723 cp/pt.c:1697 #, gcc-internal-format msgid "candidate is: %+#D" msgstr "" @@ -4039,16 +4061,26 @@ msgstr "" msgid "%s:%d: instantiated from %qs\n" msgstr "" -#: cp/error.c:2756 +#: cp/error.c:2755 #, c-format msgid "%s:%d:%d: instantiated from here" msgstr "" -#: cp/error.c:2759 +#: cp/error.c:2758 #, c-format msgid "%s:%d: instantiated from here" msgstr "" +#: cp/error.c:2794 +#, c-format +msgid "%s:%d:%d: [ skipping %d instantiation contexts ]\n" +msgstr "" + +#: cp/error.c:2798 +#, c-format +msgid "%s:%d: [ skipping %d instantiation contexts ]\n" +msgstr "" + #: cp/g++spec.c:261 java/jvspec.c:403 #, fuzzy, c-format msgid "argument to '%s' missing\n" @@ -4098,49 +4130,49 @@ msgstr "" msgid "source type is not polymorphic" msgstr "" -#: cp/typeck.c:4592 c-typeck.c:3339 +#: cp/typeck.c:4679 c-typeck.c:3345 #, gcc-internal-format msgid "wrong type argument to unary minus" msgstr "" -#: cp/typeck.c:4593 c-typeck.c:3326 +#: cp/typeck.c:4680 c-typeck.c:3332 #, gcc-internal-format msgid "wrong type argument to unary plus" msgstr "" -#: cp/typeck.c:4616 c-typeck.c:3365 +#: cp/typeck.c:4703 c-typeck.c:3371 #, gcc-internal-format msgid "wrong type argument to bit-complement" msgstr "" -#: cp/typeck.c:4623 c-typeck.c:3373 +#: cp/typeck.c:4710 c-typeck.c:3379 #, gcc-internal-format msgid "wrong type argument to abs" msgstr "" -#: cp/typeck.c:4631 c-typeck.c:3385 +#: cp/typeck.c:4718 c-typeck.c:3391 #, gcc-internal-format msgid "wrong type argument to conjugation" msgstr "" -#: cp/typeck.c:4642 +#: cp/typeck.c:4729 #, fuzzy msgid "in argument to unary !" msgstr "вельмі шмат аргументаў у функцыі" -#: cp/typeck.c:4703 +#: cp/typeck.c:4790 msgid "no pre-increment operator for type" msgstr "" -#: cp/typeck.c:4705 +#: cp/typeck.c:4792 msgid "no post-increment operator for type" msgstr "" -#: cp/typeck.c:4707 +#: cp/typeck.c:4794 msgid "no pre-decrement operator for type" msgstr "" -#: cp/typeck.c:4709 +#: cp/typeck.c:4796 msgid "no post-decrement operator for type" msgstr "" @@ -4187,42 +4219,42 @@ msgstr "" msgid "arguments 'a%d' and 'a%d' for intrinsic '%s'" msgstr "" -#: fortran/check.c:2238 fortran/intrinsic.c:3639 +#: fortran/check.c:2238 fortran/intrinsic.c:3640 #, c-format msgid "arguments '%s' and '%s' for intrinsic '%s'" msgstr "" -#: fortran/error.c:737 fortran/error.c:791 fortran/error.c:826 -#: fortran/error.c:901 +#: fortran/error.c:738 fortran/error.c:792 fortran/error.c:827 +#: fortran/error.c:902 #, fuzzy msgid "Warning:" msgstr "увага:" -#: fortran/error.c:793 fortran/error.c:881 fortran/error.c:931 +#: fortran/error.c:794 fortran/error.c:882 fortran/error.c:932 msgid "Error:" msgstr "" -#: fortran/error.c:955 +#: fortran/error.c:956 #, fuzzy msgid "Fatal Error:" msgstr "унутраная памылка" -#: fortran/expr.c:256 +#: fortran/expr.c:257 #, c-format msgid "Constant expression required at %C" msgstr "" -#: fortran/expr.c:259 +#: fortran/expr.c:260 #, c-format msgid "Integer expression required at %C" msgstr "" -#: fortran/expr.c:264 +#: fortran/expr.c:265 #, c-format msgid "Integer value too large in expression at %C" msgstr "" -#: fortran/expr.c:3032 +#: fortran/expr.c:3023 msgid "array assignment" msgstr "" @@ -4383,20 +4415,20 @@ msgstr "" msgid "Expected real string" msgstr "" -#: fortran/module.c:2974 +#: fortran/module.c:2989 msgid "Expected expression type" msgstr "" -#: fortran/module.c:3028 +#: fortran/module.c:3043 #, fuzzy msgid "Bad operator" msgstr "невыкарыстаемы параметр \"%s\"" -#: fortran/module.c:3117 +#: fortran/module.c:3132 msgid "Bad type in constant expression" msgstr "" -#: fortran/module.c:5507 +#: fortran/module.c:5522 msgid "Unexpected end of module" msgstr "" @@ -4448,87 +4480,87 @@ msgstr "" msgid "internal function" msgstr "У функцыі" -#: fortran/resolve.c:1676 +#: fortran/resolve.c:1686 msgid "elemental procedure" msgstr "" -#: fortran/resolve.c:3319 +#: fortran/resolve.c:3330 #, c-format msgid "Invalid context for NULL() pointer at %%L" msgstr "" -#: fortran/resolve.c:3335 +#: fortran/resolve.c:3346 #, c-format msgid "Operand of unary numeric operator '%s' at %%L is %s" msgstr "" -#: fortran/resolve.c:3351 +#: fortran/resolve.c:3362 #, c-format msgid "Operands of binary numeric operator '%s' at %%L are %s/%s" msgstr "" -#: fortran/resolve.c:3366 +#: fortran/resolve.c:3377 #, c-format msgid "Operands of string concatenation operator at %%L are %s/%s" msgstr "" -#: fortran/resolve.c:3385 +#: fortran/resolve.c:3396 #, c-format msgid "Operands of logical operator '%s' at %%L are %s/%s" msgstr "" -#: fortran/resolve.c:3399 +#: fortran/resolve.c:3410 #, c-format msgid "Operand of .not. operator at %%L is %s" msgstr "" -#: fortran/resolve.c:3413 +#: fortran/resolve.c:3424 msgid "COMPLEX quantities cannot be compared at %L" msgstr "" -#: fortran/resolve.c:3442 +#: fortran/resolve.c:3453 #, c-format msgid "Logicals at %%L must be compared with %s instead of %s" msgstr "" -#: fortran/resolve.c:3448 +#: fortran/resolve.c:3459 #, c-format msgid "Operands of comparison operator '%s' at %%L are %s/%s" msgstr "" -#: fortran/resolve.c:3456 +#: fortran/resolve.c:3467 #, c-format msgid "Unknown operator '%s' at %%L" msgstr "" -#: fortran/resolve.c:3458 +#: fortran/resolve.c:3469 #, c-format msgid "Operand of user operator '%s' at %%L is %s" msgstr "" -#: fortran/resolve.c:3461 +#: fortran/resolve.c:3472 #, c-format msgid "Operands of user operator '%s' at %%L are %s/%s" msgstr "" -#: fortran/resolve.c:3547 +#: fortran/resolve.c:3558 #, c-format msgid "Inconsistent ranks for operator at %%L and %%L" msgstr "" -#: fortran/resolve.c:5700 +#: fortran/resolve.c:5722 msgid "Loop variable" msgstr "" -#: fortran/resolve.c:5712 +#: fortran/resolve.c:5734 msgid "Start expression in DO loop" msgstr "" -#: fortran/resolve.c:5716 +#: fortran/resolve.c:5738 msgid "End expression in DO loop" msgstr "" -#: fortran/resolve.c:5720 +#: fortran/resolve.c:5742 msgid "Step expression in DO loop" msgstr "" @@ -4537,17 +4569,17 @@ msgstr "" msgid "Different CHARACTER lengths (%ld/%ld) in array constructor" msgstr "" -#: fortran/trans-decl.c:3975 +#: fortran/trans-decl.c:3982 #, c-format msgid "Actual string length does not match the declared one for dummy argument '%s' (%ld/%ld)" msgstr "" -#: fortran/trans-decl.c:3983 +#: fortran/trans-decl.c:3990 #, c-format msgid "Actual string length is shorter than the declared one for dummy argument '%s' (%ld/%ld)" msgstr "" -#: fortran/trans-expr.c:1620 +#: fortran/trans-expr.c:1624 msgid "internal error: bad hash value in dynamic dispatch" msgstr "" @@ -4577,11 +4609,11 @@ msgstr "" msgid "Assigned label is not a target label" msgstr "" -#: fortran/trans-stmt.c:882 fortran/trans-stmt.c:1143 +#: fortran/trans-stmt.c:882 fortran/trans-stmt.c:1152 msgid "Loop variable has been modified" msgstr "" -#: fortran/trans-stmt.c:1006 +#: fortran/trans-stmt.c:1015 msgid "DO step value is zero" msgstr "" @@ -4597,36 +4629,36 @@ msgstr "" msgid "Incorrect function return value" msgstr "" -#: fortran/trans.c:521 fortran/trans.c:952 -msgid "Attempt to allocate a negative amount of memory." -msgstr "" - -#: fortran/trans.c:541 +#: fortran/trans.c:533 msgid "Memory allocation failed" msgstr "" -#: fortran/trans.c:624 +#: fortran/trans.c:619 msgid "Attempt to allocate negative amount of memory. Possible integer overflow" msgstr "" -#: fortran/trans.c:658 fortran/trans.c:971 +#: fortran/trans.c:653 fortran/trans.c:966 msgid "Out of memory" msgstr "" -#: fortran/trans.c:751 +#: fortran/trans.c:746 #, c-format msgid "Attempting to allocate already allocated array '%s'" msgstr "" -#: fortran/trans.c:757 +#: fortran/trans.c:752 msgid "Attempting to allocate already allocatedarray" msgstr "" -#: fortran/trans.c:868 +#: fortran/trans.c:863 #, c-format msgid "Attempt to DEALLOCATE unallocated '%s'" msgstr "" +#: fortran/trans.c:947 +msgid "Attempt to allocate a negative amount of memory." +msgstr "" + #: java/jcf-dump.c:1068 #, c-format msgid "Not a valid Java .class file.\n" @@ -4854,25 +4886,26 @@ msgstr "" msgid "gfortran does not support -E without -cpp" msgstr "" -#: config/rs6000/sysv4.h:870 config/ia64/freebsd.h:26 -#: config/i386/freebsd.h:103 config/alpha/freebsd.h:33 -#: config/sparc/freebsd.h:34 -msgid "consider using `-pg' instead of `-p' with gprof(1)" -msgstr "" - -#: config/rs6000/sysv4.h:907 config/rs6000/sysv4.h:909 -#: config/alpha/linux-elf.h:33 config/alpha/linux-elf.h:35 -#: config/rs6000/linux64.h:354 config/rs6000/linux64.h:356 config/linux.h:111 -#: config/linux.h:113 -msgid "-mglibc and -muclibc used together" +#: config/arc/arc.h:61 config/mips/mips.h:1230 +msgid "may not use both -EB and -EL" msgstr "" #: config/mcore/mcore.h:54 msgid "the m210 does not have little endian support" msgstr "" -#: config/arc/arc.h:61 config/mips/mips.h:1230 -msgid "may not use both -EB and -EL" +#: ada/gcc-interface/lang-specs.h:33 gcc.c:896 java/jvspec.c:81 +msgid "-pg and -fomit-frame-pointer are incompatible" +msgstr "" + +#: ada/gcc-interface/lang-specs.h:34 +msgid "-c or -S required for Ada" +msgstr "" + +#: config/sparc/freebsd.h:34 config/rs6000/sysv4.h:870 +#: config/ia64/freebsd.h:26 config/i386/freebsd.h:103 +#: config/alpha/freebsd.h:33 +msgid "consider using `-pg' instead of `-p' with gprof(1)" msgstr "" #: config/sparc/linux64.h:165 config/sparc/linux64.h:176 @@ -4903,10 +4936,6 @@ msgstr "%s не падтрымлівае %s" msgid "GCC does not support -C or -CC without -E" msgstr "" -#: gcc.c:896 java/jvspec.c:81 ada/gcc-interface/lang-specs.h:33 -msgid "-pg and -fomit-frame-pointer are incompatible" -msgstr "" - #: gcc.c:1073 msgid "GNU C no longer supports -traditional without -E" msgstr "" @@ -4920,6 +4949,13 @@ msgstr "" msgid "shared and mdll are not compatible" msgstr "" +#: config/rs6000/sysv4.h:907 config/rs6000/sysv4.h:909 +#: config/alpha/linux-elf.h:33 config/alpha/linux-elf.h:35 +#: config/rs6000/linux64.h:356 config/rs6000/linux64.h:358 config/linux.h:111 +#: config/linux.h:113 +msgid "-mglibc and -muclibc used together" +msgstr "" + #: config/pa/pa-hpux10.h:87 config/pa/pa-hpux10.h:90 config/pa/pa-hpux10.h:98 #: config/pa/pa-hpux10.h:101 config/pa/pa-hpux11.h:108 #: config/pa/pa-hpux11.h:111 config/pa/pa64-hpux.h:30 config/pa/pa64-hpux.h:33 @@ -4976,11 +5012,6 @@ msgstr "" msgid "rx200 cpu does not have FPU hardware" msgstr "" -#: config/s390/tpf.h:119 -#, fuzzy -msgid "static is not supported on TPF-OS" -msgstr "-pipe не падтрымліваецца" - #: config/arm/freebsd.h:31 msgid "consider using `-pg' instead of `-p' with gprof(1) " msgstr "" @@ -5009,6 +5040,11 @@ msgstr "" msgid "`-mno-intel-syntax' is deprecated. Use `-masm=att' instead." msgstr "" +#: config/s390/tpf.h:119 +#, fuzzy +msgid "static is not supported on TPF-OS" +msgstr "-pipe не падтрымліваецца" + #: config/mips/r3900.h:34 msgid "-mhard-float not supported" msgstr "-mhard-float не падтрымліваецца" @@ -5025,10 +5061,6 @@ msgstr "" msgid "cannot use mshared and static together" msgstr "" -#: ada/gcc-interface/lang-specs.h:34 -msgid "-c or -S required for Ada" -msgstr "" - #: java/lang.opt:69 msgid "Warn if deprecated empty statements are found" msgstr "" @@ -5311,7 +5343,7 @@ msgid "Allow arbitrary character line width in fixed mode" msgstr "" #: fortran/lang.opt:249 -msgid "-ffixed-line-length-\t\tUse n as character line width in fixed mode" +msgid "-ffixed-line-length-\tUse n as character line width in fixed mode" msgstr "" #: fortran/lang.opt:253 @@ -5327,7 +5359,7 @@ msgid "Allow arbitrary character line width in free mode" msgstr "" #: fortran/lang.opt:265 -msgid "-ffree-line-length-\t\tUse n as character line width in free mode" +msgid "-ffree-line-length-\tUse n as character line width in free mode" msgstr "" #: fortran/lang.opt:269 @@ -5383,66 +5415,70 @@ msgid "Try to lay out derived types as compactly as possible" msgstr "" #: fortran/lang.opt:329 -msgid "Enable range checking during compilation" +msgid "Protect parentheses in expressions" msgstr "" #: fortran/lang.opt:333 -msgid "Use a 4-byte record marker for unformatted files" +msgid "Enable range checking during compilation" msgstr "" #: fortran/lang.opt:337 -msgid "Use an 8-byte record marker for unformatted files" +msgid "Use a 4-byte record marker for unformatted files" msgstr "" #: fortran/lang.opt:341 -msgid "Allocate local variables on the stack to allow indirect recursion" +msgid "Use an 8-byte record marker for unformatted files" msgstr "" #: fortran/lang.opt:345 -msgid "Copy array sections into a contiguous block on procedure entry" +msgid "Allocate local variables on the stack to allow indirect recursion" msgstr "" #: fortran/lang.opt:349 -msgid "-fcheck=[...]\tSpecify which runtime checks are to be performed" +msgid "Copy array sections into a contiguous block on procedure entry" msgstr "" #: fortran/lang.opt:353 +msgid "-fcheck=[...]\tSpecify which runtime checks are to be performed" +msgstr "" + +#: fortran/lang.opt:357 msgid "Append a second underscore if the name already contains an underscore" msgstr "" -#: fortran/lang.opt:361 +#: fortran/lang.opt:365 msgid "Apply negative sign to zero values" msgstr "" -#: fortran/lang.opt:365 +#: fortran/lang.opt:369 msgid "Append underscores to externally visible names" msgstr "" -#: fortran/lang.opt:369 +#: fortran/lang.opt:373 msgid "Compile all program units at once and check all interfaces" msgstr "" -#: fortran/lang.opt:409 +#: fortran/lang.opt:413 msgid "Statically link the GNU Fortran helper library (libgfortran)" msgstr "" -#: fortran/lang.opt:413 +#: fortran/lang.opt:417 msgid "Conform to the ISO Fortran 2003 standard" msgstr "" -#: fortran/lang.opt:417 +#: fortran/lang.opt:421 msgid "Conform to the ISO Fortran 2008 standard" msgstr "" -#: fortran/lang.opt:421 +#: fortran/lang.opt:425 msgid "Conform to the ISO Fortran 95 standard" msgstr "" -#: fortran/lang.opt:425 +#: fortran/lang.opt:429 msgid "Conform to nothing in particular" msgstr "" -#: fortran/lang.opt:429 +#: fortran/lang.opt:433 msgid "Accept extensions to support legacy code" msgstr "" @@ -9055,755 +9091,759 @@ msgid "Warn for implicit type conversions that may change a value" msgstr "" #: c.opt:176 -msgid "Warn for implicit type conversions between signed and unsigned integers" +msgid "Warn for converting NULL from/to a non-pointer type" msgstr "" #: c.opt:180 -msgid "Warn when all constructors and destructors are private" +msgid "Warn for implicit type conversions between signed and unsigned integers" msgstr "" #: c.opt:184 -msgid "Warn when a declaration is found after a statement" +msgid "Warn when all constructors and destructors are private" msgstr "" #: c.opt:188 -msgid "Warn if a deprecated compiler feature, class, method, or field is used" +msgid "Warn when a declaration is found after a statement" msgstr "" #: c.opt:192 -msgid "Warn about compile-time integer division by zero" +msgid "Warn if a deprecated compiler feature, class, method, or field is used" msgstr "" #: c.opt:196 -msgid "Warn about violations of Effective C++ style rules" +msgid "Warn about compile-time integer division by zero" msgstr "" #: c.opt:200 +msgid "Warn about violations of Effective C++ style rules" +msgstr "" + +#: c.opt:204 #, fuzzy msgid "Warn about an empty body in an if or else statement" msgstr "пустое цела ў else-выражэнні" -#: c.opt:204 +#: c.opt:208 msgid "Warn about stray tokens after #elif and #endif" msgstr "" -#: c.opt:208 +#: c.opt:212 msgid "Warn about comparison of different enum types" msgstr "" -#: c.opt:216 +#: c.opt:220 msgid "This switch is deprecated; use -Werror=implicit-function-declaration instead" msgstr "" -#: c.opt:220 +#: c.opt:224 msgid "Warn if testing floating point numbers for equality" msgstr "" -#: c.opt:224 +#: c.opt:228 msgid "Warn about printf/scanf/strftime/strfmon format string anomalies" msgstr "" -#: c.opt:228 +#: c.opt:232 #, fuzzy msgid "Warn if passing too many arguments to a function for its format string" msgstr "вельмі шмат аргумэнтаў у функцыі `%s'" -#: c.opt:232 +#: c.opt:236 msgid "Warn about format strings that are not literals" msgstr "" -#: c.opt:236 +#: c.opt:240 msgid "Warn about format strings that contain NUL bytes" msgstr "" -#: c.opt:240 +#: c.opt:244 msgid "Warn about possible security problems with format functions" msgstr "" -#: c.opt:244 +#: c.opt:248 msgid "Warn about strftime formats yielding 2-digit years" msgstr "" -#: c.opt:248 +#: c.opt:252 msgid "Warn about zero-length formats" msgstr "" -#: c.opt:255 +#: c.opt:259 msgid "Warn whenever type qualifiers are ignored." msgstr "" -#: c.opt:259 +#: c.opt:263 msgid "Warn about variables which are initialized to themselves" msgstr "" -#: c.opt:266 +#: c.opt:270 msgid "Warn about implicit function declarations" msgstr "" -#: c.opt:270 +#: c.opt:274 msgid "Warn when a declaration does not specify a type" msgstr "" -#: c.opt:277 +#: c.opt:281 msgid "Warn when there is a cast to a pointer from an integer of a different size" msgstr "" -#: c.opt:281 +#: c.opt:285 msgid "Warn about invalid uses of the \"offsetof\" macro" msgstr "" -#: c.opt:285 +#: c.opt:289 msgid "Warn about PCH files that are found but not used" msgstr "" -#: c.opt:289 +#: c.opt:293 msgid "Warn when a jump misses a variable initialization" msgstr "" -#: c.opt:293 +#: c.opt:297 msgid "Warn when a logical operator is suspiciously always evaluating to true or false" msgstr "" -#: c.opt:297 +#: c.opt:301 msgid "Do not warn about using \"long long\" when -pedantic" msgstr "" -#: c.opt:301 +#: c.opt:305 #, fuzzy msgid "Warn about suspicious declarations of \"main\"" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c.opt:305 +#: c.opt:309 msgid "Warn about possibly missing braces around initializers" msgstr "" -#: c.opt:309 +#: c.opt:313 #, fuzzy msgid "Warn about global functions without previous declarations" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: c.opt:313 +#: c.opt:317 msgid "Warn about missing fields in struct initializers" msgstr "" -#: c.opt:317 +#: c.opt:321 msgid "Warn about functions which might be candidates for format attributes" msgstr "" -#: c.opt:321 +#: c.opt:325 msgid "Warn about user-specified include directories that do not exist" msgstr "" -#: c.opt:325 +#: c.opt:329 msgid "Warn about function parameters declared without a type specifier in K&R-style functions" msgstr "" -#: c.opt:329 +#: c.opt:333 msgid "Warn about global functions without prototypes" msgstr "" -#: c.opt:333 +#: c.opt:337 #, fuzzy msgid "Warn about use of multi-character character constants" msgstr "мнагасімвальная сімвальная канстанта" -#: c.opt:337 +#: c.opt:341 msgid "Warn about \"extern\" declarations not at file scope" msgstr "" -#: c.opt:341 +#: c.opt:345 msgid "Warn when non-templatized friend functions are declared within a template" msgstr "" -#: c.opt:345 +#: c.opt:349 msgid "Warn about non-virtual destructors" msgstr "" -#: c.opt:349 +#: c.opt:353 msgid "Warn about NULL being passed to argument slots marked as requiring non-NULL" msgstr "" -#: c.opt:353 +#: c.opt:357 msgid "-Wnormalized=\tWarn about non-normalised Unicode strings" msgstr "" -#: c.opt:357 +#: c.opt:361 msgid "Warn if a C-style cast is used in a program" msgstr "" -#: c.opt:361 +#: c.opt:365 msgid "Warn for obsolescent usage in a declaration" msgstr "" -#: c.opt:365 +#: c.opt:369 msgid "Warn if an old-style parameter definition is used" msgstr "" -#: c.opt:369 +#: c.opt:373 msgid "Warn if a string is longer than the maximum portable length specified by the standard" msgstr "" -#: c.opt:373 +#: c.opt:377 msgid "Warn about overloaded virtual function names" msgstr "" -#: c.opt:377 +#: c.opt:381 msgid "Warn about overriding initializers without side effects" msgstr "" -#: c.opt:381 +#: c.opt:385 msgid "Warn about packed bit-fields whose offset changed in GCC 4.4" msgstr "" -#: c.opt:385 +#: c.opt:389 msgid "Warn about possibly missing parentheses" msgstr "" -#: c.opt:389 +#: c.opt:393 msgid "Warn when converting the type of pointers to member functions" msgstr "" -#: c.opt:393 +#: c.opt:397 msgid "Warn about function pointer arithmetic" msgstr "" -#: c.opt:397 +#: c.opt:401 msgid "Warn when a pointer is cast to an integer of a different size" msgstr "" -#: c.opt:401 +#: c.opt:405 msgid "Warn about misuses of pragmas" msgstr "" -#: c.opt:405 +#: c.opt:409 msgid "Warn if inherited methods are unimplemented" msgstr "" -#: c.opt:409 +#: c.opt:413 msgid "Warn about multiple declarations of the same object" msgstr "" -#: c.opt:413 +#: c.opt:417 msgid "Warn when the compiler reorders code" msgstr "" -#: c.opt:417 +#: c.opt:421 msgid "Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)" msgstr "" -#: c.opt:421 +#: c.opt:425 msgid "Warn if a selector has multiple methods" msgstr "" -#: c.opt:425 +#: c.opt:429 msgid "Warn about possible violations of sequence point rules" msgstr "" -#: c.opt:429 +#: c.opt:433 msgid "Warn about signed-unsigned comparisons" msgstr "" -#: c.opt:433 +#: c.opt:437 msgid "Warn when overload promotes from unsigned to signed" msgstr "" -#: c.opt:437 +#: c.opt:441 msgid "Warn about uncasted NULL used as sentinel" msgstr "" -#: c.opt:441 +#: c.opt:445 #, fuzzy msgid "Warn about unprototyped function declarations" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c.opt:445 +#: c.opt:449 msgid "Warn if type signatures of candidate methods do not match exactly" msgstr "" -#: c.opt:449 +#: c.opt:453 msgid "Warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions are used" msgstr "" -#: c.opt:453 +#: c.opt:457 msgid "Deprecated. This switch has no effect" msgstr "" -#: c.opt:461 +#: c.opt:465 msgid "Warn about features not present in traditional C" msgstr "" -#: c.opt:465 +#: c.opt:469 msgid "Warn of prototypes causing type conversions different from what would happen in the absence of prototype" msgstr "" -#: c.opt:469 +#: c.opt:473 msgid "Warn if trigraphs are encountered that might affect the meaning of the program" msgstr "" -#: c.opt:473 +#: c.opt:477 msgid "Warn about @selector()s without previously declared methods" msgstr "" -#: c.opt:477 +#: c.opt:481 msgid "Warn if an undefined macro is used in an #if directive" msgstr "" -#: c.opt:481 +#: c.opt:485 msgid "Warn about unrecognized pragmas" msgstr "" -#: c.opt:485 +#: c.opt:489 msgid "Warn about unsuffixed float constants" msgstr "" -#: c.opt:489 +#: c.opt:493 msgid "Warn about macros defined in the main file that are not used" msgstr "" -#: c.opt:493 +#: c.opt:497 msgid "Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value" msgstr "" -#: c.opt:497 +#: c.opt:501 msgid "Do not warn about using variadic macros when -pedantic" msgstr "" -#: c.opt:501 +#: c.opt:505 msgid "Warn if a variable length array is used" msgstr "" -#: c.opt:505 +#: c.opt:509 msgid "Warn when a register variable is declared volatile" msgstr "" -#: c.opt:509 +#: c.opt:513 msgid "In C++, nonzero means warn about deprecated conversion from string literals to `char *'. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard." msgstr "" -#: c.opt:513 +#: c.opt:517 msgid "Warn when a pointer differs in signedness in an assignment" msgstr "" -#: c.opt:517 +#: c.opt:521 msgid "A synonym for -std=c89 (for C) or -std=c++98 (for C++)" msgstr "" -#: c.opt:525 +#: c.opt:529 msgid "Enforce class member access control semantics" msgstr "" -#: c.opt:532 +#: c.opt:536 msgid "Change when template instances are emitted" msgstr "" -#: c.opt:536 +#: c.opt:540 msgid "Recognize the \"asm\" keyword" msgstr "" -#: c.opt:540 +#: c.opt:544 #, fuzzy msgid "Recognize built-in functions" msgstr "Не генерыраваць сімвальныя інструкцыі" -#: c.opt:547 +#: c.opt:551 msgid "Check the return value of new" msgstr "" -#: c.opt:551 +#: c.opt:555 msgid "Allow the arguments of the '?' operator to have different types" msgstr "" -#: c.opt:555 +#: c.opt:559 msgid "Reduce the size of object files" msgstr "" -#: c.opt:559 +#: c.opt:563 msgid "-fconst-string-class=\tUse class for constant strings" msgstr "" -#: c.opt:563 +#: c.opt:567 msgid "-fno-deduce-init-list\tdisable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list" msgstr "" -#: c.opt:567 +#: c.opt:571 #, fuzzy msgid "Inline member functions by default" msgstr "у функцыі \"%s\":" -#: c.opt:571 +#: c.opt:575 msgid "Preprocess directives only." msgstr "" -#: c.opt:575 +#: c.opt:579 msgid "Permit '$' as an identifier character" msgstr "" -#: c.opt:582 +#: c.opt:586 #, fuzzy msgid "Generate code to check exception specifications" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c.opt:589 +#: c.opt:593 msgid "-fexec-charset=\tConvert all strings and character constants to character set " msgstr "" -#: c.opt:593 +#: c.opt:597 msgid "Permit universal character names (\\u and \\U) in identifiers" msgstr "" -#: c.opt:597 +#: c.opt:601 msgid "-finput-charset=\tSpecify the default character set for source files" msgstr "" -#: c.opt:605 +#: c.opt:609 msgid "Scope of for-init-statement variables is local to the loop" msgstr "" -#: c.opt:609 +#: c.opt:613 msgid "Do not assume that standard C libraries and \"main\" exist" msgstr "" -#: c.opt:613 +#: c.opt:617 msgid "Recognize GNU-defined keywords" msgstr "" -#: c.opt:617 +#: c.opt:621 msgid "Generate code for GNU runtime environment" msgstr "" -#: c.opt:621 +#: c.opt:625 msgid "Use traditional GNU semantics for inline functions" msgstr "" -#: c.opt:634 +#: c.opt:638 msgid "Assume normal C execution environment" msgstr "" -#: c.opt:638 +#: c.opt:642 msgid "Enable support for huge objects" msgstr "" -#: c.opt:642 +#: c.opt:646 msgid "Export functions even if they can be inlined" msgstr "" -#: c.opt:646 +#: c.opt:650 #, fuzzy msgid "Emit implicit instantiations of inline templates" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c.opt:650 +#: c.opt:654 #, fuzzy msgid "Emit implicit instantiations of templates" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c.opt:654 +#: c.opt:658 msgid "Inject friend functions into enclosing namespace" msgstr "" -#: c.opt:661 +#: c.opt:665 msgid "Allow implicit conversions between vectors with differing numbers of subparts and/or differing element types." msgstr "" -#: c.opt:665 +#: c.opt:669 msgid "Don't warn about uses of Microsoft extensions" msgstr "" -#: c.opt:675 +#: c.opt:679 msgid "Generate code for NeXT (Apple Mac OS X) runtime environment" msgstr "" -#: c.opt:679 +#: c.opt:683 msgid "Assume that receivers of Objective-C messages may be nil" msgstr "" -#: c.opt:691 +#: c.opt:695 msgid "Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed" msgstr "" -#: c.opt:695 +#: c.opt:699 msgid "Allow fast jumps to the message dispatcher" msgstr "" -#: c.opt:701 +#: c.opt:705 msgid "Enable Objective-C exception and synchronization syntax" msgstr "" -#: c.opt:705 +#: c.opt:709 msgid "Enable garbage collection (GC) in Objective-C/Objective-C++ programs" msgstr "" -#: c.opt:710 +#: c.opt:714 #, fuzzy msgid "Enable Objective-C setjmp exception handling runtime" msgstr "Уключыць апрацоўку выключэньняў" -#: c.opt:714 +#: c.opt:718 msgid "Enable OpenMP (implies -frecursive in Fortran)" msgstr "" -#: c.opt:718 +#: c.opt:722 msgid "Recognize C++ keywords like \"compl\" and \"xor\"" msgstr "" -#: c.opt:722 +#: c.opt:726 #, fuzzy msgid "Enable optional diagnostics" msgstr "Уключаць SSA аптымізацыю" -#: c.opt:729 +#: c.opt:733 msgid "Look for and use PCH files even when preprocessing" msgstr "" -#: c.opt:733 +#: c.opt:737 msgid "Downgrade conformance errors to warnings" msgstr "" -#: c.opt:737 +#: c.opt:741 msgid "Treat the input file as already preprocessed" msgstr "" -#: c.opt:741 +#: c.opt:745 msgid "-fno-pretty-templates Do not pretty-print template specializations as the template signature followed by the arguments" msgstr "" -#: c.opt:745 +#: c.opt:749 msgid "Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime" msgstr "" -#: c.opt:749 +#: c.opt:753 msgid "Enable automatic template instantiation" msgstr "" -#: c.opt:753 +#: c.opt:757 msgid "Generate run time type descriptor information" msgstr "" -#: c.opt:757 +#: c.opt:761 msgid "Use the same size for double as for float" msgstr "" -#: c.opt:761 +#: c.opt:765 msgid "Use the narrowest integer type possible for enumeration types" msgstr "" -#: c.opt:765 +#: c.opt:769 msgid "Force the underlying type for \"wchar_t\" to be \"unsigned short\"" msgstr "" -#: c.opt:769 +#: c.opt:773 msgid "When \"signed\" or \"unsigned\" is not given make the bitfield signed" msgstr "" -#: c.opt:773 +#: c.opt:777 msgid "Make \"char\" signed by default" msgstr "" -#: c.opt:780 +#: c.opt:784 msgid "Display statistics accumulated during compilation" msgstr "" -#: c.opt:787 +#: c.opt:791 msgid "-ftabstop=\tDistance between tab stops for column reporting" msgstr "" -#: c.opt:791 -msgid "-ftemplate-depth-\tSpecify maximum template instantiation depth" +#: c.opt:798 +msgid "-ftemplate-depth=\tSpecify maximum template instantiation depth" msgstr "" -#: c.opt:798 +#: c.opt:805 msgid "-fno-threadsafe-statics\tDo not generate thread-safe code for initializing local statics" msgstr "" -#: c.opt:802 +#: c.opt:809 msgid "When \"signed\" or \"unsigned\" is not given make the bitfield unsigned" msgstr "" -#: c.opt:806 +#: c.opt:813 msgid "Make \"char\" unsigned by default" msgstr "" -#: c.opt:810 +#: c.opt:817 msgid "Use __cxa_atexit to register destructors" msgstr "" -#: c.opt:814 +#: c.opt:821 msgid "Use __cxa_get_exception_ptr in exception handling" msgstr "" -#: c.opt:818 +#: c.opt:825 msgid "Marks all inlined methods as having hidden visibility" msgstr "" -#: c.opt:822 +#: c.opt:829 msgid "Changes visibility to match Microsoft Visual Studio by default" msgstr "" -#: c.opt:826 +#: c.opt:833 msgid "Discard unused virtual functions" msgstr "" -#: c.opt:830 +#: c.opt:837 msgid "Implement vtables using thunks" msgstr "" -#: c.opt:834 +#: c.opt:841 msgid "Emit common-like symbols as weak symbols" msgstr "" -#: c.opt:838 +#: c.opt:845 msgid "-fwide-exec-charset=\tConvert all wide strings and character constants to character set " msgstr "" -#: c.opt:842 +#: c.opt:849 msgid "Generate a #line directive pointing at the current working directory" msgstr "" -#: c.opt:846 +#: c.opt:853 msgid "Emit cross referencing information" msgstr "" -#: c.opt:850 +#: c.opt:857 msgid "Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode" msgstr "" -#: c.opt:854 +#: c.opt:861 msgid "Dump declarations to a .decl file" msgstr "" -#: c.opt:858 +#: c.opt:865 msgid "-femit-struct-debug-baseonly\tAggressive reduced debug info for structs" msgstr "" -#: c.opt:862 +#: c.opt:869 msgid "-femit-struct-debug-reduced\tConservative reduced debug info for structs" msgstr "" -#: c.opt:866 +#: c.opt:873 msgid "-femit-struct-debug-detailed=\tDetailed reduced debug info for structs" msgstr "" -#: c.opt:870 +#: c.opt:877 msgid "-idirafter \tAdd to the end of the system include path" msgstr "" -#: c.opt:874 +#: c.opt:881 msgid "-imacros \tAccept definition of macros in " msgstr "" -#: c.opt:878 +#: c.opt:885 msgid "-imultilib \tSet to be the multilib include subdirectory" msgstr "" -#: c.opt:882 +#: c.opt:889 msgid "-include \tInclude the contents of before other files" msgstr "" -#: c.opt:886 +#: c.opt:893 msgid "-iprefix \tSpecify as a prefix for next two options" msgstr "" -#: c.opt:890 +#: c.opt:897 msgid "-isysroot \tSet to be the system root directory" msgstr "" -#: c.opt:894 +#: c.opt:901 msgid "-isystem \tAdd to the start of the system include path" msgstr "" -#: c.opt:898 +#: c.opt:905 msgid "-iquote \tAdd to the end of the quote include path" msgstr "" -#: c.opt:902 +#: c.opt:909 msgid "-iwithprefix \tAdd to the end of the system include path" msgstr "" -#: c.opt:906 +#: c.opt:913 msgid "-iwithprefixbefore \tAdd to the end of the main include path" msgstr "" -#: c.opt:916 +#: c.opt:923 msgid "Do not search standard system include directories (those specified with -isystem will still be used)" msgstr "" -#: c.opt:920 +#: c.opt:927 msgid "Do not search standard system include directories for C++" msgstr "" -#: c.opt:936 +#: c.opt:943 msgid "Generate C header of platform-specific features" msgstr "" -#: c.opt:940 +#: c.opt:947 msgid "Print a checksum of the executable for PCH validity checking, and stop" msgstr "" -#: c.opt:944 +#: c.opt:951 msgid "Remap file names when including files" msgstr "" -#: c.opt:948 +#: c.opt:955 msgid "Conform to the ISO 1998 C++ standard" msgstr "" -#: c.opt:952 +#: c.opt:959 msgid "Conform to the ISO 1998 C++ standard, with extensions that are likely to" msgstr "" -#: c.opt:959 c.opt:994 +#: c.opt:966 c.opt:970 c.opt:1009 msgid "Conform to the ISO 1990 C standard" msgstr "" -#: c.opt:963 c.opt:1002 +#: c.opt:974 c.opt:1017 msgid "Conform to the ISO 1999 C standard" msgstr "" -#: c.opt:967 +#: c.opt:978 msgid "Deprecated in favor of -std=c99" msgstr "" -#: c.opt:971 +#: c.opt:982 msgid "Conform to the ISO 1998 C++ standard with GNU extensions" msgstr "" -#: c.opt:975 +#: c.opt:986 msgid "Conform to the ISO 1998 C++ standard, with GNU extensions and" msgstr "" -#: c.opt:982 +#: c.opt:993 c.opt:997 msgid "Conform to the ISO 1990 C standard with GNU extensions" msgstr "" -#: c.opt:986 +#: c.opt:1001 msgid "Conform to the ISO 1999 C standard with GNU extensions" msgstr "" -#: c.opt:990 +#: c.opt:1005 msgid "Deprecated in favor of -std=gnu99" msgstr "" -#: c.opt:998 +#: c.opt:1013 msgid "Conform to the ISO 1990 C standard as amended in 1994" msgstr "" -#: c.opt:1006 +#: c.opt:1021 msgid "Deprecated in favor of -std=iso9899:1999" msgstr "" -#: c.opt:1010 +#: c.opt:1025 msgid "Enable traditional preprocessing" msgstr "" -#: c.opt:1014 +#: c.opt:1029 msgid "-trigraphs\tSupport ISO C trigraphs" msgstr "" -#: c.opt:1018 +#: c.opt:1033 msgid "Do not predefine system-specific and GCC-specific macros" msgstr "" -#: c.opt:1022 +#: c.opt:1037 msgid "Enable verbose output" msgstr "" @@ -10018,7 +10058,7 @@ msgid "-dumpbase \tSet the file basename to be used for dumps" msgstr "" #: common.opt:258 -msgid "-dumpdir \t\tSet the directory name to be used for dumps" +msgid "-dumpdir \tSet the directory name to be used for dumps" msgstr "" #: common.opt:284 @@ -10132,8 +10172,8 @@ msgid "When running CSE, follow jumps to their targets" msgstr "" #: common.opt:419 common.opt:548 common.opt:769 common.opt:1011 -#: common.opt:1132 common.opt:1191 common.opt:1250 common.opt:1266 -#: common.opt:1338 +#: common.opt:1047 common.opt:1132 common.opt:1191 common.opt:1250 +#: common.opt:1266 common.opt:1338 msgid "Does nothing. Preserved for backward compatibility." msgstr "" @@ -10700,10 +10740,6 @@ msgstr "" msgid "If scheduling post reload, do superblock scheduling" msgstr "" -#: common.opt:1047 -msgid "If scheduling post reload, do trace scheduling" -msgstr "" - #: common.opt:1051 msgid "Reschedule instructions before register allocation" msgstr "" @@ -11189,27 +11225,27 @@ msgstr "" msgid "Create a position independent executable" msgstr "" -#: attribs.c:293 +#: attribs.c:295 #, fuzzy, gcc-internal-format msgid "%qE attribute directive ignored" msgstr "\"%s\" атрыбут ігнарыруецца" -#: attribs.c:301 +#: attribs.c:303 #, fuzzy, gcc-internal-format msgid "wrong number of arguments specified for %qE attribute" msgstr "памылковая колькасьць аргументаў, зададзеных для атрыбута `%s'" -#: attribs.c:319 +#: attribs.c:321 #, fuzzy, gcc-internal-format msgid "%qE attribute does not apply to types" msgstr "\"%s\" звычайна функцыя" -#: attribs.c:370 +#: attribs.c:373 #, fuzzy, gcc-internal-format msgid "%qE attribute only applies to function types" msgstr "\"%s\" звычайна функцыя" -#: attribs.c:380 +#: attribs.c:383 #, gcc-internal-format msgid "type attributes ignored after type is already defined" msgstr "" @@ -11249,120 +11285,120 @@ msgstr "аргумент `__builtin_args_info' павінен быць канс msgid "invalid third argument to %<__builtin_prefetch%>; using zero" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: builtins.c:4303 +#: builtins.c:4318 #, fuzzy, gcc-internal-format msgid "argument of %<__builtin_args_info%> must be constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: builtins.c:4309 +#: builtins.c:4324 #, fuzzy, gcc-internal-format msgid "argument of %<__builtin_args_info%> out of range" msgstr "аргумент `__builtin_args_info' выйшаў за межы" -#: builtins.c:4315 +#: builtins.c:4330 #, fuzzy, gcc-internal-format msgid "missing argument in %<__builtin_args_info%>" msgstr "прапушчан аргумент у `__builtin_args_info'" -#: builtins.c:4452 gimplify.c:2271 +#: builtins.c:4467 gimplify.c:2271 #, fuzzy, gcc-internal-format msgid "too few arguments to function %" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: builtins.c:4614 +#: builtins.c:4629 #, gcc-internal-format msgid "first argument to % not of type %" msgstr "" -#: builtins.c:4630 +#: builtins.c:4645 #, gcc-internal-format msgid "%qT is promoted to %qT when passed through %<...%>" msgstr "" -#: builtins.c:4635 +#: builtins.c:4650 #, gcc-internal-format msgid "(so you should pass %qT not %qT to %)" msgstr "" #. We can, however, treat "undefined" any way we please. #. Call abort to encourage the user to fix the program. -#: builtins.c:4642 c-typeck.c:2664 +#: builtins.c:4657 c-typeck.c:2664 #, gcc-internal-format msgid "if this code is reached, the program will abort" msgstr "" -#: builtins.c:4769 +#: builtins.c:4784 #, gcc-internal-format msgid "invalid argument to %<__builtin_frame_address%>" msgstr "" -#: builtins.c:4771 +#: builtins.c:4786 #, gcc-internal-format msgid "invalid argument to %<__builtin_return_address%>" msgstr "" -#: builtins.c:4784 +#: builtins.c:4799 #, gcc-internal-format msgid "unsupported argument to %<__builtin_frame_address%>" msgstr "" -#: builtins.c:4786 +#: builtins.c:4801 #, gcc-internal-format msgid "unsupported argument to %<__builtin_return_address%>" msgstr "" -#: builtins.c:5041 +#: builtins.c:5056 #, fuzzy, gcc-internal-format msgid "both arguments to %<__builtin___clear_cache%> must be pointers" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: builtins.c:5418 builtins.c:5432 +#: builtins.c:5435 builtins.c:5449 #, gcc-internal-format msgid "%qD changed semantics in GCC 4.4" msgstr "" #. All valid uses of __builtin_va_arg_pack () are removed during #. inlining. -#: builtins.c:5822 expr.c:9221 +#: builtins.c:5839 expr.c:9229 msgid "%Kinvalid use of %<__builtin_va_arg_pack ()%>" msgstr "" #. All valid uses of __builtin_va_arg_pack_len () are removed during #. inlining. -#: builtins.c:5828 +#: builtins.c:5845 msgid "%Kinvalid use of %<__builtin_va_arg_pack_len ()%>" msgstr "" -#: builtins.c:6056 +#: builtins.c:6073 #, gcc-internal-format msgid "%<__builtin_longjmp%> second argument must be 1" msgstr "" -#: builtins.c:6656 +#: builtins.c:6673 #, fuzzy, gcc-internal-format msgid "target format does not support infinity" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: builtins.c:11402 +#: builtins.c:11419 #, fuzzy, gcc-internal-format msgid "% used in function with fixed args" msgstr "" "`va_start' выкарыстоўвываецца ў функцыі з нязьменнай\n" " колькасьцю аргументаў" -#: builtins.c:11410 +#: builtins.c:11427 #, fuzzy, gcc-internal-format msgid "wrong number of arguments to function %" msgstr "памылковая колькасьць аргументаў, зададзеных для атрыбута `%s'" #. Evidently an out of date version of ; can't validate #. va_start's second argument, but can still work as intended. -#: builtins.c:11423 +#: builtins.c:11440 #, fuzzy, gcc-internal-format msgid "%<__builtin_next_arg%> called without an argument" msgstr "\"__buitin_next_arg\" выклікаецца без аргумента" -#: builtins.c:11428 +#: builtins.c:11445 #, fuzzy, gcc-internal-format msgid "wrong number of arguments to function %<__builtin_next_arg%>" msgstr "памылковая колькасьць аргументаў, зададзеных для атрыбута `%s'" @@ -11372,38 +11408,38 @@ msgstr "памылковая колькасьць аргументаў, зада #. argument. We just warn and set the arg to be the last #. argument so that we will get wrong-code because of #. it. -#: builtins.c:11458 +#: builtins.c:11475 #, gcc-internal-format msgid "second parameter of % not last named argument" msgstr "" -#: builtins.c:11468 +#: builtins.c:11485 #, gcc-internal-format msgid "undefined behaviour when second parameter of % is declared with % storage" msgstr "" -#: builtins.c:11584 +#: builtins.c:11601 #, fuzzy msgid "%Kfirst argument of %D must be a pointer, second integer constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: builtins.c:11597 +#: builtins.c:11614 msgid "%Klast argument of %D is not integer constant between 0 and 3" msgstr "" -#: builtins.c:11642 builtins.c:11793 builtins.c:11850 +#: builtins.c:11659 builtins.c:11810 builtins.c:11867 msgid "%Kcall to %D will always overflow destination buffer" msgstr "" -#: builtins.c:11783 +#: builtins.c:11800 msgid "%Kcall to %D might overflow destination buffer" msgstr "" -#: builtins.c:11871 +#: builtins.c:11888 msgid "%Kattempt to free a non-heap object %qD" msgstr "" -#: builtins.c:11874 +#: builtins.c:11891 msgid "%Kattempt to free a non-heap object" msgstr "" @@ -11537,775 +11573,775 @@ msgstr "" msgid "conversion to %qT from %qT may change the sign of the result" msgstr "" -#: c-common.c:2216 +#: c-common.c:2221 #, gcc-internal-format msgid "conversion to %qT from %qT may alter its value" msgstr "" -#: c-common.c:2244 +#: c-common.c:2249 #, gcc-internal-format msgid "large integer implicitly truncated to unsigned type" msgstr "" -#: c-common.c:2250 c-common.c:2257 c-common.c:2265 +#: c-common.c:2255 c-common.c:2262 c-common.c:2270 #, gcc-internal-format msgid "overflow in implicit constant conversion" msgstr "" -#: c-common.c:2438 +#: c-common.c:2443 #, gcc-internal-format msgid "operation on %qE may be undefined" msgstr "" -#: c-common.c:2746 +#: c-common.c:2751 #, gcc-internal-format msgid "case label does not reduce to an integer constant" msgstr "" -#: c-common.c:2786 +#: c-common.c:2791 #, gcc-internal-format msgid "case label value is less than minimum value for type" msgstr "" -#: c-common.c:2794 +#: c-common.c:2799 #, gcc-internal-format msgid "case label value exceeds maximum value for type" msgstr "" -#: c-common.c:2802 +#: c-common.c:2807 #, gcc-internal-format msgid "lower value in case label range less than minimum value for type" msgstr "" -#: c-common.c:2811 +#: c-common.c:2816 #, gcc-internal-format msgid "upper value in case label range exceeds maximum value for type" msgstr "" -#: c-common.c:2885 +#: c-common.c:2890 #, gcc-internal-format msgid "GCC cannot support operators with integer types and fixed-point types that have too many integral and fractional bits together" msgstr "" -#: c-common.c:3372 +#: c-common.c:3377 #, fuzzy, gcc-internal-format msgid "invalid operands to binary %s (have %qT and %qT)" msgstr "нерэчаісны %%-код" -#: c-common.c:3608 +#: c-common.c:3613 #, gcc-internal-format msgid "comparison is always false due to limited range of data type" msgstr "" -#: c-common.c:3610 +#: c-common.c:3615 #, gcc-internal-format msgid "comparison is always true due to limited range of data type" msgstr "" -#: c-common.c:3689 +#: c-common.c:3694 #, gcc-internal-format msgid "comparison of unsigned expression >= 0 is always true" msgstr "" -#: c-common.c:3699 +#: c-common.c:3704 #, gcc-internal-format msgid "comparison of unsigned expression < 0 is always false" msgstr "" -#: c-common.c:3741 +#: c-common.c:3746 #, gcc-internal-format msgid "pointer of type % used in arithmetic" msgstr "" -#: c-common.c:3747 +#: c-common.c:3752 #, gcc-internal-format msgid "pointer to a function used in arithmetic" msgstr "" -#: c-common.c:3753 +#: c-common.c:3758 #, gcc-internal-format msgid "pointer to member function used in arithmetic" msgstr "" -#: c-common.c:3959 +#: c-common.c:3964 #, gcc-internal-format msgid "the address of %qD will always evaluate as %" msgstr "" -#: c-common.c:4060 cp/semantics.c:595 cp/typeck.c:7048 +#: c-common.c:4065 cp/semantics.c:593 cp/typeck.c:7135 #, gcc-internal-format msgid "suggest parentheses around assignment used as truth value" msgstr "" -#: c-common.c:4142 c-decl.c:3608 c-typeck.c:10266 +#: c-common.c:4147 c-decl.c:3611 c-typeck.c:10296 #, fuzzy, gcc-internal-format msgid "invalid use of %" msgstr "нявернае выкарыстанне \"restict\"" -#: c-common.c:4365 +#: c-common.c:4370 #, fuzzy, gcc-internal-format msgid "invalid application of % to a function type" msgstr "Нерэчаісны выбар \"%s\"" -#: c-common.c:4378 +#: c-common.c:4383 #, gcc-internal-format msgid "invalid application of %qs to a void type" msgstr "" -#: c-common.c:4386 +#: c-common.c:4391 #, fuzzy, gcc-internal-format msgid "invalid application of %qs to incomplete type %qT " msgstr "\"%s\" мае незавершаны тып" -#: c-common.c:4428 +#: c-common.c:4433 #, gcc-internal-format msgid "%<__alignof%> applied to a bit-field" msgstr "" -#: c-common.c:5137 +#: c-common.c:5142 #, fuzzy, gcc-internal-format msgid "cannot disable built-in function %qs" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: c-common.c:5329 +#: c-common.c:5334 #, gcc-internal-format msgid "pointers are not permitted as case values" msgstr "" -#: c-common.c:5336 +#: c-common.c:5341 #, gcc-internal-format msgid "range expressions in switch statements are non-standard" msgstr "" -#: c-common.c:5362 +#: c-common.c:5367 #, gcc-internal-format msgid "empty range specified" msgstr "" -#: c-common.c:5422 +#: c-common.c:5427 #, gcc-internal-format msgid "duplicate (or overlapping) case value" msgstr "" -#: c-common.c:5424 +#: c-common.c:5429 #, gcc-internal-format msgid "this is the first entry overlapping that value" msgstr "" -#: c-common.c:5428 +#: c-common.c:5433 #, gcc-internal-format msgid "duplicate case value" msgstr "" -#: c-common.c:5429 +#: c-common.c:5434 #, gcc-internal-format msgid "previously used here" msgstr "" -#: c-common.c:5433 +#: c-common.c:5438 #, gcc-internal-format msgid "multiple default labels in one switch" msgstr "" -#: c-common.c:5435 +#: c-common.c:5440 #, gcc-internal-format msgid "this is the first default label" msgstr "" -#: c-common.c:5487 +#: c-common.c:5492 #, gcc-internal-format msgid "case value %qs not in enumerated type" msgstr "" -#: c-common.c:5492 +#: c-common.c:5497 #, gcc-internal-format msgid "case value %qs not in enumerated type %qT" msgstr "" -#: c-common.c:5551 +#: c-common.c:5556 #, gcc-internal-format msgid "switch missing default case" msgstr "" -#: c-common.c:5623 +#: c-common.c:5628 #, gcc-internal-format msgid "enumeration value %qE not handled in switch" msgstr "" -#: c-common.c:5649 +#: c-common.c:5654 #, fuzzy, gcc-internal-format msgid "taking the address of a label is non-standard" msgstr "ISO C не дазваляе пусты ізыходны файл" -#: c-common.c:5822 +#: c-common.c:5827 #, fuzzy, gcc-internal-format msgid "%qE attribute ignored for field of type %qT" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:5833 c-common.c:5852 c-common.c:5870 c-common.c:5897 -#: c-common.c:5924 c-common.c:5950 c-common.c:5969 c-common.c:5986 -#: c-common.c:6010 c-common.c:6033 c-common.c:6056 c-common.c:6077 -#: c-common.c:6098 c-common.c:6122 c-common.c:6148 c-common.c:6185 -#: c-common.c:6212 c-common.c:6255 c-common.c:6339 c-common.c:6369 -#: c-common.c:6389 c-common.c:6727 c-common.c:6743 c-common.c:6791 -#: c-common.c:6814 c-common.c:6878 c-common.c:7006 c-common.c:7074 -#: c-common.c:7118 c-common.c:7166 c-common.c:7244 c-common.c:7268 -#: c-common.c:7554 c-common.c:7577 c-common.c:7616 c-common.c:7705 -#: c-common.c:7847 tree.c:5295 tree.c:5307 tree.c:5317 config/darwin.c:1456 -#: config/arm/arm.c:4564 config/arm/arm.c:4592 config/arm/arm.c:4609 -#: config/avr/avr.c:4818 config/h8300/h8300.c:5363 config/h8300/h8300.c:5387 -#: config/i386/i386.c:4448 config/i386/i386.c:25938 config/ia64/ia64.c:635 -#: config/m68hc11/m68hc11.c:1142 config/rs6000/rs6000.c:23518 -#: config/spu/spu.c:3919 +#: c-common.c:5838 c-common.c:5857 c-common.c:5875 c-common.c:5902 +#: c-common.c:5929 c-common.c:5955 c-common.c:5974 c-common.c:5991 +#: c-common.c:6015 c-common.c:6038 c-common.c:6061 c-common.c:6082 +#: c-common.c:6103 c-common.c:6127 c-common.c:6153 c-common.c:6190 +#: c-common.c:6217 c-common.c:6260 c-common.c:6344 c-common.c:6374 +#: c-common.c:6394 c-common.c:6732 c-common.c:6748 c-common.c:6796 +#: c-common.c:6819 c-common.c:6883 c-common.c:7011 c-common.c:7079 +#: c-common.c:7123 c-common.c:7171 c-common.c:7249 c-common.c:7273 +#: c-common.c:7559 c-common.c:7582 c-common.c:7621 c-common.c:7710 +#: c-common.c:7852 tree.c:5307 tree.c:5319 tree.c:5329 config/darwin.c:1455 +#: config/arm/arm.c:4561 config/arm/arm.c:4589 config/arm/arm.c:4606 +#: config/avr/avr.c:4818 config/h8300/h8300.c:5367 config/h8300/h8300.c:5391 +#: config/i386/i386.c:4452 config/i386/i386.c:26044 config/ia64/ia64.c:635 +#: config/m68hc11/m68hc11.c:1142 config/rs6000/rs6000.c:23564 +#: config/spu/spu.c:3909 #, fuzzy, gcc-internal-format msgid "%qE attribute ignored" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:5915 c-common.c:5941 +#: c-common.c:5920 c-common.c:5946 #, fuzzy, gcc-internal-format msgid "%qE attribute conflicts with attribute %s" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:6179 +#: c-common.c:6184 #, gcc-internal-format msgid "%qE attribute have effect only on public objects" msgstr "" -#: c-common.c:6276 +#: c-common.c:6281 #, fuzzy, gcc-internal-format msgid "destructor priorities are not supported" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-common.c:6278 +#: c-common.c:6283 #, fuzzy, gcc-internal-format msgid "constructor priorities are not supported" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-common.c:6295 +#: c-common.c:6300 #, gcc-internal-format msgid "destructor priorities from 0 to %d are reserved for the implementation" msgstr "" -#: c-common.c:6300 +#: c-common.c:6305 #, gcc-internal-format msgid "constructor priorities from 0 to %d are reserved for the implementation" msgstr "" -#: c-common.c:6308 +#: c-common.c:6313 #, gcc-internal-format msgid "destructor priorities must be integers from 0 to %d inclusive" msgstr "" -#: c-common.c:6311 +#: c-common.c:6316 #, gcc-internal-format msgid "constructor priorities must be integers from 0 to %d inclusive" msgstr "" -#: c-common.c:6433 +#: c-common.c:6438 #, fuzzy, gcc-internal-format msgid "unknown machine mode %qE" msgstr "невядомы рэжым машыны \"%s\"" -#: c-common.c:6462 +#: c-common.c:6467 #, gcc-internal-format msgid "specifying vector types with __attribute__ ((mode)) is deprecated" msgstr "" -#: c-common.c:6465 +#: c-common.c:6470 #, gcc-internal-format msgid "use __attribute__ ((vector_size)) instead" msgstr "" -#: c-common.c:6474 +#: c-common.c:6479 #, fuzzy, gcc-internal-format msgid "unable to emulate %qs" msgstr "немагу адчыніць файл \"%s\"" -#: c-common.c:6485 +#: c-common.c:6490 #, fuzzy, gcc-internal-format msgid "invalid pointer mode %qs" msgstr "Нерэчаісны выбар \"%s\"" -#: c-common.c:6502 +#: c-common.c:6507 #, gcc-internal-format msgid "signness of type and machine mode %qs don't match" msgstr "" -#: c-common.c:6513 +#: c-common.c:6518 #, fuzzy, gcc-internal-format msgid "no data type for mode %qs" msgstr "няма тыпа дадзеных для рэжыма \"%s\"" -#: c-common.c:6523 +#: c-common.c:6528 #, gcc-internal-format msgid "cannot use mode %qs for enumeral types" msgstr "" -#: c-common.c:6550 +#: c-common.c:6555 #, fuzzy, gcc-internal-format msgid "mode %qs applied to inappropriate type" msgstr "\"%s\" мае незавершаны тып" -#: c-common.c:6582 +#: c-common.c:6587 #, gcc-internal-format msgid "section attribute cannot be specified for local variables" msgstr "" -#: c-common.c:6593 config/bfin/bfin.c:5651 config/bfin/bfin.c:5702 -#: config/bfin/bfin.c:5729 config/bfin/bfin.c:5742 +#: c-common.c:6598 config/bfin/bfin.c:5652 config/bfin/bfin.c:5703 +#: config/bfin/bfin.c:5730 config/bfin/bfin.c:5743 #, fuzzy, gcc-internal-format msgid "section of %q+D conflicts with previous declaration" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: c-common.c:6601 +#: c-common.c:6606 #, fuzzy, gcc-internal-format msgid "section of %q+D cannot be overridden" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: c-common.c:6609 +#: c-common.c:6614 #, fuzzy, gcc-internal-format msgid "section attribute not allowed for %q+D" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-common.c:6616 +#: c-common.c:6621 #, gcc-internal-format msgid "section attributes are not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-common.c:6648 +#: c-common.c:6653 #, gcc-internal-format msgid "requested alignment is not a constant" msgstr "" -#: c-common.c:6653 +#: c-common.c:6658 #, gcc-internal-format msgid "requested alignment is not a power of 2" msgstr "" -#: c-common.c:6658 +#: c-common.c:6663 #, gcc-internal-format msgid "requested alignment is too large" msgstr "" -#: c-common.c:6684 +#: c-common.c:6689 #, gcc-internal-format msgid "alignment may not be specified for %q+D" msgstr "" -#: c-common.c:6691 +#: c-common.c:6696 #, gcc-internal-format msgid "alignment for %q+D was previously specified as %d and may not be decreased" msgstr "" -#: c-common.c:6695 +#: c-common.c:6700 #, fuzzy, gcc-internal-format msgid "alignment for %q+D must be at least %d" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: c-common.c:6720 +#: c-common.c:6725 #, fuzzy, gcc-internal-format msgid "inline function %q+D cannot be declared weak" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: c-common.c:6754 +#: c-common.c:6759 #, gcc-internal-format msgid "%q+D defined both normally and as an alias" msgstr "" -#: c-common.c:6770 +#: c-common.c:6775 #, fuzzy, gcc-internal-format msgid "alias argument not a string" msgstr "аргумент для \"%s\" прапушчан" -#: c-common.c:6836 +#: c-common.c:6841 #, gcc-internal-format msgid "weakref attribute must appear before alias attribute" msgstr "" -#: c-common.c:6865 +#: c-common.c:6870 #, fuzzy, gcc-internal-format msgid "%qE attribute ignored on non-class types" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:6871 +#: c-common.c:6876 #, gcc-internal-format msgid "%qE attribute ignored because %qT is already defined" msgstr "" -#: c-common.c:6884 +#: c-common.c:6889 #, fuzzy, gcc-internal-format msgid "visibility argument not a string" msgstr "аргумент для \"%s\" прапушчан" -#: c-common.c:6896 +#: c-common.c:6901 #, fuzzy, gcc-internal-format msgid "%qE attribute ignored on types" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:6912 +#: c-common.c:6917 #, gcc-internal-format msgid "visibility argument must be one of \"default\", \"hidden\", \"protected\" or \"internal\"" msgstr "" -#: c-common.c:6923 +#: c-common.c:6928 #, gcc-internal-format msgid "%qD redeclared with different visibility" msgstr "" -#: c-common.c:6926 c-common.c:6930 +#: c-common.c:6931 c-common.c:6935 #, gcc-internal-format msgid "%qD was declared %qs which implies default visibility" msgstr "" -#: c-common.c:7014 +#: c-common.c:7019 #, fuzzy, gcc-internal-format msgid "tls_model argument not a string" msgstr "не хапае аргументаў у функцыі" -#: c-common.c:7027 +#: c-common.c:7032 #, gcc-internal-format msgid "tls_model argument must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\"" msgstr "" -#: c-common.c:7047 c-common.c:7139 config/m32c/m32c.c:2853 +#: c-common.c:7052 c-common.c:7144 config/m32c/m32c.c:2853 #, fuzzy, gcc-internal-format msgid "%qE attribute applies only to functions" msgstr "\"%s\" звычайна функцыя" -#: c-common.c:7053 c-common.c:7145 +#: c-common.c:7058 c-common.c:7150 #, gcc-internal-format msgid "can%'t set %qE attribute after definition" msgstr "" -#: c-common.c:7099 +#: c-common.c:7104 #, gcc-internal-format msgid "alloc_size parameter outside range" msgstr "" -#: c-common.c:7202 +#: c-common.c:7207 #, gcc-internal-format msgid "deprecated message is not a string" msgstr "" -#: c-common.c:7242 +#: c-common.c:7247 #, fuzzy, gcc-internal-format msgid "%qE attribute ignored for %qE" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:7302 +#: c-common.c:7307 #, fuzzy, gcc-internal-format msgid "invalid vector type for attribute %qE" msgstr "нявернае выкарыстанне \"restict\"" -#: c-common.c:7308 ada/gcc-interface/utils.c:5481 +#: c-common.c:7313 ada/gcc-interface/utils.c:5481 #: ada/gcc-interface/utils.c:5575 #, gcc-internal-format msgid "vector size not an integral multiple of component size" msgstr "" -#: c-common.c:7314 ada/gcc-interface/utils.c:5487 +#: c-common.c:7319 ada/gcc-interface/utils.c:5487 #: ada/gcc-interface/utils.c:5581 #, gcc-internal-format msgid "zero vector size" msgstr "" -#: c-common.c:7322 ada/gcc-interface/utils.c:5495 +#: c-common.c:7327 ada/gcc-interface/utils.c:5495 #: ada/gcc-interface/utils.c:5588 #, gcc-internal-format msgid "number of components of the vector not a power of two" msgstr "" -#: c-common.c:7350 ada/gcc-interface/utils.c:5235 +#: c-common.c:7355 ada/gcc-interface/utils.c:5235 #, gcc-internal-format msgid "nonnull attribute without arguments on a non-prototype" msgstr "" -#: c-common.c:7365 ada/gcc-interface/utils.c:5250 +#: c-common.c:7370 ada/gcc-interface/utils.c:5250 #, gcc-internal-format msgid "nonnull argument has invalid operand number (argument %lu)" msgstr "" -#: c-common.c:7384 ada/gcc-interface/utils.c:5269 +#: c-common.c:7389 ada/gcc-interface/utils.c:5269 #, gcc-internal-format msgid "nonnull argument with out-of-range operand number (argument %lu, operand %lu)" msgstr "" -#: c-common.c:7392 ada/gcc-interface/utils.c:5277 +#: c-common.c:7397 ada/gcc-interface/utils.c:5277 #, gcc-internal-format msgid "nonnull argument references non-pointer operand (argument %lu, operand %lu)" msgstr "" -#: c-common.c:7468 +#: c-common.c:7473 #, fuzzy, gcc-internal-format msgid "not enough variable arguments to fit a sentinel" msgstr "не хапае аргументаў у функцыі" -#: c-common.c:7482 +#: c-common.c:7487 #, gcc-internal-format msgid "missing sentinel in function call" msgstr "" -#: c-common.c:7523 +#: c-common.c:7528 #, gcc-internal-format msgid "null argument where non-null required (argument %lu)" msgstr "" -#: c-common.c:7588 +#: c-common.c:7593 #, gcc-internal-format msgid "cleanup argument not an identifier" msgstr "" -#: c-common.c:7595 +#: c-common.c:7600 #, fuzzy, gcc-internal-format msgid "cleanup argument not a function" msgstr "вельмі шмат аргументаў у функцыі" -#: c-common.c:7634 +#: c-common.c:7639 #, gcc-internal-format msgid "%qE attribute requires prototypes with named arguments" msgstr "" -#: c-common.c:7645 +#: c-common.c:7650 #, fuzzy, gcc-internal-format msgid "%qE attribute only applies to variadic functions" msgstr "\"%s\" звычайна функцыя" -#: c-common.c:7657 ada/gcc-interface/utils.c:5323 +#: c-common.c:7662 ada/gcc-interface/utils.c:5323 #, fuzzy, gcc-internal-format msgid "requested position is not an integer constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: c-common.c:7665 ada/gcc-interface/utils.c:5330 +#: c-common.c:7670 ada/gcc-interface/utils.c:5330 #, gcc-internal-format msgid "requested position is less than zero" msgstr "" -#: c-common.c:7789 +#: c-common.c:7794 #, gcc-internal-format msgid "Bad option %s to optimize attribute." msgstr "" -#: c-common.c:7792 +#: c-common.c:7797 #, gcc-internal-format msgid "Bad option %s to pragma attribute" msgstr "" -#: c-common.c:7987 +#: c-common.c:7994 #, fuzzy, gcc-internal-format msgid "not enough arguments to function %qE" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: c-common.c:7992 c-typeck.c:2817 +#: c-common.c:8000 c-typeck.c:2818 #, fuzzy, gcc-internal-format msgid "too many arguments to function %qE" msgstr "вельмі шмат аргументаў у функцыі" -#: c-common.c:8022 c-common.c:8068 +#: c-common.c:8030 c-common.c:8076 #, fuzzy, gcc-internal-format msgid "non-floating-point argument in call to function %qE" msgstr "вельмі шмат аргумэнтаў у функцыі `%s'" -#: c-common.c:8045 +#: c-common.c:8053 #, fuzzy, gcc-internal-format msgid "non-floating-point arguments in call to function %qE" msgstr "вельмі шмат аргумэнтаў у функцыі `%s'" -#: c-common.c:8061 +#: c-common.c:8069 #, fuzzy, gcc-internal-format msgid "non-const integer argument %u in call to function %qE" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: c-common.c:8351 +#: c-common.c:8359 #, gcc-internal-format msgid "cannot apply % to static data member %qD" msgstr "" -#: c-common.c:8356 +#: c-common.c:8364 #, gcc-internal-format msgid "cannot apply % when % is overloaded" msgstr "" -#: c-common.c:8363 +#: c-common.c:8371 #, gcc-internal-format msgid "cannot apply % to a non constant address" msgstr "" -#: c-common.c:8376 cp/typeck.c:5004 +#: c-common.c:8384 cp/typeck.c:5091 #, fuzzy, gcc-internal-format msgid "attempt to take address of bit-field structure member %qD" msgstr "не магу атрымаць адрас бітавага поля \"%s\"" -#: c-common.c:8435 +#: c-common.c:8443 #, gcc-internal-format msgid "index %E denotes an offset greater than size of %qT" msgstr "" -#: c-common.c:8472 +#: c-common.c:8480 #, gcc-internal-format msgid "lvalue required as left operand of assignment" msgstr "" -#: c-common.c:8475 +#: c-common.c:8483 #, gcc-internal-format msgid "lvalue required as increment operand" msgstr "" -#: c-common.c:8478 +#: c-common.c:8486 #, gcc-internal-format msgid "lvalue required as decrement operand" msgstr "" -#: c-common.c:8481 +#: c-common.c:8489 #, gcc-internal-format msgid "lvalue required as unary %<&%> operand" msgstr "" -#: c-common.c:8484 +#: c-common.c:8492 #, gcc-internal-format msgid "lvalue required in asm statement" msgstr "" -#: c-common.c:8614 +#: c-common.c:8622 #, fuzzy, gcc-internal-format msgid "size of array is too large" msgstr "памер масіва \"%s\" вельмі вялікі" -#: c-common.c:8650 c-common.c:8701 c-typeck.c:3041 +#: c-common.c:8658 c-common.c:8709 c-typeck.c:3045 #, fuzzy, gcc-internal-format msgid "too few arguments to function %qE" msgstr "не хапае аргументаў у функцыі" -#: c-common.c:8667 c-typeck.c:5374 config/mep/mep.c:6341 +#: c-common.c:8675 c-typeck.c:5406 config/mep/mep.c:6321 #, gcc-internal-format msgid "incompatible type for argument %d of %qE" msgstr "" -#: c-common.c:8864 +#: c-common.c:8872 #, gcc-internal-format msgid "array subscript has type %" msgstr "" -#: c-common.c:8899 +#: c-common.c:8907 #, gcc-internal-format msgid "suggest parentheses around %<+%> inside %<<<%>" msgstr "" -#: c-common.c:8902 +#: c-common.c:8910 #, gcc-internal-format msgid "suggest parentheses around %<-%> inside %<<<%>" msgstr "" -#: c-common.c:8908 +#: c-common.c:8916 #, gcc-internal-format msgid "suggest parentheses around %<+%> inside %<>>%>" msgstr "" -#: c-common.c:8911 +#: c-common.c:8919 #, gcc-internal-format msgid "suggest parentheses around %<-%> inside %<>>%>" msgstr "" -#: c-common.c:8917 +#: c-common.c:8925 #, gcc-internal-format msgid "suggest parentheses around %<&&%> within %<||%>" msgstr "" -#: c-common.c:8926 +#: c-common.c:8934 #, gcc-internal-format msgid "suggest parentheses around arithmetic in operand of %<|%>" msgstr "" -#: c-common.c:8931 +#: c-common.c:8939 #, gcc-internal-format msgid "suggest parentheses around comparison in operand of %<|%>" msgstr "" -#: c-common.c:8935 +#: c-common.c:8943 #, gcc-internal-format msgid "suggest parentheses around operand of % or change %<|%> to %<||%> or % to %<~%>" msgstr "" -#: c-common.c:8945 +#: c-common.c:8953 #, gcc-internal-format msgid "suggest parentheses around arithmetic in operand of %<^%>" msgstr "" -#: c-common.c:8950 +#: c-common.c:8958 #, gcc-internal-format msgid "suggest parentheses around comparison in operand of %<^%>" msgstr "" -#: c-common.c:8956 +#: c-common.c:8964 #, gcc-internal-format msgid "suggest parentheses around %<+%> in operand of %<&%>" msgstr "" -#: c-common.c:8959 +#: c-common.c:8967 #, gcc-internal-format msgid "suggest parentheses around %<-%> in operand of %<&%>" msgstr "" -#: c-common.c:8964 +#: c-common.c:8972 #, gcc-internal-format msgid "suggest parentheses around comparison in operand of %<&%>" msgstr "" -#: c-common.c:8968 +#: c-common.c:8976 #, gcc-internal-format msgid "suggest parentheses around operand of % or change %<&%> to %<&&%> or % to %<~%>" msgstr "" -#: c-common.c:8976 +#: c-common.c:8984 #, gcc-internal-format msgid "suggest parentheses around comparison in operand of %<==%>" msgstr "" -#: c-common.c:8982 +#: c-common.c:8990 #, gcc-internal-format msgid "suggest parentheses around comparison in operand of %" msgstr "" -#: c-common.c:8993 +#: c-common.c:9001 #, gcc-internal-format msgid "comparisons like % do not have their mathematical meaning" msgstr "" -#: c-common.c:9008 +#: c-common.c:9016 #, fuzzy, gcc-internal-format msgid "label %q+D defined but not used" msgstr "адмеціна `%D' вызначана, але не выкарыстоўваецца" -#: c-common.c:9010 +#: c-common.c:9018 #, fuzzy, gcc-internal-format msgid "label %q+D declared but not defined" msgstr "адмеціна `%D' выкарыстоўвываецца, але ня вызначана" -#: c-common.c:9030 +#: c-common.c:9038 #, gcc-internal-format msgid "division by zero" msgstr "" -#: c-common.c:9062 +#: c-common.c:9070 #, gcc-internal-format msgid "comparison between types %qT and %qT" msgstr "" -#: c-common.c:9113 +#: c-common.c:9121 #, gcc-internal-format msgid "comparison between signed and unsigned integer expressions" msgstr "" -#: c-common.c:9164 +#: c-common.c:9172 #, gcc-internal-format msgid "promoted ~unsigned is always non-zero" msgstr "" -#: c-common.c:9167 +#: c-common.c:9175 #, gcc-internal-format msgid "comparison of promoted ~unsigned with constant" msgstr "" -#: c-common.c:9177 +#: c-common.c:9185 #, gcc-internal-format msgid "comparison of promoted ~unsigned with unsigned" msgstr "" @@ -12315,8 +12351,8 @@ msgstr "" #. an unprototyped function, it is compile-time undefined; #. making it a constraint in that case was rejected in #. DR#252. -#: c-convert.c:102 c-typeck.c:1900 c-typeck.c:4950 cp/typeck.c:1827 -#: cp/typeck.c:6328 cp/typeck.c:6953 fortran/convert.c:88 +#: c-convert.c:102 c-typeck.c:1900 c-typeck.c:4982 cp/typeck.c:1836 +#: cp/typeck.c:6415 cp/typeck.c:7040 fortran/convert.c:88 #, gcc-internal-format msgid "void value not ignored as it ought to be" msgstr "" @@ -12346,7 +12382,7 @@ msgstr "" msgid "GCC supports only %u nested scopes" msgstr "" -#: c-decl.c:1102 cp/decl.c:357 +#: c-decl.c:1102 cp/decl.c:356 #, fuzzy, gcc-internal-format msgid "label %q+D used but not defined" msgstr "адмеціна `%D' выкарыстоўвываецца, але ня вызначана" @@ -12361,7 +12397,7 @@ msgstr "\"%s\" не абвешчан (першае выкарыстанне ў msgid "inline function %q+D declared but never defined" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:1174 cp/decl.c:600 +#: c-decl.c:1174 cp/decl.c:599 #, fuzzy, gcc-internal-format msgid "unused variable %q+D" msgstr "невыкарыстоўваемая пераменная \"%s\"" @@ -12371,7 +12407,7 @@ msgstr "невыкарыстоўваемая пераменная \"%s\"" msgid "type of array %q+D completed incompatibly with implicit initialization" msgstr "" -#: c-decl.c:1462 c-decl.c:5686 c-decl.c:6464 c-decl.c:7065 +#: c-decl.c:1462 c-decl.c:5690 c-decl.c:6475 c-decl.c:7076 #, gcc-internal-format msgid "originally defined here" msgstr "" @@ -12433,7 +12469,7 @@ msgstr "" msgid "built-in function %q+D declared as non-function" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:1675 c-decl.c:1822 c-decl.c:2510 +#: c-decl.c:1675 c-decl.c:1822 c-decl.c:2514 #, fuzzy, gcc-internal-format msgid "declaration of %q+D shadows a built-in function" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" @@ -12557,198 +12593,193 @@ msgstr "перанакіраванне stdout: %s" msgid "redundant redeclaration of %q+D" msgstr "Нерэчаіснае абвяшчэнне" -#: c-decl.c:2497 +#: c-decl.c:2501 #, fuzzy, gcc-internal-format msgid "declaration of %q+D shadows previous non-variable" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: c-decl.c:2502 +#: c-decl.c:2506 #, gcc-internal-format msgid "declaration of %q+D shadows a parameter" msgstr "" -#: c-decl.c:2505 +#: c-decl.c:2509 #, gcc-internal-format msgid "declaration of %q+D shadows a global declaration" msgstr "" -#: c-decl.c:2515 +#: c-decl.c:2519 #, fuzzy, gcc-internal-format msgid "declaration of %q+D shadows a previous local" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: c-decl.c:2519 cp/name-lookup.c:1050 cp/name-lookup.c:1083 +#: c-decl.c:2523 cp/name-lookup.c:1050 cp/name-lookup.c:1083 #: cp/name-lookup.c:1092 #, fuzzy, gcc-internal-format msgid "shadowed declaration is here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:2646 +#: c-decl.c:2650 #, fuzzy, gcc-internal-format msgid "nested extern declaration of %qD" msgstr "пустое абвяшчэнне" -#: c-decl.c:2814 c-decl.c:2817 +#: c-decl.c:2818 c-decl.c:2821 #, fuzzy, gcc-internal-format msgid "implicit declaration of function %qE" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:2880 +#: c-decl.c:2884 #, fuzzy, gcc-internal-format msgid "incompatible implicit declaration of built-in function %qD" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:2889 +#: c-decl.c:2893 #, fuzzy, gcc-internal-format msgid "incompatible implicit declaration of function %qD" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:2942 +#: c-decl.c:2946 #, fuzzy, gcc-internal-format msgid "%qE undeclared here (not in a function)" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:2947 +#: c-decl.c:2951 #, fuzzy, gcc-internal-format msgid "%qE undeclared (first use in this function)" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:2951 -#, gcc-internal-format -msgid "(Each undeclared identifier is reported only once" +#: c-decl.c:2954 +#, fuzzy, gcc-internal-format +msgid "each undeclared identifier is reported only once for each function it appears in" msgstr "(Аб кожным неабвешчаным ідэнтыфікатары паведамляецца" -#: c-decl.c:2952 -#, gcc-internal-format -msgid "for each function it appears in.)" -msgstr "адзін раз для кожнай функцыі, дзе ён з'яўляецца.)" - -#: c-decl.c:3001 cp/decl.c:2443 +#: c-decl.c:3004 cp/decl.c:2446 #, gcc-internal-format msgid "label %qE referenced outside of any function" msgstr "" -#: c-decl.c:3037 +#: c-decl.c:3040 #, gcc-internal-format msgid "jump into scope of identifier with variably modified type" msgstr "" -#: c-decl.c:3040 +#: c-decl.c:3043 #, fuzzy, gcc-internal-format msgid "jump skips variable initialization" msgstr "нерэчаісны ініцыялізатар" -#: c-decl.c:3041 c-decl.c:3097 c-decl.c:3182 +#: c-decl.c:3044 c-decl.c:3100 c-decl.c:3185 #, fuzzy, gcc-internal-format msgid "label %qD defined here" msgstr "адмеціна `%D' вызначана, але не выкарыстоўваецца" -#: c-decl.c:3042 c-decl.c:3306 +#: c-decl.c:3045 c-decl.c:3309 #, fuzzy, gcc-internal-format msgid "%qD declared here" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:3096 c-decl.c:3181 +#: c-decl.c:3099 c-decl.c:3184 #, gcc-internal-format msgid "jump into statement expression" msgstr "" -#: c-decl.c:3118 +#: c-decl.c:3121 #, fuzzy, gcc-internal-format msgid "duplicate label declaration %qE" msgstr "паўторнае абвяшчэньне адмеціны `%s'" -#: c-decl.c:3212 cp/decl.c:2752 +#: c-decl.c:3215 cp/decl.c:2755 #, fuzzy, gcc-internal-format msgid "duplicate label %qD" msgstr "паўтарэнне \"%s\"" -#: c-decl.c:3243 +#: c-decl.c:3246 #, gcc-internal-format msgid "traditional C lacks a separate namespace for labels, identifier %qE conflicts" msgstr "" -#: c-decl.c:3304 +#: c-decl.c:3307 #, gcc-internal-format msgid "switch jumps over variable initialization" msgstr "" -#: c-decl.c:3305 c-decl.c:3316 +#: c-decl.c:3308 c-decl.c:3319 #, gcc-internal-format msgid "switch starts here" msgstr "" -#: c-decl.c:3315 +#: c-decl.c:3318 #, gcc-internal-format msgid "switch jumps into statement expression" msgstr "" -#: c-decl.c:3386 +#: c-decl.c:3389 #, gcc-internal-format msgid "%qE defined as wrong kind of tag" msgstr "" -#: c-decl.c:3618 +#: c-decl.c:3621 #, gcc-internal-format msgid "unnamed struct/union that defines no instances" msgstr "" -#: c-decl.c:3627 +#: c-decl.c:3630 #, gcc-internal-format msgid "empty declaration with storage class specifier does not redeclare tag" msgstr "" -#: c-decl.c:3640 +#: c-decl.c:3643 #, gcc-internal-format msgid "empty declaration with type qualifier does not redeclare tag" msgstr "" -#: c-decl.c:3662 c-decl.c:3669 +#: c-decl.c:3665 c-decl.c:3672 #, fuzzy, gcc-internal-format msgid "useless type name in empty declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c-decl.c:3677 +#: c-decl.c:3680 #, fuzzy, gcc-internal-format msgid "% in empty declaration" msgstr "пустое абвяшчэньне" -#: c-decl.c:3683 +#: c-decl.c:3686 #, gcc-internal-format msgid "% in file-scope empty declaration" msgstr "" -#: c-decl.c:3689 +#: c-decl.c:3692 #, gcc-internal-format msgid "% in file-scope empty declaration" msgstr "" -#: c-decl.c:3695 +#: c-decl.c:3698 #, fuzzy, gcc-internal-format msgid "useless storage class specifier in empty declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c-decl.c:3701 +#: c-decl.c:3704 #, gcc-internal-format msgid "useless %<__thread%> in empty declaration" msgstr "" -#: c-decl.c:3710 +#: c-decl.c:3713 #, fuzzy, gcc-internal-format msgid "useless type qualifier in empty declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c-decl.c:3717 c-parser.c:1198 +#: c-decl.c:3720 c-parser.c:1198 #, gcc-internal-format msgid "empty declaration" msgstr "пустое абвяшчэньне" -#: c-decl.c:3788 +#: c-decl.c:3791 #, fuzzy, gcc-internal-format msgid "ISO C90 does not support % or type qualifiers in parameter array declarators" msgstr "ISO C89 не падтрымлівае \"long long\"" -#: c-decl.c:3792 +#: c-decl.c:3795 #, fuzzy, gcc-internal-format msgid "ISO C90 does not support %<[*]%> array declarators" msgstr "ISO C89 не падтрымлівае \"long long\"" @@ -12756,283 +12787,283 @@ msgstr "ISO C89 не падтрымлівае \"long long\"" #. C99 6.7.5.2p4 #. A function definition isn't function prototype scope C99 6.2.1p4. #. C99 6.7.5.2p4 -#: c-decl.c:3799 c-decl.c:6060 +#: c-decl.c:3802 c-decl.c:6064 #, gcc-internal-format msgid "%<[*]%> not allowed in other than function prototype scope" msgstr "" -#: c-decl.c:3912 +#: c-decl.c:3915 #, fuzzy, gcc-internal-format msgid "%q+D is usually a function" msgstr "`%s' - звычайна функцыя" -#: c-decl.c:3921 +#: c-decl.c:3924 #, fuzzy, gcc-internal-format msgid "typedef %qD is initialized (use __typeof__ instead)" msgstr "параметр \"%s\" ініцыялізаваны" -#: c-decl.c:3926 +#: c-decl.c:3929 #, gcc-internal-format msgid "function %qD is initialized like a variable" msgstr "" #. DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE. -#: c-decl.c:3932 +#: c-decl.c:3935 #, fuzzy, gcc-internal-format msgid "parameter %qD is initialized" msgstr "параметр \"%s\" ініцыялізаваны" -#: c-decl.c:3957 +#: c-decl.c:3960 #, fuzzy, gcc-internal-format msgid "variable %qD has initializer but incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:4046 cp/decl.c:4171 cp/decl.c:11714 +#: c-decl.c:4049 cp/decl.c:4174 cp/decl.c:11712 #, fuzzy, gcc-internal-format msgid "inline function %q+D given attribute noinline" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:4143 +#: c-decl.c:4146 #, gcc-internal-format msgid "initializer fails to determine size of %q+D" msgstr "" -#: c-decl.c:4148 +#: c-decl.c:4151 #, fuzzy, gcc-internal-format msgid "array size missing in %q+D" msgstr "прапушчан памер масіва ў `%D'" -#: c-decl.c:4160 +#: c-decl.c:4163 #, fuzzy, gcc-internal-format msgid "zero or negative size array %q+D" msgstr "нулявы памер масіва `%D'" -#: c-decl.c:4215 varasm.c:2139 +#: c-decl.c:4218 varasm.c:2180 #, gcc-internal-format msgid "storage size of %q+D isn%'t known" msgstr "" -#: c-decl.c:4226 +#: c-decl.c:4229 #, fuzzy, gcc-internal-format msgid "storage size of %q+D isn%'t constant" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:4273 +#: c-decl.c:4276 #, gcc-internal-format msgid "ignoring asm-specifier for non-static local variable %q+D" msgstr "" -#: c-decl.c:4301 +#: c-decl.c:4304 #, gcc-internal-format msgid "cannot put object with volatile field into register" msgstr "" -#: c-decl.c:4391 +#: c-decl.c:4394 #, fuzzy, gcc-internal-format msgid "uninitialized const %qD is invalid in C++" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: c-decl.c:4437 +#: c-decl.c:4440 #, gcc-internal-format msgid "ISO C forbids forward parameter declarations" msgstr "" -#: c-decl.c:4523 +#: c-decl.c:4527 #, gcc-internal-format msgid "defining a type in a compound literal is invalid in C++" msgstr "" -#: c-decl.c:4575 c-decl.c:4590 +#: c-decl.c:4579 c-decl.c:4594 #, fuzzy, gcc-internal-format msgid "bit-field %qs width not an integer constant" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: c-decl.c:4585 +#: c-decl.c:4589 #, fuzzy, gcc-internal-format msgid "bit-field %qs width not an integer constant expression" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:4596 +#: c-decl.c:4600 #, gcc-internal-format msgid "negative width in bit-field %qs" msgstr "" -#: c-decl.c:4601 +#: c-decl.c:4605 #, gcc-internal-format msgid "zero width for bit-field %qs" msgstr "" -#: c-decl.c:4611 +#: c-decl.c:4615 #, fuzzy, gcc-internal-format msgid "bit-field %qs has invalid type" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: c-decl.c:4621 +#: c-decl.c:4625 #, gcc-internal-format msgid "type of bit-field %qs is a GCC extension" msgstr "" -#: c-decl.c:4627 +#: c-decl.c:4631 #, gcc-internal-format msgid "width of %qs exceeds its type" msgstr "" -#: c-decl.c:4640 +#: c-decl.c:4644 #, gcc-internal-format msgid "%qs is narrower than values of its type" msgstr "" -#: c-decl.c:4659 +#: c-decl.c:4663 #, gcc-internal-format msgid "ISO C90 forbids array %qE whose size can%'t be evaluated" msgstr "" -#: c-decl.c:4663 +#: c-decl.c:4667 #, gcc-internal-format msgid "ISO C90 forbids array whose size can%'t be evaluated" msgstr "" -#: c-decl.c:4670 +#: c-decl.c:4674 #, fuzzy, gcc-internal-format msgid "ISO C90 forbids variable length array %qE" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-decl.c:4673 +#: c-decl.c:4677 #, fuzzy, gcc-internal-format msgid "ISO C90 forbids variable length array" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-decl.c:4682 +#: c-decl.c:4686 #, fuzzy, gcc-internal-format msgid "the size of array %qE can%'t be evaluated" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:4686 +#: c-decl.c:4690 #, fuzzy, gcc-internal-format msgid "the size of array can %'t be evaluated" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:4692 +#: c-decl.c:4696 #, gcc-internal-format msgid "variable length array %qE is used" msgstr "" -#: c-decl.c:4696 cp/decl.c:7363 +#: c-decl.c:4700 cp/decl.c:7366 #, gcc-internal-format msgid "variable length array is used" msgstr "" -#: c-decl.c:4874 c-decl.c:5220 c-decl.c:5230 +#: c-decl.c:4878 c-decl.c:5224 c-decl.c:5234 #, gcc-internal-format msgid "variably modified %qE at file scope" msgstr "" -#: c-decl.c:4876 +#: c-decl.c:4880 #, gcc-internal-format msgid "variably modified field at file scope" msgstr "" -#: c-decl.c:4896 +#: c-decl.c:4900 #, gcc-internal-format msgid "type defaults to % in declaration of %qE" msgstr "" -#: c-decl.c:4900 +#: c-decl.c:4904 #, gcc-internal-format msgid "type defaults to % in type name" msgstr "" -#: c-decl.c:4933 +#: c-decl.c:4937 #, fuzzy, gcc-internal-format msgid "duplicate %" msgstr "паўтарэнне \"const\"" -#: c-decl.c:4935 +#: c-decl.c:4939 #, fuzzy, gcc-internal-format msgid "duplicate %" msgstr "паўтарэнне \"restrict\"" -#: c-decl.c:4937 +#: c-decl.c:4941 #, fuzzy, gcc-internal-format msgid "duplicate %" msgstr "паўтарэнне \"volatile\"" -#: c-decl.c:4941 +#: c-decl.c:4945 #, gcc-internal-format msgid "conflicting named address spaces (%s vs %s)" msgstr "" -#: c-decl.c:4963 +#: c-decl.c:4967 #, gcc-internal-format msgid "function definition declared %" msgstr "" -#: c-decl.c:4965 +#: c-decl.c:4969 #, fuzzy, gcc-internal-format msgid "function definition declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: c-decl.c:4967 +#: c-decl.c:4971 #, gcc-internal-format msgid "function definition declared %" msgstr "" -#: c-decl.c:4969 +#: c-decl.c:4973 #, fuzzy, gcc-internal-format msgid "function definition declared %<__thread%>" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: c-decl.c:4986 +#: c-decl.c:4990 #, gcc-internal-format msgid "storage class specified for structure field %qE" msgstr "" -#: c-decl.c:4989 +#: c-decl.c:4993 #, gcc-internal-format msgid "storage class specified for structure field" msgstr "" -#: c-decl.c:4993 +#: c-decl.c:4997 #, gcc-internal-format msgid "storage class specified for parameter %qE" msgstr "" -#: c-decl.c:4996 +#: c-decl.c:5000 #, gcc-internal-format msgid "storage class specified for unnamed parameter" msgstr "" -#: c-decl.c:4999 cp/decl.c:8291 +#: c-decl.c:5003 cp/decl.c:8294 #, gcc-internal-format msgid "storage class specified for typename" msgstr "" -#: c-decl.c:5016 +#: c-decl.c:5020 #, gcc-internal-format msgid "%qE initialized and declared %" msgstr "" -#: c-decl.c:5020 +#: c-decl.c:5024 #, gcc-internal-format msgid "%qE has both % and initializer" msgstr "" -#: c-decl.c:5025 +#: c-decl.c:5029 #, gcc-internal-format msgid "file-scope declaration of %qE specifies %" msgstr "" -#: c-decl.c:5029 +#: c-decl.c:5033 #, gcc-internal-format msgid "file-scope declaration of %qE specifies %" msgstr "" -#: c-decl.c:5034 +#: c-decl.c:5038 #, gcc-internal-format msgid "nested function %qE declared %" msgstr "" -#: c-decl.c:5037 +#: c-decl.c:5041 #, gcc-internal-format msgid "function-scope %qE implicitly auto and declared %<__thread%>" msgstr "" @@ -13040,577 +13071,577 @@ msgstr "" #. Only the innermost declarator (making a parameter be of #. array type which is converted to pointer type) #. may have static or type qualifiers. -#: c-decl.c:5084 c-decl.c:5414 +#: c-decl.c:5088 c-decl.c:5418 #, gcc-internal-format msgid "static or type qualifiers in non-parameter array declarator" msgstr "" -#: c-decl.c:5132 +#: c-decl.c:5136 #, gcc-internal-format msgid "declaration of %qE as array of voids" msgstr "" -#: c-decl.c:5134 +#: c-decl.c:5138 #, gcc-internal-format msgid "declaration of type name as array of voids" msgstr "" -#: c-decl.c:5141 +#: c-decl.c:5145 #, gcc-internal-format msgid "declaration of %qE as array of functions" msgstr "" -#: c-decl.c:5144 +#: c-decl.c:5148 #, gcc-internal-format msgid "declaration of type name as array of functions" msgstr "" -#: c-decl.c:5151 c-decl.c:6851 +#: c-decl.c:5155 c-decl.c:6862 #, fuzzy, gcc-internal-format msgid "invalid use of structure with flexible array member" msgstr "нявернае выкарыстанне \"restict\"" -#: c-decl.c:5177 +#: c-decl.c:5181 #, fuzzy, gcc-internal-format msgid "size of array %qE has non-integer type" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:5181 +#: c-decl.c:5185 #, fuzzy, gcc-internal-format msgid "size of unnamed array has non-integer type" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:5191 +#: c-decl.c:5195 #, fuzzy, gcc-internal-format msgid "ISO C forbids zero-size array %qE" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-decl.c:5194 +#: c-decl.c:5198 #, fuzzy, gcc-internal-format msgid "ISO C forbids zero-size array" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-decl.c:5203 +#: c-decl.c:5207 #, fuzzy, gcc-internal-format msgid "size of array %qE is negative" msgstr "адмоўны памер масіва " -#: c-decl.c:5205 +#: c-decl.c:5209 #, fuzzy, gcc-internal-format msgid "size of unnamed array is negative" msgstr "адмоўны памер масіва " -#: c-decl.c:5281 c-decl.c:5645 +#: c-decl.c:5285 c-decl.c:5649 #, fuzzy, gcc-internal-format msgid "size of array %qE is too large" msgstr "памер масіва \"%s\" вельмі вялікі" -#: c-decl.c:5284 c-decl.c:5647 +#: c-decl.c:5288 c-decl.c:5651 #, fuzzy, gcc-internal-format msgid "size of unnamed array is too large" msgstr "памер масіва \"%s\" вельмі вялікі" -#: c-decl.c:5321 +#: c-decl.c:5325 #, fuzzy, gcc-internal-format msgid "ISO C90 does not support flexible array members" msgstr "ISO C89 не падтрымлівае комлексныя тыпы" #. C99 6.7.5.2p4 -#: c-decl.c:5342 +#: c-decl.c:5346 #, fuzzy, gcc-internal-format msgid "%<[*]%> not in a declaration" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: c-decl.c:5355 +#: c-decl.c:5359 #, gcc-internal-format msgid "array type has incomplete element type" msgstr "" -#: c-decl.c:5447 +#: c-decl.c:5451 #, fuzzy, gcc-internal-format msgid "%qE declared as function returning a function" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:5450 +#: c-decl.c:5454 #, gcc-internal-format msgid "type name declared as function returning a function" msgstr "" -#: c-decl.c:5457 +#: c-decl.c:5461 #, gcc-internal-format msgid "%qE declared as function returning an array" msgstr "" -#: c-decl.c:5460 +#: c-decl.c:5464 #, gcc-internal-format msgid "type name declared as function returning an array" msgstr "" -#: c-decl.c:5490 +#: c-decl.c:5494 #, fuzzy, gcc-internal-format msgid "function definition has qualified void return type" msgstr "функцыя не вяртае тып string" -#: c-decl.c:5493 cp/decl.c:8397 +#: c-decl.c:5497 cp/decl.c:8400 #, gcc-internal-format msgid "type qualifiers ignored on function return type" msgstr "" -#: c-decl.c:5523 c-decl.c:5661 c-decl.c:5771 c-decl.c:5864 +#: c-decl.c:5527 c-decl.c:5665 c-decl.c:5775 c-decl.c:5868 #, gcc-internal-format msgid "ISO C forbids qualified function types" msgstr "" -#: c-decl.c:5590 +#: c-decl.c:5594 #, gcc-internal-format msgid "%qs combined with % qualifier for %qE" msgstr "" -#: c-decl.c:5594 +#: c-decl.c:5598 #, gcc-internal-format msgid "%qs combined with % qualifier for %qE" msgstr "" -#: c-decl.c:5600 +#: c-decl.c:5604 #, gcc-internal-format msgid "%qs specified for auto variable %qE" msgstr "" -#: c-decl.c:5616 +#: c-decl.c:5620 #, gcc-internal-format msgid "%qs specified for parameter %qE" msgstr "" -#: c-decl.c:5619 +#: c-decl.c:5623 #, gcc-internal-format msgid "%qs specified for unnamed parameter" msgstr "" -#: c-decl.c:5625 +#: c-decl.c:5629 #, gcc-internal-format msgid "%qs specified for structure field %qE" msgstr "" -#: c-decl.c:5628 +#: c-decl.c:5632 #, gcc-internal-format msgid "%qs specified for structure field" msgstr "" -#: c-decl.c:5669 +#: c-decl.c:5673 #, gcc-internal-format msgid "typedef %q+D declared %" msgstr "" -#: c-decl.c:5705 +#: c-decl.c:5709 #, gcc-internal-format msgid "ISO C forbids const or volatile function types" msgstr "" #. C99 6.7.2.1p8 -#: c-decl.c:5715 +#: c-decl.c:5719 #, gcc-internal-format msgid "a member of a structure or union cannot have a variably modified type" msgstr "" -#: c-decl.c:5732 cp/decl.c:7577 +#: c-decl.c:5736 cp/decl.c:7580 #, fuzzy, gcc-internal-format msgid "variable or field %qE declared void" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:5763 +#: c-decl.c:5767 #, gcc-internal-format msgid "attributes in parameter array declarator ignored" msgstr "" -#: c-decl.c:5797 +#: c-decl.c:5801 #, fuzzy, gcc-internal-format msgid "parameter %q+D declared %" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:5810 +#: c-decl.c:5814 #, fuzzy, gcc-internal-format msgid "field %qE declared as a function" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:5817 +#: c-decl.c:5821 #, fuzzy, gcc-internal-format msgid "field %qE has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:5819 +#: c-decl.c:5823 #, fuzzy, gcc-internal-format msgid "unnamed field has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:5836 c-decl.c:5847 c-decl.c:5850 +#: c-decl.c:5840 c-decl.c:5851 c-decl.c:5854 #, fuzzy, gcc-internal-format msgid "invalid storage class for function %qE" msgstr "Нерэчаісны выбар \"%s\"" -#: c-decl.c:5870 +#: c-decl.c:5874 #, gcc-internal-format msgid "% function returns non-void value" msgstr "" -#: c-decl.c:5906 +#: c-decl.c:5910 #, fuzzy, gcc-internal-format msgid "cannot inline function %" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: c-decl.c:5935 +#: c-decl.c:5939 #, gcc-internal-format msgid "variable previously declared % redeclared %" msgstr "" -#: c-decl.c:5945 +#: c-decl.c:5949 #, gcc-internal-format msgid "variable %q+D declared %" msgstr "" -#: c-decl.c:5980 +#: c-decl.c:5984 #, gcc-internal-format msgid "non-nested function with variably modified type" msgstr "" -#: c-decl.c:5982 +#: c-decl.c:5986 #, gcc-internal-format msgid "object with variably modified type must have no linkage" msgstr "" -#: c-decl.c:6065 c-decl.c:7481 +#: c-decl.c:6069 c-decl.c:7492 #, gcc-internal-format msgid "function declaration isn%'t a prototype" msgstr "" -#: c-decl.c:6073 +#: c-decl.c:6077 #, gcc-internal-format msgid "parameter names (without types) in function declaration" msgstr "" -#: c-decl.c:6108 +#: c-decl.c:6112 #, fuzzy, gcc-internal-format msgid "parameter %u (%q+D) has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:6112 +#: c-decl.c:6116 #, fuzzy, gcc-internal-format msgid "parameter %u has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:6122 +#: c-decl.c:6127 #, fuzzy, gcc-internal-format msgid "parameter %u (%q+D) has void type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:6126 +#: c-decl.c:6131 #, fuzzy, gcc-internal-format msgid "parameter %u has void type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:6196 +#: c-decl.c:6202 #, gcc-internal-format msgid "% as only parameter may not be qualified" msgstr "" -#: c-decl.c:6200 c-decl.c:6234 +#: c-decl.c:6206 c-decl.c:6240 #, fuzzy, gcc-internal-format msgid "% must be the only parameter" msgstr "нявернае выкарыстанне \"restict\"" -#: c-decl.c:6228 +#: c-decl.c:6234 #, gcc-internal-format msgid "parameter %q+D has just a forward declaration" msgstr "" #. The %s will be one of 'struct', 'union', or 'enum'. -#: c-decl.c:6273 +#: c-decl.c:6279 #, gcc-internal-format msgid "%<%s %E%> declared inside parameter list" msgstr "" #. The %s will be one of 'struct', 'union', or 'enum'. -#: c-decl.c:6277 +#: c-decl.c:6283 #, gcc-internal-format msgid "anonymous %s declared inside parameter list" msgstr "" -#: c-decl.c:6282 +#: c-decl.c:6288 #, gcc-internal-format msgid "its scope is only this definition or declaration, which is probably not what you want" msgstr "" -#: c-decl.c:6375 +#: c-decl.c:6386 #, gcc-internal-format msgid "enum type defined here" msgstr "" -#: c-decl.c:6381 +#: c-decl.c:6392 #, fuzzy, gcc-internal-format msgid "struct defined here" msgstr "папярэдняе вызначэньне" -#: c-decl.c:6387 +#: c-decl.c:6398 #, fuzzy, gcc-internal-format msgid "union defined here" msgstr "папярэдняе вызначэньне" -#: c-decl.c:6460 +#: c-decl.c:6471 #, fuzzy, gcc-internal-format msgid "redefinition of %" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:6462 +#: c-decl.c:6473 #, fuzzy, gcc-internal-format msgid "redefinition of %" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:6471 +#: c-decl.c:6482 #, fuzzy, gcc-internal-format msgid "nested redefinition of %" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:6473 +#: c-decl.c:6484 #, fuzzy, gcc-internal-format msgid "nested redefinition of %" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:6505 c-decl.c:7083 +#: c-decl.c:6516 c-decl.c:7094 #, gcc-internal-format msgid "defining type in %qs expression is invalid in C++" msgstr "" -#: c-decl.c:6572 cp/decl.c:3907 +#: c-decl.c:6583 cp/decl.c:3910 #, gcc-internal-format msgid "declaration does not declare anything" msgstr "" -#: c-decl.c:6575 +#: c-decl.c:6586 #, fuzzy, gcc-internal-format msgid "ISO C doesn%'t support unnamed structs/unions" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: c-decl.c:6638 c-decl.c:6654 +#: c-decl.c:6649 c-decl.c:6665 #, fuzzy, gcc-internal-format msgid "duplicate member %q+D" msgstr "паўтарэнне \"%s\"" -#: c-decl.c:6757 +#: c-decl.c:6768 #, gcc-internal-format msgid "union has no named members" msgstr "" -#: c-decl.c:6759 +#: c-decl.c:6770 #, gcc-internal-format msgid "union has no members" msgstr "" -#: c-decl.c:6764 +#: c-decl.c:6775 #, gcc-internal-format msgid "struct has no named members" msgstr "" -#: c-decl.c:6766 +#: c-decl.c:6777 #, gcc-internal-format msgid "struct has no members" msgstr "" -#: c-decl.c:6831 +#: c-decl.c:6842 #, gcc-internal-format msgid "flexible array member in union" msgstr "" -#: c-decl.c:6837 +#: c-decl.c:6848 #, gcc-internal-format msgid "flexible array member not at end of struct" msgstr "" -#: c-decl.c:6843 +#: c-decl.c:6854 #, gcc-internal-format msgid "flexible array member in otherwise empty struct" msgstr "" -#: c-decl.c:6960 +#: c-decl.c:6971 #, gcc-internal-format msgid "union cannot be made transparent" msgstr "" -#: c-decl.c:7056 +#: c-decl.c:7067 #, fuzzy, gcc-internal-format msgid "nested redefinition of %" msgstr "перанакіраванне stdout: %s" #. This enum is a named one that has been declared already. -#: c-decl.c:7063 +#: c-decl.c:7074 #, fuzzy, gcc-internal-format msgid "redeclaration of %" msgstr "абвяшчэньне `%#D'" -#: c-decl.c:7138 +#: c-decl.c:7149 #, gcc-internal-format msgid "enumeration values exceed range of largest integer" msgstr "" -#: c-decl.c:7155 +#: c-decl.c:7166 #, gcc-internal-format msgid "specified mode too small for enumeral values" msgstr "" -#: c-decl.c:7259 c-decl.c:7275 +#: c-decl.c:7270 c-decl.c:7286 #, fuzzy, gcc-internal-format msgid "enumerator value for %qE is not an integer constant" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:7270 +#: c-decl.c:7281 #, fuzzy, gcc-internal-format msgid "enumerator value for %qE is not an integer constant expression" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:7294 +#: c-decl.c:7305 #, gcc-internal-format msgid "overflow in enumeration values" msgstr "" -#: c-decl.c:7302 +#: c-decl.c:7313 #, gcc-internal-format msgid "ISO C restricts enumerator values to range of %" msgstr "" -#: c-decl.c:7387 +#: c-decl.c:7398 #, fuzzy, gcc-internal-format msgid "inline function %qD given attribute noinline" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:7405 +#: c-decl.c:7416 #, gcc-internal-format msgid "return type is an incomplete type" msgstr "" -#: c-decl.c:7415 +#: c-decl.c:7426 #, fuzzy, gcc-internal-format msgid "return type defaults to %" msgstr "вяртаемы тып \"%s\" не \"int\"" -#: c-decl.c:7489 +#: c-decl.c:7500 #, fuzzy, gcc-internal-format msgid "no previous prototype for %qD" msgstr "няма папярэдняга прататыпа для \"%s\"" -#: c-decl.c:7498 +#: c-decl.c:7509 #, fuzzy, gcc-internal-format msgid "%qD was used with no prototype before its definition" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:7505 +#: c-decl.c:7516 #, fuzzy, gcc-internal-format msgid "no previous declaration for %qD" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:7515 +#: c-decl.c:7526 #, fuzzy, gcc-internal-format msgid "%qD was used with no declaration before its definition" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:7538 +#: c-decl.c:7549 #, fuzzy, gcc-internal-format msgid "return type of %qD is not %" msgstr "вяртаемы тып \"%s\" не \"int\"" -#: c-decl.c:7544 +#: c-decl.c:7555 #, fuzzy, gcc-internal-format msgid "%qD is normally a non-static function" msgstr "`%s' - звычайна функцыя" -#: c-decl.c:7579 +#: c-decl.c:7590 #, gcc-internal-format msgid "old-style parameter declarations in prototyped function definition" msgstr "" -#: c-decl.c:7593 +#: c-decl.c:7604 #, gcc-internal-format msgid "traditional C rejects ISO C style function definitions" msgstr "" -#: c-decl.c:7609 +#: c-decl.c:7620 #, gcc-internal-format msgid "parameter name omitted" msgstr "" -#: c-decl.c:7644 +#: c-decl.c:7657 #, gcc-internal-format msgid "old-style function definition" msgstr "" -#: c-decl.c:7653 +#: c-decl.c:7666 #, gcc-internal-format msgid "parameter name missing from parameter list" msgstr "" -#: c-decl.c:7665 +#: c-decl.c:7678 #, gcc-internal-format msgid "%qD declared as a non-parameter" msgstr "" -#: c-decl.c:7671 +#: c-decl.c:7684 #, fuzzy, gcc-internal-format msgid "multiple parameters named %qD" msgstr "невыкарыстаемы параметр \"%s\"" -#: c-decl.c:7680 +#: c-decl.c:7693 #, fuzzy, gcc-internal-format msgid "parameter %qD declared with void type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:7709 c-decl.c:7713 +#: c-decl.c:7722 c-decl.c:7726 #, gcc-internal-format msgid "type of %qD defaults to %" msgstr "" -#: c-decl.c:7733 +#: c-decl.c:7746 #, fuzzy, gcc-internal-format msgid "parameter %qD has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:7740 +#: c-decl.c:7753 #, gcc-internal-format msgid "declaration for parameter %qD but no such parameter" msgstr "" -#: c-decl.c:7792 +#: c-decl.c:7805 #, gcc-internal-format msgid "number of arguments doesn%'t match built-in prototype" msgstr "" -#: c-decl.c:7803 +#: c-decl.c:7816 #, fuzzy, gcc-internal-format msgid "number of arguments doesn%'t match prototype" msgstr "памылковая колькасьць аргументаў, зададзеных для атрыбута `%s'" -#: c-decl.c:7806 c-decl.c:7848 c-decl.c:7862 +#: c-decl.c:7819 c-decl.c:7861 c-decl.c:7875 #, fuzzy, gcc-internal-format msgid "prototype declaration" msgstr "пустое абвяшчэньне" -#: c-decl.c:7840 +#: c-decl.c:7853 #, gcc-internal-format msgid "promoted argument %qD doesn%'t match built-in prototype" msgstr "" -#: c-decl.c:7845 +#: c-decl.c:7858 #, gcc-internal-format msgid "promoted argument %qD doesn%'t match prototype" msgstr "" -#: c-decl.c:7855 +#: c-decl.c:7868 #, gcc-internal-format msgid "argument %qD doesn%'t match built-in prototype" msgstr "" -#: c-decl.c:7860 +#: c-decl.c:7873 #, gcc-internal-format msgid "argument %qD doesn%'t match prototype" msgstr "" -#: c-decl.c:8046 cp/decl.c:12562 +#: c-decl.c:8059 cp/decl.c:12560 #, gcc-internal-format msgid "no return statement in function returning non-void" msgstr "" @@ -13618,162 +13649,162 @@ msgstr "" #. If we get here, declarations have been used in a for loop without #. the C99 for loop scope. This doesn't make much sense, so don't #. allow it. -#: c-decl.c:8119 +#: c-decl.c:8132 #, gcc-internal-format msgid "% loop initial declarations are only allowed in C99 mode" msgstr "" -#: c-decl.c:8124 +#: c-decl.c:8137 #, gcc-internal-format msgid "use option -std=c99 or -std=gnu99 to compile your code" msgstr "" -#: c-decl.c:8158 +#: c-decl.c:8171 #, gcc-internal-format msgid "declaration of static variable %qD in % loop initial declaration" msgstr "" -#: c-decl.c:8162 +#: c-decl.c:8175 #, gcc-internal-format msgid "declaration of % variable %qD in % loop initial declaration" msgstr "" -#: c-decl.c:8169 +#: c-decl.c:8182 #, gcc-internal-format msgid "% declared in % loop initial declaration" msgstr "" -#: c-decl.c:8174 +#: c-decl.c:8187 #, gcc-internal-format msgid "% declared in % loop initial declaration" msgstr "" -#: c-decl.c:8178 +#: c-decl.c:8191 #, gcc-internal-format msgid "% declared in % loop initial declaration" msgstr "" -#: c-decl.c:8182 +#: c-decl.c:8195 #, gcc-internal-format msgid "declaration of non-variable %qD in % loop initial declaration" msgstr "" -#: c-decl.c:8433 +#: c-decl.c:8446 #, gcc-internal-format msgid "incompatible address space qualifiers %qs and %qs" msgstr "" -#: c-decl.c:8472 c-decl.c:8769 c-decl.c:9135 +#: c-decl.c:8485 c-decl.c:8782 c-decl.c:9148 #, fuzzy, gcc-internal-format msgid "duplicate %qE" msgstr "паўтарэньне `%s'" -#: c-decl.c:8498 c-decl.c:8780 c-decl.c:9012 +#: c-decl.c:8511 c-decl.c:8793 c-decl.c:9025 #, gcc-internal-format msgid "two or more data types in declaration specifiers" msgstr "" -#: c-decl.c:8510 cp/parser.c:2185 +#: c-decl.c:8523 cp/parser.c:2187 #, fuzzy, gcc-internal-format msgid "% is too long for GCC" msgstr "`long long long' - вельмі доўга для GCC" -#: c-decl.c:8523 +#: c-decl.c:8536 #, fuzzy, gcc-internal-format msgid "ISO C90 does not support %" msgstr "ISO C89 не падтрымлівае `long long'" -#: c-decl.c:8681 +#: c-decl.c:8694 #, fuzzy, gcc-internal-format msgid "ISO C90 does not support complex types" msgstr "ISO C89 не падтрымлівае комлексныя тыпы" -#: c-decl.c:8720 +#: c-decl.c:8733 #, fuzzy, gcc-internal-format msgid "ISO C does not support saturating types" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: c-decl.c:8971 +#: c-decl.c:8984 #, fuzzy, gcc-internal-format msgid "ISO C does not support decimal floating point" msgstr "ISO C89 не падтрымлівае `long long'" -#: c-decl.c:8993 c-decl.c:9196 c-parser.c:5372 +#: c-decl.c:9006 c-decl.c:9209 c-parser.c:5372 #, fuzzy, gcc-internal-format msgid "fixed-point types not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-decl.c:8995 +#: c-decl.c:9008 #, fuzzy, gcc-internal-format msgid "ISO C does not support fixed-point types" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: c-decl.c:9029 +#: c-decl.c:9042 #, gcc-internal-format msgid "C++ lookup of %qD would return a field, not a type" msgstr "" -#: c-decl.c:9042 +#: c-decl.c:9055 #, gcc-internal-format msgid "%qE fails to be a typedef or built in type" msgstr "" -#: c-decl.c:9086 +#: c-decl.c:9099 #, fuzzy, gcc-internal-format msgid "%qE is not at beginning of declaration" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: c-decl.c:9100 +#: c-decl.c:9113 #, gcc-internal-format msgid "%<__thread%> used with %" msgstr "" -#: c-decl.c:9102 +#: c-decl.c:9115 #, gcc-internal-format msgid "%<__thread%> used with %" msgstr "" -#: c-decl.c:9104 +#: c-decl.c:9117 #, gcc-internal-format msgid "%<__thread%> used with %" msgstr "" -#: c-decl.c:9115 +#: c-decl.c:9128 #, gcc-internal-format msgid "%<__thread%> before %" msgstr "" -#: c-decl.c:9124 +#: c-decl.c:9137 #, gcc-internal-format msgid "%<__thread%> before %" msgstr "" -#: c-decl.c:9140 +#: c-decl.c:9153 #, gcc-internal-format msgid "multiple storage classes in declaration specifiers" msgstr "" -#: c-decl.c:9147 +#: c-decl.c:9160 #, gcc-internal-format msgid "%<__thread%> used with %qE" msgstr "" -#: c-decl.c:9194 +#: c-decl.c:9207 #, gcc-internal-format msgid "%<_Sat%> is used without %<_Fract%> or %<_Accum%>" msgstr "" -#: c-decl.c:9208 +#: c-decl.c:9221 #, fuzzy, gcc-internal-format msgid "ISO C does not support plain % meaning %" msgstr "ISO C не падтрымлівае просты \"complex\" у значэнні \"double complex\"" -#: c-decl.c:9253 c-decl.c:9279 +#: c-decl.c:9266 c-decl.c:9292 #, gcc-internal-format msgid "ISO C does not support complex integer types" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: c-decl.c:9433 toplev.c:866 +#: c-decl.c:9446 toplev.c:866 #, fuzzy, gcc-internal-format msgid "%q+F used but never defined" msgstr "адмеціна `%s' выкарыстоўвываецца, але ня вызначана" @@ -14180,7 +14211,7 @@ msgstr "" msgid "floating constant truncated to zero" msgstr "" -#: c-lex.c:933 cp/parser.c:3003 +#: c-lex.c:933 cp/parser.c:3005 #, gcc-internal-format msgid "unsupported non-standard concatenation of string literals" msgstr "" @@ -14195,7 +14226,7 @@ msgstr "" msgid "invalid expression type for %<#pragma omp atomic%>" msgstr "" -#: c-omp.c:260 cp/semantics.c:4497 +#: c-omp.c:260 cp/semantics.c:4501 #, gcc-internal-format msgid "invalid type for iteration variable %qE" msgstr "" @@ -14205,22 +14236,22 @@ msgstr "" msgid "%qE is not initialized" msgstr "прапушчан ініцыялізатар" -#: c-omp.c:290 cp/semantics.c:4412 +#: c-omp.c:290 cp/semantics.c:4416 #, gcc-internal-format msgid "missing controlling predicate" msgstr "" -#: c-omp.c:368 cp/semantics.c:4169 +#: c-omp.c:368 cp/semantics.c:4173 #, fuzzy, gcc-internal-format msgid "invalid controlling predicate" msgstr "нерэчаісны ініцыялізатар" -#: c-omp.c:375 cp/semantics.c:4418 +#: c-omp.c:375 cp/semantics.c:4422 #, fuzzy, gcc-internal-format msgid "missing increment expression" msgstr "аргумент для \"%s\" прапушчан" -#: c-omp.c:444 cp/semantics.c:4274 +#: c-omp.c:444 cp/semantics.c:4278 #, fuzzy, gcc-internal-format msgid "invalid increment expression" msgstr "нерэчаісны ініцыялізатар" @@ -14280,117 +14311,117 @@ msgstr "-pipe не падтрымліваецца." msgid "-fhandle-exceptions has been renamed -fexceptions (and is now on by default)" msgstr "" -#: c-opts.c:909 fortran/cpp.c:381 +#: c-opts.c:911 fortran/cpp.c:381 #, fuzzy, gcc-internal-format msgid "output filename specified twice" msgstr "не зададзены ўваходзячыя файлы" -#: c-opts.c:1042 +#: c-opts.c:1046 #, gcc-internal-format msgid "-fexcess-precision=standard for C++" msgstr "" -#: c-opts.c:1055 +#: c-opts.c:1059 #, gcc-internal-format msgid "-fno-gnu89-inline is only supported in GNU99 or C99 mode" msgstr "" -#: c-opts.c:1134 +#: c-opts.c:1138 #, gcc-internal-format msgid "-Wformat-y2k ignored without -Wformat" msgstr "" -#: c-opts.c:1136 +#: c-opts.c:1140 #, gcc-internal-format msgid "-Wformat-extra-args ignored without -Wformat" msgstr "" -#: c-opts.c:1138 +#: c-opts.c:1142 #, gcc-internal-format msgid "-Wformat-zero-length ignored without -Wformat" msgstr "" -#: c-opts.c:1140 +#: c-opts.c:1144 #, gcc-internal-format msgid "-Wformat-nonliteral ignored without -Wformat" msgstr "" -#: c-opts.c:1142 +#: c-opts.c:1146 #, gcc-internal-format msgid "-Wformat-contains-nul ignored without -Wformat" msgstr "" -#: c-opts.c:1144 +#: c-opts.c:1148 #, gcc-internal-format msgid "-Wformat-security ignored without -Wformat" msgstr "" -#: c-opts.c:1168 +#: c-opts.c:1172 #, fuzzy, gcc-internal-format msgid "opening output file %s: %m" msgstr "немагчыма адчыніць файл уводу `%s'" -#: c-opts.c:1173 +#: c-opts.c:1177 #, gcc-internal-format msgid "too many filenames given. Type %s --help for usage" msgstr "" -#: c-opts.c:1253 +#: c-opts.c:1257 #, gcc-internal-format msgid "The C parser does not support -dy, option ignored" msgstr "" -#: c-opts.c:1257 +#: c-opts.c:1261 #, gcc-internal-format msgid "The Objective-C parser does not support -dy, option ignored" msgstr "" -#: c-opts.c:1260 +#: c-opts.c:1264 #, gcc-internal-format msgid "The C++ parser does not support -dy, option ignored" msgstr "" -#: c-opts.c:1264 +#: c-opts.c:1268 #, gcc-internal-format msgid "The Objective-C++ parser does not support -dy, option ignored" msgstr "" -#: c-opts.c:1315 +#: c-opts.c:1319 #, gcc-internal-format msgid "opening dependency file %s: %m" msgstr "" -#: c-opts.c:1325 +#: c-opts.c:1329 #, gcc-internal-format msgid "closing dependency file %s: %m" msgstr "" -#: c-opts.c:1328 +#: c-opts.c:1332 #, fuzzy, gcc-internal-format msgid "when writing output to %s: %m" msgstr "памылка запісу ў %s" -#: c-opts.c:1408 +#: c-opts.c:1412 #, gcc-internal-format msgid "to generate dependencies you must specify either -M or -MM" msgstr "" -#: c-opts.c:1431 +#: c-opts.c:1435 #, gcc-internal-format msgid "-MG may only be used with -M or -MM" msgstr "" -#: c-opts.c:1461 +#: c-opts.c:1465 #, gcc-internal-format msgid "-fdirectives-only is incompatible with -Wunused_macros" msgstr "" -#: c-opts.c:1463 +#: c-opts.c:1467 #, gcc-internal-format msgid "-fdirectives-only is incompatible with -traditional" msgstr "" -#: c-opts.c:1601 +#: c-opts.c:1605 #, gcc-internal-format msgid "too late for # directive to set debug directory" msgstr "" @@ -14448,7 +14479,7 @@ msgstr "" msgid "expected identifier" msgstr "" -#: c-parser.c:1743 cp/parser.c:12727 +#: c-parser.c:1743 cp/parser.c:12734 #, gcc-internal-format msgid "comma at end of enumerator list" msgstr "" @@ -14523,7 +14554,7 @@ msgstr "" msgid "wide string literal in %" msgstr "" -#: c-parser.c:2765 c-parser.c:7091 cp/parser.c:22952 +#: c-parser.c:2765 c-parser.c:7091 cp/parser.c:22966 #, gcc-internal-format msgid "expected string literal" msgstr "" @@ -14573,7 +14604,7 @@ msgstr "ISO C не дазваляе дэкларацыі метак (label)" msgid "expected %<}%> before %" msgstr "" -#: c-parser.c:3564 cp/parser.c:7910 +#: c-parser.c:3564 cp/parser.c:7917 #, gcc-internal-format msgid "% without a previous %" msgstr "" @@ -14607,12 +14638,12 @@ msgstr "" msgid "expected statement" msgstr "" -#: c-parser.c:3985 cp/parser.c:7992 +#: c-parser.c:3985 cp/parser.c:7999 #, fuzzy, gcc-internal-format msgid "suggest braces around empty body in an % statement" msgstr "пустое цела ў else-выражэнні" -#: c-parser.c:4013 cp/parser.c:8015 +#: c-parser.c:4013 cp/parser.c:8022 #, fuzzy, gcc-internal-format msgid "suggest braces around empty body in an % statement" msgstr "пустое цела ў else-выражэнні" @@ -14682,37 +14713,37 @@ msgstr "ISO C не падтрымлівае \"goto *expr;\"" msgid "extra semicolon in method definition specified" msgstr "" -#: c-parser.c:6985 cp/parser.c:22996 +#: c-parser.c:6985 cp/parser.c:23010 #, gcc-internal-format msgid "%<#pragma omp barrier%> may only be used in compound statements" msgstr "" -#: c-parser.c:6996 cp/parser.c:23011 +#: c-parser.c:6996 cp/parser.c:23025 #, gcc-internal-format msgid "%<#pragma omp flush%> may only be used in compound statements" msgstr "" -#: c-parser.c:7007 cp/parser.c:23027 +#: c-parser.c:7007 cp/parser.c:23041 #, gcc-internal-format msgid "%<#pragma omp taskwait%> may only be used in compound statements" msgstr "" -#: c-parser.c:7020 cp/parser.c:23055 +#: c-parser.c:7020 cp/parser.c:23069 #, gcc-internal-format msgid "%<#pragma omp section%> may only be used in %<#pragma omp sections%> construct" msgstr "" -#: c-parser.c:7026 cp/parser.c:22986 +#: c-parser.c:7026 cp/parser.c:23000 #, gcc-internal-format msgid "%<#pragma GCC pch_preprocess%> must be first" msgstr "" -#: c-parser.c:7185 cp/parser.c:21275 +#: c-parser.c:7185 cp/parser.c:21289 #, fuzzy, gcc-internal-format msgid "too many %qs clauses" msgstr "вельмі шмат уваходзячых файлаў" -#: c-parser.c:7287 cp/parser.c:21389 +#: c-parser.c:7287 cp/parser.c:21403 #, gcc-internal-format msgid "collapse argument needs positive constant integer expression" msgstr "" @@ -14737,12 +14768,12 @@ msgstr "" msgid "expected %<+%>, %<*%>, %<-%>, %<&%>, %<^%>, %<|%>, %<&&%>, or %<||%>" msgstr "" -#: c-parser.c:7627 cp/parser.c:21677 +#: c-parser.c:7627 cp/parser.c:21691 #, gcc-internal-format msgid "schedule % does not take a % parameter" msgstr "" -#: c-parser.c:7631 cp/parser.c:21680 +#: c-parser.c:7631 cp/parser.c:21694 #, gcc-internal-format msgid "schedule % does not take a % parameter" msgstr "" @@ -14757,7 +14788,7 @@ msgstr "нерэчаісны %%-код" msgid "expected %<#pragma omp%> clause" msgstr "" -#: c-parser.c:7778 cp/parser.c:21828 +#: c-parser.c:7778 cp/parser.c:21842 #, fuzzy, gcc-internal-format msgid "%qs is not valid for %qs" msgstr "complex нерэчаісны для \"%s\"" @@ -14777,7 +14808,7 @@ msgstr "" msgid "for statement expected" msgstr "вельмі шмат аргументаў у функцыі" -#: c-parser.c:8049 cp/semantics.c:4402 cp/semantics.c:4472 +#: c-parser.c:8049 cp/semantics.c:4406 cp/semantics.c:4476 #, gcc-internal-format msgid "expected iteration declaration or initialization" msgstr "" @@ -14787,12 +14818,12 @@ msgstr "" msgid "not enough perfectly nested loops" msgstr "" -#: c-parser.c:8182 cp/parser.c:22533 +#: c-parser.c:8182 cp/parser.c:22547 #, gcc-internal-format msgid "collapsed loops not perfectly nested" msgstr "" -#: c-parser.c:8220 cp/parser.c:22377 cp/parser.c:22415 cp/pt.c:11272 +#: c-parser.c:8220 cp/parser.c:22391 cp/parser.c:22429 cp/pt.c:11410 #, gcc-internal-format msgid "iteration variable %qD should not be firstprivate" msgstr "" @@ -14802,17 +14833,17 @@ msgstr "" msgid "%qD is not a variable" msgstr "\"%s\" мае незавершаны тып" -#: c-parser.c:8667 cp/semantics.c:4027 +#: c-parser.c:8667 cp/semantics.c:4031 #, gcc-internal-format msgid "%qE declared % after first use" msgstr "" -#: c-parser.c:8669 cp/semantics.c:4029 +#: c-parser.c:8669 cp/semantics.c:4033 #, gcc-internal-format msgid "automatic variable %qE cannot be %" msgstr "" -#: c-parser.c:8673 cp/semantics.c:4031 +#: c-parser.c:8673 cp/semantics.c:4035 #, fuzzy, gcc-internal-format msgid "% %qE has incomplete type" msgstr "\"%s\" мае незавершаны тып" @@ -14822,52 +14853,52 @@ msgstr "\"%s\" мае незавершаны тып" msgid "can%'t create precompiled header %s: %m" msgstr "немагчыма стварыць дырэкторыю \"%s\"" -#: c-pch.c:153 +#: c-pch.c:154 #, fuzzy, gcc-internal-format msgid "can%'t write to %s: %m" msgstr "не магу запісаць ў %s" -#: c-pch.c:159 +#: c-pch.c:160 #, gcc-internal-format msgid "%qs is not a valid output file" msgstr "" -#: c-pch.c:188 c-pch.c:203 c-pch.c:217 +#: c-pch.c:189 c-pch.c:204 c-pch.c:218 #, fuzzy, gcc-internal-format msgid "can%'t write %s: %m" msgstr "немагчыма адчыніць %s" -#: c-pch.c:193 c-pch.c:210 +#: c-pch.c:194 c-pch.c:211 #, fuzzy, gcc-internal-format msgid "can%'t seek in %s: %m" msgstr "немагчыма адчыніць %s" -#: c-pch.c:201 c-pch.c:243 c-pch.c:284 c-pch.c:335 +#: c-pch.c:202 c-pch.c:244 c-pch.c:285 c-pch.c:336 #, fuzzy, gcc-internal-format msgid "can%'t read %s: %m" msgstr "не магу прачытаць з %s" -#: c-pch.c:466 +#: c-pch.c:467 #, gcc-internal-format msgid "pch_preprocess pragma should only be used with -fpreprocessed" msgstr "" -#: c-pch.c:467 +#: c-pch.c:468 #, gcc-internal-format msgid "use #include instead" msgstr "" -#: c-pch.c:473 +#: c-pch.c:474 #, fuzzy, gcc-internal-format msgid "%s: couldn%'t open PCH file: %m" msgstr "Немагчыма адчыніць файл з дадзенымі %s.\n" -#: c-pch.c:478 +#: c-pch.c:479 #, gcc-internal-format msgid "use -Winvalid-pch for more information" msgstr "" -#: c-pch.c:479 +#: c-pch.c:480 #, gcc-internal-format msgid "%s: PCH file was invalid" msgstr "" @@ -15167,7 +15198,7 @@ msgstr "" msgid "%qD has an incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-typeck.c:236 cp/call.c:3089 +#: c-typeck.c:236 cp/call.c:3088 #, gcc-internal-format msgid "invalid use of void expression" msgstr "" @@ -15233,7 +15264,7 @@ msgstr "" msgid "function return types not compatible due to %" msgstr "" -#: c-typeck.c:1690 c-typeck.c:3251 +#: c-typeck.c:1690 c-typeck.c:3257 #, gcc-internal-format msgid "arithmetic on pointer to an incomplete type" msgstr "" @@ -15273,12 +15304,12 @@ msgstr "" msgid "invalid type argument of %<->%> (have %qT)" msgstr "нявернае выкарыстанне \"restict\"" -#: c-typeck.c:2218 cp/typeck.c:2942 +#: c-typeck.c:2218 cp/typeck.c:2951 #, gcc-internal-format msgid "subscripted value is neither array nor pointer" msgstr "" -#: c-typeck.c:2229 cp/typeck.c:2857 cp/typeck.c:2947 +#: c-typeck.c:2229 cp/typeck.c:2866 cp/typeck.c:2956 #, gcc-internal-format msgid "array subscript is not an integer" msgstr "" @@ -15321,347 +15352,352 @@ msgstr "" msgid "function with qualified void return type called" msgstr "" -#: c-typeck.c:2852 +#: c-typeck.c:2820 c-typeck.c:3047 cp/typeck.c:3315 cp/typeck.c:3429 +#, fuzzy, gcc-internal-format +msgid "declared here" +msgstr "выклікана адсюль" + +#: c-typeck.c:2855 #, gcc-internal-format msgid "type of formal parameter %d is incomplete" msgstr "" -#: c-typeck.c:2867 +#: c-typeck.c:2870 #, gcc-internal-format msgid "passing argument %d of %qE as integer rather than floating due to prototype" msgstr "" -#: c-typeck.c:2872 +#: c-typeck.c:2875 #, gcc-internal-format msgid "passing argument %d of %qE as integer rather than complex due to prototype" msgstr "" -#: c-typeck.c:2877 +#: c-typeck.c:2880 #, gcc-internal-format msgid "passing argument %d of %qE as complex rather than floating due to prototype" msgstr "" -#: c-typeck.c:2882 +#: c-typeck.c:2885 #, gcc-internal-format msgid "passing argument %d of %qE as floating rather than integer due to prototype" msgstr "" -#: c-typeck.c:2887 +#: c-typeck.c:2890 #, gcc-internal-format msgid "passing argument %d of %qE as complex rather than integer due to prototype" msgstr "" -#: c-typeck.c:2892 +#: c-typeck.c:2895 #, gcc-internal-format msgid "passing argument %d of %qE as floating rather than complex due to prototype" msgstr "" -#: c-typeck.c:2905 +#: c-typeck.c:2908 #, gcc-internal-format msgid "passing argument %d of %qE as % rather than % due to prototype" msgstr "" -#: c-typeck.c:2930 +#: c-typeck.c:2933 #, gcc-internal-format msgid "passing argument %d of %qE as %qT rather than %qT due to prototype" msgstr "" -#: c-typeck.c:2952 +#: c-typeck.c:2955 #, gcc-internal-format msgid "passing argument %d of %qE with different width due to prototype" msgstr "" -#: c-typeck.c:2976 +#: c-typeck.c:2979 #, gcc-internal-format msgid "passing argument %d of %qE as unsigned due to prototype" msgstr "" -#: c-typeck.c:2981 +#: c-typeck.c:2984 #, gcc-internal-format msgid "passing argument %d of %qE as signed due to prototype" msgstr "" -#: c-typeck.c:3121 c-typeck.c:3126 +#: c-typeck.c:3127 c-typeck.c:3132 #, gcc-internal-format msgid "comparison with string literal results in unspecified behavior" msgstr "" -#: c-typeck.c:3140 +#: c-typeck.c:3146 #, gcc-internal-format msgid "comparison between %qT and %qT" msgstr "" -#: c-typeck.c:3192 +#: c-typeck.c:3198 #, gcc-internal-format msgid "pointer of type % used in subtraction" msgstr "" -#: c-typeck.c:3195 +#: c-typeck.c:3201 #, gcc-internal-format msgid "pointer to a function used in subtraction" msgstr "" -#: c-typeck.c:3359 +#: c-typeck.c:3365 #, fuzzy, gcc-internal-format msgid "ISO C does not support %<~%> for complex conjugation" msgstr "ISO C89 не падтрымлівае комлексныя тыпы" -#: c-typeck.c:3398 +#: c-typeck.c:3404 #, gcc-internal-format msgid "wrong type argument to unary exclamation mark" msgstr "" -#: c-typeck.c:3462 +#: c-typeck.c:3468 #, gcc-internal-format msgid "increment of enumeration value is invalid in C++" msgstr "" -#: c-typeck.c:3465 +#: c-typeck.c:3471 #, gcc-internal-format msgid "decrement of enumeration value is invalid in C++" msgstr "" -#: c-typeck.c:3478 +#: c-typeck.c:3484 #, fuzzy, gcc-internal-format msgid "ISO C does not support %<++%> and %<--%> on complex types" msgstr "ISO C не падтрымлівае \"++\" і \"--\" для тыпу complex" -#: c-typeck.c:3497 c-typeck.c:3529 +#: c-typeck.c:3503 c-typeck.c:3535 #, fuzzy, gcc-internal-format msgid "wrong type argument to increment" msgstr "не хапае аргументаў у функцыі" -#: c-typeck.c:3499 c-typeck.c:3532 +#: c-typeck.c:3505 c-typeck.c:3538 #, gcc-internal-format msgid "wrong type argument to decrement" msgstr "" -#: c-typeck.c:3519 +#: c-typeck.c:3525 #, gcc-internal-format msgid "increment of pointer to unknown structure" msgstr "" -#: c-typeck.c:3522 +#: c-typeck.c:3528 #, gcc-internal-format msgid "decrement of pointer to unknown structure" msgstr "" -#: c-typeck.c:3599 +#: c-typeck.c:3605 #, gcc-internal-format msgid "taking address of expression of type %" msgstr "" -#: c-typeck.c:3768 +#: c-typeck.c:3774 #, gcc-internal-format msgid "assignment of read-only member %qD" msgstr "" -#: c-typeck.c:3769 +#: c-typeck.c:3775 #, gcc-internal-format msgid "increment of read-only member %qD" msgstr "" -#: c-typeck.c:3770 +#: c-typeck.c:3776 #, gcc-internal-format msgid "decrement of read-only member %qD" msgstr "" -#: c-typeck.c:3771 +#: c-typeck.c:3777 #, gcc-internal-format msgid "read-only member %qD used as % output" msgstr "" -#: c-typeck.c:3775 cp/typeck2.c:141 +#: c-typeck.c:3781 cp/typeck2.c:141 #, gcc-internal-format msgid "assignment of read-only variable %qD" msgstr "" -#: c-typeck.c:3776 cp/typeck2.c:145 +#: c-typeck.c:3782 cp/typeck2.c:145 #, gcc-internal-format msgid "increment of read-only variable %qD" msgstr "" -#: c-typeck.c:3777 cp/typeck2.c:147 +#: c-typeck.c:3783 cp/typeck2.c:147 #, gcc-internal-format msgid "decrement of read-only variable %qD" msgstr "" -#: c-typeck.c:3778 +#: c-typeck.c:3784 #, gcc-internal-format msgid "read-only variable %qD used as % output" msgstr "" -#: c-typeck.c:3781 c-typeck.c:3797 cp/typeck2.c:196 +#: c-typeck.c:3787 c-typeck.c:3803 cp/typeck2.c:196 #, gcc-internal-format msgid "assignment of read-only location %qE" msgstr "" -#: c-typeck.c:3782 c-typeck.c:3800 cp/typeck2.c:200 +#: c-typeck.c:3788 c-typeck.c:3806 cp/typeck2.c:200 #, gcc-internal-format msgid "increment of read-only location %qE" msgstr "" -#: c-typeck.c:3783 c-typeck.c:3803 cp/typeck2.c:202 +#: c-typeck.c:3789 c-typeck.c:3809 cp/typeck2.c:202 #, gcc-internal-format msgid "decrement of read-only location %qE" msgstr "" -#: c-typeck.c:3784 +#: c-typeck.c:3790 #, gcc-internal-format msgid "read-only location %qE used as % output" msgstr "" -#: c-typeck.c:3843 +#: c-typeck.c:3849 #, fuzzy, gcc-internal-format msgid "cannot take address of bit-field %qD" msgstr "не магу атрымаць адрас бітавага поля \"%s\"" -#: c-typeck.c:3871 +#: c-typeck.c:3877 #, gcc-internal-format msgid "global register variable %qD used in nested function" msgstr "" -#: c-typeck.c:3874 +#: c-typeck.c:3880 #, gcc-internal-format msgid "register variable %qD used in nested function" msgstr "" -#: c-typeck.c:3879 +#: c-typeck.c:3885 #, gcc-internal-format msgid "address of global register variable %qD requested" msgstr "" -#: c-typeck.c:3881 +#: c-typeck.c:3887 #, gcc-internal-format msgid "address of register variable %qD requested" msgstr "" -#: c-typeck.c:3948 +#: c-typeck.c:3982 #, gcc-internal-format msgid "non-lvalue array in conditional expression" msgstr "" -#: c-typeck.c:4076 +#: c-typeck.c:4110 #, gcc-internal-format msgid "ISO C forbids conditional expr with only one void side" msgstr "" -#: c-typeck.c:4093 +#: c-typeck.c:4127 #, gcc-internal-format msgid "pointers to disjoint address spaces used in conditional expression" msgstr "" -#: c-typeck.c:4101 c-typeck.c:4110 +#: c-typeck.c:4135 c-typeck.c:4144 #, gcc-internal-format msgid "ISO C forbids conditional expr between % and function pointer" msgstr "" -#: c-typeck.c:4121 +#: c-typeck.c:4155 #, gcc-internal-format msgid "pointer type mismatch in conditional expression" msgstr "" -#: c-typeck.c:4130 c-typeck.c:4141 +#: c-typeck.c:4164 c-typeck.c:4175 #, gcc-internal-format msgid "pointer/integer type mismatch in conditional expression" msgstr "" -#: c-typeck.c:4155 +#: c-typeck.c:4189 #, gcc-internal-format msgid "type mismatch in conditional expression" msgstr "" -#: c-typeck.c:4251 +#: c-typeck.c:4283 #, gcc-internal-format msgid "left-hand operand of comma expression has no effect" msgstr "" -#: c-typeck.c:4319 +#: c-typeck.c:4351 #, gcc-internal-format msgid "cast adds new qualifiers to function type" msgstr "" -#: c-typeck.c:4325 +#: c-typeck.c:4357 #, gcc-internal-format msgid "cast discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:4395 +#: c-typeck.c:4427 #, gcc-internal-format msgid "cast specifies array type" msgstr "" -#: c-typeck.c:4401 +#: c-typeck.c:4433 #, gcc-internal-format msgid "cast specifies function type" msgstr "" -#: c-typeck.c:4417 +#: c-typeck.c:4449 #, gcc-internal-format msgid "ISO C forbids casting nonscalar to the same type" msgstr "" -#: c-typeck.c:4434 +#: c-typeck.c:4466 #, gcc-internal-format msgid "ISO C forbids casts to union type" msgstr "" -#: c-typeck.c:4444 +#: c-typeck.c:4476 #, gcc-internal-format msgid "cast to union type from type not present in union" msgstr "" -#: c-typeck.c:4479 +#: c-typeck.c:4511 #, gcc-internal-format msgid "cast to %s address space pointer from disjoint generic address space pointer" msgstr "" -#: c-typeck.c:4484 +#: c-typeck.c:4516 #, gcc-internal-format msgid "cast to generic address space pointer from disjoint %s address space pointer" msgstr "" -#: c-typeck.c:4489 +#: c-typeck.c:4521 #, gcc-internal-format msgid "cast to %s address space pointer from disjoint %s address space pointer" msgstr "" -#: c-typeck.c:4509 +#: c-typeck.c:4541 #, gcc-internal-format msgid "cast increases required alignment of target type" msgstr "" -#: c-typeck.c:4520 +#: c-typeck.c:4552 #, gcc-internal-format msgid "cast from pointer to integer of different size" msgstr "" -#: c-typeck.c:4525 +#: c-typeck.c:4557 #, gcc-internal-format msgid "cast from function call of type %qT to non-matching type %qT" msgstr "" -#: c-typeck.c:4534 +#: c-typeck.c:4566 #, gcc-internal-format msgid "cast to pointer from integer of different size" msgstr "" -#: c-typeck.c:4548 +#: c-typeck.c:4580 #, gcc-internal-format msgid "ISO C forbids conversion of function pointer to object pointer type" msgstr "" -#: c-typeck.c:4557 +#: c-typeck.c:4589 #, gcc-internal-format msgid "ISO C forbids conversion of object pointer to function pointer type" msgstr "" -#: c-typeck.c:4639 +#: c-typeck.c:4671 #, gcc-internal-format msgid "defining a type in a cast is invalid in C++" msgstr "" -#: c-typeck.c:4764 c-typeck.c:4931 +#: c-typeck.c:4796 c-typeck.c:4963 #, gcc-internal-format msgid "enum conversion in assignment is invalid in C++" msgstr "" @@ -15669,462 +15705,462 @@ msgstr "" #. This macro is used to emit diagnostics to ensure that all format #. strings are complete sentences, visible to gettext and checked at #. compile time. -#: c-typeck.c:4869 c-typeck.c:5377 +#: c-typeck.c:4901 c-typeck.c:5409 #, gcc-internal-format msgid "expected %qT but argument is of type %qT" msgstr "" -#: c-typeck.c:4929 +#: c-typeck.c:4961 #, gcc-internal-format msgid "enum conversion when passing argument %d of %qE is invalid in C++" msgstr "" -#: c-typeck.c:4935 +#: c-typeck.c:4967 #, gcc-internal-format msgid "enum conversion in return is invalid in C++" msgstr "" -#: c-typeck.c:4964 +#: c-typeck.c:4996 #, gcc-internal-format msgid "cannot pass rvalue to reference parameter" msgstr "" -#: c-typeck.c:5094 c-typeck.c:5299 +#: c-typeck.c:5126 c-typeck.c:5331 #, gcc-internal-format msgid "passing argument %d of %qE makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:5097 c-typeck.c:5302 +#: c-typeck.c:5129 c-typeck.c:5334 #, gcc-internal-format msgid "assignment makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:5100 c-typeck.c:5304 +#: c-typeck.c:5132 c-typeck.c:5336 #, gcc-internal-format msgid "initialization makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:5103 c-typeck.c:5306 +#: c-typeck.c:5135 c-typeck.c:5338 #, gcc-internal-format msgid "return makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:5109 c-typeck.c:5263 +#: c-typeck.c:5141 c-typeck.c:5295 #, gcc-internal-format msgid "passing argument %d of %qE discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:5111 c-typeck.c:5265 +#: c-typeck.c:5143 c-typeck.c:5297 #, gcc-internal-format msgid "assignment discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:5113 c-typeck.c:5267 +#: c-typeck.c:5145 c-typeck.c:5299 #, gcc-internal-format msgid "initialization discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:5115 c-typeck.c:5269 +#: c-typeck.c:5147 c-typeck.c:5301 #, gcc-internal-format msgid "return discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:5123 +#: c-typeck.c:5155 #, gcc-internal-format msgid "ISO C prohibits argument conversion to union type" msgstr "" -#: c-typeck.c:5159 +#: c-typeck.c:5191 #, gcc-internal-format msgid "request for implicit conversion from %qT to %qT not permitted in C++" msgstr "" -#: c-typeck.c:5171 +#: c-typeck.c:5203 #, gcc-internal-format msgid "passing argument %d of %qE from pointer to non-enclosed address space" msgstr "" -#: c-typeck.c:5175 +#: c-typeck.c:5207 #, gcc-internal-format msgid "assignment from pointer to non-enclosed address space" msgstr "" -#: c-typeck.c:5179 +#: c-typeck.c:5211 #, gcc-internal-format msgid "initialization from pointer to non-enclosed address space" msgstr "" -#: c-typeck.c:5183 +#: c-typeck.c:5215 #, gcc-internal-format msgid "return from pointer to non-enclosed address space" msgstr "" -#: c-typeck.c:5201 +#: c-typeck.c:5233 #, gcc-internal-format msgid "argument %d of %qE might be a candidate for a format attribute" msgstr "" -#: c-typeck.c:5207 +#: c-typeck.c:5239 #, gcc-internal-format msgid "assignment left-hand side might be a candidate for a format attribute" msgstr "" -#: c-typeck.c:5212 +#: c-typeck.c:5244 #, gcc-internal-format msgid "initialization left-hand side might be a candidate for a format attribute" msgstr "" -#: c-typeck.c:5217 +#: c-typeck.c:5249 #, gcc-internal-format msgid "return type might be a candidate for a format attribute" msgstr "" -#: c-typeck.c:5241 +#: c-typeck.c:5273 #, gcc-internal-format msgid "ISO C forbids passing argument %d of %qE between function pointer and %" msgstr "" -#: c-typeck.c:5244 +#: c-typeck.c:5276 #, gcc-internal-format msgid "ISO C forbids assignment between function pointer and %" msgstr "" -#: c-typeck.c:5246 +#: c-typeck.c:5278 #, gcc-internal-format msgid "ISO C forbids initialization between function pointer and %" msgstr "" -#: c-typeck.c:5248 +#: c-typeck.c:5280 #, gcc-internal-format msgid "ISO C forbids return between function pointer and %" msgstr "" -#: c-typeck.c:5280 +#: c-typeck.c:5312 #, gcc-internal-format msgid "pointer targets in passing argument %d of %qE differ in signedness" msgstr "" -#: c-typeck.c:5282 +#: c-typeck.c:5314 #, gcc-internal-format msgid "pointer targets in assignment differ in signedness" msgstr "" -#: c-typeck.c:5284 +#: c-typeck.c:5316 #, gcc-internal-format msgid "pointer targets in initialization differ in signedness" msgstr "" -#: c-typeck.c:5286 +#: c-typeck.c:5318 #, gcc-internal-format msgid "pointer targets in return differ in signedness" msgstr "" -#: c-typeck.c:5314 +#: c-typeck.c:5346 #, gcc-internal-format msgid "passing argument %d of %qE from incompatible pointer type" msgstr "" -#: c-typeck.c:5316 +#: c-typeck.c:5348 #, gcc-internal-format msgid "assignment from incompatible pointer type" msgstr "" -#: c-typeck.c:5317 +#: c-typeck.c:5349 #, gcc-internal-format msgid "initialization from incompatible pointer type" msgstr "" -#: c-typeck.c:5319 +#: c-typeck.c:5351 #, gcc-internal-format msgid "return from incompatible pointer type" msgstr "" -#: c-typeck.c:5337 +#: c-typeck.c:5369 #, gcc-internal-format msgid "passing argument %d of %qE makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:5339 +#: c-typeck.c:5371 #, gcc-internal-format msgid "assignment makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:5341 +#: c-typeck.c:5373 #, gcc-internal-format msgid "initialization makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:5343 +#: c-typeck.c:5375 #, gcc-internal-format msgid "return makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:5351 +#: c-typeck.c:5383 #, gcc-internal-format msgid "passing argument %d of %qE makes integer from pointer without a cast" msgstr "" -#: c-typeck.c:5353 +#: c-typeck.c:5385 #, gcc-internal-format msgid "assignment makes integer from pointer without a cast" msgstr "" -#: c-typeck.c:5355 +#: c-typeck.c:5387 #, gcc-internal-format msgid "initialization makes integer from pointer without a cast" msgstr "" -#: c-typeck.c:5357 +#: c-typeck.c:5389 #, gcc-internal-format msgid "return makes integer from pointer without a cast" msgstr "" -#: c-typeck.c:5380 +#: c-typeck.c:5412 #, gcc-internal-format msgid "incompatible types when assigning to type %qT from type %qT" msgstr "" -#: c-typeck.c:5385 +#: c-typeck.c:5417 #, gcc-internal-format msgid "incompatible types when initializing type %qT using type %qT" msgstr "" -#: c-typeck.c:5390 +#: c-typeck.c:5422 #, gcc-internal-format msgid "incompatible types when returning type %qT but %qT was expected" msgstr "" -#: c-typeck.c:5454 +#: c-typeck.c:5486 #, gcc-internal-format msgid "traditional C rejects automatic aggregate initialization" msgstr "" -#: c-typeck.c:5627 c-typeck.c:5643 c-typeck.c:5660 +#: c-typeck.c:5659 c-typeck.c:5675 c-typeck.c:5692 #, fuzzy, gcc-internal-format msgid "(near initialization for %qs)" msgstr "ініцыялізацыя" -#: c-typeck.c:6263 cp/decl.c:5224 +#: c-typeck.c:6295 cp/decl.c:5227 #, gcc-internal-format msgid "opaque vector types cannot be initialized" msgstr "" -#: c-typeck.c:6928 +#: c-typeck.c:6960 #, gcc-internal-format msgid "unknown field %qE specified in initializer" msgstr "" -#: c-typeck.c:7907 +#: c-typeck.c:7939 #, gcc-internal-format msgid "traditional C rejects initialization of unions" msgstr "" -#: c-typeck.c:8246 +#: c-typeck.c:8278 #, fuzzy, gcc-internal-format msgid "ISO C forbids %" msgstr "ISO C не падтрымлівае \"goto *expr;\"" -#: c-typeck.c:8268 cp/typeck.c:7236 +#: c-typeck.c:8300 cp/typeck.c:7323 #, fuzzy, gcc-internal-format msgid "function declared % has a % statement" msgstr "функцыя не вяртае тып string" -#: c-typeck.c:8291 +#: c-typeck.c:8323 #, gcc-internal-format msgid "% with no value, in function returning non-void" msgstr "" -#: c-typeck.c:8301 +#: c-typeck.c:8333 #, gcc-internal-format msgid "% with a value, in function returning void" msgstr "" -#: c-typeck.c:8303 +#: c-typeck.c:8335 #, gcc-internal-format msgid "ISO C forbids % with expression, in function returning void" msgstr "" -#: c-typeck.c:8364 +#: c-typeck.c:8396 #, gcc-internal-format msgid "function returns address of local variable" msgstr "" -#: c-typeck.c:8437 cp/semantics.c:953 +#: c-typeck.c:8469 cp/semantics.c:951 #, gcc-internal-format msgid "switch quantity not an integer" msgstr "" -#: c-typeck.c:8450 +#: c-typeck.c:8482 #, gcc-internal-format msgid "% switch expression not converted to % in ISO C" msgstr "" -#: c-typeck.c:8486 c-typeck.c:8494 +#: c-typeck.c:8518 c-typeck.c:8526 #, fuzzy, gcc-internal-format msgid "case label is not an integer constant expression" msgstr "памер масіва \"%s\" адмоўны" -#: c-typeck.c:8500 cp/parser.c:7750 +#: c-typeck.c:8532 cp/parser.c:7757 #, gcc-internal-format msgid "case label not within a switch statement" msgstr "" -#: c-typeck.c:8502 +#: c-typeck.c:8534 #, gcc-internal-format msgid "% label not within a switch statement" msgstr "" -#: c-typeck.c:8585 cp/parser.c:8041 +#: c-typeck.c:8617 cp/parser.c:8048 #, gcc-internal-format msgid "suggest explicit braces to avoid ambiguous %" msgstr "" -#: c-typeck.c:8694 cp/cp-gimplify.c:92 cp/parser.c:8391 +#: c-typeck.c:8726 cp/cp-gimplify.c:92 cp/parser.c:8398 #, gcc-internal-format msgid "break statement not within loop or switch" msgstr "" -#: c-typeck.c:8696 cp/parser.c:8412 +#: c-typeck.c:8728 cp/parser.c:8419 #, gcc-internal-format msgid "continue statement not within a loop" msgstr "" -#: c-typeck.c:8701 cp/parser.c:8402 +#: c-typeck.c:8733 cp/parser.c:8409 #, gcc-internal-format msgid "break statement used with OpenMP for loop" msgstr "" -#: c-typeck.c:8727 cp/cp-gimplify.c:412 +#: c-typeck.c:8759 cp/cp-gimplify.c:412 #, gcc-internal-format msgid "statement with no effect" msgstr "" -#: c-typeck.c:8751 +#: c-typeck.c:8783 #, gcc-internal-format msgid "expression statement has incomplete type" msgstr "" -#: c-typeck.c:9328 cp/typeck.c:3814 +#: c-typeck.c:9360 cp/typeck.c:3825 #, gcc-internal-format msgid "right shift count is negative" msgstr "" -#: c-typeck.c:9339 cp/typeck.c:3821 +#: c-typeck.c:9371 cp/typeck.c:3832 #, gcc-internal-format msgid "right shift count >= width of type" msgstr "" -#: c-typeck.c:9365 cp/typeck.c:3843 +#: c-typeck.c:9397 cp/typeck.c:3854 #, gcc-internal-format msgid "left shift count is negative" msgstr "" -#: c-typeck.c:9372 cp/typeck.c:3849 +#: c-typeck.c:9404 cp/typeck.c:3860 #, gcc-internal-format msgid "left shift count >= width of type" msgstr "" -#: c-typeck.c:9392 cp/typeck.c:3895 +#: c-typeck.c:9424 cp/typeck.c:3906 #, gcc-internal-format msgid "comparing floating point with == or != is unsafe" msgstr "" -#: c-typeck.c:9420 c-typeck.c:9508 +#: c-typeck.c:9452 c-typeck.c:9540 #, gcc-internal-format msgid "comparison of pointers to disjoint address spaces" msgstr "" -#: c-typeck.c:9427 c-typeck.c:9433 +#: c-typeck.c:9459 c-typeck.c:9465 #, fuzzy, gcc-internal-format msgid "ISO C forbids comparison of % with function pointer" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-typeck.c:9440 c-typeck.c:9518 +#: c-typeck.c:9472 c-typeck.c:9550 #, gcc-internal-format msgid "comparison of distinct pointer types lacks a cast" msgstr "" -#: c-typeck.c:9454 c-typeck.c:9463 cp/typeck.c:3918 cp/typeck.c:3930 +#: c-typeck.c:9486 c-typeck.c:9495 cp/typeck.c:3929 cp/typeck.c:3941 #, gcc-internal-format msgid "the address of %qD will never be NULL" msgstr "" -#: c-typeck.c:9470 c-typeck.c:9475 c-typeck.c:9540 c-typeck.c:9545 +#: c-typeck.c:9502 c-typeck.c:9507 c-typeck.c:9572 c-typeck.c:9577 #, gcc-internal-format msgid "comparison between pointer and integer" msgstr "" -#: c-typeck.c:9501 +#: c-typeck.c:9533 #, gcc-internal-format msgid "comparison of complete and incomplete pointers" msgstr "" -#: c-typeck.c:9503 +#: c-typeck.c:9535 #, gcc-internal-format msgid "ISO C forbids ordered comparisons of pointers to functions" msgstr "" -#: c-typeck.c:9526 c-typeck.c:9529 c-typeck.c:9535 +#: c-typeck.c:9558 c-typeck.c:9561 c-typeck.c:9567 #, gcc-internal-format msgid "ordered comparison of pointer with integer zero" msgstr "" -#: c-typeck.c:9857 +#: c-typeck.c:9887 #, gcc-internal-format msgid "used array that cannot be converted to pointer where scalar is required" msgstr "" -#: c-typeck.c:9861 +#: c-typeck.c:9891 #, gcc-internal-format msgid "used struct type value where scalar is required" msgstr "" -#: c-typeck.c:9865 +#: c-typeck.c:9895 #, gcc-internal-format msgid "used union type value where scalar is required" msgstr "" -#: c-typeck.c:10022 cp/semantics.c:3910 +#: c-typeck.c:10052 cp/semantics.c:3914 #, gcc-internal-format msgid "%qE has invalid type for %" msgstr "" -#: c-typeck.c:10057 cp/semantics.c:3923 +#: c-typeck.c:10087 cp/semantics.c:3927 #, gcc-internal-format msgid "%qE has invalid type for %" msgstr "" -#: c-typeck.c:10074 cp/semantics.c:3933 +#: c-typeck.c:10104 cp/semantics.c:3937 #, gcc-internal-format msgid "%qE must be % for %" msgstr "" -#: c-typeck.c:10084 cp/semantics.c:3730 +#: c-typeck.c:10114 cp/semantics.c:3734 #, gcc-internal-format msgid "%qE is not a variable in clause %qs" msgstr "" -#: c-typeck.c:10092 c-typeck.c:10114 c-typeck.c:10136 +#: c-typeck.c:10122 c-typeck.c:10144 c-typeck.c:10166 #, gcc-internal-format msgid "%qE appears more than once in data clauses" msgstr "" -#: c-typeck.c:10107 cp/semantics.c:3753 +#: c-typeck.c:10137 cp/semantics.c:3757 #, gcc-internal-format msgid "%qE is not a variable in clause %" msgstr "" -#: c-typeck.c:10129 cp/semantics.c:3775 +#: c-typeck.c:10159 cp/semantics.c:3779 #, gcc-internal-format msgid "%qE is not a variable in clause %" msgstr "" -#: c-typeck.c:10191 cp/semantics.c:3974 +#: c-typeck.c:10221 cp/semantics.c:3978 #, gcc-internal-format msgid "%qE is predetermined %qs for %qs" msgstr "" -#: c-typeck.c:10280 +#: c-typeck.c:10310 #, gcc-internal-format msgid "C++ requires promoted type, not enum type, in %" msgstr "" @@ -16134,17 +16170,17 @@ msgstr "" msgid "function call has aggregate value" msgstr "" -#: cfgexpand.c:1018 function.c:919 varasm.c:2167 +#: cfgexpand.c:984 function.c:919 varasm.c:2208 #, fuzzy, gcc-internal-format msgid "size of variable %q+D is too large" msgstr "памер масіва \"%s\" вельмі вялікі" -#: cfgexpand.c:3569 +#: cfgexpand.c:3767 #, gcc-internal-format msgid "not protecting local variables: variable length buffer" msgstr "" -#: cfgexpand.c:3572 +#: cfgexpand.c:3770 #, gcc-internal-format msgid "not protecting function: no buffer at least %d bytes long" msgstr "" @@ -16549,7 +16585,7 @@ msgstr "" msgid "number of bb notes in insn chain (%d) != n_basic_blocks (%d)" msgstr "" -#: cgraph.c:1798 +#: cgraph.c:1799 #, gcc-internal-format msgid "%D renamed after being referenced in assembly" msgstr "" @@ -16664,57 +16700,57 @@ msgstr "" msgid "edge points to same body alias:" msgstr "" -#: cgraphunit.c:757 +#: cgraphunit.c:758 #, fuzzy, gcc-internal-format msgid "edge points to wrong declaration:" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cgraphunit.c:767 +#: cgraphunit.c:768 #, gcc-internal-format msgid "missing callgraph edge for call stmt:" msgstr "" -#: cgraphunit.c:783 +#: cgraphunit.c:784 #, gcc-internal-format msgid "edge %s->%s has no corresponding call_stmt" msgstr "" -#: cgraphunit.c:795 +#: cgraphunit.c:796 #, gcc-internal-format msgid "verify_cgraph_node failed" msgstr "" -#: cgraphunit.c:898 cgraphunit.c:918 +#: cgraphunit.c:901 cgraphunit.c:921 #, gcc-internal-format msgid "% attribute have effect only on public objects" msgstr "" -#: cgraphunit.c:1160 cgraphunit.c:1181 +#: cgraphunit.c:1163 cgraphunit.c:1184 #, gcc-internal-format msgid "failed to reclaim unneeded function" msgstr "" -#: cgraphunit.c:1903 +#: cgraphunit.c:1906 #, gcc-internal-format msgid "nodes with unreleased memory found" msgstr "" -#: collect2.c:1519 opts.c:1140 +#: collect2.c:1530 opts.c:1134 #, gcc-internal-format msgid "LTO support has not been enabled in this configuration" msgstr "" -#: collect2.c:1612 +#: collect2.c:1623 #, fuzzy, gcc-internal-format msgid "unknown demangling style '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: collect2.c:1973 lto/lto.c:1241 +#: collect2.c:1993 lto/lto.c:1241 #, gcc-internal-format msgid "%s terminated with signal %d [%s]%s" msgstr "" -#: collect2.c:2775 +#: collect2.c:2795 #, fuzzy, gcc-internal-format msgid "cannot find 'ldd'" msgstr "не магу знайсці \"ldd\"" @@ -16739,32 +16775,32 @@ msgstr "" msgid "conversion to incomplete type" msgstr "" -#: convert.c:829 convert.c:905 +#: convert.c:854 convert.c:930 #, gcc-internal-format msgid "can't convert between vector values of different size" msgstr "" -#: convert.c:835 +#: convert.c:860 #, gcc-internal-format msgid "aggregate value used where an integer was expected" msgstr "" -#: convert.c:885 +#: convert.c:910 #, gcc-internal-format msgid "pointer value used where a complex was expected" msgstr "" -#: convert.c:889 +#: convert.c:914 #, gcc-internal-format msgid "aggregate value used where a complex was expected" msgstr "" -#: convert.c:911 +#: convert.c:936 #, gcc-internal-format msgid "can't convert value to a vector" msgstr "" -#: convert.c:950 +#: convert.c:975 #, gcc-internal-format msgid "aggregate value used where a fixed-point was expected" msgstr "" @@ -16859,7 +16895,7 @@ msgstr "" msgid "common symbol debug info is not structured as symbol+offset" msgstr "" -#: diagnostic.c:728 +#: diagnostic.c:763 #, fuzzy, gcc-internal-format msgid "in %s, at %s:%d" msgstr "спынена ў %s, ля %s:%d" @@ -16874,16 +16910,21 @@ msgstr "" msgid "dominator of %d should be %d, not %d" msgstr "" -#: dwarf2out.c:4014 +#: dwarf2out.c:4007 #, gcc-internal-format msgid "Multiple EH personalities are supported only with assemblers supporting .cfi.personality directive." msgstr "" -#: dwarf2out.c:5392 +#: dwarf2out.c:5393 #, gcc-internal-format msgid "DW_LOC_OP %s not implemented" msgstr "" +#: dwarf2out.c:12859 +#, gcc-internal-format +msgid "non-delegitimized UNSPEC %d found in variable location" +msgstr "" + #: emit-rtl.c:2460 #, fuzzy, gcc-internal-format msgid "invalid rtl sharing found in the insn" @@ -16914,57 +16955,57 @@ msgstr "спынена ў %s, ля %s:%d" msgid "exception handling disabled, use -fexceptions to enable" msgstr "" -#: except.c:2026 +#: except.c:2032 #, fuzzy, gcc-internal-format msgid "argument of %<__builtin_eh_return_regno%> must be constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: except.c:2163 +#: except.c:2169 #, gcc-internal-format msgid "__builtin_eh_return not supported on this target" msgstr "" -#: except.c:3334 except.c:3359 +#: except.c:3340 except.c:3365 #, gcc-internal-format msgid "region_array is corrupted for region %i" msgstr "" -#: except.c:3347 except.c:3378 +#: except.c:3353 except.c:3384 #, gcc-internal-format msgid "lp_array is corrupted for lp %i" msgstr "" -#: except.c:3364 +#: except.c:3370 #, gcc-internal-format msgid "outer block of region %i is wrong" msgstr "" -#: except.c:3369 +#: except.c:3375 #, gcc-internal-format msgid "negative nesting depth of region %i" msgstr "" -#: except.c:3383 +#: except.c:3389 #, gcc-internal-format msgid "region of lp %i is wrong" msgstr "" -#: except.c:3410 +#: except.c:3416 #, gcc-internal-format msgid "tree list ends on depth %i" msgstr "" -#: except.c:3415 +#: except.c:3421 #, gcc-internal-format msgid "region_array does not match region_tree" msgstr "" -#: except.c:3420 +#: except.c:3426 #, gcc-internal-format msgid "lp_array does not match region_tree" msgstr "" -#: except.c:3427 +#: except.c:3433 #, gcc-internal-format msgid "verify_eh_tree failed" msgstr "" @@ -16974,30 +17015,30 @@ msgstr "" msgid "stack limits not supported on this target" msgstr "" -#: expr.c:9228 +#: expr.c:9236 msgid "%Kcall to %qs declared with attribute error: %s" msgstr "" -#: expr.c:9235 +#: expr.c:9243 msgid "%Kcall to %qs declared with attribute warning: %s" msgstr "" -#: final.c:1457 +#: final.c:1460 #, fuzzy, gcc-internal-format msgid "invalid argument %qs to -fdebug-prefix-map" msgstr "нявернае выкарыстанне \"restict\"" -#: final.c:1574 +#: final.c:1577 #, fuzzy, gcc-internal-format msgid "the frame size of %wd bytes is larger than %wd bytes" msgstr "памер \"%s\" больш чам %d байт" -#: final.c:4367 toplev.c:1928 +#: final.c:4370 toplev.c:1936 #, fuzzy, gcc-internal-format msgid "could not open final insn dump file %qs: %s" msgstr "не магу знайсці крыніцу %s\n" -#: final.c:4423 +#: final.c:4428 #, fuzzy, gcc-internal-format msgid "could not close final insn dump file %qs: %s" msgstr "не магу знайсці крыніцу %s\n" @@ -17047,7 +17088,7 @@ msgstr "" msgid "assuming signed overflow does not occur when combining constants around a comparison" msgstr "" -#: fold-const.c:14231 +#: fold-const.c:14233 #, gcc-internal-format msgid "fold check: original tree changed by fold" msgstr "" @@ -17057,7 +17098,7 @@ msgstr "" msgid "total size of local objects too large" msgstr "памер масіва \"%s\" вельмі вялікі" -#: function.c:1645 gimplify.c:4890 +#: function.c:1645 gimplify.c:4983 #, fuzzy, gcc-internal-format msgid "impossible constraint in %" msgstr "немагчымы апэратар '%s'" @@ -17107,7 +17148,7 @@ msgstr "аргумент для \"%s\" прапушчан" msgid "warning: -pipe ignored because -save-temps specified" msgstr "" -#: gcc.c:4608 +#: gcc.c:4623 #, gcc-internal-format msgid "warning: '-x %s' after last input file has no effect" msgstr "" @@ -17115,87 +17156,87 @@ msgstr "" #. Catch the case where a spec string contains something like #. '%{foo:%*}'. i.e. there is no * in the pattern on the left #. hand side of the :. -#: gcc.c:5862 +#: gcc.c:5877 #, gcc-internal-format msgid "spec failure: '%%*' has not been initialized by pattern match" msgstr "" -#: gcc.c:5871 +#: gcc.c:5886 #, gcc-internal-format msgid "warning: use of obsolete %%[ operator in specs" msgstr "" -#: gcc.c:5952 +#: gcc.c:5967 #, fuzzy, gcc-internal-format msgid "spec failure: unrecognized spec option '%c'" msgstr "нераспазнаны выбар \"-%s\"" -#: gcc.c:6688 +#: gcc.c:6703 #, gcc-internal-format msgid "%s: could not determine length of compare-debug file %s" msgstr "" -#: gcc.c:6699 +#: gcc.c:6714 #, gcc-internal-format msgid "%s: -fcompare-debug failure (length)" msgstr "" -#: gcc.c:6709 gcc.c:6750 +#: gcc.c:6724 gcc.c:6765 #, fuzzy, gcc-internal-format msgid "%s: could not open compare-debug file %s" msgstr "Немагчыма адчыніць файл з дадзенымі %s.\n" -#: gcc.c:6729 gcc.c:6766 +#: gcc.c:6744 gcc.c:6781 #, gcc-internal-format msgid "%s: -fcompare-debug failure" msgstr "" -#: gcc.c:7002 +#: gcc.c:7017 #, gcc-internal-format msgid "spec failure: more than one arg to SYSROOT_SUFFIX_SPEC" msgstr "" -#: gcc.c:7025 +#: gcc.c:7040 #, gcc-internal-format msgid "spec failure: more than one arg to SYSROOT_HEADERS_SUFFIX_SPEC" msgstr "" -#: gcc.c:7133 +#: gcc.c:7148 #, fuzzy, gcc-internal-format msgid "unrecognized option '-%s'" msgstr "нераспазнаны выбар \"-%s\"" -#: gcc.c:7366 gcc.c:7429 +#: gcc.c:7381 gcc.c:7444 #, gcc-internal-format msgid "%s: %s compiler not installed on this system" msgstr "%s: %s кампілятар не ўсталяваны на гэтай сістэме" -#: gcc.c:7453 +#: gcc.c:7468 #, gcc-internal-format msgid "Recompiling with -fcompare-debug" msgstr "" -#: gcc.c:7467 +#: gcc.c:7482 #, gcc-internal-format msgid "during -fcompare-debug recompilation" msgstr "" -#: gcc.c:7476 +#: gcc.c:7491 #, gcc-internal-format msgid "Comparing final insns dumps" msgstr "" -#: gcc.c:7600 +#: gcc.c:7615 #, gcc-internal-format msgid "%s: linker input file unused because linking not done" msgstr "" -#: gcc.c:7640 +#: gcc.c:7655 #, gcc-internal-format msgid "language %s not recognized" msgstr "мова %s не распазнана" -#: gcc.c:7711 lto/lto.c:1231 +#: gcc.c:7726 lto/lto.c:1231 #, gcc-internal-format msgid "%s: %s" msgstr "" @@ -17263,52 +17304,52 @@ msgstr "" msgid "using result of function returning %" msgstr "" -#: gimplify.c:4775 +#: gimplify.c:4868 #, gcc-internal-format msgid "invalid lvalue in asm output %d" msgstr "" -#: gimplify.c:4891 +#: gimplify.c:4984 #, gcc-internal-format msgid "non-memory input %d must stay in memory" msgstr "" -#: gimplify.c:4906 +#: gimplify.c:4999 #, gcc-internal-format msgid "memory input %d is not directly addressable" msgstr "" -#: gimplify.c:5407 +#: gimplify.c:5500 #, gcc-internal-format msgid "%qE not specified in enclosing parallel" msgstr "" -#: gimplify.c:5409 +#: gimplify.c:5502 #, gcc-internal-format msgid "enclosing parallel" msgstr "" -#: gimplify.c:5514 +#: gimplify.c:5607 #, gcc-internal-format msgid "iteration variable %qE should be private" msgstr "" -#: gimplify.c:5528 +#: gimplify.c:5621 #, gcc-internal-format msgid "iteration variable %qE should not be firstprivate" msgstr "" -#: gimplify.c:5531 +#: gimplify.c:5624 #, gcc-internal-format msgid "iteration variable %qE should not be reduction" msgstr "" -#: gimplify.c:5694 +#: gimplify.c:5787 #, gcc-internal-format msgid "%s variable %qE is private in outer context" msgstr "" -#: gimplify.c:7214 +#: gimplify.c:7307 #, gcc-internal-format msgid "gimplification failed" msgstr "" @@ -17318,7 +17359,7 @@ msgstr "" msgid "can't open %s: %m" msgstr "немагчыма адчыніць %s" -#: graphite.c:296 toplev.c:1843 +#: graphite.c:289 toplev.c:1851 #, gcc-internal-format msgid "Graphite loop optimizations cannot be used" msgstr "" @@ -17394,27 +17435,27 @@ msgstr "" msgid "bytecode stream: found non-null terminated string" msgstr "" -#: lto-streamer-in.c:1109 +#: lto-streamer-in.c:1133 #, gcc-internal-format msgid "bytecode stream: unknown GIMPLE statement tag %s" msgstr "" -#: lto-streamer-in.c:2391 +#: lto-streamer-in.c:2418 #, fuzzy, gcc-internal-format msgid "optimization options not supported yet" msgstr "аптымізацыя уключана" -#: lto-streamer-in.c:2396 +#: lto-streamer-in.c:2423 #, gcc-internal-format msgid "target optimization options not supported yet" msgstr "" -#: lto-streamer-in.c:2539 +#: lto-streamer-in.c:2566 #, gcc-internal-format msgid "bytecode stream: tried to jump backwards in the stream" msgstr "" -#: lto-streamer-in.c:2583 +#: lto-streamer-in.c:2610 #, gcc-internal-format msgid "target specific builtin not available" msgstr "" @@ -17484,48 +17525,48 @@ msgstr "\"%s\" не абвешчан (першае выкарыстанне ў msgid "function %qD redeclared as variable" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: omp-low.c:1837 +#: omp-low.c:1838 #, gcc-internal-format msgid "barrier region may not be closely nested inside of work-sharing, critical, ordered, master or explicit task region" msgstr "" -#: omp-low.c:1842 +#: omp-low.c:1843 #, gcc-internal-format msgid "work-sharing region may not be closely nested inside of work-sharing, critical, ordered, master or explicit task region" msgstr "" -#: omp-low.c:1860 +#: omp-low.c:1861 #, gcc-internal-format msgid "master region may not be closely nested inside of work-sharing or explicit task region" msgstr "" -#: omp-low.c:1875 +#: omp-low.c:1876 #, gcc-internal-format msgid "ordered region may not be closely nested inside of critical or explicit task region" msgstr "" -#: omp-low.c:1881 +#: omp-low.c:1882 #, gcc-internal-format msgid "ordered region must be closely nested inside a loop region with an ordered clause" msgstr "" -#: omp-low.c:1896 +#: omp-low.c:1897 #, gcc-internal-format msgid "critical region may not be nested inside a critical region with the same name" msgstr "" -#: omp-low.c:6750 cp/decl.c:2716 cp/parser.c:8399 cp/parser.c:8419 +#: omp-low.c:6751 cp/decl.c:2719 cp/parser.c:8406 cp/parser.c:8426 #, gcc-internal-format msgid "invalid exit from OpenMP structured block" msgstr "" -#: omp-low.c:6752 omp-low.c:6757 +#: omp-low.c:6753 omp-low.c:6758 #, gcc-internal-format msgid "invalid entry to OpenMP structured block" msgstr "" #. Otherwise, be vague and lazy, but efficient. -#: omp-low.c:6760 +#: omp-low.c:6761 #, gcc-internal-format msgid "invalid branch to/from an OpenMP structured block" msgstr "" @@ -17586,117 +17627,117 @@ msgstr "" msgid "section anchors must be disabled when toplevel reorder is disabled" msgstr "" -#: opts.c:1061 config/darwin.c:1724 config/sh/sh.c:903 +#: opts.c:1062 config/darwin.c:1723 config/sh/sh.c:907 #, gcc-internal-format msgid "-freorder-blocks-and-partition does not work with exceptions on this architecture" msgstr "" -#: opts.c:1078 config/sh/sh.c:911 +#: opts.c:1079 config/sh/sh.c:915 #, gcc-internal-format msgid "-freorder-blocks-and-partition does not support unwind info on this architecture" msgstr "" -#: opts.c:1097 +#: opts.c:1098 #, gcc-internal-format msgid "-freorder-blocks-and-partition does not work on this architecture" msgstr "" -#: opts.c:1111 +#: opts.c:1112 #, gcc-internal-format msgid "-fira-algorithm=CB does not work on this architecture" msgstr "" -#: opts.c:1147 +#: opts.c:1141 #, gcc-internal-format msgid "-flto and -fwhopr are mutually exclusive" msgstr "" -#: opts.c:1438 +#: opts.c:1432 #, gcc-internal-format msgid "unrecognized include_flags 0x%x passed to print_specific_help" msgstr "" -#: opts.c:1780 +#: opts.c:1774 #, fuzzy, gcc-internal-format msgid "unknown excess precision style \"%s\"" msgstr "невядомая назва рэгістра: %s\n" -#: opts.c:1817 +#: opts.c:1811 #, gcc-internal-format msgid "structure alignment must be a small power of two, not %d" msgstr "" -#: opts.c:1833 opts.c:1841 +#: opts.c:1827 opts.c:1835 #, gcc-internal-format msgid "Plugin support is disabled. Configure with --enable-plugin." msgstr "" -#: opts.c:1920 +#: opts.c:1914 #, fuzzy, gcc-internal-format msgid "unrecognized visibility value \"%s\"" msgstr "нераспазнаная назва сэкцыі \"%s\"" -#: opts.c:1978 +#: opts.c:1972 #, fuzzy, gcc-internal-format msgid "unknown stack check parameter \"%s\"" msgstr "невыкарыстаемы параметр \"%s\"" -#: opts.c:2004 +#: opts.c:1998 #, fuzzy, gcc-internal-format msgid "unrecognized register name \"%s\"" msgstr "нераспазнаная назва сэкцыі \"%s\"" -#: opts.c:2028 +#: opts.c:2022 #, fuzzy, gcc-internal-format msgid "unknown tls-model \"%s\"" msgstr "невядомы рэжым машыны \"%s\"" -#: opts.c:2037 +#: opts.c:2031 #, fuzzy, gcc-internal-format msgid "unknown ira algorithm \"%s\"" msgstr "невядомая назва рэгістра: %s" -#: opts.c:2048 +#: opts.c:2042 #, fuzzy, gcc-internal-format msgid "unknown ira region \"%s\"" msgstr "невядомая назва рэгістра: %s" -#: opts.c:2093 +#: opts.c:2087 #, fuzzy, gcc-internal-format msgid "dwarf version %d is not supported" msgstr "-pipe не падтрымліваецца" -#: opts.c:2162 +#: opts.c:2157 #, gcc-internal-format msgid "%s: --param arguments should be of the form NAME=VALUE" msgstr "" -#: opts.c:2167 +#: opts.c:2162 #, fuzzy, gcc-internal-format msgid "invalid --param value %qs" msgstr "нерэчаісны выбар --param : %s" -#: opts.c:2270 +#: opts.c:2265 #, fuzzy, gcc-internal-format msgid "target system does not support debug output" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: opts.c:2277 +#: opts.c:2272 #, fuzzy, gcc-internal-format msgid "debug format \"%s\" conflicts with prior selection" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: opts.c:2293 +#: opts.c:2288 #, fuzzy, gcc-internal-format msgid "unrecognised debug output level \"%s\"" msgstr "нераспазнаная назва сэкцыі \"%s\"" -#: opts.c:2295 +#: opts.c:2290 #, gcc-internal-format msgid "debug output level %s is too high" msgstr "" -#: opts.c:2415 +#: opts.c:2410 #, gcc-internal-format msgid "-Werror=%s: No option -%s" msgstr "" @@ -17722,22 +17763,22 @@ msgstr "нерэчаісны парамэтр `%s'" msgid "Invalid pass positioning operation" msgstr "" -#: passes.c:639 +#: passes.c:641 #, fuzzy, gcc-internal-format msgid "plugin cannot register a missing pass" msgstr "невядомая назва рэгістра: %s" -#: passes.c:642 +#: passes.c:644 #, fuzzy, gcc-internal-format msgid "plugin cannot register an unnamed pass" msgstr "невядомая назва рэгістра: %s" -#: passes.c:646 +#: passes.c:648 #, gcc-internal-format msgid "plugin cannot register pass %qs without reference pass name" msgstr "" -#: passes.c:658 +#: passes.c:666 #, gcc-internal-format msgid "pass %qs not found but is referenced by new pass %qs" msgstr "" @@ -17861,22 +17902,22 @@ msgstr "" msgid "output operand %d must use %<&%> constraint" msgstr "" -#: regcprop.c:978 +#: regcprop.c:1129 #, gcc-internal-format msgid "validate_value_data: [%u] Bad next_regno for empty chain (%u)" msgstr "" -#: regcprop.c:990 +#: regcprop.c:1141 #, gcc-internal-format msgid "validate_value_data: Loop in regno chain (%u)" msgstr "" -#: regcprop.c:993 +#: regcprop.c:1144 #, gcc-internal-format msgid "validate_value_data: [%u] Bad oldest_regno (%u)" msgstr "" -#: regcprop.c:1005 +#: regcprop.c:1156 #, gcc-internal-format msgid "validate_value_data: [%u] Non-empty reg in chain (%s %u %i)" msgstr "" @@ -17887,8 +17928,8 @@ msgid "can't use '%s' as a %s register" msgstr "" #: reginfo.c:834 config/ia64/ia64.c:5396 config/ia64/ia64.c:5403 -#: config/pa/pa.c:380 config/pa/pa.c:387 config/sh/sh.c:8539 -#: config/sh/sh.c:8546 config/spu/spu.c:5062 config/spu/spu.c:5069 +#: config/pa/pa.c:383 config/pa/pa.c:390 config/sh/sh.c:8575 +#: config/sh/sh.c:8582 config/spu/spu.c:5052 config/spu/spu.c:5059 #, gcc-internal-format msgid "unknown register name: %s" msgstr "невядомая назва рэгістра: %s" @@ -17928,42 +17969,42 @@ msgstr "" msgid "inconsistent operand constraints in an %" msgstr "" -#: reload1.c:1370 +#: reload1.c:1385 #, gcc-internal-format msgid "% operand has impossible constraints" msgstr "" -#: reload1.c:1390 +#: reload1.c:1405 #, gcc-internal-format msgid "frame size too large for reliable stack checking" msgstr "" -#: reload1.c:1393 +#: reload1.c:1408 #, gcc-internal-format msgid "try reducing the number of local variables" msgstr "" -#: reload1.c:2128 +#: reload1.c:2145 #, gcc-internal-format msgid "can't find a register in class %qs while reloading %" msgstr "" -#: reload1.c:2133 +#: reload1.c:2150 #, gcc-internal-format msgid "unable to find a register to spill in class %qs" msgstr "" -#: reload1.c:4284 +#: reload1.c:4309 #, gcc-internal-format msgid "% operand requires impossible reload" msgstr "" -#: reload1.c:5666 +#: reload1.c:5698 #, gcc-internal-format msgid "% operand constraint incompatible with operand size" msgstr "" -#: reload1.c:7647 +#: reload1.c:7679 #, gcc-internal-format msgid "output operand is constant in %" msgstr "" @@ -18123,7 +18164,7 @@ msgstr "" msgid "undefined named operand %qs" msgstr "нераспазнаны аператар %s" -#: stmt.c:1542 cp/cvt.c:917 cp/cvt.c:1033 +#: stmt.c:1542 cp/cvt.c:918 cp/cvt.c:1034 #, gcc-internal-format msgid "value computed is not used" msgstr "" @@ -18153,47 +18194,47 @@ msgstr "памер \"%s\" больш чам %d байт" msgid "packed attribute causes inefficient alignment for %q+D" msgstr "" -#: stor-layout.c:1104 +#: stor-layout.c:1105 #, gcc-internal-format msgid "packed attribute is unnecessary for %q+D" msgstr "" -#: stor-layout.c:1122 +#: stor-layout.c:1123 #, gcc-internal-format msgid "padding struct to align %q+D" msgstr "" -#: stor-layout.c:1183 +#: stor-layout.c:1184 #, gcc-internal-format msgid "Offset of packed bit-field %qD has changed in GCC 4.4" msgstr "" -#: stor-layout.c:1489 +#: stor-layout.c:1491 #, gcc-internal-format msgid "padding struct size to alignment boundary" msgstr "" -#: stor-layout.c:1519 +#: stor-layout.c:1521 #, gcc-internal-format msgid "packed attribute causes inefficient alignment for %qE" msgstr "" -#: stor-layout.c:1523 +#: stor-layout.c:1525 #, gcc-internal-format msgid "packed attribute is unnecessary for %qE" msgstr "" -#: stor-layout.c:1529 +#: stor-layout.c:1531 #, gcc-internal-format msgid "packed attribute causes inefficient alignment" msgstr "" -#: stor-layout.c:1531 +#: stor-layout.c:1533 #, gcc-internal-format msgid "packed attribute is unnecessary" msgstr "" -#: stor-layout.c:2046 +#: stor-layout.c:2048 #, gcc-internal-format msgid "alignment of array elements is greater than element size" msgstr "" @@ -18313,652 +18354,652 @@ msgstr "" msgid "type is deprecated" msgstr "" -#: toplev.c:1193 +#: toplev.c:1197 #, gcc-internal-format msgid "unrecognized gcc debugging option: %c" msgstr "" -#: toplev.c:1458 +#: toplev.c:1462 #, fuzzy, gcc-internal-format msgid "can%'t open %s for writing: %m" msgstr "немагчыма адчыніць %s для запісу" -#: toplev.c:1479 +#: toplev.c:1483 #, fuzzy, gcc-internal-format msgid "-frecord-gcc-switches is not supported by the current target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:1816 +#: toplev.c:1824 #, fuzzy, gcc-internal-format msgid "this target does not support %qs" msgstr "%s не падтрымлівае %s" -#: toplev.c:1873 +#: toplev.c:1881 #, gcc-internal-format msgid "instruction scheduling not supported on this target machine" msgstr "" -#: toplev.c:1877 +#: toplev.c:1885 #, gcc-internal-format msgid "this target machine does not have delayed branches" msgstr "" -#: toplev.c:1891 +#: toplev.c:1899 #, gcc-internal-format msgid "-f%sleading-underscore not supported on this target machine" msgstr "" -#: toplev.c:1934 +#: toplev.c:1942 #, fuzzy, gcc-internal-format msgid "could not close zeroed insn dump file %qs: %s" msgstr "немагчыма зачыніць уваходзячы файл %s" -#: toplev.c:1999 +#: toplev.c:2007 #, gcc-internal-format msgid "target system does not support the \"%s\" debug format" msgstr "" -#: toplev.c:2011 +#: toplev.c:2019 #, gcc-internal-format msgid "variable tracking requested, but useless unless producing debug info" msgstr "" -#: toplev.c:2014 +#: toplev.c:2022 #, gcc-internal-format msgid "variable tracking requested, but not supported by this debug format" msgstr "" -#: toplev.c:2042 +#: toplev.c:2050 #, gcc-internal-format msgid "var-tracking-assignments changes selective scheduling" msgstr "" -#: toplev.c:2058 +#: toplev.c:2066 #, fuzzy, gcc-internal-format msgid "can%'t open %s: %m" msgstr "немагчыма адчыніць %s" -#: toplev.c:2065 +#: toplev.c:2073 #, fuzzy, gcc-internal-format msgid "-ffunction-sections not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:2070 +#: toplev.c:2078 #, fuzzy, gcc-internal-format msgid "-fdata-sections not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:2077 +#: toplev.c:2085 #, gcc-internal-format msgid "-ffunction-sections disabled; it makes profiling impossible" msgstr "" -#: toplev.c:2084 +#: toplev.c:2092 #, fuzzy, gcc-internal-format msgid "-fprefetch-loop-arrays not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:2090 +#: toplev.c:2098 #, gcc-internal-format msgid "-fprefetch-loop-arrays not supported for this target (try -march switches)" msgstr "" -#: toplev.c:2099 +#: toplev.c:2107 #, gcc-internal-format msgid "-fprefetch-loop-arrays is not supported with -Os" msgstr "" -#: toplev.c:2110 +#: toplev.c:2118 #, gcc-internal-format msgid "-fassociative-math disabled; other options take precedence" msgstr "" -#: toplev.c:2126 +#: toplev.c:2134 #, fuzzy, gcc-internal-format msgid "-fstack-protector not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:2139 +#: toplev.c:2147 #, gcc-internal-format msgid "unwind tables currently require a frame pointer for correctness" msgstr "" -#: toplev.c:2360 +#: toplev.c:2372 #, fuzzy, gcc-internal-format msgid "error writing to %s: %m" msgstr "памылка запісу ў %s" -#: toplev.c:2362 java/jcf-parse.c:1767 +#: toplev.c:2374 java/jcf-parse.c:1767 #, fuzzy, gcc-internal-format msgid "error closing %s: %m" msgstr "памылка запісу ў %s" -#: tree-cfg.c:2519 +#: tree-cfg.c:2507 #, gcc-internal-format msgid "SSA name in freelist but still referenced" msgstr "" -#: tree-cfg.c:2528 +#: tree-cfg.c:2516 #, gcc-internal-format msgid "Indirect reference's operand is not a register or a constant." msgstr "" -#: tree-cfg.c:2537 +#: tree-cfg.c:2525 #, gcc-internal-format msgid "ASSERT_EXPR with an always-false condition" msgstr "" -#: tree-cfg.c:2543 +#: tree-cfg.c:2531 #, gcc-internal-format msgid "MODIFY_EXPR not expected while having tuples." msgstr "" -#: tree-cfg.c:2564 +#: tree-cfg.c:2552 #, gcc-internal-format msgid "constant not recomputed when ADDR_EXPR changed" msgstr "" -#: tree-cfg.c:2569 +#: tree-cfg.c:2557 #, gcc-internal-format msgid "side effects not recomputed when ADDR_EXPR changed" msgstr "" -#: tree-cfg.c:2587 tree-ssa.c:826 +#: tree-cfg.c:2575 tree-ssa.c:826 #, gcc-internal-format msgid "address taken, but ADDRESSABLE bit not set" msgstr "" -#: tree-cfg.c:2592 +#: tree-cfg.c:2580 #, gcc-internal-format msgid "DECL_GIMPLE_REG_P set on a variable with address taken" msgstr "" -#: tree-cfg.c:2603 +#: tree-cfg.c:2591 #, gcc-internal-format msgid "non-integral used in condition" msgstr "" -#: tree-cfg.c:2608 +#: tree-cfg.c:2596 #, fuzzy, gcc-internal-format msgid "invalid conditional operand" msgstr "нерэчаісны %%c аперанд" -#: tree-cfg.c:2655 +#: tree-cfg.c:2643 #, gcc-internal-format msgid "invalid position or size operand to BIT_FIELD_REF" msgstr "" -#: tree-cfg.c:2662 +#: tree-cfg.c:2650 #, gcc-internal-format msgid "integral result type precision does not match field size of BIT_FIELD_REF" msgstr "" -#: tree-cfg.c:2670 +#: tree-cfg.c:2658 #, gcc-internal-format msgid "mode precision of non-integral result does not match field size of BIT_FIELD_REF" msgstr "" -#: tree-cfg.c:2681 +#: tree-cfg.c:2669 #, gcc-internal-format msgid "invalid reference prefix" msgstr "" -#: tree-cfg.c:2692 +#: tree-cfg.c:2680 #, fuzzy, gcc-internal-format msgid "invalid operand to plus/minus, type is a pointer" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:2703 +#: tree-cfg.c:2691 #, gcc-internal-format msgid "invalid operand to pointer plus, first operand is not a pointer" msgstr "" -#: tree-cfg.c:2711 +#: tree-cfg.c:2699 #, gcc-internal-format msgid "invalid operand to pointer plus, second operand is not an integer with type of sizetype." msgstr "" -#: tree-cfg.c:2782 +#: tree-cfg.c:2770 #, fuzzy, gcc-internal-format msgid "invalid expression for min lvalue" msgstr "нерэчаіснае значэньне %%m" -#: tree-cfg.c:2793 +#: tree-cfg.c:2781 #, fuzzy, gcc-internal-format msgid "invalid operand in indirect reference" msgstr "Нерэчаісны выбар \"%s\"" -#: tree-cfg.c:2800 +#: tree-cfg.c:2788 #, gcc-internal-format msgid "type mismatch in indirect reference" msgstr "" -#: tree-cfg.c:2829 +#: tree-cfg.c:2817 #, fuzzy, gcc-internal-format msgid "invalid operands to array reference" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:2840 +#: tree-cfg.c:2828 #, gcc-internal-format msgid "type mismatch in array reference" msgstr "" -#: tree-cfg.c:2849 +#: tree-cfg.c:2837 #, gcc-internal-format msgid "type mismatch in array range reference" msgstr "" -#: tree-cfg.c:2860 +#: tree-cfg.c:2848 #, gcc-internal-format msgid "type mismatch in real/imagpart reference" msgstr "" -#: tree-cfg.c:2870 +#: tree-cfg.c:2858 #, gcc-internal-format msgid "type mismatch in component reference" msgstr "" -#: tree-cfg.c:2887 +#: tree-cfg.c:2875 #, gcc-internal-format msgid "Conversion of an SSA_NAME on the left hand side." msgstr "" -#: tree-cfg.c:2945 +#: tree-cfg.c:2933 #, fuzzy, gcc-internal-format msgid "invalid function in gimple call" msgstr "Нерэчаісная спецыфікацыя! Памылка ў cc." -#: tree-cfg.c:2954 +#: tree-cfg.c:2942 #, gcc-internal-format msgid "non-function in gimple call" msgstr "" -#: tree-cfg.c:2962 +#: tree-cfg.c:2950 #, gcc-internal-format msgid "invalid LHS in gimple call" msgstr "" -#: tree-cfg.c:2968 +#: tree-cfg.c:2956 #, gcc-internal-format msgid "LHS in noreturn call" msgstr "" -#: tree-cfg.c:2984 +#: tree-cfg.c:2972 #, gcc-internal-format msgid "invalid conversion in gimple call" msgstr "" -#: tree-cfg.c:2993 +#: tree-cfg.c:2981 #, gcc-internal-format msgid "invalid static chain in gimple call" msgstr "" -#: tree-cfg.c:3005 +#: tree-cfg.c:2993 #, gcc-internal-format msgid "static chain in indirect gimple call" msgstr "" -#: tree-cfg.c:3012 +#: tree-cfg.c:3000 #, gcc-internal-format msgid "static chain with function that doesn't use one" msgstr "" -#: tree-cfg.c:3027 +#: tree-cfg.c:3015 #, fuzzy, gcc-internal-format msgid "invalid argument to gimple call" msgstr "нявернае выкарыстанне \"restict\"" -#: tree-cfg.c:3046 +#: tree-cfg.c:3034 #, fuzzy, gcc-internal-format msgid "invalid operands in gimple comparison" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:3064 +#: tree-cfg.c:3052 #, gcc-internal-format msgid "type mismatch in comparison expression" msgstr "" -#: tree-cfg.c:3090 +#: tree-cfg.c:3078 #, gcc-internal-format msgid "non-register as LHS of unary operation" msgstr "" -#: tree-cfg.c:3096 +#: tree-cfg.c:3084 #, fuzzy, gcc-internal-format msgid "invalid operand in unary operation" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:3131 +#: tree-cfg.c:3119 #, fuzzy, gcc-internal-format msgid "invalid types in nop conversion" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:3146 +#: tree-cfg.c:3134 #, gcc-internal-format msgid "invalid types in address space conversion" msgstr "" -#: tree-cfg.c:3160 +#: tree-cfg.c:3148 #, gcc-internal-format msgid "invalid types in fixed-point conversion" msgstr "" -#: tree-cfg.c:3173 +#: tree-cfg.c:3161 #, gcc-internal-format msgid "invalid types in conversion to floating point" msgstr "" -#: tree-cfg.c:3186 +#: tree-cfg.c:3174 #, gcc-internal-format msgid "invalid types in conversion to integer" msgstr "" -#: tree-cfg.c:3221 +#: tree-cfg.c:3209 #, gcc-internal-format msgid "non-trivial conversion in unary operation" msgstr "" -#: tree-cfg.c:3248 +#: tree-cfg.c:3236 #, gcc-internal-format msgid "non-register as LHS of binary operation" msgstr "" -#: tree-cfg.c:3255 +#: tree-cfg.c:3243 #, fuzzy, gcc-internal-format msgid "invalid operands in binary operation" msgstr "прапушчан ініцыялізатар" -#: tree-cfg.c:3270 +#: tree-cfg.c:3258 #, gcc-internal-format msgid "type mismatch in complex expression" msgstr "" -#: tree-cfg.c:3299 +#: tree-cfg.c:3287 #, gcc-internal-format msgid "type mismatch in shift expression" msgstr "" -#: tree-cfg.c:3321 +#: tree-cfg.c:3309 #, gcc-internal-format msgid "type mismatch in vector shift expression" msgstr "" -#: tree-cfg.c:3334 +#: tree-cfg.c:3322 #, gcc-internal-format msgid "non-element sized vector shift of floating point vector" msgstr "" -#: tree-cfg.c:3352 +#: tree-cfg.c:3340 #, gcc-internal-format msgid "invalid non-vector operands to vector valued plus" msgstr "" -#: tree-cfg.c:3376 +#: tree-cfg.c:3364 #, gcc-internal-format msgid "invalid (pointer) operands to plus/minus" msgstr "" -#: tree-cfg.c:3391 +#: tree-cfg.c:3379 #, gcc-internal-format msgid "type mismatch in pointer plus expression" msgstr "" -#: tree-cfg.c:3414 +#: tree-cfg.c:3402 #, gcc-internal-format msgid "type mismatch in binary truth expression" msgstr "" -#: tree-cfg.c:3482 +#: tree-cfg.c:3470 #, gcc-internal-format msgid "type mismatch in binary expression" msgstr "" -#: tree-cfg.c:3507 +#: tree-cfg.c:3495 #, gcc-internal-format msgid "non-trivial conversion at assignment" msgstr "" -#: tree-cfg.c:3524 +#: tree-cfg.c:3512 #, fuzzy, gcc-internal-format msgid "invalid operand in unary expression" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:3532 +#: tree-cfg.c:3520 #, gcc-internal-format msgid "type mismatch in address expression" msgstr "" -#: tree-cfg.c:3556 tree-cfg.c:3582 +#: tree-cfg.c:3544 tree-cfg.c:3570 #, fuzzy, gcc-internal-format msgid "invalid rhs for gimple memory store" msgstr "нерэчаісны рэжым для gen_tst_reg" -#: tree-cfg.c:3646 +#: tree-cfg.c:3634 #, fuzzy, gcc-internal-format msgid "invalid operand in return statement" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:3658 +#: tree-cfg.c:3646 #, gcc-internal-format msgid "invalid conversion in return statement" msgstr "" -#: tree-cfg.c:3682 +#: tree-cfg.c:3670 #, gcc-internal-format msgid "goto destination is neither a label nor a pointer" msgstr "" -#: tree-cfg.c:3697 +#: tree-cfg.c:3685 #, fuzzy, gcc-internal-format msgid "invalid operand to switch statement" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:3717 +#: tree-cfg.c:3705 #, fuzzy, gcc-internal-format msgid "Invalid PHI result" msgstr "нерэчаісны адрас" -#: tree-cfg.c:3729 +#: tree-cfg.c:3717 #, fuzzy, gcc-internal-format msgid "Invalid PHI argument" msgstr "нерэчаіснае значэньне %%P" -#: tree-cfg.c:3735 +#: tree-cfg.c:3723 #, gcc-internal-format msgid "Incompatible types in PHI argument %u" msgstr "" -#: tree-cfg.c:3782 +#: tree-cfg.c:3770 #, fuzzy, gcc-internal-format msgid "invalid comparison code in gimple cond" msgstr "нерэчаісны %%-код" -#: tree-cfg.c:3790 +#: tree-cfg.c:3778 #, gcc-internal-format msgid "invalid labels in gimple cond" msgstr "" -#: tree-cfg.c:3889 +#: tree-cfg.c:3877 #, gcc-internal-format msgid "verify_gimple failed" msgstr "" -#: tree-cfg.c:3924 +#: tree-cfg.c:3912 #, gcc-internal-format msgid "invalid function in call statement" msgstr "" -#: tree-cfg.c:3935 +#: tree-cfg.c:3923 #, fuzzy, gcc-internal-format msgid "invalid pure const state for function" msgstr "Нерэчаісны выбар \"%s\"" -#: tree-cfg.c:3948 tree-ssa.c:1001 tree-ssa.c:1010 +#: tree-cfg.c:3936 tree-ssa.c:1001 tree-ssa.c:1010 #, fuzzy, gcc-internal-format msgid "in statement" msgstr "вельмі шмат аргументаў у функцыі" -#: tree-cfg.c:3968 +#: tree-cfg.c:3956 #, gcc-internal-format msgid "statement marked for throw, but doesn%'t" msgstr "" -#: tree-cfg.c:3974 +#: tree-cfg.c:3962 #, gcc-internal-format msgid "statement marked for throw in middle of block" msgstr "" -#: tree-cfg.c:4046 +#: tree-cfg.c:4034 #, gcc-internal-format msgid "Dead STMT in EH table" msgstr "" -#: tree-cfg.c:4084 +#: tree-cfg.c:4072 #, gcc-internal-format msgid "gimple_bb (phi) is set to a wrong basic block" msgstr "" -#: tree-cfg.c:4095 +#: tree-cfg.c:4083 #, fuzzy, gcc-internal-format msgid "missing PHI def" msgstr "Прапушчан ідэнтыфікатар" -#: tree-cfg.c:4106 +#: tree-cfg.c:4094 #, gcc-internal-format msgid "PHI argument is not a GIMPLE value" msgstr "" -#: tree-cfg.c:4115 tree-cfg.c:4188 +#: tree-cfg.c:4103 tree-cfg.c:4176 #, gcc-internal-format msgid "incorrect sharing of tree nodes" msgstr "" -#: tree-cfg.c:4138 +#: tree-cfg.c:4126 #, fuzzy, gcc-internal-format msgid "invalid GIMPLE statement" msgstr "Нерэчаісны выбар %s" -#: tree-cfg.c:4147 +#: tree-cfg.c:4135 #, gcc-internal-format msgid "gimple_bb (stmt) is set to a wrong basic block" msgstr "" -#: tree-cfg.c:4160 +#: tree-cfg.c:4148 #, gcc-internal-format msgid "incorrect entry in label_to_block_map" msgstr "" -#: tree-cfg.c:4170 +#: tree-cfg.c:4158 #, gcc-internal-format msgid "incorrect setting of landing pad number" msgstr "" -#: tree-cfg.c:4204 +#: tree-cfg.c:4192 #, gcc-internal-format msgid "verify_stmts failed" msgstr "" -#: tree-cfg.c:4227 +#: tree-cfg.c:4215 #, gcc-internal-format msgid "ENTRY_BLOCK has IL associated with it" msgstr "" -#: tree-cfg.c:4233 +#: tree-cfg.c:4221 #, gcc-internal-format msgid "EXIT_BLOCK has IL associated with it" msgstr "" -#: tree-cfg.c:4240 +#: tree-cfg.c:4228 #, gcc-internal-format msgid "fallthru to exit from bb %d" msgstr "" -#: tree-cfg.c:4264 +#: tree-cfg.c:4252 #, gcc-internal-format msgid "nonlocal label " msgstr "" -#: tree-cfg.c:4273 +#: tree-cfg.c:4261 #, gcc-internal-format msgid "EH landing pad label " msgstr "" -#: tree-cfg.c:4282 tree-cfg.c:4291 tree-cfg.c:4316 +#: tree-cfg.c:4270 tree-cfg.c:4279 tree-cfg.c:4304 #, gcc-internal-format msgid "label " msgstr "" -#: tree-cfg.c:4306 +#: tree-cfg.c:4294 #, gcc-internal-format msgid "control flow in the middle of basic block %d" msgstr "" -#: tree-cfg.c:4339 +#: tree-cfg.c:4327 #, gcc-internal-format msgid "fallthru edge after a control statement in bb %d" msgstr "" -#: tree-cfg.c:4352 +#: tree-cfg.c:4340 #, gcc-internal-format msgid "true/false edge after a non-GIMPLE_COND in bb %d" msgstr "" -#: tree-cfg.c:4375 tree-cfg.c:4397 tree-cfg.c:4410 tree-cfg.c:4479 +#: tree-cfg.c:4363 tree-cfg.c:4385 tree-cfg.c:4398 tree-cfg.c:4467 #, gcc-internal-format msgid "wrong outgoing edge flags at end of bb %d" msgstr "" -#: tree-cfg.c:4385 +#: tree-cfg.c:4373 #, gcc-internal-format msgid "explicit goto at end of bb %d" msgstr "" -#: tree-cfg.c:4415 +#: tree-cfg.c:4403 #, gcc-internal-format msgid "return edge does not point to exit in bb %d" msgstr "" -#: tree-cfg.c:4445 +#: tree-cfg.c:4433 #, gcc-internal-format msgid "found default case not at the start of case vector" msgstr "" -#: tree-cfg.c:4453 +#: tree-cfg.c:4441 #, fuzzy, gcc-internal-format msgid "case labels not sorted: " msgstr "%s не падтрымлівае %s" -#: tree-cfg.c:4470 +#: tree-cfg.c:4458 #, gcc-internal-format msgid "extra outgoing edge %d->%d" msgstr "" -#: tree-cfg.c:4493 +#: tree-cfg.c:4481 #, fuzzy, gcc-internal-format msgid "missing edge %i->%i" msgstr "прапушчана поле '%s' у '%s'" -#: tree-cfg.c:7121 +#: tree-cfg.c:7109 #, gcc-internal-format msgid "% function does return" msgstr "" -#: tree-cfg.c:7141 +#: tree-cfg.c:7129 #, gcc-internal-format msgid "control reaches end of non-void function" msgstr "" -#: tree-cfg.c:7204 +#: tree-cfg.c:7192 #, gcc-internal-format msgid "function might be possible candidate for attribute %" msgstr "" -#: tree-cfg.c:7275 +#: tree-cfg.c:7263 #, gcc-internal-format msgid "ignoring return value of %qD, declared with attribute warn_unused_result" msgstr "" -#: tree-cfg.c:7280 +#: tree-cfg.c:7268 #, gcc-internal-format msgid "ignoring return value of function declared with attribute warn_unused_result" msgstr "" @@ -18973,112 +19014,112 @@ msgstr "Немагчыма адчыніць файл з дадзенымі %s.\n msgid "ignoring unknown option %q.*s in %<-fdump-%s%>" msgstr "" -#: tree-eh.c:3880 +#: tree-eh.c:3923 #, gcc-internal-format msgid "BB %i has multiple EH edges" msgstr "" -#: tree-eh.c:3892 +#: tree-eh.c:3935 #, gcc-internal-format msgid "BB %i can not throw but has an EH edge" msgstr "" -#: tree-eh.c:3900 +#: tree-eh.c:3943 #, gcc-internal-format msgid "BB %i last statement has incorrectly set lp" msgstr "" -#: tree-eh.c:3906 +#: tree-eh.c:3949 #, gcc-internal-format msgid "BB %i is missing an EH edge" msgstr "" -#: tree-eh.c:3912 +#: tree-eh.c:3955 #, gcc-internal-format msgid "Incorrect EH edge %i->%i" msgstr "" -#: tree-eh.c:3946 tree-eh.c:3965 +#: tree-eh.c:3989 tree-eh.c:4008 #, gcc-internal-format msgid "BB %i is missing an edge" msgstr "" -#: tree-eh.c:3982 +#: tree-eh.c:4025 #, gcc-internal-format msgid "BB %i too many fallthru edges" msgstr "" -#: tree-eh.c:3991 +#: tree-eh.c:4034 #, gcc-internal-format msgid "BB %i has incorrect edge" msgstr "" -#: tree-eh.c:3997 +#: tree-eh.c:4040 #, gcc-internal-format msgid "BB %i has incorrect fallthru edge" msgstr "" -#: tree-inline.c:2744 +#: tree-inline.c:2751 #, gcc-internal-format msgid "function %q+F can never be copied because it receives a non-local goto" msgstr "" -#: tree-inline.c:2761 +#: tree-inline.c:2768 #, gcc-internal-format msgid "function %q+F can never be copied because it saves address of local label in a static variable" msgstr "" -#: tree-inline.c:2799 +#: tree-inline.c:2806 #, gcc-internal-format msgid "function %q+F can never be inlined because it uses alloca (override using the always_inline attribute)" msgstr "" -#: tree-inline.c:2813 +#: tree-inline.c:2820 #, gcc-internal-format msgid "function %q+F can never be inlined because it uses setjmp" msgstr "" -#: tree-inline.c:2827 +#: tree-inline.c:2834 #, gcc-internal-format msgid "function %q+F can never be inlined because it uses variable argument lists" msgstr "" -#: tree-inline.c:2839 +#: tree-inline.c:2846 #, gcc-internal-format msgid "function %q+F can never be inlined because it uses setjmp-longjmp exception handling" msgstr "" -#: tree-inline.c:2847 +#: tree-inline.c:2854 #, gcc-internal-format msgid "function %q+F can never be inlined because it uses non-local goto" msgstr "" -#: tree-inline.c:2859 +#: tree-inline.c:2866 #, gcc-internal-format msgid "function %q+F can never be inlined because it uses __builtin_return or __builtin_apply_args" msgstr "" -#: tree-inline.c:2879 +#: tree-inline.c:2886 #, gcc-internal-format msgid "function %q+F can never be inlined because it contains a computed goto" msgstr "" -#: tree-inline.c:2959 +#: tree-inline.c:2966 #, gcc-internal-format msgid "function %q+F can never be inlined because it is suppressed using -fno-inline" msgstr "" -#: tree-inline.c:2973 +#: tree-inline.c:2980 #, gcc-internal-format msgid "function %q+F can never be inlined because it uses attributes conflicting with inlining" msgstr "" -#: tree-inline.c:3544 tree-inline.c:3555 +#: tree-inline.c:3551 tree-inline.c:3562 #, gcc-internal-format msgid "inlining failed in call to %q+F: %s" msgstr "" -#: tree-inline.c:3546 tree-inline.c:3557 +#: tree-inline.c:3553 tree-inline.c:3564 #, gcc-internal-format msgid "called from here" msgstr "выклікана адсюль" @@ -19113,7 +19154,7 @@ msgstr "памер вяртаемага значэння \"%s\" %u байт" msgid "size of return value of %q+D is larger than %wd bytes" msgstr "памер вяртаемага значэння \"%s\" больш чым %d байт" -#: tree-outof-ssa.c:756 tree-outof-ssa.c:813 tree-ssa-coalesce.c:959 +#: tree-outof-ssa.c:777 tree-outof-ssa.c:834 tree-ssa-coalesce.c:959 #: tree-ssa-coalesce.c:974 tree-ssa-coalesce.c:1196 tree-ssa-live.c:1184 #, gcc-internal-format msgid "SSA corruption" @@ -19274,147 +19315,147 @@ msgstr "\"%s\" не абвешчан (першае выкарыстанне ў msgid "%qD may be used uninitialized in this function" msgstr "" -#: tree-vrp.c:5015 +#: tree-vrp.c:5025 #, gcc-internal-format msgid "array subscript is outside array bounds" msgstr "" -#: tree-vrp.c:5030 +#: tree-vrp.c:5040 #, gcc-internal-format msgid "array subscript is above array bounds" msgstr "" -#: tree-vrp.c:5037 +#: tree-vrp.c:5047 #, gcc-internal-format msgid "array subscript is below array bounds" msgstr "" -#: tree-vrp.c:5686 +#: tree-vrp.c:5689 #, gcc-internal-format msgid "assuming signed overflow does not occur when simplifying conditional to constant" msgstr "" -#: tree-vrp.c:5692 +#: tree-vrp.c:5695 #, gcc-internal-format msgid "assuming signed overflow does not occur when simplifying conditional" msgstr "" -#: tree-vrp.c:5736 +#: tree-vrp.c:5739 #, gcc-internal-format msgid "comparison always false due to limited range of data type" msgstr "" -#: tree-vrp.c:5738 +#: tree-vrp.c:5741 #, gcc-internal-format msgid "comparison always true due to limited range of data type" msgstr "" -#: tree-vrp.c:6578 +#: tree-vrp.c:6589 #, gcc-internal-format msgid "assuming signed overflow does not occur when simplifying % or %<%%%> to %<>>%> or %<&%>" msgstr "" -#: tree-vrp.c:6660 +#: tree-vrp.c:6671 #, gcc-internal-format msgid "assuming signed overflow does not occur when simplifying % to % or %<-X%>" msgstr "" -#: tree.c:4080 +#: tree.c:4084 #, gcc-internal-format msgid "ignoring attributes applied to %qT after definition" msgstr "" -#: tree.c:5208 +#: tree.c:5220 #, gcc-internal-format msgid "%q+D already declared with dllexport attribute: dllimport ignored" msgstr "" -#: tree.c:5220 +#: tree.c:5232 #, gcc-internal-format msgid "%q+D redeclared without dllimport attribute after being referenced with dll linkage" msgstr "" -#: tree.c:5235 +#: tree.c:5247 #, gcc-internal-format msgid "%q+D redeclared without dllimport attribute: previous dllimport ignored" msgstr "" -#: tree.c:5335 +#: tree.c:5347 #, gcc-internal-format msgid "inline function %q+D declared as dllimport: attribute ignored" msgstr "" -#: tree.c:5343 +#: tree.c:5355 #, gcc-internal-format msgid "function %q+D definition is marked dllimport" msgstr "" -#: tree.c:5351 config/sh/symbian-c.c:144 config/sh/symbian-cxx.c:576 +#: tree.c:5363 config/sh/symbian-c.c:144 config/sh/symbian-cxx.c:576 #, gcc-internal-format msgid "variable %q+D definition is marked dllimport" msgstr "" -#: tree.c:5378 config/sh/symbian-c.c:164 config/sh/symbian-cxx.c:651 +#: tree.c:5390 config/sh/symbian-c.c:164 config/sh/symbian-cxx.c:651 #, gcc-internal-format msgid "external linkage required for symbol %q+D because of %qE attribute" msgstr "" -#: tree.c:5392 +#: tree.c:5404 #, gcc-internal-format msgid "%qE implies default visibility, but %qD has already been declared with a different visibility" msgstr "" -#: tree.c:6992 +#: tree.c:7004 #, gcc-internal-format msgid "arrays of functions are not meaningful" msgstr "" -#: tree.c:7129 +#: tree.c:7141 #, gcc-internal-format msgid "function return type cannot be function" msgstr "" -#: tree.c:8341 tree.c:8426 tree.c:8487 +#: tree.c:8361 tree.c:8446 tree.c:8507 #, gcc-internal-format msgid "tree check: %s, have %s in %s, at %s:%d" msgstr "" -#: tree.c:8378 +#: tree.c:8398 #, gcc-internal-format msgid "tree check: expected none of %s, have %s in %s, at %s:%d" msgstr "" -#: tree.c:8391 +#: tree.c:8411 #, gcc-internal-format msgid "tree check: expected class %qs, have %qs (%s) in %s, at %s:%d" msgstr "" -#: tree.c:8440 +#: tree.c:8460 #, gcc-internal-format msgid "tree check: did not expect class %qs, have %qs (%s) in %s, at %s:%d" msgstr "" -#: tree.c:8453 +#: tree.c:8473 #, gcc-internal-format msgid "tree check: expected omp_clause %s, have %s in %s, at %s:%d" msgstr "" -#: tree.c:8513 +#: tree.c:8533 #, gcc-internal-format msgid "tree check: expected tree that contains %qs structure, have %qs in %s, at %s:%d" msgstr "" -#: tree.c:8527 +#: tree.c:8547 #, gcc-internal-format msgid "tree check: accessed elt %d of tree_vec with %d elts in %s, at %s:%d" msgstr "" -#: tree.c:8540 +#: tree.c:8560 #, gcc-internal-format msgid "tree check: accessed operand %d of %s with %d operands in %s, at %s:%d" msgstr "" -#: tree.c:8553 +#: tree.c:8573 #, gcc-internal-format msgid "tree check: accessed operand %d of omp_clause %s with %d operands in %s, at %s:%d" msgstr "" @@ -19444,6 +19485,16 @@ msgstr "" msgid "Corrupted value profile: %s profiler overall count (%d) does not match BB count (%d)" msgstr "" +#: var-tracking.c:6051 +#, gcc-internal-format +msgid "variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without" +msgstr "" + +#: var-tracking.c:6055 +#, gcc-internal-format +msgid "variable tracking size limit exceeded" +msgstr "" + #: varasm.c:580 #, gcc-internal-format msgid "%+D causes a section type conflict" @@ -19454,132 +19505,132 @@ msgstr "" msgid "alignment of %q+D is greater than maximum object file alignment. Using %d" msgstr "" -#: varasm.c:1363 varasm.c:1371 +#: varasm.c:1364 varasm.c:1372 #, gcc-internal-format msgid "register name not specified for %q+D" msgstr "" -#: varasm.c:1373 +#: varasm.c:1374 #, fuzzy, gcc-internal-format msgid "invalid register name for %q+D" msgstr "нерэчаісная назва рэгістра `%s'" -#: varasm.c:1375 +#: varasm.c:1376 #, gcc-internal-format msgid "data type of %q+D isn%'t suitable for a register" msgstr "" -#: varasm.c:1378 +#: varasm.c:1379 #, gcc-internal-format msgid "register specified for %q+D isn%'t suitable for data type" msgstr "" -#: varasm.c:1388 +#: varasm.c:1389 #, gcc-internal-format msgid "global register variable has initial value" msgstr "" -#: varasm.c:1392 +#: varasm.c:1393 #, gcc-internal-format msgid "optimization may eliminate reads and/or writes to register variables" msgstr "" -#: varasm.c:1430 +#: varasm.c:1431 #, gcc-internal-format msgid "register name given for non-register variable %q+D" msgstr "" -#: varasm.c:1507 +#: varasm.c:1548 #, fuzzy, gcc-internal-format msgid "global destructors not supported on this target" msgstr "__buitin_saveregs не падтрымліваецца гэтай мэтай" -#: varasm.c:1573 +#: varasm.c:1614 #, fuzzy, gcc-internal-format msgid "global constructors not supported on this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: varasm.c:1960 +#: varasm.c:2001 #, gcc-internal-format msgid "thread-local COMMON data not implemented" msgstr "" -#: varasm.c:1989 +#: varasm.c:2030 #, gcc-internal-format msgid "requested alignment for %q+D is greater than implemented alignment of %wu" msgstr "" -#: varasm.c:4624 +#: varasm.c:4665 #, gcc-internal-format msgid "initializer for integer/fixed-point value is too complicated" msgstr "" -#: varasm.c:4629 +#: varasm.c:4670 #, gcc-internal-format msgid "initializer for floating value is not a floating constant" msgstr "" -#: varasm.c:4935 +#: varasm.c:4976 #, fuzzy, gcc-internal-format msgid "invalid initial value for member %qE" msgstr "нявернае выкарыстанне \"restict\"" -#: varasm.c:5244 varasm.c:5288 +#: varasm.c:5285 varasm.c:5329 #, gcc-internal-format msgid "weak declaration of %q+D must precede definition" msgstr "" -#: varasm.c:5252 +#: varasm.c:5293 #, gcc-internal-format msgid "weak declaration of %q+D after first use results in unspecified behavior" msgstr "" -#: varasm.c:5286 +#: varasm.c:5327 #, gcc-internal-format msgid "weak declaration of %q+D must be public" msgstr "" -#: varasm.c:5290 +#: varasm.c:5331 #, gcc-internal-format msgid "weak declaration of %q+D not supported" msgstr "" -#: varasm.c:5319 varasm.c:5721 +#: varasm.c:5360 varasm.c:5766 #, gcc-internal-format msgid "only weak aliases are supported in this configuration" msgstr "" -#: varasm.c:5536 +#: varasm.c:5581 #, fuzzy, gcc-internal-format msgid "weakref is not supported in this configuration" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: varasm.c:5650 +#: varasm.c:5695 #, gcc-internal-format msgid "%q+D aliased to undefined symbol %qE" msgstr "" -#: varasm.c:5660 +#: varasm.c:5705 #, gcc-internal-format msgid "%q+D aliased to external symbol %qE" msgstr "" -#: varasm.c:5699 +#: varasm.c:5744 #, gcc-internal-format msgid "weakref %q+D ultimately targets itself" msgstr "" -#: varasm.c:5708 +#: varasm.c:5753 #, gcc-internal-format msgid "weakref %q+D must have static linkage" msgstr "" -#: varasm.c:5715 +#: varasm.c:5760 #, fuzzy, gcc-internal-format msgid "alias definitions not supported in this configuration" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: varasm.c:5781 +#: varasm.c:5822 config/sol2.c:156 #, fuzzy, gcc-internal-format msgid "visibility attribute not supported in this configuration; ignored" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" @@ -19666,17 +19717,17 @@ msgstr "" msgid "Unknown value %qs of -mmacosx-version-min" msgstr "" -#: config/darwin.c:1429 +#: config/darwin.c:1428 #, gcc-internal-format msgid "%qE 2.95 vtable-compatibility attribute applies only when compiling a kext" msgstr "" -#: config/darwin.c:1436 +#: config/darwin.c:1435 #, gcc-internal-format msgid "%qE 2.95 vtable-compatibility attribute applies only to C++ classes" msgstr "" -#: config/darwin.c:1561 +#: config/darwin.c:1560 #, gcc-internal-format msgid "internal and protected visibility attributes not supported in this configuration; ignored" msgstr "" @@ -19716,32 +19767,32 @@ msgstr "" msgid "malformed %<#pragma init%>, ignoring" msgstr "" -#: config/sol2-c.c:187 config/sol2-c.c:199 +#: config/sol2-c.c:188 config/sol2-c.c:200 #, gcc-internal-format msgid "malformed %<#pragma init%>" msgstr "" -#: config/sol2-c.c:194 +#: config/sol2-c.c:195 #, gcc-internal-format msgid "junk at end of %<#pragma init%>" msgstr "" -#: config/sol2-c.c:215 config/sol2-c.c:222 +#: config/sol2-c.c:216 config/sol2-c.c:223 #, gcc-internal-format msgid "malformed %<#pragma fini%>, ignoring" msgstr "" -#: config/sol2-c.c:245 config/sol2-c.c:257 +#: config/sol2-c.c:247 config/sol2-c.c:259 #, gcc-internal-format msgid "malformed %<#pragma fini%>" msgstr "" -#: config/sol2-c.c:252 +#: config/sol2-c.c:254 #, gcc-internal-format msgid "junk at end of %<#pragma fini%>" msgstr "" -#: config/sol2.c:53 +#: config/sol2.c:54 #, gcc-internal-format msgid "ignoring %<#pragma align%> for explicitly aligned %q+D" msgstr "" @@ -19767,7 +19818,7 @@ msgstr "-pipe не падтрымліваецца" msgid "profiler support for VxWorks" msgstr "" -#: config/alpha/alpha.c:230 config/rs6000/rs6000.c:3147 +#: config/alpha/alpha.c:230 config/rs6000/rs6000.c:3144 #, gcc-internal-format msgid "bad value %qs for -mtls-size switch" msgstr "" @@ -19802,11 +19853,16 @@ msgstr "" msgid "bad value %qs for -mfp-trap-mode switch" msgstr "" -#: config/alpha/alpha.c:379 config/alpha/alpha.c:391 +#: config/alpha/alpha.c:379 #, gcc-internal-format msgid "bad value %qs for -mcpu switch" msgstr "" +#: config/alpha/alpha.c:391 +#, gcc-internal-format +msgid "bad value %qs for -mtune switch" +msgstr "" + #: config/alpha/alpha.c:398 #, gcc-internal-format msgid "trap mode not supported on Unicos/Mk" @@ -19842,8 +19898,8 @@ msgstr "" msgid "bad value %qs for -mmemory-latency" msgstr "" -#: config/alpha/alpha.c:6732 config/alpha/alpha.c:6735 config/s390/s390.c:8805 -#: config/s390/s390.c:8808 +#: config/alpha/alpha.c:6732 config/alpha/alpha.c:6735 config/s390/s390.c:8824 +#: config/s390/s390.c:8827 #, gcc-internal-format msgid "bad builtin fcode" msgstr "" @@ -19863,7 +19919,7 @@ msgstr "аргумент `__builtin_args_info' павінен быць канс msgid "switch -mcpu=%s conflicts with -march= switch" msgstr "" -#: config/arm/arm.c:1347 config/rs6000/rs6000.c:2366 config/sparc/sparc.c:783 +#: config/arm/arm.c:1347 config/rs6000/rs6000.c:2363 config/sparc/sparc.c:776 #, gcc-internal-format msgid "bad value (%s) for %s switch" msgstr "" @@ -19948,153 +20004,153 @@ msgstr "" msgid "invalid floating point emulation option: -mfpe=%s" msgstr "" -#: config/arm/arm.c:1643 +#: config/arm/arm.c:1645 #, fuzzy, gcc-internal-format msgid "invalid floating point option: -mfpu=%s" msgstr "нерэчаісны выбар --param : %s" -#: config/arm/arm.c:1680 +#: config/arm/arm.c:1684 #, gcc-internal-format msgid "invalid floating point abi: -mfloat-abi=%s" msgstr "" -#: config/arm/arm.c:1688 +#: config/arm/arm.c:1692 #, gcc-internal-format msgid "FPA is unsupported in the AAPCS" msgstr "" -#: config/arm/arm.c:1693 +#: config/arm/arm.c:1697 #, gcc-internal-format msgid "AAPCS does not support -mcaller-super-interworking" msgstr "" -#: config/arm/arm.c:1696 +#: config/arm/arm.c:1700 #, gcc-internal-format msgid "AAPCS does not support -mcallee-super-interworking" msgstr "" -#: config/arm/arm.c:1703 +#: config/arm/arm.c:1707 #, fuzzy, gcc-internal-format msgid "iWMMXt and hardware floating point" msgstr "Выкарыстоўваць апаратную \"плаваючую кропку\"" -#: config/arm/arm.c:1707 +#: config/arm/arm.c:1711 #, gcc-internal-format msgid "Thumb-2 iWMMXt" msgstr "" -#: config/arm/arm.c:1711 +#: config/arm/arm.c:1715 #, gcc-internal-format msgid "__fp16 and no ldrh" msgstr "" -#: config/arm/arm.c:1731 +#: config/arm/arm.c:1735 #, gcc-internal-format msgid "-mfloat-abi=hard and VFP" msgstr "" -#: config/arm/arm.c:1755 +#: config/arm/arm.c:1759 #, fuzzy, gcc-internal-format msgid "invalid thread pointer option: -mtp=%s" msgstr "нерэчаісны выбар --param : %s" -#: config/arm/arm.c:1768 +#: config/arm/arm.c:1772 #, gcc-internal-format msgid "can not use -mtp=cp15 with 16-bit Thumb" msgstr "" -#: config/arm/arm.c:1782 +#: config/arm/arm.c:1786 #, gcc-internal-format msgid "structure size boundary can only be set to %s" msgstr "" -#: config/arm/arm.c:1788 +#: config/arm/arm.c:1792 #, gcc-internal-format msgid "RTP PIC is incompatible with Thumb" msgstr "" -#: config/arm/arm.c:1797 +#: config/arm/arm.c:1801 #, gcc-internal-format msgid "RTP PIC is incompatible with -msingle-pic-base" msgstr "" -#: config/arm/arm.c:1809 +#: config/arm/arm.c:1813 #, gcc-internal-format msgid "-mpic-register= is useless without -fpic" msgstr "" -#: config/arm/arm.c:1818 +#: config/arm/arm.c:1822 #, gcc-internal-format msgid "unable to use '%s' for PIC register" msgstr "" -#: config/arm/arm.c:1871 +#: config/arm/arm.c:1875 #, fuzzy, gcc-internal-format msgid "-freorder-blocks-and-partition not supported on this architecture" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: config/arm/arm.c:3633 +#: config/arm/arm.c:3630 #, gcc-internal-format msgid "Non-AAPCS derived PCS variant" msgstr "" -#: config/arm/arm.c:3635 +#: config/arm/arm.c:3632 #, gcc-internal-format msgid "Variadic functions must use the base AAPCS variant" msgstr "" -#: config/arm/arm.c:3654 +#: config/arm/arm.c:3651 #, gcc-internal-format msgid "PCS variant" msgstr "" -#: config/arm/arm.c:4532 config/arm/arm.c:4550 config/avr/avr.c:4838 -#: config/avr/avr.c:4854 config/bfin/bfin.c:5550 config/bfin/bfin.c:5611 -#: config/bfin/bfin.c:5640 config/h8300/h8300.c:5339 config/i386/i386.c:4409 -#: config/i386/i386.c:25883 config/i386/i386.c:25963 -#: config/m68hc11/m68hc11.c:1168 config/m68k/m68k.c:802 -#: config/mcore/mcore.c:3036 config/mep/mep.c:4062 config/mep/mep.c:4076 -#: config/mep/mep.c:4150 config/rs6000/rs6000.c:23444 config/rx/rx.c:2099 -#: config/sh/sh.c:8680 config/sh/sh.c:8698 config/sh/sh.c:8727 -#: config/sh/sh.c:8809 config/sh/sh.c:8832 config/spu/spu.c:3861 +#: config/arm/arm.c:4529 config/arm/arm.c:4547 config/avr/avr.c:4838 +#: config/avr/avr.c:4854 config/bfin/bfin.c:5551 config/bfin/bfin.c:5612 +#: config/bfin/bfin.c:5641 config/h8300/h8300.c:5343 config/i386/i386.c:4413 +#: config/i386/i386.c:25989 config/i386/i386.c:26069 +#: config/m68hc11/m68hc11.c:1168 config/m68k/m68k.c:806 +#: config/mcore/mcore.c:3036 config/mep/mep.c:4042 config/mep/mep.c:4056 +#: config/mep/mep.c:4130 config/rs6000/rs6000.c:23490 config/rx/rx.c:2099 +#: config/sh/sh.c:8716 config/sh/sh.c:8734 config/sh/sh.c:8763 +#: config/sh/sh.c:8845 config/sh/sh.c:8868 config/spu/spu.c:3851 #: config/stormy16/stormy16.c:2230 config/v850/v850.c:2080 #, fuzzy, gcc-internal-format msgid "%qE attribute only applies to functions" msgstr "\"%s\" звычайна функцыя" -#: config/arm/arm.c:16373 +#: config/arm/arm.c:16401 #, gcc-internal-format msgid "unable to compute real location of stacked parameter" msgstr "" -#: config/arm/arm.c:17953 +#: config/arm/arm.c:17981 #, fuzzy, gcc-internal-format msgid "argument must be a constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" #. @@@ better error message -#: config/arm/arm.c:18261 config/arm/arm.c:18298 +#: config/arm/arm.c:18289 config/arm/arm.c:18326 #, gcc-internal-format msgid "selector must be an immediate" msgstr "" #. @@@ better error message -#: config/arm/arm.c:18341 +#: config/arm/arm.c:18369 #, gcc-internal-format msgid "mask must be an immediate" msgstr "" -#: config/arm/arm.c:19003 +#: config/arm/arm.c:19031 #, gcc-internal-format msgid "no low registers available for popping high registers" msgstr "" -#: config/arm/arm.c:19226 +#: config/arm/arm.c:19254 #, gcc-internal-format msgid "interrupt Service Routines cannot be coded in Thumb mode" msgstr "" -#: config/arm/arm.c:21346 +#: config/arm/arm.c:21374 #, gcc-internal-format msgid "the mangling of % has changed in GCC 4.4" msgstr "" @@ -20154,78 +20210,78 @@ msgstr "" msgid "MCU %qs supported for assembler only" msgstr "" -#: config/bfin/bfin.c:2554 config/m68k/m68k.c:519 +#: config/bfin/bfin.c:2555 config/m68k/m68k.c:523 #, gcc-internal-format msgid "-mshared-library-id=%s is not between 0 and %d" msgstr "" -#: config/bfin/bfin.c:2574 +#: config/bfin/bfin.c:2575 #, gcc-internal-format msgid "-mcpu=%s is not valid" msgstr "" -#: config/bfin/bfin.c:2610 +#: config/bfin/bfin.c:2611 #, gcc-internal-format msgid "-mcpu=%s has invalid silicon revision" msgstr "" -#: config/bfin/bfin.c:2675 +#: config/bfin/bfin.c:2676 #, gcc-internal-format msgid "-mshared-library-id= specified without -mid-shared-library" msgstr "" -#: config/bfin/bfin.c:2678 +#: config/bfin/bfin.c:2679 #, fuzzy, gcc-internal-format msgid "Can't use multiple stack checking methods together." msgstr "Уключаць код правэркі стэку ў праграму" -#: config/bfin/bfin.c:2681 +#: config/bfin/bfin.c:2682 #, gcc-internal-format msgid "ID shared libraries and FD-PIC mode can't be used together." msgstr "" -#: config/bfin/bfin.c:2686 config/m68k/m68k.c:627 +#: config/bfin/bfin.c:2687 config/m68k/m68k.c:631 #, gcc-internal-format msgid "cannot specify both -msep-data and -mid-shared-library" msgstr "" -#: config/bfin/bfin.c:2706 +#: config/bfin/bfin.c:2707 #, gcc-internal-format msgid "-mmulticore can only be used with BF561" msgstr "" -#: config/bfin/bfin.c:2709 +#: config/bfin/bfin.c:2710 #, gcc-internal-format msgid "-mcorea should be used with -mmulticore" msgstr "" -#: config/bfin/bfin.c:2712 +#: config/bfin/bfin.c:2713 #, gcc-internal-format msgid "-mcoreb should be used with -mmulticore" msgstr "" -#: config/bfin/bfin.c:2715 +#: config/bfin/bfin.c:2716 #, gcc-internal-format msgid "-mcorea and -mcoreb can't be used together" msgstr "" -#: config/bfin/bfin.c:5555 +#: config/bfin/bfin.c:5556 #, gcc-internal-format msgid "multiple function type attributes specified" msgstr "" -#: config/bfin/bfin.c:5622 +#: config/bfin/bfin.c:5623 #, gcc-internal-format msgid "can't apply both longcall and shortcall attributes to the same function" msgstr "" -#: config/bfin/bfin.c:5672 config/i386/winnt.c:59 config/mep/mep.c:3966 -#: config/mep/mep.c:4104 +#: config/bfin/bfin.c:5673 config/i386/winnt.c:59 config/mep/mep.c:3946 +#: config/mep/mep.c:4084 #, fuzzy, gcc-internal-format msgid "%qE attribute only applies to variables" msgstr "\"%s\" атрыбут ігнарыруецца" -#: config/bfin/bfin.c:5679 +#: config/bfin/bfin.c:5680 #, fuzzy, gcc-internal-format msgid "%qE attribute cannot be specified for local variables" msgstr "\"%s\" атрыбут ігнарыруецца" @@ -20454,417 +20510,417 @@ msgstr "немагчыма стварыць часовы файл" msgid "can't set position in PCH file: %m" msgstr "немагчыма зачыніць уваходзячы файл %s" -#: config/i386/i386.c:2824 config/i386/i386.c:3075 +#: config/i386/i386.c:2832 config/i386/i386.c:3081 #, gcc-internal-format msgid "bad value (%s) for %stune=%s %s" msgstr "" -#: config/i386/i386.c:2868 -#, gcc-internal-format -msgid "bad value (%s) for %sstringop-strategy=%s %s" -msgstr "" - -#: config/i386/i386.c:2872 +#: config/i386/i386.c:2835 #, gcc-internal-format msgid "%stune=x86-64%s is deprecated. Use %stune=k8%s or %stune=generic%s instead as appropriate." msgstr "" -#: config/i386/i386.c:2882 +#: config/i386/i386.c:2881 #, gcc-internal-format -msgid "generic CPU can be used only for %stune=%s %s" -msgstr "" - -#: config/i386/i386.c:2885 config/i386/i386.c:3036 -#, gcc-internal-format -msgid "bad value (%s) for %sarch=%s %s" +msgid "bad value (%s) for %sstringop-strategy=%s %s" msgstr "" -#: config/i386/i386.c:2896 +#: config/i386/i386.c:2898 #, fuzzy, gcc-internal-format msgid "unknown ABI (%s) for %sabi=%s %s" msgstr "невядомы рэжым машыны \"%s\"" -#: config/i386/i386.c:2911 +#: config/i386/i386.c:2913 #, fuzzy, gcc-internal-format msgid "code model %s does not support PIC mode" msgstr "%s не падтрымлівае %s" -#: config/i386/i386.c:2917 +#: config/i386/i386.c:2919 #, gcc-internal-format msgid "bad value (%s) for %scmodel=%s %s" msgstr "" -#: config/i386/i386.c:2941 +#: config/i386/i386.c:2943 #, gcc-internal-format msgid "bad value (%s) for %sasm=%s %s" msgstr "" -#: config/i386/i386.c:2945 +#: config/i386/i386.c:2947 #, fuzzy, gcc-internal-format msgid "code model %qs not supported in the %s bit mode" msgstr "__buitin_saveregs не падтрымліваецца гэтай мэтай" -#: config/i386/i386.c:2948 +#: config/i386/i386.c:2950 #, gcc-internal-format msgid "%i-bit mode not compiled in" msgstr "" -#: config/i386/i386.c:2960 config/i386/i386.c:3061 +#: config/i386/i386.c:2962 config/i386/i386.c:3066 #, fuzzy, gcc-internal-format msgid "CPU you selected does not support x86-64 instruction set" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: config/i386/i386.c:3094 +#: config/i386/i386.c:3038 +#, gcc-internal-format +msgid "generic CPU can be used only for %stune=%s %s" +msgstr "" + +#: config/i386/i386.c:3041 +#, gcc-internal-format +msgid "bad value (%s) for %sarch=%s %s" +msgstr "" + +#: config/i386/i386.c:3100 #, gcc-internal-format msgid "%sregparm%s is ignored in 64-bit mode" msgstr "" -#: config/i386/i386.c:3097 +#: config/i386/i386.c:3103 #, gcc-internal-format msgid "%sregparm=%d%s is not between 0 and %d" msgstr "" -#: config/i386/i386.c:3110 +#: config/i386/i386.c:3116 #, gcc-internal-format msgid "%salign-loops%s is obsolete, use -falign-loops%s" msgstr "" -#: config/i386/i386.c:3116 config/i386/i386.c:3131 config/i386/i386.c:3146 +#: config/i386/i386.c:3122 config/i386/i386.c:3137 config/i386/i386.c:3152 #, gcc-internal-format msgid "%salign-loops=%d%s is not between 0 and %d" msgstr "" -#: config/i386/i386.c:3125 +#: config/i386/i386.c:3131 #, gcc-internal-format msgid "%salign-jumps%s is obsolete, use -falign-jumps%s" msgstr "" -#: config/i386/i386.c:3140 +#: config/i386/i386.c:3146 #, gcc-internal-format msgid "%salign-functions%s is obsolete, use -falign-functions%s" msgstr "" -#: config/i386/i386.c:3175 +#: config/i386/i386.c:3181 #, gcc-internal-format msgid "%sbranch-cost=%d%s is not between 0 and 5" msgstr "" -#: config/i386/i386.c:3183 +#: config/i386/i386.c:3189 #, gcc-internal-format msgid "%slarge-data-threshold=%d%s is negative" msgstr "" -#: config/i386/i386.c:3197 +#: config/i386/i386.c:3201 #, gcc-internal-format msgid "bad value (%s) for %stls-dialect=%s %s" msgstr "" -#: config/i386/i386.c:3205 +#: config/i386/i386.c:3209 #, gcc-internal-format msgid "pc%d is not valid precision setting (32, 64 or 80)" msgstr "" -#: config/i386/i386.c:3221 +#: config/i386/i386.c:3225 #, gcc-internal-format msgid "%srtd%s is ignored in 64bit mode" msgstr "" -#: config/i386/i386.c:3276 +#: config/i386/i386.c:3280 #, gcc-internal-format msgid "%spreferred-stack-boundary=%d%s is not between %d and 12" msgstr "" -#: config/i386/i386.c:3295 +#: config/i386/i386.c:3299 #, gcc-internal-format msgid "-mincoming-stack-boundary=%d is not between %d and 12" msgstr "" -#: config/i386/i386.c:3308 +#: config/i386/i386.c:3312 #, gcc-internal-format msgid "%ssseregparm%s used without SSE enabled" msgstr "" -#: config/i386/i386.c:3319 config/i386/i386.c:3333 +#: config/i386/i386.c:3323 config/i386/i386.c:3337 #, gcc-internal-format msgid "SSE instruction set disabled, using 387 arithmetics" msgstr "" -#: config/i386/i386.c:3338 +#: config/i386/i386.c:3342 #, gcc-internal-format msgid "387 instruction set disabled, using SSE arithmetics" msgstr "" -#: config/i386/i386.c:3345 +#: config/i386/i386.c:3349 #, gcc-internal-format msgid "bad value (%s) for %sfpmath=%s %s" msgstr "" -#: config/i386/i386.c:3361 +#: config/i386/i386.c:3365 #, gcc-internal-format msgid "unknown vectorization library ABI type (%s) for %sveclibabi=%s %s" msgstr "" -#: config/i386/i386.c:3381 +#: config/i386/i386.c:3385 #, gcc-internal-format msgid "unwind tables currently require either a frame pointer or %saccumulate-outgoing-args%s for correctness" msgstr "" -#: config/i386/i386.c:3394 +#: config/i386/i386.c:3398 #, gcc-internal-format msgid "stack probing requires %saccumulate-outgoing-args%s for correctness" msgstr "" -#: config/i386/i386.c:3805 +#: config/i386/i386.c:3809 #, gcc-internal-format msgid "attribute(target(\"%s\")) is unknown" msgstr "" -#: config/i386/i386.c:3827 +#: config/i386/i386.c:3831 #, gcc-internal-format msgid "option(\"%s\") was already specified" msgstr "" -#: config/i386/i386.c:4422 config/i386/i386.c:4467 +#: config/i386/i386.c:4426 config/i386/i386.c:4471 #, gcc-internal-format msgid "fastcall and regparm attributes are not compatible" msgstr "" -#: config/i386/i386.c:4429 +#: config/i386/i386.c:4433 #, gcc-internal-format msgid "%qE attribute requires an integer constant argument" msgstr "" -#: config/i386/i386.c:4435 +#: config/i386/i386.c:4439 #, fuzzy, gcc-internal-format msgid "argument to %qE attribute larger than %d" msgstr "памер \"%s\" больш чам %d байт" -#: config/i386/i386.c:4459 config/i386/i386.c:4494 +#: config/i386/i386.c:4463 config/i386/i386.c:4498 #, gcc-internal-format msgid "fastcall and cdecl attributes are not compatible" msgstr "" -#: config/i386/i386.c:4463 +#: config/i386/i386.c:4467 #, gcc-internal-format msgid "fastcall and stdcall attributes are not compatible" msgstr "" -#: config/i386/i386.c:4477 config/i386/i386.c:4490 +#: config/i386/i386.c:4481 config/i386/i386.c:4494 #, gcc-internal-format msgid "stdcall and cdecl attributes are not compatible" msgstr "" -#: config/i386/i386.c:4481 +#: config/i386/i386.c:4485 #, gcc-internal-format msgid "stdcall and fastcall attributes are not compatible" msgstr "" -#: config/i386/i386.c:4624 +#: config/i386/i386.c:4628 #, gcc-internal-format msgid "Calling %qD with attribute sseregparm without SSE/SSE2 enabled" msgstr "" -#: config/i386/i386.c:4627 +#: config/i386/i386.c:4631 #, gcc-internal-format msgid "Calling %qT with attribute sseregparm without SSE/SSE2 enabled" msgstr "" -#: config/i386/i386.c:4832 +#: config/i386/i386.c:4836 #, gcc-internal-format msgid "ms_hook_prologue is not compatible with nested function" msgstr "" -#: config/i386/i386.c:4905 +#: config/i386/i386.c:4909 #, gcc-internal-format msgid "ms_abi attribute requires -maccumulate-outgoing-args or subtarget optimization implying it" msgstr "" -#: config/i386/i386.c:5024 +#: config/i386/i386.c:5028 #, gcc-internal-format msgid "AVX vector argument without AVX enabled changes the ABI" msgstr "" -#: config/i386/i386.c:5206 +#: config/i386/i386.c:5210 #, gcc-internal-format msgid "The ABI of passing struct with a flexible array member has changed in GCC 4.4" msgstr "" -#: config/i386/i386.c:5322 +#: config/i386/i386.c:5326 #, gcc-internal-format msgid "The ABI of passing union with long double has changed in GCC 4.4" msgstr "" -#: config/i386/i386.c:5437 +#: config/i386/i386.c:5441 #, gcc-internal-format msgid "The ABI of passing structure with complex float member has changed in GCC 4.4" msgstr "" -#: config/i386/i386.c:5583 +#: config/i386/i386.c:5587 #, gcc-internal-format msgid "SSE register return with SSE disabled" msgstr "" -#: config/i386/i386.c:5589 +#: config/i386/i386.c:5593 #, gcc-internal-format msgid "SSE register argument with SSE disabled" msgstr "" -#: config/i386/i386.c:5605 +#: config/i386/i386.c:5609 #, gcc-internal-format msgid "x87 register return with x87 disabled" msgstr "" -#: config/i386/i386.c:5975 +#: config/i386/i386.c:5979 #, gcc-internal-format msgid "SSE vector argument without SSE enabled changes the ABI" msgstr "" -#: config/i386/i386.c:6013 +#: config/i386/i386.c:6017 #, gcc-internal-format msgid "MMX vector argument without MMX enabled changes the ABI" msgstr "" -#: config/i386/i386.c:6615 +#: config/i386/i386.c:6619 #, gcc-internal-format msgid "SSE vector return without SSE enabled changes the ABI" msgstr "" -#: config/i386/i386.c:6625 +#: config/i386/i386.c:6629 #, gcc-internal-format msgid "MMX vector return without MMX enabled changes the ABI" msgstr "" -#: config/i386/i386.c:11195 +#: config/i386/i386.c:11279 #, gcc-internal-format msgid "extended registers have no high halves" msgstr "" -#: config/i386/i386.c:11210 +#: config/i386/i386.c:11294 #, gcc-internal-format msgid "unsupported operand size for extended register" msgstr "" -#: config/i386/i386.c:11455 +#: config/i386/i386.c:11538 #, gcc-internal-format msgid "non-integer operand used with operand code '%c'" msgstr "" -#: config/i386/i386.c:22863 +#: config/i386/i386.c:22959 #, fuzzy, gcc-internal-format msgid "last argument must be an immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23156 +#: config/i386/i386.c:23256 #, fuzzy, gcc-internal-format msgid "the fifth argument must be a 8-bit immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23251 +#: config/i386/i386.c:23351 #, fuzzy, gcc-internal-format msgid "the third argument must be a 8-bit immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23597 +#: config/i386/i386.c:23704 #, fuzzy, gcc-internal-format msgid "the last argument must be a 4-bit immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23602 +#: config/i386/i386.c:23713 #, fuzzy, gcc-internal-format msgid "the last argument must be a 2-bit immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23611 +#: config/i386/i386.c:23722 #, fuzzy, gcc-internal-format msgid "the last argument must be a 1-bit immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23620 +#: config/i386/i386.c:23731 #, fuzzy, gcc-internal-format msgid "the last argument must be a 5-bit immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23629 +#: config/i386/i386.c:23740 #, gcc-internal-format msgid "the next to last argument must be an 8-bit immediate" msgstr "" -#: config/i386/i386.c:23633 config/i386/i386.c:23831 +#: config/i386/i386.c:23744 config/i386/i386.c:23942 #, fuzzy, gcc-internal-format msgid "the last argument must be an 8-bit immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23829 +#: config/i386/i386.c:23940 #, fuzzy, gcc-internal-format msgid "the last argument must be a 32-bit immediate" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/i386/i386.c:23895 config/rs6000/rs6000.c:10249 +#: config/i386/i386.c:24006 config/rs6000/rs6000.c:10239 #, gcc-internal-format msgid "selector must be an integer constant in the range 0..%wi" msgstr "" -#: config/i386/i386.c:24038 +#: config/i386/i386.c:24149 #, gcc-internal-format msgid "%qE needs unknown isa option" msgstr "" -#: config/i386/i386.c:24042 +#: config/i386/i386.c:24153 #, fuzzy, gcc-internal-format msgid "%qE needs isa option %s" msgstr "Нерэчаісны выбар %s" -#: config/i386/i386.c:25890 +#: config/i386/i386.c:25996 #, fuzzy, gcc-internal-format msgid "%qE attribute only available for 64-bit" msgstr "\"%s\" атрыбут ігнарыруецца" -#: config/i386/i386.c:25901 config/i386/i386.c:25910 +#: config/i386/i386.c:26007 config/i386/i386.c:26016 #, gcc-internal-format msgid "ms_abi and sysv_abi attributes are not compatible" msgstr "" -#: config/i386/i386.c:25948 config/rs6000/rs6000.c:23527 +#: config/i386/i386.c:26054 config/rs6000/rs6000.c:23573 #, fuzzy, gcc-internal-format msgid "%qE incompatible attribute ignored" msgstr "\"%s\" атрыбут ігнарыруецца" -#: config/i386/i386.c:25971 +#: config/i386/i386.c:26077 #, fuzzy, gcc-internal-format msgid "%qE attribute only available for 32-bit" msgstr "\"%s\" атрыбут ігнарыруецца" -#: config/i386/i386.c:25977 +#: config/i386/i386.c:26083 #, gcc-internal-format msgid "ms_hook_prologue attribute needs assembler swap suffix support" msgstr "" -#: config/i386/i386.c:29887 +#: config/i386/i386.c:30003 #, gcc-internal-format msgid "vector permutation requires vector constant" msgstr "" -#: config/i386/i386.c:29897 +#: config/i386/i386.c:30013 #, fuzzy, gcc-internal-format msgid "invalid vector permutation constant" msgstr "`%E' - нерэчаісная нязьменная тыпу string" -#: config/i386/i386.c:29945 +#: config/i386/i386.c:30061 #, gcc-internal-format msgid "vector permutation (%d %d)" msgstr "" -#: config/i386/i386.c:29948 +#: config/i386/i386.c:30064 #, gcc-internal-format msgid "vector permutation (%d %d %d %d)" msgstr "" -#: config/i386/i386.c:29952 +#: config/i386/i386.c:30068 #, gcc-internal-format msgid "vector permutation (%d %d %d %d %d %d %d %d)" msgstr "" -#: config/i386/i386.c:29957 +#: config/i386/i386.c:30073 #, gcc-internal-format msgid "vector permutation (%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d)" msgstr "" @@ -20942,14 +20998,14 @@ msgstr "\"%s\" звычайна функцыя" msgid "%qE attribute requires a string constant argument" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: config/ia64/ia64.c:5384 config/pa/pa.c:368 config/sh/sh.c:8528 -#: config/spu/spu.c:5051 +#: config/ia64/ia64.c:5384 config/pa/pa.c:371 config/sh/sh.c:8564 +#: config/spu/spu.c:5041 #, gcc-internal-format msgid "value of -mfixed-range must have form REG1-REG2" msgstr "" -#: config/ia64/ia64.c:5411 config/pa/pa.c:395 config/sh/sh.c:8554 -#: config/spu/spu.c:5077 +#: config/ia64/ia64.c:5411 config/pa/pa.c:398 config/sh/sh.c:8590 +#: config/spu/spu.c:5067 #, gcc-internal-format msgid "%s-%s is an empty range" msgstr "" @@ -21020,7 +21076,7 @@ msgid "%qE attribute is not supported for R8C target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" #. The argument must be a constant integer. -#: config/m32c/m32c.c:2861 config/sh/sh.c:8735 config/sh/sh.c:8841 +#: config/m32c/m32c.c:2861 config/sh/sh.c:8771 config/sh/sh.c:8877 #, fuzzy, gcc-internal-format msgid "%qE attribute argument not an integer constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" @@ -21060,37 +21116,37 @@ msgstr "" msgid "% attribute is already used" msgstr "" -#: config/m68k/m68k.c:568 +#: config/m68k/m68k.c:572 #, gcc-internal-format msgid "-mcpu=%s conflicts with -march=%s" msgstr "" -#: config/m68k/m68k.c:639 +#: config/m68k/m68k.c:643 #, gcc-internal-format msgid "-mpcrel -fPIC is not currently supported on selected cpu" msgstr "" -#: config/m68k/m68k.c:701 +#: config/m68k/m68k.c:705 #, fuzzy, gcc-internal-format msgid "-falign-labels=%d is not supported" msgstr "-pipe не падтрымліваецца" -#: config/m68k/m68k.c:706 +#: config/m68k/m68k.c:710 #, fuzzy, gcc-internal-format msgid "-falign-loops=%d is not supported" msgstr "-pipe не падтрымліваецца" -#: config/m68k/m68k.c:809 +#: config/m68k/m68k.c:813 #, gcc-internal-format msgid "multiple interrupt attributes not allowed" msgstr "" -#: config/m68k/m68k.c:816 +#: config/m68k/m68k.c:820 #, gcc-internal-format msgid "interrupt_thread is available only on fido" msgstr "" -#: config/m68k/m68k.c:1145 config/rs6000/rs6000.c:18025 +#: config/m68k/m68k.c:1149 config/rs6000/rs6000.c:18071 #, gcc-internal-format msgid "stack limit expression is not supported" msgstr "" @@ -21220,152 +21276,152 @@ msgstr "" msgid "unusual TP-relative address" msgstr "" -#: config/mep/mep.c:3531 +#: config/mep/mep.c:3510 #, gcc-internal-format msgid "unconvertible operand %c %qs" msgstr "" -#: config/mep/mep.c:3973 config/mep/mep.c:4036 +#: config/mep/mep.c:3953 config/mep/mep.c:4016 #, gcc-internal-format msgid "address region attributes not allowed with auto storage class" msgstr "" -#: config/mep/mep.c:3979 config/mep/mep.c:4042 +#: config/mep/mep.c:3959 config/mep/mep.c:4022 #, gcc-internal-format msgid "address region attributes on pointed-to types ignored" msgstr "" -#: config/mep/mep.c:4028 +#: config/mep/mep.c:4008 #, fuzzy, gcc-internal-format msgid "%qE attribute only applies to variables and functions" msgstr "\"%s\" звычайна функцыя" -#: config/mep/mep.c:4048 config/mep/mep.c:4336 +#: config/mep/mep.c:4028 config/mep/mep.c:4316 #, gcc-internal-format msgid "duplicate address region attribute %qE in declaration of %qE on line %d" msgstr "" -#: config/mep/mep.c:4082 +#: config/mep/mep.c:4062 #, fuzzy, gcc-internal-format msgid "cannot inline interrupt function %qE" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: config/mep/mep.c:4088 +#: config/mep/mep.c:4068 #, gcc-internal-format msgid "interrupt function must have return type of void" msgstr "" -#: config/mep/mep.c:4093 +#: config/mep/mep.c:4073 #, gcc-internal-format msgid "interrupt function must have no arguments" msgstr "" -#: config/mep/mep.c:4114 +#: config/mep/mep.c:4094 #, gcc-internal-format msgid "%qE attribute allows only an integer constant argument" msgstr "" -#: config/mep/mep.c:4147 +#: config/mep/mep.c:4127 #, fuzzy, gcc-internal-format msgid "%qE attribute only applies to functions, not %s" msgstr "\"%s\" звычайна функцыя" -#: config/mep/mep.c:4157 +#: config/mep/mep.c:4137 #, gcc-internal-format msgid "To describe a pointer to a VLIW function, use syntax like this:" msgstr "" -#: config/mep/mep.c:4158 +#: config/mep/mep.c:4138 #, gcc-internal-format msgid " typedef int (__vliw *vfuncptr) ();" msgstr "" -#: config/mep/mep.c:4165 +#: config/mep/mep.c:4145 #, gcc-internal-format msgid "To describe an array of VLIW function pointers, use syntax like this:" msgstr "" -#: config/mep/mep.c:4166 +#: config/mep/mep.c:4146 #, gcc-internal-format msgid " typedef int (__vliw *vfuncptr[]) ();" msgstr "" -#: config/mep/mep.c:4171 +#: config/mep/mep.c:4151 #, gcc-internal-format msgid "VLIW functions are not allowed without a VLIW configuration" msgstr "" -#: config/mep/mep.c:4319 +#: config/mep/mep.c:4299 #, gcc-internal-format msgid "\"#pragma disinterrupt %s\" not used" msgstr "" -#: config/mep/mep.c:4461 +#: config/mep/mep.c:4441 #, gcc-internal-format msgid "__io address 0x%x is the same for %qE and %qE" msgstr "" -#: config/mep/mep.c:4609 +#: config/mep/mep.c:4589 #, gcc-internal-format msgid "variable %s (%ld bytes) is too large for the %s section (%d bytes)" msgstr "" -#: config/mep/mep.c:4707 +#: config/mep/mep.c:4687 #, gcc-internal-format msgid "variable %D of type % must be uninitialized" msgstr "" -#: config/mep/mep.c:4712 +#: config/mep/mep.c:4692 #, gcc-internal-format msgid "variable %D of type % must be uninitialized" msgstr "" -#: config/mep/mep.c:6165 +#: config/mep/mep.c:6145 #, gcc-internal-format msgid "coprocessor intrinsic %qs is not available in this configuration" msgstr "" -#: config/mep/mep.c:6168 +#: config/mep/mep.c:6148 #, fuzzy, gcc-internal-format msgid "%qs is not available in VLIW functions" msgstr "`%D' - гэта ня функцыя," -#: config/mep/mep.c:6171 +#: config/mep/mep.c:6151 #, gcc-internal-format msgid "%qs is not available in non-VLIW functions" msgstr "" -#: config/mep/mep.c:6333 config/mep/mep.c:6451 +#: config/mep/mep.c:6313 config/mep/mep.c:6431 #, fuzzy, gcc-internal-format msgid "argument %d of %qE must be in the range %d...%d" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/mep/mep.c:6336 +#: config/mep/mep.c:6316 #, fuzzy, gcc-internal-format msgid "argument %d of %qE must be a multiple of %d" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/mep/mep.c:6390 +#: config/mep/mep.c:6370 #, fuzzy, gcc-internal-format msgid "too few arguments to %qE" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: config/mep/mep.c:6395 +#: config/mep/mep.c:6375 #, fuzzy, gcc-internal-format msgid "too many arguments to %qE" msgstr "вельмі шмат аргументаў у функцыі \"%s\"" -#: config/mep/mep.c:6413 +#: config/mep/mep.c:6393 #, fuzzy, gcc-internal-format msgid "argument %d of %qE must be an address" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/mep/mep.c:7209 +#: config/mep/mep.c:7189 #, gcc-internal-format msgid "2 byte cop instructions are not allowed in 64-bit VLIW mode" msgstr "" -#: config/mep/mep.c:7215 +#: config/mep/mep.c:7195 #, gcc-internal-format msgid "unexpected %d byte cop instruction" msgstr "" @@ -21586,27 +21642,27 @@ msgstr "" msgid "MMIX Internal: %s is not a shiftable int" msgstr "" -#: config/pa/pa.c:500 +#: config/pa/pa.c:503 #, gcc-internal-format msgid "PIC code generation is not supported in the portable runtime model" msgstr "" -#: config/pa/pa.c:505 +#: config/pa/pa.c:508 #, gcc-internal-format msgid "PIC code generation is not compatible with fast indirect calls" msgstr "" -#: config/pa/pa.c:510 +#: config/pa/pa.c:513 #, gcc-internal-format msgid "-g is only supported when using GAS on this processor," msgstr "" -#: config/pa/pa.c:511 +#: config/pa/pa.c:514 #, gcc-internal-format msgid "-g option disabled" msgstr "" -#: config/pa/pa.c:8463 +#: config/pa/pa.c:8466 #, gcc-internal-format msgid "alignment (%u) for %s exceeds maximum alignment for global common data. Using %u" msgstr "" @@ -21766,322 +21822,322 @@ msgstr "" msgid "junk at end of #pragma longcall" msgstr "" -#: config/rs6000/rs6000-c.c:3238 +#: config/rs6000/rs6000-c.c:3246 #, gcc-internal-format msgid "%s only accepts %d arguments" msgstr "" -#: config/rs6000/rs6000-c.c:3243 +#: config/rs6000/rs6000-c.c:3251 #, gcc-internal-format msgid "%s only accepts 1 argument" msgstr "" -#: config/rs6000/rs6000-c.c:3248 +#: config/rs6000/rs6000-c.c:3256 #, gcc-internal-format msgid "%s only accepts 2 arguments" msgstr "" -#: config/rs6000/rs6000-c.c:3313 +#: config/rs6000/rs6000-c.c:3321 #, gcc-internal-format msgid "vec_extract only accepts 2 arguments" msgstr "" -#: config/rs6000/rs6000-c.c:3389 +#: config/rs6000/rs6000-c.c:3397 #, gcc-internal-format msgid "vec_insert only accepts 3 arguments" msgstr "" -#: config/rs6000/rs6000-c.c:3492 +#: config/rs6000/rs6000-c.c:3500 #, gcc-internal-format msgid "passing arg %d of %qE discards qualifiers frompointer target type" msgstr "" -#: config/rs6000/rs6000-c.c:3535 +#: config/rs6000/rs6000-c.c:3543 #, fuzzy, gcc-internal-format msgid "invalid parameter combination for AltiVec intrinsic" msgstr "нявернае выкарыстанне \"restict\"" -#: config/rs6000/rs6000.c:2111 +#: config/rs6000/rs6000.c:2108 #, gcc-internal-format msgid "-mdynamic-no-pic overrides -fpic or -fPIC" msgstr "" -#: config/rs6000/rs6000.c:2122 +#: config/rs6000/rs6000.c:2119 #, gcc-internal-format msgid "-m64 requires PowerPC64 architecture, enabling" msgstr "" -#: config/rs6000/rs6000.c:2374 +#: config/rs6000/rs6000.c:2371 #, fuzzy, gcc-internal-format msgid "AltiVec not supported in this target" msgstr "__buitin_saveregs не падтрымліваецца гэтай мэтай" -#: config/rs6000/rs6000.c:2376 +#: config/rs6000/rs6000.c:2373 #, fuzzy, gcc-internal-format msgid "Spe not supported in this target" msgstr "__buitin_saveregs не падтрымліваецца гэтай мэтай" -#: config/rs6000/rs6000.c:2403 +#: config/rs6000/rs6000.c:2400 #, gcc-internal-format msgid "-mmultiple is not supported on little endian systems" msgstr "" -#: config/rs6000/rs6000.c:2410 +#: config/rs6000/rs6000.c:2407 #, gcc-internal-format msgid "-mstring is not supported on little endian systems" msgstr "" -#: config/rs6000/rs6000.c:2469 +#: config/rs6000/rs6000.c:2466 #, gcc-internal-format msgid "unknown -mdebug-%s switch" msgstr "" -#: config/rs6000/rs6000.c:2509 +#: config/rs6000/rs6000.c:2506 #, gcc-internal-format msgid "unknown -mtraceback arg %qs; expecting %, % or %" msgstr "" -#: config/rs6000/rs6000.c:3130 +#: config/rs6000/rs6000.c:3127 #, fuzzy, gcc-internal-format msgid "unknown -m%s= option specified: '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: config/rs6000/rs6000.c:3176 +#: config/rs6000/rs6000.c:3173 #, gcc-internal-format msgid "unknown value %s for -mfpu" msgstr "" -#: config/rs6000/rs6000.c:3505 +#: config/rs6000/rs6000.c:3504 #, gcc-internal-format msgid "not configured for ABI: '%s'" msgstr "" -#: config/rs6000/rs6000.c:3518 +#: config/rs6000/rs6000.c:3517 #, gcc-internal-format msgid "Using darwin64 ABI" msgstr "" -#: config/rs6000/rs6000.c:3523 +#: config/rs6000/rs6000.c:3522 #, gcc-internal-format msgid "Using old darwin ABI" msgstr "" -#: config/rs6000/rs6000.c:3530 +#: config/rs6000/rs6000.c:3529 #, gcc-internal-format msgid "Using IBM extended precision long double" msgstr "" -#: config/rs6000/rs6000.c:3536 +#: config/rs6000/rs6000.c:3535 #, gcc-internal-format msgid "Using IEEE extended precision long double" msgstr "" -#: config/rs6000/rs6000.c:3541 +#: config/rs6000/rs6000.c:3540 #, fuzzy, gcc-internal-format msgid "unknown ABI specified: '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: config/rs6000/rs6000.c:3568 +#: config/rs6000/rs6000.c:3567 #, fuzzy, gcc-internal-format msgid "invalid option for -mfloat-gprs: '%s'" msgstr "Нерэчаісны выбар \"%s\"" -#: config/rs6000/rs6000.c:3578 +#: config/rs6000/rs6000.c:3577 #, gcc-internal-format msgid "Unknown switch -mlong-double-%s" msgstr "" -#: config/rs6000/rs6000.c:3599 +#: config/rs6000/rs6000.c:3598 #, gcc-internal-format msgid "-malign-power is not supported for 64-bit Darwin; it is incompatible with the installed C and C++ libraries" msgstr "" -#: config/rs6000/rs6000.c:3607 +#: config/rs6000/rs6000.c:3606 #, fuzzy, gcc-internal-format msgid "unknown -malign-XXXXX option specified: '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: config/rs6000/rs6000.c:3614 +#: config/rs6000/rs6000.c:3613 #, gcc-internal-format msgid "-msingle-float option equivalent to -mhard-float" msgstr "" -#: config/rs6000/rs6000.c:3630 +#: config/rs6000/rs6000.c:3629 #, gcc-internal-format msgid "-msimple-fpu option ignored" msgstr "" -#: config/rs6000/rs6000.c:6793 +#: config/rs6000/rs6000.c:6779 #, gcc-internal-format msgid "GCC vector returned by reference: non-standard ABI extension with no compatibility guarantee" msgstr "" -#: config/rs6000/rs6000.c:6866 +#: config/rs6000/rs6000.c:6852 #, gcc-internal-format msgid "cannot return value in vector register because altivec instructions are disabled, use -maltivec to enable them" msgstr "" -#: config/rs6000/rs6000.c:7125 +#: config/rs6000/rs6000.c:7111 #, gcc-internal-format msgid "cannot pass argument in vector register because altivec instructions are disabled, use -maltivec to enable them" msgstr "" -#: config/rs6000/rs6000.c:8027 +#: config/rs6000/rs6000.c:8013 #, gcc-internal-format msgid "GCC vector passed by reference: non-standard ABI extension with no compatibility guarantee" msgstr "" -#: config/rs6000/rs6000.c:8609 +#: config/rs6000/rs6000.c:8595 #, gcc-internal-format msgid "internal error: builtin function to %s already processed." msgstr "" -#: config/rs6000/rs6000.c:9544 +#: config/rs6000/rs6000.c:9534 #, fuzzy, gcc-internal-format msgid "argument 1 must be a 5-bit signed literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:9647 config/rs6000/rs6000.c:10619 +#: config/rs6000/rs6000.c:9637 config/rs6000/rs6000.c:10609 #, fuzzy, gcc-internal-format msgid "argument 2 must be a 5-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:9686 +#: config/rs6000/rs6000.c:9676 #, fuzzy, gcc-internal-format msgid "argument 1 of __builtin_altivec_predicate must be a constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: config/rs6000/rs6000.c:9738 +#: config/rs6000/rs6000.c:9728 #, fuzzy, gcc-internal-format msgid "argument 1 of __builtin_altivec_predicate is out of range" msgstr "аргумент `__builtin_args_info' выйшаў за межы" -#: config/rs6000/rs6000.c:9988 +#: config/rs6000/rs6000.c:9978 #, fuzzy, gcc-internal-format msgid "argument 3 must be a 4-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:10006 +#: config/rs6000/rs6000.c:9996 #, fuzzy, gcc-internal-format msgid "argument 3 must be a 2-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:10018 +#: config/rs6000/rs6000.c:10008 #, fuzzy, gcc-internal-format msgid "argument 3 must be a 1-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:10194 +#: config/rs6000/rs6000.c:10184 #, fuzzy, gcc-internal-format msgid "argument to %qs must be a 2-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:10338 +#: config/rs6000/rs6000.c:10328 #, gcc-internal-format msgid "unresolved overload for Altivec builtin %qF" msgstr "" -#: config/rs6000/rs6000.c:10429 +#: config/rs6000/rs6000.c:10419 #, fuzzy, gcc-internal-format msgid "argument to dss must be a 2-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:10739 +#: config/rs6000/rs6000.c:10729 #, fuzzy, gcc-internal-format msgid "argument 1 of __builtin_paired_predicate must be a constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: config/rs6000/rs6000.c:10786 +#: config/rs6000/rs6000.c:10776 #, fuzzy, gcc-internal-format msgid "argument 1 of __builtin_paired_predicate is out of range" msgstr "аргумент `__builtin_args_info' выйшаў за межы" -#: config/rs6000/rs6000.c:10811 +#: config/rs6000/rs6000.c:10801 #, fuzzy, gcc-internal-format msgid "argument 1 of __builtin_spe_predicate must be a constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: config/rs6000/rs6000.c:10883 +#: config/rs6000/rs6000.c:10873 #, fuzzy, gcc-internal-format msgid "argument 1 of __builtin_spe_predicate is out of range" msgstr "аргумент `__builtin_args_info' выйшаў за межы" -#: config/rs6000/rs6000.c:12229 +#: config/rs6000/rs6000.c:12219 #, gcc-internal-format msgid "internal error: builtin function %s had no type" msgstr "" -#: config/rs6000/rs6000.c:12236 +#: config/rs6000/rs6000.c:12226 #, gcc-internal-format msgid "internal error: builtin function %s had an unexpected return type %s" msgstr "" -#: config/rs6000/rs6000.c:12249 +#: config/rs6000/rs6000.c:12239 #, gcc-internal-format msgid "internal error: builtin function %s, argument %d had unexpected argument type %s" msgstr "" -#: config/rs6000/rs6000.c:17995 +#: config/rs6000/rs6000.c:18041 #, fuzzy, gcc-internal-format msgid "stack frame too large" msgstr "%s - вельмі вялікі" -#: config/rs6000/rs6000.c:18391 +#: config/rs6000/rs6000.c:18437 #, gcc-internal-format msgid "Out-of-line save/restore routines not supported on Darwin" msgstr "" -#: config/rs6000/rs6000.c:21286 +#: config/rs6000/rs6000.c:21332 #, gcc-internal-format msgid "no profiling of 64-bit code for this ABI" msgstr "" -#: config/rs6000/rs6000.c:23314 +#: config/rs6000/rs6000.c:23360 #, gcc-internal-format msgid "use of % in AltiVec types is invalid" msgstr "" -#: config/rs6000/rs6000.c:23316 +#: config/rs6000/rs6000.c:23362 #, gcc-internal-format msgid "use of boolean types in AltiVec types is invalid" msgstr "" -#: config/rs6000/rs6000.c:23318 +#: config/rs6000/rs6000.c:23364 #, gcc-internal-format msgid "use of % in AltiVec types is invalid" msgstr "" -#: config/rs6000/rs6000.c:23320 +#: config/rs6000/rs6000.c:23366 #, gcc-internal-format msgid "use of decimal floating point types in AltiVec types is invalid" msgstr "" -#: config/rs6000/rs6000.c:23326 +#: config/rs6000/rs6000.c:23372 #, gcc-internal-format msgid "use of % in AltiVec types is invalid for 64-bit code without -mvsx" msgstr "" -#: config/rs6000/rs6000.c:23329 +#: config/rs6000/rs6000.c:23375 #, gcc-internal-format msgid "use of % in AltiVec types is deprecated; use %" msgstr "" -#: config/rs6000/rs6000.c:23334 +#: config/rs6000/rs6000.c:23380 #, gcc-internal-format msgid "use of % in AltiVec types is invalid without -mvsx" msgstr "" -#: config/rs6000/rs6000.c:23337 +#: config/rs6000/rs6000.c:23383 #, gcc-internal-format msgid "use of % in AltiVec types is invalid without -mvsx" msgstr "" -#: config/rs6000/rs6000.c:25739 +#: config/rs6000/rs6000.c:25785 #, gcc-internal-format msgid "emitting microcode insn %s\t[%s] #%d" msgstr "" -#: config/rs6000/rs6000.c:25743 +#: config/rs6000/rs6000.c:25789 #, gcc-internal-format msgid "emitting conditional microcode insn %s\t[%s] #%d" msgstr "" @@ -22135,7 +22191,7 @@ msgstr "-pipe не падтрымліваецца" msgid "-m64 not supported in this configuration" msgstr "-pipe не падтрымліваецца" -#: config/rs6000/linux64.h:113 +#: config/rs6000/linux64.h:115 #, gcc-internal-format msgid "-m64 requires a PowerPC64 cpu" msgstr "" @@ -22310,17 +22366,17 @@ msgstr "" msgid "total size of local variables exceeds architecture limit" msgstr "" -#: config/s390/s390.c:7794 +#: config/s390/s390.c:7794 config/s390/s390.c:7810 #, gcc-internal-format msgid "frame size of function %qs is " msgstr "" -#: config/s390/s390.c:7820 +#: config/s390/s390.c:7839 #, fuzzy, gcc-internal-format msgid "frame size of %qs is " msgstr "памер \"%s\" - %d байт" -#: config/s390/s390.c:7824 +#: config/s390/s390.c:7843 #, gcc-internal-format msgid "%qs uses dynamic stack allocation" msgstr "" @@ -22330,58 +22386,58 @@ msgstr "" msgid "-fPIC and -G are incompatible" msgstr "" -#: config/sh/sh.c:888 +#: config/sh/sh.c:892 #, gcc-internal-format msgid "ignoring -fschedule-insns because of exception handling bug" msgstr "" -#: config/sh/sh.c:7463 +#: config/sh/sh.c:7499 #, fuzzy, gcc-internal-format msgid "__builtin_saveregs not supported by this subtarget" msgstr "__buitin_saveregs не падтрымліваецца гэтай мэтай" -#: config/sh/sh.c:8616 +#: config/sh/sh.c:8652 #, fuzzy, gcc-internal-format msgid "%qE attribute only applies to interrupt functions" msgstr "\"%s\" звычайна функцыя" -#: config/sh/sh.c:8674 +#: config/sh/sh.c:8710 #, fuzzy, gcc-internal-format msgid "%qE attribute is supported only for SH2A" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: config/sh/sh.c:8704 +#: config/sh/sh.c:8740 #, gcc-internal-format msgid "attribute interrupt_handler is not compatible with -m5-compact" msgstr "" -#: config/sh/sh.c:8721 +#: config/sh/sh.c:8757 #, fuzzy, gcc-internal-format msgid "%qE attribute only applies to SH2A" msgstr "\"%s\" звычайна функцыя" -#: config/sh/sh.c:8743 +#: config/sh/sh.c:8779 #, gcc-internal-format msgid "%qE attribute argument should be between 0 to 255" msgstr "" #. The argument must be a constant string. -#: config/sh/sh.c:8816 +#: config/sh/sh.c:8852 #, fuzzy, gcc-internal-format msgid "%qE attribute argument not a string constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: config/sh/sh.c:11238 +#: config/sh/sh.c:11274 #, gcc-internal-format msgid "r0 needs to be available as a call-clobbered register" msgstr "" -#: config/sh/sh.c:11259 +#: config/sh/sh.c:11295 #, gcc-internal-format msgid "Need a second call-clobbered general purpose register" msgstr "" -#: config/sh/sh.c:11267 +#: config/sh/sh.c:11303 #, gcc-internal-format msgid "Need a call-clobbered target register" msgstr "" @@ -22431,22 +22487,22 @@ msgstr "" msgid "-mrelax is only supported for RTP PIC" msgstr "" -#: config/sparc/sparc.c:720 +#: config/sparc/sparc.c:713 #, gcc-internal-format msgid "%s is not supported by this configuration" msgstr "" -#: config/sparc/sparc.c:727 +#: config/sparc/sparc.c:720 #, gcc-internal-format msgid "-mlong-double-64 not allowed with -m64" msgstr "" -#: config/sparc/sparc.c:747 +#: config/sparc/sparc.c:740 #, gcc-internal-format msgid "bad value (%s) for -mcmodel= switch" msgstr "" -#: config/sparc/sparc.c:752 +#: config/sparc/sparc.c:745 #, gcc-internal-format msgid "-mcmodel= is not supported on 32 bit systems" msgstr "" @@ -22456,12 +22512,12 @@ msgstr "" msgid "insufficient arguments to overloaded function %s" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: config/spu/spu-c.c:173 +#: config/spu/spu-c.c:172 #, fuzzy, gcc-internal-format msgid "too many arguments to overloaded function %s" msgstr "вельмі шмат аргумэнтаў у функцыі `%s'" -#: config/spu/spu-c.c:185 +#: config/spu/spu-c.c:184 #, gcc-internal-format msgid "parameter list does not match a valid signature for %s()" msgstr "" @@ -22471,27 +22527,27 @@ msgstr "" msgid "Unknown architecture '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: config/spu/spu.c:5331 config/spu/spu.c:5334 +#: config/spu/spu.c:5321 config/spu/spu.c:5324 #, gcc-internal-format msgid "creating run-time relocation for %qD" msgstr "" -#: config/spu/spu.c:5339 config/spu/spu.c:5341 +#: config/spu/spu.c:5329 config/spu/spu.c:5331 #, gcc-internal-format msgid "creating run-time relocation" msgstr "" -#: config/spu/spu.c:6399 +#: config/spu/spu.c:6389 #, gcc-internal-format msgid "%s expects an integer literal in the range [%d, %d]." msgstr "" -#: config/spu/spu.c:6419 +#: config/spu/spu.c:6409 #, gcc-internal-format msgid "%s expects an integer literal in the range [%d, %d]. (" msgstr "" -#: config/spu/spu.c:6449 +#: config/spu/spu.c:6439 #, gcc-internal-format msgid "%d least significant bits of %s are ignored." msgstr "" @@ -22666,420 +22722,420 @@ msgstr "" msgid "only uninitialized variables can be placed in a .bss section" msgstr "" -#: cp/call.c:2706 +#: cp/call.c:2710 #, gcc-internal-format msgid "%s %D(%T, %T, %T) " msgstr "" -#: cp/call.c:2711 +#: cp/call.c:2715 #, gcc-internal-format msgid "%s %D(%T, %T) " msgstr "" -#: cp/call.c:2715 +#: cp/call.c:2719 #, gcc-internal-format msgid "%s %D(%T) " msgstr "" -#: cp/call.c:2719 +#: cp/call.c:2723 #, gcc-internal-format msgid "%s %T " msgstr "" -#: cp/call.c:2721 +#: cp/call.c:2725 #, gcc-internal-format msgid "%s %+#D " msgstr "" -#: cp/call.c:2723 +#: cp/call.c:2727 #, gcc-internal-format msgid "%s %+#D " msgstr "" -#: cp/call.c:2725 cp/pt.c:1703 +#: cp/call.c:2729 cp/pt.c:1704 #, gcc-internal-format msgid "%s %+#D" msgstr "" -#: cp/call.c:3020 +#: cp/call.c:3019 #, fuzzy, gcc-internal-format msgid "conversion from %qT to %qT is ambiguous" msgstr "пераўтварэньне з `%T' у `%T'" -#: cp/call.c:3182 cp/call.c:3203 cp/call.c:3268 +#: cp/call.c:3181 cp/call.c:3202 cp/call.c:3267 #, gcc-internal-format msgid "no matching function for call to %<%D(%A)%>" msgstr "" -#: cp/call.c:3206 cp/call.c:3271 +#: cp/call.c:3205 cp/call.c:3270 #, gcc-internal-format msgid "call of overloaded %<%D(%A)%> is ambiguous" msgstr "" #. It's no good looking for an overloaded operator() on a #. pointer-to-member-function. -#: cp/call.c:3350 +#: cp/call.c:3349 #, gcc-internal-format msgid "pointer-to-member function %E cannot be called without an object; consider using .* or ->*" msgstr "" -#: cp/call.c:3442 +#: cp/call.c:3432 #, gcc-internal-format msgid "no match for call to %<(%T) (%A)%>" msgstr "" -#: cp/call.c:3455 +#: cp/call.c:3445 #, fuzzy, gcc-internal-format msgid "call of %<(%T) (%A)%> is ambiguous" msgstr "памер \"%s\" - %d байт" -#: cp/call.c:3497 +#: cp/call.c:3487 #, gcc-internal-format msgid "ambiguous overload for ternary % in %<%E ? %E : %E%>" msgstr "" -#: cp/call.c:3500 +#: cp/call.c:3490 #, gcc-internal-format msgid "no match for ternary % in %<%E ? %E : %E%>" msgstr "" -#: cp/call.c:3507 +#: cp/call.c:3497 #, gcc-internal-format msgid "ambiguous overload for % in %<%E%s%>" msgstr "" -#: cp/call.c:3510 +#: cp/call.c:3500 #, gcc-internal-format msgid "no match for % in %<%E%s%>" msgstr "" -#: cp/call.c:3516 +#: cp/call.c:3506 #, gcc-internal-format msgid "ambiguous overload for % in %<%E[%E]%>" msgstr "" -#: cp/call.c:3519 +#: cp/call.c:3509 #, gcc-internal-format msgid "no match for % in %<%E[%E]%>" msgstr "" -#: cp/call.c:3526 +#: cp/call.c:3516 #, gcc-internal-format msgid "ambiguous overload for %qs in %<%s %E%>" msgstr "" -#: cp/call.c:3529 +#: cp/call.c:3519 #, gcc-internal-format msgid "no match for %qs in %<%s %E%>" msgstr "" -#: cp/call.c:3536 +#: cp/call.c:3526 #, gcc-internal-format msgid "ambiguous overload for % in %<%E %s %E%>" msgstr "" -#: cp/call.c:3539 +#: cp/call.c:3529 #, gcc-internal-format msgid "no match for % in %<%E %s %E%>" msgstr "" -#: cp/call.c:3543 +#: cp/call.c:3533 #, gcc-internal-format msgid "ambiguous overload for % in %<%s%E%>" msgstr "" -#: cp/call.c:3546 +#: cp/call.c:3536 #, gcc-internal-format msgid "no match for % in %<%s%E%>" msgstr "" -#: cp/call.c:3641 +#: cp/call.c:3631 #, gcc-internal-format msgid "ISO C++ forbids omitting the middle term of a ?: expression" msgstr "" -#: cp/call.c:3722 +#: cp/call.c:3712 #, gcc-internal-format msgid "second operand to the conditional operator is of type %, but the third operand is neither a throw-expression nor of type %" msgstr "" -#: cp/call.c:3727 +#: cp/call.c:3717 #, gcc-internal-format msgid "third operand to the conditional operator is of type %, but the second operand is neither a throw-expression nor of type %" msgstr "" -#: cp/call.c:3769 cp/call.c:4007 +#: cp/call.c:3759 cp/call.c:3997 #, gcc-internal-format msgid "operands to ?: have different types %qT and %qT" msgstr "" -#: cp/call.c:3954 +#: cp/call.c:3944 #, gcc-internal-format msgid "enumeral mismatch in conditional expression: %qT vs %qT" msgstr "" -#: cp/call.c:3965 +#: cp/call.c:3955 #, gcc-internal-format msgid "enumeral and non-enumeral type in conditional expression" msgstr "" -#: cp/call.c:4312 +#: cp/call.c:4302 #, gcc-internal-format msgid "no %<%D(int)%> declared for postfix %qs, trying prefix operator instead" msgstr "" -#: cp/call.c:4314 +#: cp/call.c:4304 #, gcc-internal-format msgid "no %<%D(int)%> declared for postfix %qs" msgstr "" -#: cp/call.c:4408 +#: cp/call.c:4398 #, gcc-internal-format msgid "comparison between %q#T and %q#T" msgstr "" -#: cp/call.c:4652 +#: cp/call.c:4642 #, fuzzy, gcc-internal-format msgid "non-placement deallocation function %q+D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/call.c:4653 +#: cp/call.c:4643 #, gcc-internal-format msgid "selected for placement delete" msgstr "" -#: cp/call.c:4732 +#: cp/call.c:4722 #, gcc-internal-format msgid "no corresponding deallocation function for %qD" msgstr "" -#: cp/call.c:4737 +#: cp/call.c:4727 #, fuzzy, gcc-internal-format msgid "no suitable % for %qT" msgstr "немагчымы апэратар '%s'" -#: cp/call.c:4755 +#: cp/call.c:4745 #, gcc-internal-format msgid "%q+#D is private" msgstr "" -#: cp/call.c:4757 +#: cp/call.c:4747 #, gcc-internal-format msgid "%q+#D is protected" msgstr "" -#: cp/call.c:4759 +#: cp/call.c:4749 #, gcc-internal-format msgid "%q+#D is inaccessible" msgstr "" -#: cp/call.c:4760 +#: cp/call.c:4750 #, gcc-internal-format msgid "within this context" msgstr "" -#: cp/call.c:4807 +#: cp/call.c:4798 #, gcc-internal-format msgid "passing NULL to non-pointer argument %P of %qD" msgstr "" -#: cp/call.c:4810 +#: cp/call.c:4802 #, gcc-internal-format msgid "converting to non-pointer type %qT from NULL" msgstr "" -#: cp/call.c:4816 +#: cp/call.c:4808 #, gcc-internal-format msgid "converting % to pointer type for argument %P of %qD" msgstr "" -#: cp/call.c:4854 +#: cp/call.c:4846 #, fuzzy, gcc-internal-format msgid "too many braces around initializer for %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/call.c:4876 cp/cvt.c:217 +#: cp/call.c:4868 cp/cvt.c:218 #, fuzzy, gcc-internal-format msgid "invalid conversion from %qT to %qT" msgstr "пераўтварэньне з `%T' у `%T'" -#: cp/call.c:4878 cp/call.c:5047 +#: cp/call.c:4870 cp/call.c:5039 #, gcc-internal-format msgid " initializing argument %P of %qD" msgstr "" -#: cp/call.c:4902 +#: cp/call.c:4894 #, gcc-internal-format msgid "converting to %qT from initializer list would use explicit constructor %qD" msgstr "" -#: cp/call.c:5062 +#: cp/call.c:5054 #, fuzzy, gcc-internal-format msgid "cannot bind %qT lvalue to %qT" msgstr "не магу знайсці крыніцу %s" -#: cp/call.c:5065 +#: cp/call.c:5057 #, gcc-internal-format msgid " initializing argument %P of %q+D" msgstr "" -#: cp/call.c:5092 +#: cp/call.c:5084 #, fuzzy, gcc-internal-format msgid "cannot bind bitfield %qE to %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/call.c:5095 cp/call.c:5113 +#: cp/call.c:5087 cp/call.c:5105 #, gcc-internal-format msgid "cannot bind packed field %qE to %qT" msgstr "" -#: cp/call.c:5098 +#: cp/call.c:5090 #, fuzzy, gcc-internal-format msgid "cannot bind rvalue %qE to %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/call.c:5217 +#: cp/call.c:5209 #, gcc-internal-format msgid "cannot pass objects of non-trivially-copyable type %q#T through %<...%>" msgstr "" #. conditionally-supported behavior [expr.call] 5.2.2/7. -#: cp/call.c:5244 +#: cp/call.c:5236 #, gcc-internal-format msgid "cannot receive objects of non-trivially-copyable type %q#T through %<...%>; " msgstr "" -#: cp/call.c:5290 +#: cp/call.c:5282 #, gcc-internal-format msgid "the default argument for parameter %d of %qD has not yet been parsed" msgstr "" -#: cp/call.c:5300 +#: cp/call.c:5292 #, fuzzy, gcc-internal-format msgid "recursive evaluation of default argument for %q#D" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/call.c:5417 +#: cp/call.c:5409 #, gcc-internal-format msgid "argument of function call might be a candidate for a format attribute" msgstr "" -#: cp/call.c:5601 +#: cp/call.c:5593 #, gcc-internal-format msgid "passing %qT as % argument of %q#D discards qualifiers" msgstr "" -#: cp/call.c:5623 +#: cp/call.c:5615 #, gcc-internal-format msgid "%qT is not an accessible base of %qT" msgstr "" -#: cp/call.c:5675 +#: cp/call.c:5667 #, gcc-internal-format msgid "deducing %qT as %qT" msgstr "" -#: cp/call.c:5678 +#: cp/call.c:5670 #, gcc-internal-format msgid " in call to %q+D" msgstr "" -#: cp/call.c:5680 +#: cp/call.c:5672 #, gcc-internal-format msgid " (you can disable this with -fno-deduce-init-list)" msgstr "" -#: cp/call.c:5953 +#: cp/call.c:5965 #, gcc-internal-format msgid "could not find class$ field in java interface type %qT" msgstr "" -#: cp/call.c:6212 +#: cp/call.c:6224 #, gcc-internal-format msgid "call to non-function %qD" msgstr "" -#: cp/call.c:6257 cp/typeck.c:2537 +#: cp/call.c:6269 cp/typeck.c:2546 #, gcc-internal-format msgid "cannot call constructor %<%T::%D%> directly" msgstr "" -#: cp/call.c:6259 +#: cp/call.c:6271 #, gcc-internal-format msgid " for a function-style cast, remove the redundant %<::%D%>" msgstr "" -#: cp/call.c:6381 +#: cp/call.c:6393 #, gcc-internal-format msgid "no matching function for call to %<%T::%s(%A)%#V%>" msgstr "" -#: cp/call.c:6406 +#: cp/call.c:6418 #, gcc-internal-format msgid "call of overloaded %<%s(%A)%> is ambiguous" msgstr "" -#: cp/call.c:6435 +#: cp/call.c:6447 #, gcc-internal-format msgid "cannot call member function %qD without object" msgstr "" -#: cp/call.c:7121 +#: cp/call.c:7133 #, gcc-internal-format msgid "passing %qT chooses %qT over %qT" msgstr "" -#: cp/call.c:7123 cp/name-lookup.c:5018 +#: cp/call.c:7135 cp/name-lookup.c:5019 #, gcc-internal-format msgid " in call to %qD" msgstr "" -#: cp/call.c:7180 +#: cp/call.c:7192 #, gcc-internal-format msgid "choosing %qD over %qD" msgstr "" -#: cp/call.c:7181 +#: cp/call.c:7193 #, fuzzy, gcc-internal-format msgid " for conversion from %qT to %qT" msgstr "пераўтварэньне з `%T' у `%T'" -#: cp/call.c:7184 +#: cp/call.c:7196 #, gcc-internal-format msgid " because conversion sequence for the argument is better" msgstr "" -#: cp/call.c:7302 +#: cp/call.c:7314 #, gcc-internal-format msgid "default argument mismatch in overload resolution" msgstr "" -#: cp/call.c:7305 +#: cp/call.c:7317 #, gcc-internal-format msgid " candidate 1: %q+#F" msgstr "" -#: cp/call.c:7307 +#: cp/call.c:7319 #, gcc-internal-format msgid " candidate 2: %q+#F" msgstr "" -#: cp/call.c:7345 +#: cp/call.c:7357 #, gcc-internal-format msgid "ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:" msgstr "" -#: cp/call.c:7498 +#: cp/call.c:7510 #, gcc-internal-format msgid "could not convert %qE to %qT" msgstr "" -#: cp/call.c:7716 +#: cp/call.c:7728 #, gcc-internal-format msgid "invalid initialization of non-const reference of type %qT from an rvalue of type %qT" msgstr "" -#: cp/call.c:7720 +#: cp/call.c:7732 #, gcc-internal-format msgid "invalid initialization of reference of type %qT from expression of type %qT" msgstr "" @@ -23180,7 +23236,7 @@ msgstr "" msgid " by %q+D" msgstr "" -#: cp/class.c:2549 cp/decl2.c:1292 +#: cp/class.c:2549 cp/decl2.c:1325 #, gcc-internal-format msgid "%q+#D invalid; an anonymous union can only have non-static data members" msgstr "" @@ -23190,7 +23246,7 @@ msgstr "" msgid "%q+#D invalid; an anonymous struct can only have non-static data members" msgstr "" -#: cp/class.c:2560 cp/decl2.c:1298 +#: cp/class.c:2560 cp/decl2.c:1331 #, gcc-internal-format msgid "private member %q+#D in anonymous union" msgstr "" @@ -23200,7 +23256,7 @@ msgstr "" msgid "private member %q+#D in anonymous struct" msgstr "" -#: cp/class.c:2567 cp/decl2.c:1300 +#: cp/class.c:2567 cp/decl2.c:1333 #, gcc-internal-format msgid "protected member %q+#D in anonymous union" msgstr "" @@ -23347,97 +23403,97 @@ msgstr "" msgid "%q+D declared to take non-const reference cannot be defaulted in the class body" msgstr "" -#: cp/class.c:4679 +#: cp/class.c:4681 #, gcc-internal-format msgid "offset of virtual base %qT is not ABI-compliant and may change in a future version of GCC" msgstr "" -#: cp/class.c:4780 +#: cp/class.c:4782 #, gcc-internal-format msgid "direct base %qT inaccessible in %qT due to ambiguity" msgstr "" -#: cp/class.c:4792 +#: cp/class.c:4794 #, gcc-internal-format msgid "virtual base %qT inaccessible in %qT due to ambiguity" msgstr "" -#: cp/class.c:4971 +#: cp/class.c:4973 #, gcc-internal-format msgid "size assigned to %qT may not be ABI-compliant and may change in a future version of GCC" msgstr "" -#: cp/class.c:5011 +#: cp/class.c:5013 #, gcc-internal-format msgid "the offset of %qD may not be ABI-compliant and may change in a future version of GCC" msgstr "" -#: cp/class.c:5039 +#: cp/class.c:5041 #, gcc-internal-format msgid "offset of %q+D is not ABI-compliant and may change in a future version of GCC" msgstr "" -#: cp/class.c:5048 +#: cp/class.c:5051 #, gcc-internal-format msgid "%q+D contains empty classes which may cause base classes to be placed at different locations in a future version of GCC" msgstr "" -#: cp/class.c:5136 +#: cp/class.c:5139 #, gcc-internal-format msgid "layout of classes derived from empty class %qT may change in a future version of GCC" msgstr "" -#: cp/class.c:5289 cp/parser.c:16349 +#: cp/class.c:5292 cp/parser.c:16363 #, fuzzy, gcc-internal-format msgid "redefinition of %q#T" msgstr "папярэдняе вызначэньне `%#T'" -#: cp/class.c:5441 +#: cp/class.c:5444 #, gcc-internal-format msgid "%q#T has virtual functions and accessible non-virtual destructor" msgstr "" -#: cp/class.c:5546 +#: cp/class.c:5549 #, gcc-internal-format msgid "trying to finish struct, but kicked out due to previous parse errors" msgstr "" -#: cp/class.c:6010 +#: cp/class.c:6013 #, fuzzy, gcc-internal-format msgid "language string %<\"%E\"%> not recognized" msgstr "мова %s не распазнана" -#: cp/class.c:6100 +#: cp/class.c:6103 #, gcc-internal-format msgid "cannot resolve overloaded function %qD based on conversion to type %qT" msgstr "" -#: cp/class.c:6224 +#: cp/class.c:6227 #, gcc-internal-format msgid "no matches converting function %qD to type %q#T" msgstr "" -#: cp/class.c:6254 +#: cp/class.c:6257 #, gcc-internal-format msgid "converting overloaded function %qD to type %q#T is ambiguous" msgstr "" -#: cp/class.c:6281 +#: cp/class.c:6284 #, fuzzy, gcc-internal-format msgid "assuming pointer to member %qD" msgstr "прапушчан ініцыялізатар" -#: cp/class.c:6284 +#: cp/class.c:6287 #, gcc-internal-format msgid "(a pointer to member can only be formed with %<&%E%>)" msgstr "" -#: cp/class.c:6346 cp/class.c:6380 +#: cp/class.c:6349 cp/class.c:6383 #, gcc-internal-format msgid "not enough type information" msgstr "" -#: cp/class.c:6363 +#: cp/class.c:6366 #, gcc-internal-format msgid "argument of type %qT does not match %qT" msgstr "" @@ -23447,12 +23503,12 @@ msgstr "" #. A name N used in a class S shall refer to the same declaration #. in its context and when re-evaluated in the completed scope of #. S. -#: cp/class.c:6665 cp/decl.c:1197 cp/name-lookup.c:525 +#: cp/class.c:6668 cp/decl.c:1196 cp/name-lookup.c:525 #, fuzzy, gcc-internal-format msgid "declaration of %q#D" msgstr "абвяшчэньне `%#D'" -#: cp/class.c:6666 +#: cp/class.c:6669 #, gcc-internal-format msgid "changes meaning of %qD from %q+#D" msgstr "" @@ -23462,228 +23518,248 @@ msgstr "" msgid "continue statement not within loop or switch" msgstr "" -#: cp/cp-gimplify.c:1192 +#: cp/cp-gimplify.c:1201 #, gcc-internal-format msgid "%qE implicitly determined as % has reference type" msgstr "" -#: cp/cvt.c:90 +#: cp/cvt.c:91 #, fuzzy, gcc-internal-format msgid "can't convert from incomplete type %qT to %qT" msgstr "\"%s\" мае незавершаны тып" -#: cp/cvt.c:99 +#: cp/cvt.c:100 #, gcc-internal-format msgid "conversion of %qE from %qT to %qT is ambiguous" msgstr "" -#: cp/cvt.c:168 cp/cvt.c:193 cp/cvt.c:238 +#: cp/cvt.c:169 cp/cvt.c:194 cp/cvt.c:239 #, gcc-internal-format msgid "cannot convert %qE from type %qT to type %qT" msgstr "" -#: cp/cvt.c:452 +#: cp/cvt.c:371 +#, gcc-internal-format +msgid "initialization of volatile reference type %q#T from rvalue of type %qT" +msgstr "" + +#: cp/cvt.c:374 +#, gcc-internal-format +msgid "conversion to volatile reference type %q#T from rvalue of type %qT" +msgstr "" + +#: cp/cvt.c:377 +#, gcc-internal-format +msgid "initialization of non-const reference type %q#T from rvalue of type %qT" +msgstr "" + +#: cp/cvt.c:380 +#, gcc-internal-format +msgid "conversion to non-const reference type %q#T from rvalue of type %qT" +msgstr "" + +#: cp/cvt.c:453 #, gcc-internal-format msgid "conversion from %qT to %qT discards qualifiers" msgstr "" -#: cp/cvt.c:470 cp/typeck.c:5832 +#: cp/cvt.c:471 cp/typeck.c:5919 #, gcc-internal-format msgid "casting %qT to %qT does not dereference pointer" msgstr "" -#: cp/cvt.c:498 +#: cp/cvt.c:499 #, fuzzy, gcc-internal-format msgid "cannot convert type %qT to type %qT" msgstr "\"%s\" мае незавершаны тып" -#: cp/cvt.c:669 +#: cp/cvt.c:670 #, fuzzy, gcc-internal-format msgid "conversion from %q#T to %q#T" msgstr "пераўтварэньне з `%T' у `%T'" -#: cp/cvt.c:684 +#: cp/cvt.c:685 #, gcc-internal-format msgid "the result of the conversion is unspecified because %qE is outside the range of type %qT" msgstr "" -#: cp/cvt.c:695 cp/cvt.c:715 +#: cp/cvt.c:696 cp/cvt.c:716 #, gcc-internal-format msgid "%q#T used where a %qT was expected" msgstr "" -#: cp/cvt.c:730 +#: cp/cvt.c:731 #, gcc-internal-format msgid "%q#T used where a floating point value was expected" msgstr "" -#: cp/cvt.c:790 +#: cp/cvt.c:791 #, gcc-internal-format msgid "conversion from %qT to non-scalar type %qT requested" msgstr "" -#: cp/cvt.c:829 +#: cp/cvt.c:830 #, gcc-internal-format msgid "pseudo-destructor is not called" msgstr "" -#: cp/cvt.c:892 +#: cp/cvt.c:893 #, gcc-internal-format msgid "object of incomplete type %qT will not be accessed in %s" msgstr "" -#: cp/cvt.c:900 +#: cp/cvt.c:901 #, gcc-internal-format msgid "object of type %qT will not be accessed in %s" msgstr "" -#: cp/cvt.c:931 +#: cp/cvt.c:932 #, gcc-internal-format msgid "object %qE of incomplete type %qT will not be accessed in %s" msgstr "" -#: cp/cvt.c:971 +#: cp/cvt.c:972 #, gcc-internal-format msgid "%s cannot resolve address of overloaded function" msgstr "" -#: cp/cvt.c:981 +#: cp/cvt.c:982 #, gcc-internal-format msgid "%s is a reference, not call, to function %qE" msgstr "" -#: cp/cvt.c:999 +#: cp/cvt.c:1000 #, gcc-internal-format msgid "%s has no effect" msgstr "" -#: cp/cvt.c:1143 +#: cp/cvt.c:1145 #, gcc-internal-format msgid "converting NULL to non-pointer type" msgstr "" -#: cp/cvt.c:1255 +#: cp/cvt.c:1259 #, gcc-internal-format msgid "ambiguous default type conversion from %qT" msgstr "" -#: cp/cvt.c:1257 +#: cp/cvt.c:1261 #, gcc-internal-format msgid " candidate conversions include %qD and %qD" msgstr "" -#: cp/decl.c:1059 +#: cp/decl.c:1058 #, gcc-internal-format msgid "%qD was declared % and later %" msgstr "" -#: cp/decl.c:1060 cp/decl.c:1610 objc/objc-act.c:2983 objc/objc-act.c:7599 +#: cp/decl.c:1059 cp/decl.c:1609 objc/objc-act.c:2986 objc/objc-act.c:7602 #, fuzzy, gcc-internal-format msgid "previous declaration of %q+D" msgstr "папярэдняе абвяшчэньне `%D'" -#: cp/decl.c:1093 +#: cp/decl.c:1092 #, gcc-internal-format msgid "declaration of %qF throws different exceptions" msgstr "" -#: cp/decl.c:1094 +#: cp/decl.c:1093 #, fuzzy, gcc-internal-format msgid "from previous declaration %q+F" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1150 +#: cp/decl.c:1149 #, fuzzy, gcc-internal-format msgid "function %q+D redeclared as inline" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:1152 +#: cp/decl.c:1151 #, fuzzy, gcc-internal-format msgid "previous declaration of %q+D with attribute noinline" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1159 +#: cp/decl.c:1158 #, fuzzy, gcc-internal-format msgid "function %q+D redeclared with attribute noinline" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:1161 +#: cp/decl.c:1160 #, fuzzy, gcc-internal-format msgid "previous declaration of %q+D was inline" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1185 cp/decl.c:1259 +#: cp/decl.c:1184 cp/decl.c:1258 #, fuzzy, gcc-internal-format msgid "shadowing built-in function %q#D" msgstr "у функцыі \"%s\":" -#: cp/decl.c:1186 cp/decl.c:1260 +#: cp/decl.c:1185 cp/decl.c:1259 #, fuzzy, gcc-internal-format msgid "shadowing library function %q#D" msgstr "у функцыі \"%s\":" -#: cp/decl.c:1193 +#: cp/decl.c:1192 #, gcc-internal-format msgid "library function %q#D redeclared as non-function %q#D" msgstr "" -#: cp/decl.c:1198 +#: cp/decl.c:1197 #, fuzzy, gcc-internal-format msgid "conflicts with built-in declaration %q#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1252 cp/decl.c:1379 cp/decl.c:1395 +#: cp/decl.c:1251 cp/decl.c:1378 cp/decl.c:1394 #, fuzzy, gcc-internal-format msgid "new declaration %q#D" msgstr "новае абвяшчэньне `%#D'" -#: cp/decl.c:1253 +#: cp/decl.c:1252 #, fuzzy, gcc-internal-format msgid "ambiguates built-in declaration %q#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1343 +#: cp/decl.c:1342 #, gcc-internal-format msgid "%q#D redeclared as different kind of symbol" msgstr "" -#: cp/decl.c:1346 +#: cp/decl.c:1345 #, fuzzy, gcc-internal-format msgid "previous declaration of %q+#D" msgstr "папярэдняе абвяшчэньне `%#D'" -#: cp/decl.c:1365 +#: cp/decl.c:1364 #, fuzzy, gcc-internal-format msgid "declaration of template %q#D" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:1366 cp/name-lookup.c:526 cp/name-lookup.c:812 +#: cp/decl.c:1365 cp/name-lookup.c:526 cp/name-lookup.c:812 #: cp/name-lookup.c:823 #, fuzzy, gcc-internal-format msgid "conflicts with previous declaration %q+#D" msgstr "канфлікт з папярэднім абвяшчэньнем `%#D'" -#: cp/decl.c:1380 cp/decl.c:1396 +#: cp/decl.c:1379 cp/decl.c:1395 #, fuzzy, gcc-internal-format msgid "ambiguates old declaration %q+#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1388 +#: cp/decl.c:1387 #, fuzzy, gcc-internal-format msgid "declaration of C function %q#D conflicts with" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1390 +#: cp/decl.c:1389 #, fuzzy, gcc-internal-format msgid "previous declaration %q+#D here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1404 +#: cp/decl.c:1403 #, fuzzy, gcc-internal-format msgid "conflicting declaration %q#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1405 +#: cp/decl.c:1404 #, fuzzy, gcc-internal-format msgid "%q+D has a previous declaration as %q#D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" @@ -23695,63 +23771,63 @@ msgstr "няма папярэдняга аб'яўлення для \"%s\"" #. A namespace-name defined at global scope shall not be #. declared as the name of any other entity in any global scope #. of the program. -#: cp/decl.c:1457 +#: cp/decl.c:1456 #, fuzzy, gcc-internal-format msgid "declaration of namespace %qD conflicts with" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:1458 +#: cp/decl.c:1457 #, fuzzy, gcc-internal-format msgid "previous declaration of namespace %q+D here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1469 +#: cp/decl.c:1468 #, fuzzy, gcc-internal-format msgid "%q+#D previously defined here" msgstr "папярэдняе вызначэньне" #. Prototype decl follows defn w/o prototype. -#: cp/decl.c:1479 +#: cp/decl.c:1478 #, fuzzy, gcc-internal-format msgid "prototype for %q+#D" msgstr "няма папярэдняга прататыпа для \"%s\"" -#: cp/decl.c:1481 +#: cp/decl.c:1480 #, gcc-internal-format msgid "follows non-prototype definition here" msgstr "" -#: cp/decl.c:1521 +#: cp/decl.c:1520 #, fuzzy, gcc-internal-format msgid "previous declaration of %q+#D with %qL linkage" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1523 +#: cp/decl.c:1522 #, fuzzy, gcc-internal-format msgid "conflicts with new declaration with %qL linkage" msgstr "канфлікт з папярэднім абвяшчэньнем `%#D'" -#: cp/decl.c:1546 cp/decl.c:1552 +#: cp/decl.c:1545 cp/decl.c:1551 #, fuzzy, gcc-internal-format msgid "default argument given for parameter %d of %q#D" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/decl.c:1548 cp/decl.c:1554 +#: cp/decl.c:1547 cp/decl.c:1553 #, fuzzy, gcc-internal-format msgid "after previous specification in %q+#D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1609 +#: cp/decl.c:1608 #, fuzzy, gcc-internal-format msgid "redundant redeclaration of %qD in same scope" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1615 +#: cp/decl.c:1614 #, fuzzy, gcc-internal-format msgid "deleted definition of %qD" msgstr "папярэдняе вызначэньне `%#T'" -#: cp/decl.c:1616 +#: cp/decl.c:1615 #, fuzzy, gcc-internal-format msgid "after previous declaration %q+D" msgstr "папярэдняе абвяшчэньне `%D'" @@ -23764,43 +23840,43 @@ msgstr "папярэдняе абвяшчэньне `%D'" #. that specialization that would cause an implicit #. instantiation to take place, in every translation unit in #. which such a use occurs. -#: cp/decl.c:1967 +#: cp/decl.c:1966 #, fuzzy, gcc-internal-format msgid "explicit specialization of %qD after first use" msgstr "ініцыялізацыя" -#: cp/decl.c:2064 +#: cp/decl.c:2063 #, gcc-internal-format msgid "%q+D: visibility attribute ignored because it" msgstr "" -#: cp/decl.c:2066 +#: cp/decl.c:2065 #, fuzzy, gcc-internal-format msgid "conflicts with previous declaration here" msgstr "канфлікт з папярэднім абвяшчэньнем `%#D'" #. Reject two definitions. -#: cp/decl.c:2213 cp/decl.c:2242 cp/decl.c:2271 cp/decl.c:2288 cp/decl.c:2360 +#: cp/decl.c:2216 cp/decl.c:2245 cp/decl.c:2274 cp/decl.c:2291 cp/decl.c:2363 #, fuzzy, gcc-internal-format msgid "redefinition of %q#D" msgstr "папярэдняе вызначэньне `%#T'" -#: cp/decl.c:2229 +#: cp/decl.c:2232 #, fuzzy, gcc-internal-format msgid "%qD conflicts with used function" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: cp/decl.c:2239 +#: cp/decl.c:2242 #, fuzzy, gcc-internal-format msgid "%q#D not declared in class" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:2253 cp/decl.c:2298 +#: cp/decl.c:2256 cp/decl.c:2301 #, gcc-internal-format msgid "%q+D redeclared inline with % attribute" msgstr "" -#: cp/decl.c:2256 cp/decl.c:2301 +#: cp/decl.c:2259 cp/decl.c:2304 #, gcc-internal-format msgid "%q+D redeclared inline without % attribute" msgstr "" @@ -23808,329 +23884,329 @@ msgstr "" #. is_primary= #. is_partial= #. is_friend_decl= -#: cp/decl.c:2317 +#: cp/decl.c:2320 #, gcc-internal-format msgid "redeclaration of friend %q#D may not have default template arguments" msgstr "" -#: cp/decl.c:2331 +#: cp/decl.c:2334 #, gcc-internal-format msgid "thread-local declaration of %q#D follows non-thread-local declaration" msgstr "" -#: cp/decl.c:2334 +#: cp/decl.c:2337 #, gcc-internal-format msgid "non-thread-local declaration of %q#D follows thread-local declaration" msgstr "" -#: cp/decl.c:2349 cp/decl.c:2368 +#: cp/decl.c:2352 cp/decl.c:2371 #, fuzzy, gcc-internal-format msgid "redeclaration of %q#D" msgstr "абвяшчэньне `%#D'" -#: cp/decl.c:2511 +#: cp/decl.c:2514 #, fuzzy, gcc-internal-format msgid "jump to label %qD" msgstr "паўтарэнне \"%s\"" -#: cp/decl.c:2513 +#: cp/decl.c:2516 #, gcc-internal-format msgid "jump to case label" msgstr "" -#: cp/decl.c:2515 cp/decl.c:2655 cp/decl.c:2696 +#: cp/decl.c:2518 cp/decl.c:2658 cp/decl.c:2699 #, gcc-internal-format msgid " from here" msgstr " адсюль" -#: cp/decl.c:2534 cp/decl.c:2699 +#: cp/decl.c:2537 cp/decl.c:2702 #, gcc-internal-format msgid " exits OpenMP structured block" msgstr "" -#: cp/decl.c:2555 +#: cp/decl.c:2558 #, fuzzy, gcc-internal-format msgid " crosses initialization of %q+#D" msgstr "ініцыялізацыя" -#: cp/decl.c:2557 cp/decl.c:2673 +#: cp/decl.c:2560 cp/decl.c:2676 #, gcc-internal-format msgid " enters scope of %q+#D which has non-trivial destructor" msgstr "" -#: cp/decl.c:2571 cp/decl.c:2678 +#: cp/decl.c:2574 cp/decl.c:2681 #, gcc-internal-format msgid " enters try block" msgstr "" #. Can't skip init of __exception_info. -#: cp/decl.c:2573 cp/decl.c:2667 cp/decl.c:2680 +#: cp/decl.c:2576 cp/decl.c:2670 cp/decl.c:2683 #, gcc-internal-format msgid " enters catch block" msgstr "" -#: cp/decl.c:2583 cp/decl.c:2683 +#: cp/decl.c:2586 cp/decl.c:2686 #, gcc-internal-format msgid " enters OpenMP structured block" msgstr "" -#: cp/decl.c:2654 cp/decl.c:2695 +#: cp/decl.c:2657 cp/decl.c:2698 #, fuzzy, gcc-internal-format msgid "jump to label %q+D" msgstr "паўтарэнне \"%s\"" -#: cp/decl.c:2671 +#: cp/decl.c:2674 #, fuzzy, gcc-internal-format msgid " skips initialization of %q+#D" msgstr "ініцыялізацыя" -#: cp/decl.c:2748 +#: cp/decl.c:2751 #, gcc-internal-format msgid "label named wchar_t" msgstr "" -#: cp/decl.c:3019 +#: cp/decl.c:3022 #, fuzzy, gcc-internal-format msgid "%qD is not a type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:3025 cp/parser.c:4238 +#: cp/decl.c:3028 cp/parser.c:4240 #, fuzzy, gcc-internal-format msgid "%qD used without template parameters" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:3034 +#: cp/decl.c:3037 #, fuzzy, gcc-internal-format msgid "%q#T is not a class" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:3058 cp/decl.c:3145 +#: cp/decl.c:3061 cp/decl.c:3148 #, gcc-internal-format msgid "no class template named %q#T in %q#T" msgstr "" -#: cp/decl.c:3071 +#: cp/decl.c:3074 #, fuzzy, gcc-internal-format msgid "lookup of %qT in %qT is ambiguous" msgstr "памер \"%s\" - %d байт" -#: cp/decl.c:3080 +#: cp/decl.c:3083 #, gcc-internal-format msgid "% names %q#T, which is not a class template" msgstr "" -#: cp/decl.c:3087 +#: cp/decl.c:3090 #, gcc-internal-format msgid "% names %q#T, which is not a type" msgstr "" -#: cp/decl.c:3154 +#: cp/decl.c:3157 #, fuzzy, gcc-internal-format msgid "template parameters do not match template" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:3155 cp/friend.c:321 cp/friend.c:329 +#: cp/decl.c:3158 cp/friend.c:321 cp/friend.c:329 #, fuzzy, gcc-internal-format msgid "%q+D declared here" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:3837 +#: cp/decl.c:3840 #, gcc-internal-format msgid "an anonymous struct cannot have function members" msgstr "" -#: cp/decl.c:3840 +#: cp/decl.c:3843 #, gcc-internal-format msgid "an anonymous union cannot have function members" msgstr "" -#: cp/decl.c:3858 +#: cp/decl.c:3861 #, gcc-internal-format msgid "member %q+#D with constructor not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3861 +#: cp/decl.c:3864 #, gcc-internal-format msgid "member %q+#D with destructor not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3864 +#: cp/decl.c:3867 #, gcc-internal-format msgid "member %q+#D with copy assignment operator not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3889 +#: cp/decl.c:3892 #, gcc-internal-format msgid "multiple types in one declaration" msgstr "" -#: cp/decl.c:3893 +#: cp/decl.c:3896 #, fuzzy, gcc-internal-format msgid "redeclaration of C++ built-in type %qT" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:3930 +#: cp/decl.c:3933 #, gcc-internal-format msgid "missing type-name in typedef-declaration" msgstr "" -#: cp/decl.c:3937 +#: cp/decl.c:3940 #, gcc-internal-format msgid "ISO C++ prohibits anonymous structs" msgstr "" -#: cp/decl.c:3944 +#: cp/decl.c:3947 #, fuzzy, gcc-internal-format msgid "%qs can only be specified for functions" msgstr "\"%s\" звычайна функцыя" -#: cp/decl.c:3950 +#: cp/decl.c:3953 #, gcc-internal-format msgid "% can only be specified inside a class" msgstr "" -#: cp/decl.c:3952 +#: cp/decl.c:3955 #, gcc-internal-format msgid "% can only be specified for constructors" msgstr "" -#: cp/decl.c:3954 +#: cp/decl.c:3957 #, gcc-internal-format msgid "a storage class can only be specified for objects and functions" msgstr "" -#: cp/decl.c:3960 +#: cp/decl.c:3963 #, gcc-internal-format msgid "qualifiers can only be specified for objects and functions" msgstr "" -#: cp/decl.c:3963 +#: cp/decl.c:3966 #, gcc-internal-format msgid "% was ignored in this declaration" msgstr "" -#: cp/decl.c:3965 +#: cp/decl.c:3968 #, gcc-internal-format msgid "% cannot be used for type declarations" msgstr "" -#: cp/decl.c:3994 +#: cp/decl.c:3997 #, fuzzy, gcc-internal-format msgid "attribute ignored in declaration of %q+#T" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:3995 +#: cp/decl.c:3998 #, gcc-internal-format msgid "attribute for %q+#T must follow the %qs keyword" msgstr "" -#: cp/decl.c:4040 +#: cp/decl.c:4043 #, gcc-internal-format msgid "ignoring attributes applied to class type %qT outside of definition" msgstr "" #. A template type parameter or other dependent type. -#: cp/decl.c:4044 +#: cp/decl.c:4047 #, gcc-internal-format msgid "ignoring attributes applied to dependent type %qT without an associated declaration" msgstr "" -#: cp/decl.c:4117 cp/decl2.c:792 +#: cp/decl.c:4120 cp/decl2.c:820 #, fuzzy, gcc-internal-format msgid "typedef %qD is initialized (use decltype instead)" msgstr "параметр \"%s\" ініцыялізаваны" -#: cp/decl.c:4135 +#: cp/decl.c:4138 #, gcc-internal-format msgid "declaration of %q#D has % and is initialized" msgstr "" -#: cp/decl.c:4160 +#: cp/decl.c:4163 #, gcc-internal-format msgid "definition of %q#D is marked %" msgstr "" -#: cp/decl.c:4179 +#: cp/decl.c:4182 #, gcc-internal-format msgid "%q#D is not a static member of %q#T" msgstr "" -#: cp/decl.c:4185 +#: cp/decl.c:4188 #, gcc-internal-format msgid "ISO C++ does not permit %<%T::%D%> to be defined as %<%T::%D%>" msgstr "" -#: cp/decl.c:4194 +#: cp/decl.c:4197 #, gcc-internal-format msgid "template header not allowed in member definition of explicitly specialized class" msgstr "" -#: cp/decl.c:4202 +#: cp/decl.c:4205 #, fuzzy, gcc-internal-format msgid "duplicate initialization of %qD" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:4207 +#: cp/decl.c:4210 #, gcc-internal-format msgid "%qD declared % outside its class" msgstr "" -#: cp/decl.c:4244 +#: cp/decl.c:4247 #, gcc-internal-format msgid "declaration of %q#D outside of class is not definition" msgstr "" -#: cp/decl.c:4342 +#: cp/decl.c:4345 #, fuzzy, gcc-internal-format msgid "variable %q#D has initializer but incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:4348 cp/decl.c:5099 +#: cp/decl.c:4351 cp/decl.c:5102 #, fuzzy, gcc-internal-format msgid "elements of array %q#D have incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:4355 cp/decl.c:5595 +#: cp/decl.c:4358 cp/decl.c:5598 #, fuzzy, gcc-internal-format msgid "declaration of %q#D has no initializer" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:4357 +#: cp/decl.c:4360 #, gcc-internal-format msgid "aggregate %q#D has incomplete type and cannot be defined" msgstr "" -#: cp/decl.c:4393 +#: cp/decl.c:4396 #, gcc-internal-format msgid "%qD declared as reference but not initialized" msgstr "" -#: cp/decl.c:4418 +#: cp/decl.c:4421 #, fuzzy, gcc-internal-format msgid "cannot initialize %qT from %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:4482 +#: cp/decl.c:4485 #, gcc-internal-format msgid "name used in a GNU-style designated initializer for an array" msgstr "" -#: cp/decl.c:4487 +#: cp/decl.c:4490 #, gcc-internal-format msgid "name %qD used in a GNU-style designated initializer for an array" msgstr "" -#: cp/decl.c:4537 +#: cp/decl.c:4540 #, gcc-internal-format msgid "initializer fails to determine size of %qD" msgstr "" -#: cp/decl.c:4544 +#: cp/decl.c:4547 #, fuzzy, gcc-internal-format msgid "array size missing in %qD" msgstr "прапушчан памер масіва ў `%D'" -#: cp/decl.c:4556 +#: cp/decl.c:4559 #, fuzzy, gcc-internal-format msgid "zero-size array %qD" msgstr "нулявы памер масіва `%D'" @@ -24138,264 +24214,264 @@ msgstr "нулявы памер масіва `%D'" #. An automatic variable with an incomplete type: that is an error. #. Don't talk about array types here, since we took care of that #. message in grokdeclarator. -#: cp/decl.c:4599 +#: cp/decl.c:4602 #, gcc-internal-format msgid "storage size of %qD isn't known" msgstr "" -#: cp/decl.c:4622 +#: cp/decl.c:4625 #, fuzzy, gcc-internal-format msgid "storage size of %qD isn't constant" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:4668 +#: cp/decl.c:4671 #, gcc-internal-format msgid "sorry: semantics of inline function static data %q+#D are wrong (you'll wind up with multiple copies)" msgstr "" -#: cp/decl.c:4672 +#: cp/decl.c:4675 #, gcc-internal-format msgid " you can work around this by removing the initializer" msgstr "" -#: cp/decl.c:4692 +#: cp/decl.c:4695 #, fuzzy, gcc-internal-format msgid "missing initializer for constexpr %qD" msgstr "прапушчан ініцыялізатар" -#: cp/decl.c:4702 +#: cp/decl.c:4705 #, fuzzy, gcc-internal-format msgid "uninitialized const %qD" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:4814 +#: cp/decl.c:4817 #, fuzzy, gcc-internal-format msgid "invalid type %qT as initializer for a vector of type %qT" msgstr "нерэчаісны ініцыялізатар" -#: cp/decl.c:4856 +#: cp/decl.c:4859 #, gcc-internal-format msgid "initializer for %qT must be brace-enclosed" msgstr "" -#: cp/decl.c:4874 +#: cp/decl.c:4877 #, gcc-internal-format msgid "%qT has no non-static data member named %qD" msgstr "" -#: cp/decl.c:4933 +#: cp/decl.c:4936 #, fuzzy, gcc-internal-format msgid "braces around scalar initializer for type %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:5024 +#: cp/decl.c:5027 #, fuzzy, gcc-internal-format msgid "missing braces around initializer for %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:5081 cp/typeck2.c:1017 cp/typeck2.c:1192 cp/typeck2.c:1215 -#: cp/typeck2.c:1258 +#: cp/decl.c:5084 cp/typeck2.c:1019 cp/typeck2.c:1194 cp/typeck2.c:1217 +#: cp/typeck2.c:1260 #, fuzzy, gcc-internal-format msgid "too many initializers for %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:5101 +#: cp/decl.c:5104 #, fuzzy, gcc-internal-format msgid "elements of array %q#T have incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:5110 +#: cp/decl.c:5113 #, gcc-internal-format msgid "variable-sized object %qD may not be initialized" msgstr "" -#: cp/decl.c:5112 +#: cp/decl.c:5115 #, gcc-internal-format msgid "variable-sized compound literal" msgstr "" -#: cp/decl.c:5166 +#: cp/decl.c:5169 #, fuzzy, gcc-internal-format msgid "%qD has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:5186 +#: cp/decl.c:5189 #, gcc-internal-format msgid "scalar object %qD requires one element in initializer" msgstr "" -#: cp/decl.c:5217 +#: cp/decl.c:5220 #, gcc-internal-format msgid "in C++98 %qD must be initialized by constructor, not by %<{...}%>" msgstr "" -#: cp/decl.c:5249 +#: cp/decl.c:5252 #, gcc-internal-format msgid "array %qD initialized by parenthesized string literal %qE" msgstr "" -#: cp/decl.c:5263 +#: cp/decl.c:5266 #, fuzzy, gcc-internal-format msgid "structure %qD with uninitialized const members" msgstr "параметр \"%s\" ініцыялізаваны" -#: cp/decl.c:5265 +#: cp/decl.c:5268 #, fuzzy, gcc-internal-format msgid "structure %qD with uninitialized reference members" msgstr "параметр \"%s\" ініцыялізаваны" -#: cp/decl.c:5562 +#: cp/decl.c:5565 #, gcc-internal-format msgid "assignment (not initialization) in declaration" msgstr "" -#: cp/decl.c:5703 +#: cp/decl.c:5706 #, fuzzy, gcc-internal-format msgid "shadowing previous type declaration of %q#D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:5735 +#: cp/decl.c:5738 #, gcc-internal-format msgid "%qD cannot be thread-local because it has non-trivial type %qT" msgstr "" -#: cp/decl.c:5778 +#: cp/decl.c:5781 #, gcc-internal-format msgid "Java object %qD not allocated with %" msgstr "" -#: cp/decl.c:5795 +#: cp/decl.c:5798 #, gcc-internal-format msgid "%qD is thread-local and so cannot be dynamically initialized" msgstr "" -#: cp/decl.c:5813 +#: cp/decl.c:5816 #, gcc-internal-format msgid "%qD cannot be initialized by a non-constant expression when being declared" msgstr "" -#: cp/decl.c:5862 +#: cp/decl.c:5865 #, gcc-internal-format msgid "non-static data member %qD has Java class type" msgstr "" -#: cp/decl.c:5926 +#: cp/decl.c:5929 #, gcc-internal-format msgid "function %q#D is initialized like a variable" msgstr "" -#: cp/decl.c:6506 +#: cp/decl.c:6509 #, gcc-internal-format msgid "destructor for alien class %qT cannot be a member" msgstr "" -#: cp/decl.c:6508 +#: cp/decl.c:6511 #, gcc-internal-format msgid "constructor for alien class %qT cannot be a member" msgstr "" -#: cp/decl.c:6529 +#: cp/decl.c:6532 #, gcc-internal-format msgid "%qD declared as a % %s" msgstr "" -#: cp/decl.c:6531 +#: cp/decl.c:6534 #, gcc-internal-format msgid "%qD declared as an % %s" msgstr "" -#: cp/decl.c:6533 +#: cp/decl.c:6536 #, gcc-internal-format msgid "% and % function specifiers on %qD invalid in %s declaration" msgstr "" -#: cp/decl.c:6537 +#: cp/decl.c:6540 #, gcc-internal-format msgid "%q+D declared as a friend" msgstr "" -#: cp/decl.c:6543 +#: cp/decl.c:6546 #, fuzzy, gcc-internal-format msgid "%q+D declared with an exception specification" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:6577 +#: cp/decl.c:6580 #, gcc-internal-format msgid "definition of %qD is not in namespace enclosing %qT" msgstr "" -#: cp/decl.c:6698 +#: cp/decl.c:6701 #, fuzzy, gcc-internal-format msgid "defining explicit specialization %qD in friend declaration" msgstr "ініцыялізацыя" #. Something like `template friend void f()'. -#: cp/decl.c:6708 +#: cp/decl.c:6711 #, fuzzy, gcc-internal-format msgid "invalid use of template-id %qD in declaration of primary template" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:6738 +#: cp/decl.c:6741 #, gcc-internal-format msgid "default arguments are not allowed in declaration of friend template specialization %qD" msgstr "" -#: cp/decl.c:6746 +#: cp/decl.c:6749 #, gcc-internal-format msgid "% is not allowed in declaration of friend template specialization %qD" msgstr "" -#: cp/decl.c:6789 +#: cp/decl.c:6792 #, gcc-internal-format msgid "cannot declare %<::main%> to be a template" msgstr "" -#: cp/decl.c:6791 +#: cp/decl.c:6794 #, gcc-internal-format msgid "cannot declare %<::main%> to be inline" msgstr "" -#: cp/decl.c:6793 +#: cp/decl.c:6796 #, gcc-internal-format msgid "cannot declare %<::main%> to be static" msgstr "" -#: cp/decl.c:6821 +#: cp/decl.c:6824 #, gcc-internal-format msgid "non-local function %q#D uses anonymous type" msgstr "" -#: cp/decl.c:6824 cp/decl.c:7107 cp/decl2.c:3445 +#: cp/decl.c:6827 cp/decl.c:7110 cp/decl2.c:3480 #, gcc-internal-format msgid "%q+#D does not refer to the unqualified type, so it is not used for linkage" msgstr "" -#: cp/decl.c:6830 +#: cp/decl.c:6833 #, gcc-internal-format msgid "non-local function %q#D uses local type %qT" msgstr "" -#: cp/decl.c:6849 +#: cp/decl.c:6852 #, gcc-internal-format msgid "static member function %qD cannot have cv-qualifier" msgstr "" -#: cp/decl.c:6850 +#: cp/decl.c:6853 #, gcc-internal-format msgid "non-member function %qD cannot have cv-qualifier" msgstr "" -#: cp/decl.c:6895 +#: cp/decl.c:6898 #, fuzzy, gcc-internal-format msgid "%<::main%> must return %" msgstr "`main' павінна вяртаць `int'" -#: cp/decl.c:6935 +#: cp/decl.c:6938 #, gcc-internal-format msgid "definition of implicitly-declared %qD" msgstr "" -#: cp/decl.c:6952 cp/decl2.c:702 +#: cp/decl.c:6955 cp/decl2.c:730 #, gcc-internal-format msgid "no %q#D member function declared in class %qT" msgstr "" @@ -24404,671 +24480,671 @@ msgstr "" #. no linkage can only be used to declare extern "C" #. entities. Since it's not always an error in the #. ISO C++ 90 Standard, we only issue a warning. -#: cp/decl.c:7104 +#: cp/decl.c:7107 #, gcc-internal-format msgid "non-local variable %q#D uses anonymous type" msgstr "" -#: cp/decl.c:7113 +#: cp/decl.c:7116 #, gcc-internal-format msgid "non-local variable %q#D uses local type %qT" msgstr "" -#: cp/decl.c:7234 +#: cp/decl.c:7237 #, gcc-internal-format msgid "invalid in-class initialization of static data member of non-integral type %qT" msgstr "" -#: cp/decl.c:7244 +#: cp/decl.c:7247 #, gcc-internal-format msgid "ISO C++ forbids in-class initialization of non-const static member %qD" msgstr "" -#: cp/decl.c:7248 +#: cp/decl.c:7251 #, gcc-internal-format msgid "ISO C++ forbids initialization of member constant %qD of non-integral type %qT" msgstr "" -#: cp/decl.c:7273 +#: cp/decl.c:7276 #, fuzzy, gcc-internal-format msgid "size of array %qD has non-integral type %qT" msgstr "памер масіва `%D' не цэлалікавы тып" -#: cp/decl.c:7275 +#: cp/decl.c:7278 #, fuzzy, gcc-internal-format msgid "size of array has non-integral type %qT" msgstr "памер масіва \"%s\" адмоўны" -#: cp/decl.c:7324 +#: cp/decl.c:7327 #, fuzzy, gcc-internal-format msgid "size of array %qD is negative" msgstr "памер масіва `%D' - адмоўны" -#: cp/decl.c:7326 +#: cp/decl.c:7329 #, gcc-internal-format msgid "size of array is negative" msgstr "адмоўны памер масіва " -#: cp/decl.c:7334 +#: cp/decl.c:7337 #, fuzzy, gcc-internal-format msgid "ISO C++ forbids zero-size array %qD" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:7336 +#: cp/decl.c:7339 #, fuzzy, gcc-internal-format msgid "ISO C++ forbids zero-size array" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:7343 +#: cp/decl.c:7346 #, fuzzy, gcc-internal-format msgid "size of array %qD is not an integral constant-expression" msgstr "памер масіва \"%s\" адмоўны" -#: cp/decl.c:7346 +#: cp/decl.c:7349 #, gcc-internal-format msgid "size of array is not an integral constant-expression" msgstr "" -#: cp/decl.c:7352 +#: cp/decl.c:7355 #, fuzzy, gcc-internal-format msgid "ISO C++ forbids variable length array %qD" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:7354 +#: cp/decl.c:7357 #, fuzzy, gcc-internal-format msgid "ISO C++ forbids variable length array" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:7360 +#: cp/decl.c:7363 #, gcc-internal-format msgid "variable length array %qD is used" msgstr "" -#: cp/decl.c:7396 +#: cp/decl.c:7399 #, gcc-internal-format msgid "overflow in array dimension" msgstr "" -#: cp/decl.c:7452 +#: cp/decl.c:7455 #, fuzzy, gcc-internal-format msgid "declaration of %qD as array of void" msgstr "абвяшчэньне `%#D'" -#: cp/decl.c:7454 +#: cp/decl.c:7457 #, gcc-internal-format msgid "creating array of void" msgstr "" -#: cp/decl.c:7459 +#: cp/decl.c:7462 #, gcc-internal-format msgid "declaration of %qD as array of functions" msgstr "" -#: cp/decl.c:7461 +#: cp/decl.c:7464 #, gcc-internal-format msgid "creating array of functions" msgstr "" -#: cp/decl.c:7466 +#: cp/decl.c:7469 #, gcc-internal-format msgid "declaration of %qD as array of references" msgstr "" -#: cp/decl.c:7468 +#: cp/decl.c:7471 #, gcc-internal-format msgid "creating array of references" msgstr "" -#: cp/decl.c:7473 +#: cp/decl.c:7476 #, gcc-internal-format msgid "declaration of %qD as array of function members" msgstr "" -#: cp/decl.c:7475 +#: cp/decl.c:7478 #, gcc-internal-format msgid "creating array of function members" msgstr "" -#: cp/decl.c:7489 +#: cp/decl.c:7492 #, gcc-internal-format msgid "declaration of %qD as multidimensional array must have bounds for all dimensions except the first" msgstr "" -#: cp/decl.c:7493 +#: cp/decl.c:7496 #, gcc-internal-format msgid "multidimensional array must have bounds for all dimensions except the first" msgstr "" -#: cp/decl.c:7528 +#: cp/decl.c:7531 #, gcc-internal-format msgid "return type specification for constructor invalid" msgstr "" -#: cp/decl.c:7538 +#: cp/decl.c:7541 #, gcc-internal-format msgid "return type specification for destructor invalid" msgstr "" -#: cp/decl.c:7551 +#: cp/decl.c:7554 #, gcc-internal-format msgid "return type specified for %" msgstr "" -#: cp/decl.c:7573 +#: cp/decl.c:7576 #, gcc-internal-format msgid "unnamed variable or field declared void" msgstr "" -#: cp/decl.c:7580 +#: cp/decl.c:7583 #, gcc-internal-format msgid "variable or field declared void" msgstr "" -#: cp/decl.c:7759 +#: cp/decl.c:7762 #, fuzzy, gcc-internal-format msgid "invalid use of qualified-name %<::%D%>" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:7762 +#: cp/decl.c:7765 #, fuzzy, gcc-internal-format msgid "invalid use of qualified-name %<%T::%D%>" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:7765 +#: cp/decl.c:7768 #, fuzzy, gcc-internal-format msgid "invalid use of qualified-name %<%D::%D%>" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:7777 +#: cp/decl.c:7780 #, gcc-internal-format msgid "type %qT is not derived from type %qT" msgstr "" -#: cp/decl.c:7793 cp/decl.c:7885 cp/decl.c:9154 +#: cp/decl.c:7796 cp/decl.c:7888 cp/decl.c:9157 #, fuzzy, gcc-internal-format msgid "declaration of %qD as non-function" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:7799 +#: cp/decl.c:7802 #, fuzzy, gcc-internal-format msgid "declaration of %qD as non-member" msgstr "абвяшчэньне `%#D'" -#: cp/decl.c:7830 +#: cp/decl.c:7833 #, gcc-internal-format msgid "declarator-id missing; using reserved word %qD" msgstr "" -#: cp/decl.c:7877 +#: cp/decl.c:7880 #, gcc-internal-format msgid "function definition does not declare parameters" msgstr "" -#: cp/decl.c:7919 +#: cp/decl.c:7922 #, fuzzy, gcc-internal-format msgid "two or more data types in declaration of %qs" msgstr "пустое абвяшчэнне" -#: cp/decl.c:7925 +#: cp/decl.c:7928 #, fuzzy, gcc-internal-format msgid "conflicting specifiers in declaration of %qs" msgstr "канфлікт з папярэднім абвяшчэньнем `%#D'" -#: cp/decl.c:7996 cp/decl.c:7999 cp/decl.c:8002 +#: cp/decl.c:7999 cp/decl.c:8002 cp/decl.c:8005 #, fuzzy, gcc-internal-format msgid "ISO C++ forbids declaration of %qs with no type" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:8027 cp/decl.c:8045 +#: cp/decl.c:8030 cp/decl.c:8048 #, fuzzy, gcc-internal-format msgid "% or % invalid for %qs" msgstr "long, short, signed ці unsigned нерэчаісны для \"%s\"" -#: cp/decl.c:8029 +#: cp/decl.c:8032 #, gcc-internal-format msgid "% and % specified together for %qs" msgstr "" -#: cp/decl.c:8031 +#: cp/decl.c:8034 #, fuzzy, gcc-internal-format msgid "% invalid for %qs" msgstr "complex нерэчаісны для \"%s\"" -#: cp/decl.c:8033 +#: cp/decl.c:8036 #, fuzzy, gcc-internal-format msgid "% invalid for %qs" msgstr "complex нерэчаісны для \"%s\"" -#: cp/decl.c:8035 +#: cp/decl.c:8038 #, fuzzy, gcc-internal-format msgid "% invalid for %qs" msgstr "complex нерэчаісны для \"%s\"" -#: cp/decl.c:8037 +#: cp/decl.c:8040 #, fuzzy, gcc-internal-format msgid "% or % invalid for %qs" msgstr "long, short, signed ці unsigned нерэчаісны для \"%s\"" -#: cp/decl.c:8039 +#: cp/decl.c:8042 #, gcc-internal-format msgid "% or % specified with char for %qs" msgstr "" -#: cp/decl.c:8041 +#: cp/decl.c:8044 #, gcc-internal-format msgid "% and % specified together for %qs" msgstr "" -#: cp/decl.c:8047 +#: cp/decl.c:8050 #, fuzzy, gcc-internal-format msgid "% or % invalid for %qs" msgstr "long, short, signed ці unsigned нерэчаісны для \"%s\"" -#: cp/decl.c:8055 +#: cp/decl.c:8058 #, fuzzy, gcc-internal-format msgid "long, short, signed or unsigned used invalidly for %qs" msgstr "long, short, signed ці unsigned нерэчаісны для \"%s\"" -#: cp/decl.c:8119 +#: cp/decl.c:8122 #, fuzzy, gcc-internal-format msgid "complex invalid for %qs" msgstr "complex нерэчаісны для \"%s\"" -#: cp/decl.c:8150 +#: cp/decl.c:8153 #, gcc-internal-format msgid "both % and % cannot be used here" msgstr "" -#: cp/decl.c:8159 +#: cp/decl.c:8162 #, gcc-internal-format msgid "qualifiers are not allowed on declaration of %" msgstr "" -#: cp/decl.c:8172 cp/typeck.c:7744 +#: cp/decl.c:8175 cp/typeck.c:7831 #, fuzzy, gcc-internal-format msgid "ignoring %qV qualifiers added to function type %qT" msgstr "Нерэчаісны выбар \"%s\"" -#: cp/decl.c:8195 +#: cp/decl.c:8198 #, gcc-internal-format msgid "member %qD cannot be declared both virtual and static" msgstr "" -#: cp/decl.c:8203 +#: cp/decl.c:8206 #, fuzzy, gcc-internal-format msgid "%<%T::%D%> is not a valid declarator" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/decl.c:8212 +#: cp/decl.c:8215 #, gcc-internal-format msgid "typedef declaration invalid in parameter declaration" msgstr "" -#: cp/decl.c:8217 +#: cp/decl.c:8220 #, gcc-internal-format msgid "storage class specified for template parameter %qs" msgstr "" -#: cp/decl.c:8223 +#: cp/decl.c:8226 #, gcc-internal-format msgid "storage class specifiers invalid in parameter declarations" msgstr "" -#: cp/decl.c:8227 +#: cp/decl.c:8230 #, fuzzy, gcc-internal-format msgid "parameter declared %" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:8235 +#: cp/decl.c:8238 #, fuzzy, gcc-internal-format msgid "a parameter cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:8244 +#: cp/decl.c:8247 #, fuzzy, gcc-internal-format msgid "% outside class declaration" msgstr "Нерэчаіснае абвяшчэнне" -#: cp/decl.c:8262 +#: cp/decl.c:8265 #, fuzzy, gcc-internal-format msgid "multiple storage classes in declaration of %qs" msgstr "паўторнае абвяшчэньне адмеціны `%s'" -#: cp/decl.c:8285 +#: cp/decl.c:8288 #, gcc-internal-format msgid "storage class specified for %qs" msgstr "" -#: cp/decl.c:8289 +#: cp/decl.c:8292 #, gcc-internal-format msgid "storage class specified for parameter %qs" msgstr "" -#: cp/decl.c:8302 +#: cp/decl.c:8305 #, gcc-internal-format msgid "nested function %qs declared %" msgstr "" -#: cp/decl.c:8306 +#: cp/decl.c:8309 #, gcc-internal-format msgid "top-level declaration of %qs specifies %" msgstr "" -#: cp/decl.c:8312 +#: cp/decl.c:8315 #, gcc-internal-format msgid "function-scope %qs implicitly auto and declared %<__thread%>" msgstr "" -#: cp/decl.c:8319 +#: cp/decl.c:8322 #, gcc-internal-format msgid "storage class specifiers invalid in friend function declarations" msgstr "" -#: cp/decl.c:8413 +#: cp/decl.c:8416 #, fuzzy, gcc-internal-format msgid "%qs declared as function returning a function" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:8418 +#: cp/decl.c:8421 #, gcc-internal-format msgid "%qs declared as function returning an array" msgstr "" -#: cp/decl.c:8439 +#: cp/decl.c:8442 #, gcc-internal-format msgid "%qs function uses % type specifier without late return type" msgstr "" -#: cp/decl.c:8445 +#: cp/decl.c:8448 #, gcc-internal-format msgid "%qs function with late return type has %qT as its type rather than plain %" msgstr "" -#: cp/decl.c:8453 +#: cp/decl.c:8456 #, gcc-internal-format msgid "%qs function with late return type not declared with % type specifier" msgstr "" -#: cp/decl.c:8486 +#: cp/decl.c:8489 #, gcc-internal-format msgid "destructor cannot be static member function" msgstr "" -#: cp/decl.c:8491 +#: cp/decl.c:8494 #, gcc-internal-format msgid "destructors may not be cv-qualified" msgstr "" -#: cp/decl.c:8509 +#: cp/decl.c:8512 #, gcc-internal-format msgid "constructors cannot be declared virtual" msgstr "" -#: cp/decl.c:8522 +#: cp/decl.c:8525 #, fuzzy, gcc-internal-format msgid "can't initialize friend function %qs" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" #. Cannot be both friend and virtual. -#: cp/decl.c:8526 +#: cp/decl.c:8529 #, gcc-internal-format msgid "virtual functions cannot be friends" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:8530 +#: cp/decl.c:8533 #, gcc-internal-format msgid "friend declaration not in class definition" msgstr "" -#: cp/decl.c:8532 +#: cp/decl.c:8535 #, fuzzy, gcc-internal-format msgid "can't define friend function %qs in a local class definition" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:8550 +#: cp/decl.c:8553 #, gcc-internal-format msgid "the % specifier cannot be used in a function declaration that is not a definition" msgstr "" -#: cp/decl.c:8568 +#: cp/decl.c:8571 #, gcc-internal-format msgid "destructors may not have parameters" msgstr "" -#: cp/decl.c:8587 +#: cp/decl.c:8590 #, fuzzy, gcc-internal-format msgid "cannot declare pointer to %q#T" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:8600 cp/decl.c:8607 +#: cp/decl.c:8603 cp/decl.c:8610 #, fuzzy, gcc-internal-format msgid "cannot declare reference to %q#T" msgstr "Не магу знайсці файл для класа %s." -#: cp/decl.c:8609 +#: cp/decl.c:8612 #, gcc-internal-format msgid "cannot declare pointer to %q#T member" msgstr "" -#: cp/decl.c:8630 +#: cp/decl.c:8633 #, gcc-internal-format msgid "cannot declare reference to qualified function type %qT" msgstr "" -#: cp/decl.c:8631 +#: cp/decl.c:8634 #, fuzzy, gcc-internal-format msgid "cannot declare pointer to qualified function type %qT" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:8667 +#: cp/decl.c:8670 #, gcc-internal-format msgid "cannot declare reference to %q#T, which is not a typedef or a template type argument" msgstr "" -#: cp/decl.c:8711 +#: cp/decl.c:8714 #, gcc-internal-format msgid "template-id %qD used as a declarator" msgstr "" -#: cp/decl.c:8762 +#: cp/decl.c:8765 #, gcc-internal-format msgid "member functions are implicitly friends of their class" msgstr "" -#: cp/decl.c:8767 +#: cp/decl.c:8770 #, gcc-internal-format msgid "extra qualification %<%T::%> on member %qs" msgstr "" -#: cp/decl.c:8799 +#: cp/decl.c:8802 #, gcc-internal-format msgid "cannot define member function %<%T::%s%> within %<%T%>" msgstr "" -#: cp/decl.c:8808 +#: cp/decl.c:8811 #, gcc-internal-format msgid "a constexpr function cannot be defined outside of its class" msgstr "" -#: cp/decl.c:8822 +#: cp/decl.c:8825 #, gcc-internal-format msgid "cannot declare member %<%T::%s%> within %qT" msgstr "" -#: cp/decl.c:8845 +#: cp/decl.c:8848 #, gcc-internal-format msgid "non-parameter %qs cannot be a parameter pack" msgstr "" -#: cp/decl.c:8855 +#: cp/decl.c:8858 #, fuzzy, gcc-internal-format msgid "size of array %qs is too large" msgstr "памер масіва \"%s\" вельмі вялікі" -#: cp/decl.c:8866 +#: cp/decl.c:8869 #, gcc-internal-format msgid "data member may not have variably modified type %qT" msgstr "" -#: cp/decl.c:8868 +#: cp/decl.c:8871 #, gcc-internal-format msgid "parameter may not have variably modified type %qT" msgstr "" #. [dcl.fct.spec] The explicit specifier shall only be used in #. declarations of constructors within a class definition. -#: cp/decl.c:8876 +#: cp/decl.c:8879 #, gcc-internal-format msgid "only declarations of constructors can be %" msgstr "" -#: cp/decl.c:8884 +#: cp/decl.c:8887 #, fuzzy, gcc-internal-format msgid "non-member %qs cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:8889 +#: cp/decl.c:8892 #, gcc-internal-format msgid "non-object member %qs cannot be declared %" msgstr "" -#: cp/decl.c:8895 +#: cp/decl.c:8898 #, fuzzy, gcc-internal-format msgid "function %qs cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:8900 +#: cp/decl.c:8903 #, fuzzy, gcc-internal-format msgid "static %qs cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:8905 +#: cp/decl.c:8908 #, fuzzy, gcc-internal-format msgid "const %qs cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:8943 +#: cp/decl.c:8946 #, gcc-internal-format msgid "typedef name may not be a nested-name-specifier" msgstr "" -#: cp/decl.c:8961 +#: cp/decl.c:8964 #, gcc-internal-format msgid "ISO C++ forbids nested type %qD with same name as enclosing class" msgstr "" -#: cp/decl.c:9055 +#: cp/decl.c:9058 #, gcc-internal-format msgid "qualified function types cannot be used to declare static member functions" msgstr "" -#: cp/decl.c:9057 +#: cp/decl.c:9060 #, fuzzy, gcc-internal-format msgid "qualified function types cannot be used to declare free functions" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:9084 +#: cp/decl.c:9087 #, gcc-internal-format msgid "type qualifiers specified for friend class declaration" msgstr "" -#: cp/decl.c:9089 +#: cp/decl.c:9092 #, fuzzy, gcc-internal-format msgid "% specified for friend class declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:9097 +#: cp/decl.c:9100 #, fuzzy, gcc-internal-format msgid "template parameters cannot be friends" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:9099 +#: cp/decl.c:9102 #, gcc-internal-format msgid "friend declaration requires class-key, i.e. %" msgstr "" -#: cp/decl.c:9103 +#: cp/decl.c:9106 #, gcc-internal-format msgid "friend declaration requires class-key, i.e. %" msgstr "" -#: cp/decl.c:9116 +#: cp/decl.c:9119 #, gcc-internal-format msgid "trying to make class %qT a friend of global scope" msgstr "" -#: cp/decl.c:9134 +#: cp/decl.c:9137 #, gcc-internal-format msgid "invalid qualifiers on non-member function type" msgstr "" -#: cp/decl.c:9144 +#: cp/decl.c:9147 #, gcc-internal-format msgid "abstract declarator %qT used as declaration" msgstr "" -#: cp/decl.c:9173 +#: cp/decl.c:9176 #, fuzzy, gcc-internal-format msgid "cannot use %<::%> in parameter declaration" msgstr "Не магу знайсці дэкларацыю пратакола для \"%s\"" #. Something like struct S { int N::j; }; -#: cp/decl.c:9219 +#: cp/decl.c:9222 #, fuzzy, gcc-internal-format msgid "invalid use of %<::%>" msgstr "нерэчаіснае выкарыстаньне `::'" -#: cp/decl.c:9234 +#: cp/decl.c:9237 #, gcc-internal-format msgid "can't make %qD into a method -- not in a class" msgstr "" -#: cp/decl.c:9243 +#: cp/decl.c:9246 #, fuzzy, gcc-internal-format msgid "function %qD declared virtual inside a union" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:9252 +#: cp/decl.c:9255 #, gcc-internal-format msgid "%qD cannot be declared virtual, since it is always static" msgstr "" -#: cp/decl.c:9270 +#: cp/decl.c:9273 #, gcc-internal-format msgid "expected qualified name in friend declaration for destructor %qD" msgstr "" -#: cp/decl.c:9277 +#: cp/decl.c:9280 #, fuzzy, gcc-internal-format msgid "declaration of %qD as member of %qT" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:9282 +#: cp/decl.c:9285 #, gcc-internal-format msgid "a destructor cannot be %" msgstr "" -#: cp/decl.c:9286 +#: cp/decl.c:9289 #, gcc-internal-format msgid "expected qualified name in friend declaration for constructor %qD" msgstr "" -#: cp/decl.c:9350 +#: cp/decl.c:9353 #, fuzzy, gcc-internal-format msgid "field %qD has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:9352 +#: cp/decl.c:9355 #, fuzzy, gcc-internal-format msgid "name %qT has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:9361 +#: cp/decl.c:9364 #, fuzzy, gcc-internal-format msgid " in instantiation of template %qT" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:9370 +#: cp/decl.c:9373 #, fuzzy, gcc-internal-format msgid "%qE is neither function nor member function; cannot be declared friend" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" @@ -25085,133 +25161,133 @@ msgstr "віртуальныя функцыі не могуць быць сяб #. the rest of the compiler does not correctly #. handle the initialization unless the member is #. static so we make it static below. -#: cp/decl.c:9423 +#: cp/decl.c:9426 #, fuzzy, gcc-internal-format msgid "ISO C++ forbids initialization of member %qD" msgstr "ініцыялізацыя" -#: cp/decl.c:9425 +#: cp/decl.c:9428 #, gcc-internal-format msgid "making %qD static" msgstr "" -#: cp/decl.c:9459 +#: cp/decl.c:9462 #, gcc-internal-format msgid "non-static data member %qE declared %" msgstr "" -#: cp/decl.c:9494 +#: cp/decl.c:9497 #, gcc-internal-format msgid "storage class % invalid for function %qs" msgstr "" -#: cp/decl.c:9496 +#: cp/decl.c:9499 #, gcc-internal-format msgid "storage class % invalid for function %qs" msgstr "" -#: cp/decl.c:9498 +#: cp/decl.c:9501 #, gcc-internal-format msgid "storage class %<__thread%> invalid for function %qs" msgstr "" -#: cp/decl.c:9510 +#: cp/decl.c:9513 #, gcc-internal-format msgid "% specified invalid for function %qs declared out of global scope" msgstr "" -#: cp/decl.c:9514 +#: cp/decl.c:9517 #, gcc-internal-format msgid "% specifier invalid for function %qs declared out of global scope" msgstr "" -#: cp/decl.c:9521 +#: cp/decl.c:9524 #, gcc-internal-format msgid "%q#T is not a class or a namespace" msgstr "" -#: cp/decl.c:9529 +#: cp/decl.c:9532 #, gcc-internal-format msgid "virtual non-class function %qs" msgstr "" -#: cp/decl.c:9536 +#: cp/decl.c:9539 #, gcc-internal-format msgid "%qs defined in a non-class scope" msgstr "" -#: cp/decl.c:9569 +#: cp/decl.c:9572 #, gcc-internal-format msgid "cannot declare member function %qD to have static linkage" msgstr "" #. FIXME need arm citation -#: cp/decl.c:9576 +#: cp/decl.c:9579 #, gcc-internal-format msgid "cannot declare static function inside another function" msgstr "" -#: cp/decl.c:9606 +#: cp/decl.c:9609 #, gcc-internal-format msgid "% may not be used when defining (as opposed to declaring) a static data member" msgstr "" -#: cp/decl.c:9613 +#: cp/decl.c:9616 #, gcc-internal-format msgid "static member %qD declared %" msgstr "" -#: cp/decl.c:9619 +#: cp/decl.c:9622 #, gcc-internal-format msgid "cannot explicitly declare member %q#D to have extern linkage" msgstr "" -#: cp/decl.c:9633 +#: cp/decl.c:9636 #, gcc-internal-format msgid "%qs initialized and declared %" msgstr "" -#: cp/decl.c:9637 +#: cp/decl.c:9640 #, gcc-internal-format msgid "%qs has both % and initializer" msgstr "" -#: cp/decl.c:9764 +#: cp/decl.c:9767 #, fuzzy, gcc-internal-format msgid "default argument for %q#D has type %qT" msgstr "звычайны аргумэнт для `%#D' мае тып `%T'" -#: cp/decl.c:9767 +#: cp/decl.c:9770 #, fuzzy, gcc-internal-format msgid "default argument for parameter of type %qT has type %qT" msgstr "звычайны аргумэнт для `%#D' мае тып `%T'" -#: cp/decl.c:9783 +#: cp/decl.c:9786 #, fuzzy, gcc-internal-format msgid "default argument %qE uses local variable %qD" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/decl.c:9871 +#: cp/decl.c:9874 #, fuzzy, gcc-internal-format msgid "parameter %qD has Java class type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:9899 +#: cp/decl.c:9902 #, fuzzy, gcc-internal-format msgid "parameter %qD invalidly declared method type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:9924 +#: cp/decl.c:9927 #, gcc-internal-format msgid "parameter %qD includes pointer to array of unknown bound %qT" msgstr "" -#: cp/decl.c:9926 +#: cp/decl.c:9929 #, gcc-internal-format msgid "parameter %qD includes reference to array of unknown bound %qT" msgstr "" -#: cp/decl.c:9941 +#: cp/decl.c:9944 #, gcc-internal-format msgid "parameter packs must be at the end of the parameter list" msgstr "" @@ -25231,163 +25307,163 @@ msgstr "" #. or implicitly defined), there's no need to worry about their #. existence. Theoretically, they should never even be #. instantiated, but that's hard to forestall. -#: cp/decl.c:10164 +#: cp/decl.c:10167 #, gcc-internal-format msgid "invalid constructor; you probably meant %<%T (const %T&)%>" msgstr "" -#: cp/decl.c:10286 +#: cp/decl.c:10289 #, fuzzy, gcc-internal-format msgid "%qD may not be declared within a namespace" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:10291 +#: cp/decl.c:10294 #, fuzzy, gcc-internal-format msgid "%qD may not be declared as static" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:10321 +#: cp/decl.c:10320 #, gcc-internal-format msgid "%qD must be a nonstatic member function" msgstr "" -#: cp/decl.c:10331 +#: cp/decl.c:10329 #, gcc-internal-format msgid "%qD must be either a non-static member function or a non-member function" msgstr "" -#: cp/decl.c:10353 +#: cp/decl.c:10351 #, gcc-internal-format msgid "%qD must have an argument of class or enumerated type" msgstr "" -#: cp/decl.c:10382 +#: cp/decl.c:10380 #, gcc-internal-format msgid "conversion to a reference to void will never use a type conversion operator" msgstr "" -#: cp/decl.c:10384 +#: cp/decl.c:10382 #, gcc-internal-format msgid "conversion to void will never use a type conversion operator" msgstr "" -#: cp/decl.c:10391 +#: cp/decl.c:10389 #, gcc-internal-format msgid "conversion to a reference to the same type will never use a type conversion operator" msgstr "" -#: cp/decl.c:10393 +#: cp/decl.c:10391 #, gcc-internal-format msgid "conversion to the same type will never use a type conversion operator" msgstr "" -#: cp/decl.c:10401 +#: cp/decl.c:10399 #, gcc-internal-format msgid "conversion to a reference to a base class will never use a type conversion operator" msgstr "" -#: cp/decl.c:10403 +#: cp/decl.c:10401 #, gcc-internal-format msgid "conversion to a base class will never use a type conversion operator" msgstr "" #. 13.4.0.3 -#: cp/decl.c:10412 +#: cp/decl.c:10410 #, gcc-internal-format msgid "ISO C++ prohibits overloading operator ?:" msgstr "" -#: cp/decl.c:10417 +#: cp/decl.c:10415 #, gcc-internal-format msgid "%qD must not have variable number of arguments" msgstr "" -#: cp/decl.c:10468 +#: cp/decl.c:10466 #, gcc-internal-format msgid "postfix %qD must take % as its argument" msgstr "" -#: cp/decl.c:10471 +#: cp/decl.c:10469 #, gcc-internal-format msgid "postfix %qD must take % as its second argument" msgstr "" -#: cp/decl.c:10479 +#: cp/decl.c:10477 #, gcc-internal-format msgid "%qD must take either zero or one argument" msgstr "" -#: cp/decl.c:10481 +#: cp/decl.c:10479 #, gcc-internal-format msgid "%qD must take either one or two arguments" msgstr "" -#: cp/decl.c:10503 +#: cp/decl.c:10501 #, gcc-internal-format msgid "prefix %qD should return %qT" msgstr "" -#: cp/decl.c:10509 +#: cp/decl.c:10507 #, gcc-internal-format msgid "postfix %qD should return %qT" msgstr "" -#: cp/decl.c:10518 +#: cp/decl.c:10516 #, gcc-internal-format msgid "%qD must take %" msgstr "" -#: cp/decl.c:10520 cp/decl.c:10529 +#: cp/decl.c:10518 cp/decl.c:10527 #, gcc-internal-format msgid "%qD must take exactly one argument" msgstr "" -#: cp/decl.c:10531 +#: cp/decl.c:10529 #, gcc-internal-format msgid "%qD must take exactly two arguments" msgstr "" -#: cp/decl.c:10540 +#: cp/decl.c:10538 #, gcc-internal-format msgid "user-defined %qD always evaluates both arguments" msgstr "" -#: cp/decl.c:10554 +#: cp/decl.c:10552 #, gcc-internal-format msgid "%qD should return by value" msgstr "" -#: cp/decl.c:10565 cp/decl.c:10570 +#: cp/decl.c:10563 cp/decl.c:10568 #, fuzzy, gcc-internal-format msgid "%qD cannot have default arguments" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/decl.c:10628 +#: cp/decl.c:10626 #, fuzzy, gcc-internal-format msgid "using template type parameter %qT after %qs" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:10644 +#: cp/decl.c:10642 #, gcc-internal-format msgid "using typedef-name %qD after %qs" msgstr "" -#: cp/decl.c:10645 +#: cp/decl.c:10643 #, fuzzy, gcc-internal-format msgid "%q+D has a previous declaration here" msgstr "гэта папярэдняе абвяшчэньне" -#: cp/decl.c:10653 +#: cp/decl.c:10651 #, gcc-internal-format msgid "%qT referred to as %qs" msgstr "" -#: cp/decl.c:10654 cp/decl.c:10661 +#: cp/decl.c:10652 cp/decl.c:10659 #, fuzzy, gcc-internal-format msgid "%q+T has a previous declaration here" msgstr "гэта папярэдняе абвяшчэньне" -#: cp/decl.c:10660 +#: cp/decl.c:10658 #, gcc-internal-format msgid "%qT referred to as enum" msgstr "" @@ -25399,78 +25475,78 @@ msgstr "" #. void f(class C); // No template header here #. #. then the required template argument is missing. -#: cp/decl.c:10675 +#: cp/decl.c:10673 #, fuzzy, gcc-internal-format msgid "template argument required for %<%s %T%>" msgstr "параметр \"%s\" ініцыялізаваны" -#: cp/decl.c:10723 cp/name-lookup.c:2823 +#: cp/decl.c:10721 cp/name-lookup.c:2823 #, gcc-internal-format msgid "%qD has the same name as the class in which it is declared" msgstr "" -#: cp/decl.c:10753 cp/name-lookup.c:2328 cp/name-lookup.c:3098 -#: cp/name-lookup.c:3142 cp/parser.c:4243 cp/parser.c:18102 +#: cp/decl.c:10751 cp/name-lookup.c:2328 cp/name-lookup.c:3098 +#: cp/name-lookup.c:3143 cp/parser.c:4245 cp/parser.c:18116 #, fuzzy, gcc-internal-format msgid "reference to %qD is ambiguous" msgstr "памер \"%s\" - %d байт" -#: cp/decl.c:10867 +#: cp/decl.c:10865 #, fuzzy, gcc-internal-format msgid "use of enum %q#D without previous declaration" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: cp/decl.c:10888 +#: cp/decl.c:10886 #, fuzzy, gcc-internal-format msgid "redeclaration of %qT as a non-template" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:10889 +#: cp/decl.c:10887 #, fuzzy, gcc-internal-format msgid "previous declaration %q+D" msgstr "папярэдняе абвяшчэньне `%D'" -#: cp/decl.c:11003 +#: cp/decl.c:11001 #, gcc-internal-format msgid "derived union %qT invalid" msgstr "" -#: cp/decl.c:11012 +#: cp/decl.c:11010 #, gcc-internal-format msgid "Java class %qT cannot have multiple bases" msgstr "" -#: cp/decl.c:11023 +#: cp/decl.c:11021 #, gcc-internal-format msgid "Java class %qT cannot have virtual bases" msgstr "" -#: cp/decl.c:11043 +#: cp/decl.c:11041 #, gcc-internal-format msgid "base type %qT fails to be a struct or class type" msgstr "" -#: cp/decl.c:11076 +#: cp/decl.c:11074 #, gcc-internal-format msgid "recursive type %qT undefined" msgstr "" -#: cp/decl.c:11078 +#: cp/decl.c:11076 #, fuzzy, gcc-internal-format msgid "duplicate base type %qT invalid" msgstr "паўтарэнне \"restrict\"" -#: cp/decl.c:11162 +#: cp/decl.c:11160 #, fuzzy, gcc-internal-format msgid "multiple definition of %q#T" msgstr "папярэдняе вызначэньне `%#T'" -#: cp/decl.c:11164 +#: cp/decl.c:11162 #, gcc-internal-format msgid "previous definition here" msgstr "папярэдняе вызначэньне" -#: cp/decl.c:11211 +#: cp/decl.c:11209 #, gcc-internal-format msgid "underlying type %<%T%> of %<%T%> must be an integral type" msgstr "" @@ -25479,217 +25555,222 @@ msgstr "" #. #. IF no integral type can represent all the enumerator values, the #. enumeration is ill-formed. -#: cp/decl.c:11345 +#: cp/decl.c:11343 #, gcc-internal-format msgid "no integral type can represent all of the enumerator values for %qT" msgstr "" -#: cp/decl.c:11477 +#: cp/decl.c:11475 #, fuzzy, gcc-internal-format msgid "enumerator value for %qD is not an integer constant" msgstr "памер масіва \"%s\" адмоўны" -#: cp/decl.c:11509 +#: cp/decl.c:11507 #, gcc-internal-format msgid "overflow in enumeration values at %qD" msgstr "" -#: cp/decl.c:11529 +#: cp/decl.c:11527 #, gcc-internal-format msgid "enumerator value %E is too large for underlying type %<%T%>" msgstr "" -#: cp/decl.c:11630 +#: cp/decl.c:11628 #, fuzzy, gcc-internal-format msgid "return type %q#T is incomplete" msgstr "вяртаемы тып \"%s\" не \"int\"" -#: cp/decl.c:11632 +#: cp/decl.c:11630 #, gcc-internal-format msgid "return type has Java class type %q#T" msgstr "" -#: cp/decl.c:11760 cp/typeck.c:7380 +#: cp/decl.c:11758 cp/typeck.c:7467 #, gcc-internal-format msgid "% should return a reference to %<*this%>" msgstr "" -#: cp/decl.c:11855 +#: cp/decl.c:11853 #, fuzzy, gcc-internal-format msgid "no previous declaration for %q+D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:12076 +#: cp/decl.c:12074 #, fuzzy, gcc-internal-format msgid "invalid function declaration" msgstr "Нерэчаіснае абвяшчэнне" -#: cp/decl.c:12160 +#: cp/decl.c:12158 #, fuzzy, gcc-internal-format msgid "parameter %qD declared void" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:12661 +#: cp/decl.c:12659 #, fuzzy, gcc-internal-format msgid "invalid member function declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:12676 +#: cp/decl.c:12674 #, fuzzy, gcc-internal-format msgid "%qD is already defined in class %qT" msgstr "не знойдзен клас \"%s\"" -#: cp/decl.c:12887 +#: cp/decl.c:12885 #, gcc-internal-format msgid "static member function %q#D declared with type qualifiers" msgstr "" -#: cp/decl2.c:287 +#: cp/decl2.c:315 #, gcc-internal-format msgid "name missing for member function" msgstr "" -#: cp/decl2.c:358 cp/decl2.c:372 +#: cp/decl2.c:386 cp/decl2.c:400 #, gcc-internal-format msgid "ambiguous conversion for array subscript" msgstr "" -#: cp/decl2.c:366 +#: cp/decl2.c:394 #, gcc-internal-format msgid "invalid types %<%T[%T]%> for array subscript" msgstr "" -#: cp/decl2.c:409 +#: cp/decl2.c:437 #, gcc-internal-format msgid "deleting array %q#D" msgstr "" -#: cp/decl2.c:415 +#: cp/decl2.c:443 #, gcc-internal-format msgid "type %q#T argument given to %, expected pointer" msgstr "" -#: cp/decl2.c:427 +#: cp/decl2.c:455 #, gcc-internal-format msgid "cannot delete a function. Only pointer-to-objects are valid arguments to %" msgstr "" -#: cp/decl2.c:435 +#: cp/decl2.c:463 #, fuzzy, gcc-internal-format msgid "deleting %qT is undefined" msgstr "метка \"%s\" ужываецца, але не вызначана" -#: cp/decl2.c:478 cp/pt.c:4301 +#: cp/decl2.c:506 cp/pt.c:4380 #, fuzzy, gcc-internal-format msgid "template declaration of %q#D" msgstr "пустое абвяшчэнне" -#: cp/decl2.c:530 +#: cp/decl2.c:558 #, gcc-internal-format msgid "Java method %qD has non-Java return type %qT" msgstr "" -#: cp/decl2.c:547 +#: cp/decl2.c:575 #, gcc-internal-format msgid "Java method %qD has non-Java parameter type %qT" msgstr "" -#: cp/decl2.c:596 +#: cp/decl2.c:624 #, gcc-internal-format msgid "template parameter lists provided don't match the template parameters of %qD" msgstr "" -#: cp/decl2.c:664 +#: cp/decl2.c:692 #, gcc-internal-format msgid "prototype for %q#D does not match any in class %qT" msgstr "" -#: cp/decl2.c:740 +#: cp/decl2.c:768 #, gcc-internal-format msgid "local class %q#T shall not have static data member %q#D" msgstr "" -#: cp/decl2.c:748 +#: cp/decl2.c:776 #, gcc-internal-format msgid "initializer invalid for static member with constructor" msgstr "" -#: cp/decl2.c:751 +#: cp/decl2.c:779 #, gcc-internal-format msgid "(an out of class initialization is required)" msgstr "" -#: cp/decl2.c:812 +#: cp/decl2.c:840 #, fuzzy, gcc-internal-format msgid "explicit template argument list not allowed" msgstr "параметр \"%s\" ініцыялізаваны" -#: cp/decl2.c:818 +#: cp/decl2.c:846 #, gcc-internal-format msgid "member %qD conflicts with virtual function table field name" msgstr "" -#: cp/decl2.c:854 +#: cp/decl2.c:882 #, fuzzy, gcc-internal-format msgid "%qD is already defined in %qT" msgstr "не знойдзен клас \"%s\"" -#: cp/decl2.c:890 +#: cp/decl2.c:917 +#, fuzzy, gcc-internal-format +msgid "invalid initializer for member function %qD" +msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" + +#: cp/decl2.c:923 #, fuzzy, gcc-internal-format msgid "initializer specified for static member function %qD" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl2.c:913 +#: cp/decl2.c:946 #, gcc-internal-format msgid "field initializer is not constant" msgstr "" -#: cp/decl2.c:940 +#: cp/decl2.c:973 #, gcc-internal-format msgid "% specifiers are not permitted on non-static data members" msgstr "" -#: cp/decl2.c:992 +#: cp/decl2.c:1025 #, fuzzy, gcc-internal-format msgid "bit-field %qD with non-integral type" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: cp/decl2.c:998 +#: cp/decl2.c:1031 #, fuzzy, gcc-internal-format msgid "cannot declare %qD to be a bit-field type" msgstr "не магу атрымаць адрас бітавага поля \"%s\"" -#: cp/decl2.c:1008 +#: cp/decl2.c:1041 #, fuzzy, gcc-internal-format msgid "cannot declare bit-field %qD with function type" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl2.c:1015 +#: cp/decl2.c:1048 #, fuzzy, gcc-internal-format msgid "%qD is already defined in the class %qT" msgstr "не знойдзен клас \"%s\"" -#: cp/decl2.c:1022 +#: cp/decl2.c:1055 #, fuzzy, gcc-internal-format msgid "static member %qD cannot be a bit-field" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl2.c:1279 +#: cp/decl2.c:1312 #, gcc-internal-format msgid "anonymous struct not inside named type" msgstr "" -#: cp/decl2.c:1365 +#: cp/decl2.c:1398 #, gcc-internal-format msgid "namespace-scope anonymous aggregates must be static" msgstr "" -#: cp/decl2.c:1374 +#: cp/decl2.c:1407 #, gcc-internal-format msgid "anonymous union with no members" msgstr "" -#: cp/decl2.c:1411 +#: cp/decl2.c:1444 #, gcc-internal-format msgid "% must return type %qT" msgstr "" @@ -25698,107 +25779,114 @@ msgstr "" #. #. The first parameter shall not have an associated default #. argument. -#: cp/decl2.c:1422 +#: cp/decl2.c:1455 #, gcc-internal-format msgid "the first parameter of % cannot have a default argument" msgstr "" -#: cp/decl2.c:1438 +#: cp/decl2.c:1471 #, gcc-internal-format msgid "% takes type % (%qT) as first parameter" msgstr "" -#: cp/decl2.c:1467 +#: cp/decl2.c:1500 #, gcc-internal-format msgid "% must return type %qT" msgstr "" -#: cp/decl2.c:1476 +#: cp/decl2.c:1509 #, gcc-internal-format msgid "% takes type %qT as first parameter" msgstr "" -#: cp/decl2.c:2198 +#: cp/decl2.c:2233 #, gcc-internal-format msgid "%qT has a field %qD whose type uses the anonymous namespace" msgstr "" -#: cp/decl2.c:2205 +#: cp/decl2.c:2240 #, gcc-internal-format msgid "%qT declared with greater visibility than the type of its field %qD" msgstr "" -#: cp/decl2.c:2218 +#: cp/decl2.c:2253 #, gcc-internal-format msgid "%qT has a base %qT whose type uses the anonymous namespace" msgstr "" -#: cp/decl2.c:2224 +#: cp/decl2.c:2259 #, gcc-internal-format msgid "%qT declared with greater visibility than its base %qT" msgstr "" -#: cp/decl2.c:3442 +#: cp/decl2.c:3477 #, gcc-internal-format msgid "%q+#D, declared using anonymous type, is used but never defined" msgstr "" -#: cp/decl2.c:3449 +#: cp/decl2.c:3484 #, gcc-internal-format msgid "%q+#D, declared using local type %qT, is used but never defined" msgstr "" -#: cp/decl2.c:3758 +#: cp/decl2.c:3793 #, fuzzy, gcc-internal-format msgid "inline function %q+D used but never defined" msgstr "адмеціна `%D' выкарыстоўвываецца, але ня вызначана" -#: cp/decl2.c:3924 +#: cp/decl2.c:3959 #, fuzzy, gcc-internal-format msgid "default argument missing for parameter %P of %q+#D" msgstr "аргумент для \"%s\" прапушчан" -#: cp/decl2.c:3975 cp/search.c:1891 +#. We mark a lambda conversion op as deleted if we can't +#. generate it properly; see maybe_add_lambda_conv_op. +#: cp/decl2.c:4017 +#, gcc-internal-format +msgid "converting lambda which uses %<...%> to function pointer" +msgstr "" + +#: cp/decl2.c:4022 cp/search.c:1892 #, gcc-internal-format msgid "deleted function %q+D" msgstr "" -#: cp/decl2.c:3976 +#: cp/decl2.c:4023 #, gcc-internal-format msgid "used here" msgstr "" -#: cp/error.c:2869 +#: cp/error.c:2922 #, gcc-internal-format msgid "extended initializer lists only available with -std=c++0x or -std=gnu++0x" msgstr "" -#: cp/error.c:2874 +#: cp/error.c:2927 #, gcc-internal-format msgid "explicit conversion operators only available with -std=c++0x or -std=gnu++0x" msgstr "" -#: cp/error.c:2879 +#: cp/error.c:2932 #, gcc-internal-format msgid "variadic templates only available with -std=c++0x or -std=gnu++0x" msgstr "" -#: cp/error.c:2884 +#: cp/error.c:2937 #, gcc-internal-format msgid "lambda expressions only available with -std=c++0x or -std=gnu++0x" msgstr "" -#: cp/error.c:2889 +#: cp/error.c:2942 #, gcc-internal-format msgid "C++0x auto only available with -std=c++0x or -std=gnu++0x" msgstr "" -#: cp/error.c:2893 +#: cp/error.c:2946 #, gcc-internal-format msgid "scoped enums only available with -std=c++0x or -std=gnu++0x" msgstr "" -#: cp/error.c:2897 +#: cp/error.c:2950 #, gcc-internal-format msgid "defaulted and deleted functions only available with -std=c++0x or -std=gnu++0x" msgstr "" @@ -26059,7 +26147,7 @@ msgstr "" msgid "bad array initializer" msgstr "нерэчаісны ініцыялізатар" -#: cp/init.c:1456 cp/semantics.c:2619 +#: cp/init.c:1456 cp/semantics.c:2623 #, fuzzy, gcc-internal-format msgid "%qT is not a class type" msgstr "\"%s\" мае незавершаны тып" @@ -26109,7 +26197,7 @@ msgstr "" msgid "no suitable %qD found in class %qT" msgstr "поле \"%s\" не знойдзена ў класе" -#: cp/init.c:1935 +#: cp/init.c:1935 cp/search.c:1105 #, fuzzy, gcc-internal-format msgid "request for member %qD is ambiguous" msgstr "памер \"%s\" - %d байт" @@ -26234,92 +26322,102 @@ msgstr "" msgid "(if you use %<-fpermissive%>, G++ will accept your code, but allowing the use of an undeclared name is deprecated)" msgstr "" -#: cp/mangle.c:1933 +#: cp/mangle.c:1937 #, gcc-internal-format msgid "mangling typeof, use decltype instead" msgstr "" -#: cp/mangle.c:2152 +#: cp/mangle.c:2156 #, gcc-internal-format msgid "mangling unknown fixed point type" msgstr "" -#: cp/mangle.c:2557 +#: cp/mangle.c:2561 #, gcc-internal-format msgid "mangling %C" msgstr "" -#: cp/mangle.c:2609 +#: cp/mangle.c:2613 #, gcc-internal-format msgid "mangling new-expression" msgstr "" -#: cp/mangle.c:2643 +#: cp/mangle.c:2647 #, gcc-internal-format msgid "omitted middle operand to % operand cannot be mangled" msgstr "" -#: cp/mangle.c:2951 +#: cp/mangle.c:2955 #, gcc-internal-format msgid "the mangled name of %qD will change in a future version of GCC" msgstr "" -#: cp/method.c:388 +#: cp/mangle.c:3071 +#, gcc-internal-format +msgid "-fabi-version=4 (or =0) avoids this error with a change in vector mangling" +msgstr "" + +#: cp/method.c:396 #, gcc-internal-format msgid "generic thunk code fails for method %q#D which uses %<...%>" msgstr "" -#: cp/method.c:569 +#: cp/method.c:577 #, gcc-internal-format msgid "non-static const member %q#D, can't use default assignment operator" msgstr "" -#: cp/method.c:575 +#: cp/method.c:583 #, gcc-internal-format msgid "non-static reference member %q#D, can't use default assignment operator" msgstr "" -#: cp/method.c:688 +#: cp/method.c:696 #, gcc-internal-format msgid "synthesized method %qD first required here " msgstr "" -#: cp/method.c:1015 +#: cp/method.c:1023 #, fuzzy, gcc-internal-format msgid "defaulted declaration %q+D" msgstr "пустое абвяшчэнне" -#: cp/method.c:1017 +#: cp/method.c:1025 #, gcc-internal-format msgid "does not match expected signature %qD" msgstr "" -#: cp/method.c:1049 +#: cp/method.c:1057 #, fuzzy, gcc-internal-format msgid "%qD cannot be defaulted" msgstr "YYDEBUG не вызначан." -#: cp/method.c:1058 +#: cp/method.c:1066 #, gcc-internal-format msgid "defaulted function %q+D with default argument" msgstr "" -#: cp/method.c:1064 +#: cp/method.c:1072 #, gcc-internal-format msgid "%qD declared explicit cannot be defaulted in the class body" msgstr "" -#: cp/method.c:1067 +#: cp/method.c:1075 #, gcc-internal-format msgid "%qD declared with non-public access cannot be defaulted in the class body" msgstr "" -#: cp/method.c:1070 +#: cp/method.c:1078 #, gcc-internal-format msgid "function %q+D defaulted on its first declaration must not have an exception-specification" msgstr "" -#: cp/method.c:1119 +#: cp/method.c:1081 +#, gcc-internal-format +msgid "%qD declared virtual cannot be defaulted in the class body" +msgstr "" + +#: cp/method.c:1130 #, gcc-internal-format msgid "vtable layout for class %qT may not be ABI-compliantand may change in a future version of GCC due to implicit virtual destructor" msgstr "" @@ -26426,7 +26524,7 @@ msgstr "" msgid " using obsolete binding at %q+D" msgstr "" -#: cp/name-lookup.c:1251 cp/parser.c:10890 +#: cp/name-lookup.c:1251 cp/parser.c:10897 #, gcc-internal-format msgid "(if you use %<-fpermissive%> G++ will accept your code)" msgstr "" @@ -26526,52 +26624,52 @@ msgstr "" msgid "explicit qualification in declaration of %qD" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/name-lookup.c:3167 +#: cp/name-lookup.c:3168 #, gcc-internal-format msgid "%qD should have been declared inside %qD" msgstr "" -#: cp/name-lookup.c:3212 +#: cp/name-lookup.c:3213 #, gcc-internal-format msgid "%qD attribute requires a single NTBS argument" msgstr "" -#: cp/name-lookup.c:3219 +#: cp/name-lookup.c:3220 #, gcc-internal-format msgid "%qD attribute is meaningless since members of the anonymous namespace get local symbols" msgstr "" -#: cp/name-lookup.c:3228 cp/name-lookup.c:3598 +#: cp/name-lookup.c:3229 cp/name-lookup.c:3599 #, fuzzy, gcc-internal-format msgid "%qD attribute directive ignored" msgstr "\"%s\" атрыбут ігнарыруецца" -#: cp/name-lookup.c:3273 +#: cp/name-lookup.c:3274 #, fuzzy, gcc-internal-format msgid "namespace alias %qD not allowed here, assuming %qD" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/name-lookup.c:3586 +#: cp/name-lookup.c:3587 #, gcc-internal-format msgid "strong using only meaningful at namespace scope" msgstr "" -#: cp/name-lookup.c:3590 +#: cp/name-lookup.c:3591 #, gcc-internal-format msgid "current namespace %qD does not enclose strongly used namespace %qD" msgstr "" -#: cp/name-lookup.c:5017 +#: cp/name-lookup.c:5018 #, gcc-internal-format msgid "argument dependent lookup finds %q+D" msgstr "" -#: cp/name-lookup.c:5461 +#: cp/name-lookup.c:5462 #, gcc-internal-format msgid "XXX entering pop_everything ()\n" msgstr "" -#: cp/name-lookup.c:5470 +#: cp/name-lookup.c:5471 #, gcc-internal-format msgid "XXX leaving pop_everything ()\n" msgstr "" @@ -26581,577 +26679,607 @@ msgstr "" msgid "making multiple clones of %qD" msgstr "" -#: cp/parser.c:435 +#: cp/parser.c:436 #, gcc-internal-format msgid "identifier %qE will become a keyword in C++0x" msgstr "" -#: cp/parser.c:2100 +#: cp/parser.c:2102 #, fuzzy, gcc-internal-format msgid "%<#pragma%> is not allowed here" msgstr "Клас \"%s\" ужо існуе" -#: cp/parser.c:2131 +#: cp/parser.c:2133 #, gcc-internal-format msgid "%<%E::%E%> has not been declared" msgstr "" -#: cp/parser.c:2134 +#: cp/parser.c:2136 #, gcc-internal-format msgid "%<::%E%> has not been declared" msgstr "" -#: cp/parser.c:2137 +#: cp/parser.c:2139 #, gcc-internal-format msgid "request for member %qE in non-class type %qT" msgstr "" -#: cp/parser.c:2140 +#: cp/parser.c:2142 #, gcc-internal-format msgid "%<%T::%E%> has not been declared" msgstr "" -#: cp/parser.c:2143 +#: cp/parser.c:2145 #, gcc-internal-format msgid "%qE has not been declared" msgstr "" -#: cp/parser.c:2146 +#: cp/parser.c:2148 #, gcc-internal-format msgid "%<%E::%E%> %s" msgstr "" -#: cp/parser.c:2148 +#: cp/parser.c:2150 #, gcc-internal-format msgid "%<::%E%> %s" msgstr "" -#: cp/parser.c:2150 +#: cp/parser.c:2152 #, gcc-internal-format msgid "%qE %s" msgstr "" -#: cp/parser.c:2188 +#: cp/parser.c:2190 #, fuzzy, gcc-internal-format msgid "ISO C++ 1998 does not support %" msgstr "ISO C++ не падтрымлівае \"long long\"" -#: cp/parser.c:2209 +#: cp/parser.c:2211 #, fuzzy, gcc-internal-format msgid "duplicate %qs" msgstr "паўтарэньне `%s'" -#: cp/parser.c:2254 +#: cp/parser.c:2256 #, gcc-internal-format msgid "new types may not be defined in a return type" msgstr "" -#: cp/parser.c:2256 +#: cp/parser.c:2258 #, fuzzy, gcc-internal-format msgid "(perhaps a semicolon is missing after the definition of %qT)" msgstr "Не магу знайсці дэкларацыю інтэрфейса для \"%s\"" -#: cp/parser.c:2276 cp/parser.c:4289 cp/pt.c:6249 +#: cp/parser.c:2278 cp/parser.c:4291 cp/pt.c:6335 #, fuzzy, gcc-internal-format msgid "%qT is not a template" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:2278 +#: cp/parser.c:2280 #, fuzzy, gcc-internal-format msgid "%qE is not a template" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:2280 +#: cp/parser.c:2282 #, fuzzy, gcc-internal-format msgid "invalid template-id" msgstr "Нерэчаісны выбар %s" -#: cp/parser.c:2343 +#: cp/parser.c:2345 #, fuzzy, gcc-internal-format msgid "invalid use of template-name %qE without an argument list" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/parser.c:2346 +#: cp/parser.c:2348 #, fuzzy, gcc-internal-format msgid "invalid use of destructor %qD as a type" msgstr "нявернае выкарыстанне \"restict\"" #. Something like 'unsigned A a;' -#: cp/parser.c:2349 +#: cp/parser.c:2351 #, gcc-internal-format msgid "invalid combination of multiple type-specifiers" msgstr "" #. Issue an error message. -#: cp/parser.c:2353 +#: cp/parser.c:2355 #, fuzzy, gcc-internal-format msgid "%qE does not name a type" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:2386 +#: cp/parser.c:2388 #, gcc-internal-format msgid "(perhaps % was intended)" msgstr "" -#: cp/parser.c:2401 +#: cp/parser.c:2403 #, gcc-internal-format msgid "%qE in namespace %qE does not name a type" msgstr "" #. A::A() -#: cp/parser.c:2407 +#: cp/parser.c:2409 #, gcc-internal-format msgid "%<%T::%E%> names the constructor, not the type" msgstr "" -#: cp/parser.c:2410 +#: cp/parser.c:2412 #, gcc-internal-format msgid "and %qT has no template constructors" msgstr "" -#: cp/parser.c:2415 +#: cp/parser.c:2417 #, gcc-internal-format msgid "need % before %<%T::%E%> because %qT is a dependent scope" msgstr "" -#: cp/parser.c:2419 +#: cp/parser.c:2421 #, gcc-internal-format msgid "%qE in class %qT does not name a type" msgstr "" -#: cp/parser.c:3208 +#: cp/parser.c:3210 #, fuzzy, gcc-internal-format msgid "fixed-point types not supported in C++" msgstr "-pipe не падтрымліваецца" -#: cp/parser.c:3289 +#: cp/parser.c:3291 #, gcc-internal-format msgid "ISO C++ forbids braced-groups within expressions" msgstr "" -#: cp/parser.c:3301 +#: cp/parser.c:3303 #, gcc-internal-format msgid "statement-expressions are not allowed outside functions nor in template-argument lists" msgstr "" -#: cp/parser.c:3374 +#: cp/parser.c:3376 #, fuzzy, gcc-internal-format msgid "% may not be used in this context" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/parser.c:3595 +#: cp/parser.c:3597 #, gcc-internal-format msgid "local variable %qD may not appear in this context" msgstr "" -#: cp/parser.c:3889 +#: cp/parser.c:3891 #, gcc-internal-format msgid "scope %qT before %<~%> is not a class-name" msgstr "" -#: cp/parser.c:4008 +#: cp/parser.c:4010 #, gcc-internal-format msgid "declaration of %<~%T%> as member of %qT" msgstr "" -#: cp/parser.c:4023 +#: cp/parser.c:4025 #, gcc-internal-format msgid "typedef-name %qD used as destructor declarator" msgstr "" +#: cp/parser.c:4552 cp/parser.c:6165 +#, gcc-internal-format +msgid "types may not be defined in casts" +msgstr "" + +#: cp/parser.c:4615 +#, gcc-internal-format +msgid "types may not be defined in a % expression" +msgstr "" + #. Warn the user that a compound literal is not #. allowed in standard C++. -#: cp/parser.c:4713 +#: cp/parser.c:4725 #, fuzzy, gcc-internal-format msgid "ISO C++ forbids compound-literals" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/parser.c:5090 +#: cp/parser.c:5102 #, fuzzy, gcc-internal-format msgid "%qE does not have class type" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:5175 cp/typeck.c:2316 +#: cp/parser.c:5187 cp/typeck.c:2325 #, fuzzy, gcc-internal-format msgid "invalid use of %qD" msgstr "нерэчаіснае выкарыстаньне `%D'" -#: cp/parser.c:5758 +#: cp/parser.c:5770 #, gcc-internal-format msgid "array bound forbidden after parenthesized type-id" msgstr "" -#: cp/parser.c:5760 +#: cp/parser.c:5772 #, gcc-internal-format msgid "try removing the parentheses around the type-id" msgstr "" -#: cp/parser.c:5964 +#: cp/parser.c:5852 +#, gcc-internal-format +msgid "types may not be defined in a new-type-id" +msgstr "" + +#: cp/parser.c:5976 #, gcc-internal-format msgid "expression in new-declarator must have integral or enumeration type" msgstr "" -#: cp/parser.c:6218 +#: cp/parser.c:6230 #, gcc-internal-format msgid "use of old-style cast" msgstr "" -#: cp/parser.c:6349 +#: cp/parser.c:6361 #, gcc-internal-format msgid "%<>>%> operator will be treated as two right angle brackets in C++0x" msgstr "" -#: cp/parser.c:6352 +#: cp/parser.c:6364 #, gcc-internal-format msgid "suggest parentheses around %<>>%> expression" msgstr "" -#: cp/parser.c:7187 +#: cp/parser.c:7203 #, gcc-internal-format msgid "expected end of capture-list" msgstr "" -#: cp/parser.c:7238 +#: cp/parser.c:7254 #, gcc-internal-format msgid "ISO C++ does not allow initializers in lambda expression capture lists" msgstr "" -#: cp/parser.c:7332 +#: cp/parser.c:7348 #, fuzzy, gcc-internal-format msgid "default argument specified for lambda parameter" msgstr "памылковая колькасьць аргументаў, зададзеных для атрыбута `%s'" -#: cp/parser.c:7395 -#, gcc-internal-format -msgid "lambda expression with no captures declared mutable" -msgstr "" - -#: cp/parser.c:7738 +#: cp/parser.c:7745 #, gcc-internal-format msgid "case label %qE not within a switch statement" msgstr "" -#: cp/parser.c:7811 +#: cp/parser.c:7818 #, gcc-internal-format msgid "need % before %qE because %qT is a dependent scope" msgstr "" -#: cp/parser.c:7820 +#: cp/parser.c:7827 #, gcc-internal-format msgid "%<%T::%D%> names the constructor, not the type" msgstr "" +#: cp/parser.c:8113 +#, gcc-internal-format +msgid "types may not be defined in conditions" +msgstr "" + #. Issue a warning about this use of a GNU extension. -#: cp/parser.c:8455 +#: cp/parser.c:8462 #, gcc-internal-format msgid "ISO C++ forbids computed gotos" msgstr "" -#: cp/parser.c:8600 cp/parser.c:16601 +#: cp/parser.c:8607 cp/parser.c:16615 #, gcc-internal-format msgid "extra %<;%>" msgstr "" -#: cp/parser.c:8821 +#: cp/parser.c:8828 #, gcc-internal-format msgid "%<__label__%> not at the beginning of a block" msgstr "" -#: cp/parser.c:8959 +#: cp/parser.c:8966 #, gcc-internal-format msgid "mixing declarations and function-definitions is forbidden" msgstr "" -#: cp/parser.c:9100 +#: cp/parser.c:9107 #, gcc-internal-format msgid "% used outside of class" msgstr "" #. Complain about `auto' as a storage specifier, if #. we're complaining about C++0x compatibility. -#: cp/parser.c:9159 +#: cp/parser.c:9166 #, gcc-internal-format msgid "% will change meaning in C++0x; please remove it" msgstr "" -#: cp/parser.c:9281 +#: cp/parser.c:9288 #, fuzzy, gcc-internal-format msgid "class definition may not be declared a friend" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/parser.c:9350 cp/parser.c:16925 +#: cp/parser.c:9357 cp/parser.c:16939 #, gcc-internal-format msgid "templates may not be %" msgstr "" -#: cp/parser.c:9771 +#: cp/parser.c:9523 +#, gcc-internal-format +msgid "types may not be defined in % expressions" +msgstr "" + +#: cp/parser.c:9778 #, gcc-internal-format msgid "invalid use of % in conversion operator" msgstr "" -#: cp/parser.c:9856 +#: cp/parser.c:9863 #, gcc-internal-format msgid "only constructors take base initializers" msgstr "" -#: cp/parser.c:9878 +#: cp/parser.c:9885 #, fuzzy, gcc-internal-format msgid "cannot expand initializer for member %<%D%>" msgstr "прапушчан ініцыялізатар" -#: cp/parser.c:9933 +#: cp/parser.c:9940 #, gcc-internal-format msgid "anachronistic old-style base class initializer" msgstr "" -#: cp/parser.c:10001 +#: cp/parser.c:10008 #, gcc-internal-format msgid "keyword % not allowed in this context (a qualified member initializer is implicitly a type)" msgstr "" #. Warn that we do not support `export'. -#: cp/parser.c:10346 +#: cp/parser.c:10353 #, gcc-internal-format msgid "keyword % not implemented, and will be ignored" msgstr "" -#: cp/parser.c:10532 cp/parser.c:10631 cp/parser.c:10738 cp/parser.c:15310 +#: cp/parser.c:10539 cp/parser.c:10638 cp/parser.c:10745 cp/parser.c:15324 #, fuzzy, gcc-internal-format msgid "template parameter pack %qD cannot have a default argument" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/parser.c:10536 cp/parser.c:15317 +#: cp/parser.c:10543 cp/parser.c:15331 #, fuzzy, gcc-internal-format msgid "template parameter pack cannot have a default argument" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/parser.c:10635 cp/parser.c:10742 +#: cp/parser.c:10642 cp/parser.c:10749 #, fuzzy, gcc-internal-format msgid "template parameter packs cannot have default arguments" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/parser.c:10882 +#: cp/parser.c:10889 #, gcc-internal-format msgid "%<<::%> cannot begin a template-argument list" msgstr "" -#: cp/parser.c:10886 +#: cp/parser.c:10893 #, gcc-internal-format msgid "%<<:%> is an alternate spelling for %<[%>. Insert whitespace between %<<%> and %<::%>" msgstr "" -#: cp/parser.c:10964 +#: cp/parser.c:10971 #, gcc-internal-format msgid "parse error in template argument list" msgstr "" #. Explain what went wrong. -#: cp/parser.c:11078 +#: cp/parser.c:11085 #, gcc-internal-format msgid "non-template %qD used as template" msgstr "" -#: cp/parser.c:11080 +#: cp/parser.c:11087 #, gcc-internal-format msgid "use %<%T::template %D%> to indicate that it is a template" msgstr "" -#: cp/parser.c:11213 +#: cp/parser.c:11220 #, gcc-internal-format msgid "expected parameter pack before %<...%>" msgstr "" -#: cp/parser.c:11631 +#: cp/parser.c:11638 #, gcc-internal-format msgid "template specialization with C linkage" msgstr "" -#: cp/parser.c:12447 +#: cp/parser.c:12454 #, gcc-internal-format msgid "declaration %qD does not declare anything" msgstr "" -#: cp/parser.c:12533 +#: cp/parser.c:12540 #, gcc-internal-format msgid "attributes ignored on uninstantiated type" msgstr "" -#: cp/parser.c:12537 +#: cp/parser.c:12544 #, gcc-internal-format msgid "attributes ignored on template instantiation" msgstr "" -#: cp/parser.c:12542 +#: cp/parser.c:12549 #, gcc-internal-format msgid "attributes ignored on elaborated-type-specifier that is not a forward declaration" msgstr "" -#: cp/parser.c:12827 +#: cp/parser.c:12834 #, fuzzy, gcc-internal-format msgid "%qD is not a namespace-name" msgstr "`%D' - гэта ня функцыя," -#: cp/parser.c:12954 +#: cp/parser.c:12961 #, gcc-internal-format msgid "% definition is not allowed here" msgstr "" -#: cp/parser.c:13095 +#: cp/parser.c:13102 #, fuzzy, gcc-internal-format msgid "a template-id may not appear in a using-declaration" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/parser.c:13516 +#: cp/parser.c:13528 #, gcc-internal-format msgid "an asm-specification is not allowed on a function-definition" msgstr "" -#: cp/parser.c:13520 +#: cp/parser.c:13532 #, fuzzy, gcc-internal-format msgid "attributes are not allowed on a function-definition" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/parser.c:13673 +#: cp/parser.c:13685 #, fuzzy, gcc-internal-format msgid "initializer provided for function" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/parser.c:13706 +#: cp/parser.c:13718 #, gcc-internal-format msgid "attributes after parenthesized initializer ignored" msgstr "" -#: cp/parser.c:14101 cp/pt.c:9873 -#, fuzzy, gcc-internal-format -msgid "array bound is not an integer constant" -msgstr "памер масіва \"%s\" адмоўны" - -#: cp/parser.c:14222 +#: cp/parser.c:14236 #, gcc-internal-format msgid "cannot define member of dependent typedef %qT" msgstr "" -#: cp/parser.c:14226 +#: cp/parser.c:14240 #, fuzzy, gcc-internal-format msgid "%<%T::%E%> is not a type" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:14254 +#: cp/parser.c:14268 #, fuzzy, gcc-internal-format msgid "invalid use of constructor as a template" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/parser.c:14256 +#: cp/parser.c:14270 #, gcc-internal-format msgid "use %<%T::%D%> instead of %<%T::%D%> to name the constructor in a qualified name" msgstr "" -#: cp/parser.c:14434 +#: cp/parser.c:14448 #, gcc-internal-format msgid "%qD is a namespace" msgstr "" -#: cp/parser.c:14509 +#: cp/parser.c:14523 #, fuzzy, gcc-internal-format msgid "duplicate cv-qualifier" msgstr "паўтарэнне \"volatile\"" -#: cp/parser.c:14631 cp/typeck2.c:501 +#: cp/parser.c:14645 cp/typeck2.c:501 #, fuzzy, gcc-internal-format msgid "invalid use of %" msgstr "нерэчаіснае выкарыстаньне `%D'" -#: cp/parser.c:15243 +#: cp/parser.c:15039 +#, gcc-internal-format +msgid "types may not be defined in parameter types" +msgstr "" + +#: cp/parser.c:15257 #, fuzzy, gcc-internal-format msgid "file ends in default argument" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/parser.c:15289 +#: cp/parser.c:15303 #, gcc-internal-format msgid "deprecated use of default argument for parameter of non-function" msgstr "" -#: cp/parser.c:15293 +#: cp/parser.c:15307 #, gcc-internal-format msgid "default arguments are only permitted for function parameters" msgstr "" -#: cp/parser.c:15579 +#: cp/parser.c:15593 #, gcc-internal-format msgid "ISO C++ does not allow designated initializers" msgstr "" -#: cp/parser.c:16193 +#: cp/parser.c:16207 #, fuzzy, gcc-internal-format msgid "invalid class name in declaration of %qD" msgstr "Нерэчаіснае абвяшчэнне" -#: cp/parser.c:16207 +#: cp/parser.c:16221 #, gcc-internal-format msgid "declaration of %qD in namespace %qD which does not enclose %qD" msgstr "" -#: cp/parser.c:16212 +#: cp/parser.c:16226 #, gcc-internal-format msgid "declaration of %qD in %qD which does not enclose %qD" msgstr "" -#: cp/parser.c:16226 +#: cp/parser.c:16240 #, gcc-internal-format msgid "extra qualification not allowed" msgstr "" -#: cp/parser.c:16238 +#: cp/parser.c:16252 #, fuzzy, gcc-internal-format msgid "an explicit specialization must be preceded by %